Exemple #1
0
 def do_del_unused_edges(self, ssa, head):
     """
     Del unused edges of the ssa graph
     @head: Location instance of the graph head
     """
     modified = del_unused_edges(ssa.graph, set([head]))
     return modified
Exemple #2
0
 def do_propagate_expr(self, ssa, head):
     """
     Expressions propagation through ExprId in the @ssa graph
     @head: Location instance of the graph head
     """
     modified = self.propag_expr.propagate(ssa, head)
     modified |= ssa.graph.simplify(self.expr_simp)
     modified |= del_unused_edges(ssa.graph, set([head]))
     return modified
Exemple #3
0
 def do_propagate_mem(self, ssa, head):
     """
     Propagation of expression based on ExprInt/ExprId in the @ssa graph
     @head: Location instance of the graph head
     """
     modified = self.propag_mem.propagate(ssa, head)
     modified |= ssa.graph.simplify(self.expr_simp)
     modified |= del_unused_edges(ssa.graph, set([head]))
     return modified
Exemple #4
0
 def do_propagate_int(self, ssa, head):
     """
     Constant propagation in the @ssa graph
     @head: Location instance of the graph head
     """
     modified = self.propag_int.propagate(ssa, head)
     modified |= ssa.graph.simplify(self.expr_simp)
     modified |= del_unused_edges(ssa.graph, set([head]))
     return modified
Exemple #5
0
 def do_propagate_expr(self, ssa, head):
     """
     Expressions propagation through ExprId in the @ssa graph
     @head: Location instance of the graph head
     """
     modified = self.propag_expr.propagate(ssa, head)
     modified |= ssa.graph.simplify(self.expr_simp)
     modified |= del_unused_edges(ssa.graph, set([head]))
     return modified
Exemple #6
0
 def do_propagate_mem(self, ssa, head):
     """
     Propagation of expression based on ExprInt/ExprId in the @ssa graph
     @head: Location instance of the graph head
     """
     modified = self.propag_mem.propagate(ssa, head)
     modified |= ssa.graph.simplify(self.expr_simp)
     modified |= del_unused_edges(ssa.graph, set([head]))
     return modified
Exemple #7
0
 def do_propagate_int(self, ssa, head):
     """
     Constant propagation in the @ssa graph
     @head: Location instance of the graph head
     """
     modified = self.propag_int.propagate(ssa, head)
     modified |= ssa.graph.simplify(self.expr_simp)
     modified |= del_unused_edges(ssa.graph, set([head]))
     return modified
Exemple #8
0
    def do_dead_simp_ssa(self, ssa, head):
        """
        Apply:
        - dead_simp
        - remove_empty_assignblks
        - del_unused_edges
        - merge_blocks
        on the @ircfg until reaching fix point
        Return True if the graph has been modified

        @ircfg: IRCFG instance to simplify
        @head: Location instance of the ircfg head
        """
        modified = dead_simp(self.ir_arch, ssa.graph)
        modified |= remove_empty_assignblks(ssa.graph)
        modified |= del_unused_edges(ssa.graph, set([head]))
        modified |= merge_blocks(ssa.graph, set([head]))
        return modified
Exemple #9
0
    def do_dead_simp_ssa(self, ssa, head):
        """
        Apply:
        - dead_simp
        - remove_empty_assignblks
        - del_unused_edges
        - merge_blocks
        on the @ircfg until reaching fix point
        Return True if the graph has been modified

        @ircfg: IRCFG instance to simplify
        @head: Location instance of the ircfg head
        """
        modified = dead_simp(self.ir_arch, ssa.graph)
        modified |= remove_empty_assignblks(ssa.graph)
        modified |= del_unused_edges(ssa.graph, set([head]))
        modified |= merge_blocks(ssa.graph, set([head]))
        return modified