diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2019-02-08 17:50:34 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2019-02-18 22:49:33 +0100 |
| commit | 087f9f0998563914745f5b8b26e1c7b63e3ab84c (patch) | |
| tree | 1e6c719954a40b0c81cf4afa40962429f2105b7d /test/ir/reduce_graph.py | |
| parent | 2d7b38576c49bd4b2e23e0a45faa0287b7042e77 (diff) | |
| download | miasm-087f9f0998563914745f5b8b26e1c7b63e3ab84c.tar.gz miasm-087f9f0998563914745f5b8b26e1c7b63e3ab84c.zip | |
Merge blocks: don't create predecessors for heads
Diffstat (limited to 'test/ir/reduce_graph.py')
| -rw-r--r-- | test/ir/reduce_graph.py | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/test/ir/reduce_graph.py b/test/ir/reduce_graph.py index 29a3501f..75ff3410 100644 --- a/test/ir/reduce_graph.py +++ b/test/ir/reduce_graph.py @@ -321,17 +321,27 @@ G4_RES_IRB0 = gen_irblock( LBL0, [ [ + ExprAssign(IRDst, ExprLoc(LBL1, 32)), + ] + ] +) + + +G4_RES_IRB1 = gen_irblock( + LBL1, + [ + [ ExprAssign(A, C), ], [ ExprAssign(D, A), - ExprAssign(IRDst, ExprLoc(LBL0, 32)), + ExprAssign(IRDst, ExprLoc(LBL1, 32)), ] ] ) -for irb in [G4_RES_IRB0 ]: +for irb in [G4_RES_IRB0, G4_RES_IRB1 ]: G4_RES.add_irblock(irb) @@ -389,15 +399,25 @@ for irb in [G5_IRB0, G5_IRB1, G5_IRB2, G5_IRB3]: # Result G5_RES = IRA.new_ircfg() + G5_RES_IRB0 = gen_irblock( LBL0, [ [ + ExprAssign(IRDst, ExprLoc(LBL1, 32)), + ] + ] +) + +G5_RES_IRB1 = gen_irblock( + LBL1, + [ + [ ExprAssign(A, C), ], [ ExprAssign(D, A), - ExprAssign(IRDst, ExprCond(C, ExprLoc(LBL0, 32), ExprLoc(LBL3, 32))), + ExprAssign(IRDst, ExprCond(C, ExprLoc(LBL1, 32), ExprLoc(LBL3, 32))), ] ] ) @@ -413,7 +433,7 @@ G5_RES_IRB3 = gen_irblock( ] ) -for irb in [G5_RES_IRB0, G5_RES_IRB3 ]: +for irb in [G5_RES_IRB0, G5_RES_IRB1, G5_RES_IRB3 ]: G5_RES.add_irblock(irb) @@ -605,14 +625,23 @@ G8_RES_IRB0 = gen_irblock( LBL0, [ [ + ExprAssign(IRDst, ExprLoc(LBL1, 32)), + ] + ] +) + +G8_RES_IRB1 = gen_irblock( + LBL1, + [ + [ ExprAssign(A, C), - ExprAssign(IRDst, ExprLoc(LBL0, 32)), + ExprAssign(IRDst, ExprLoc(LBL1, 32)), ] ] ) -for irb in [G8_RES_IRB0]: +for irb in [G8_RES_IRB0, G8_RES_IRB1]: G8_RES.add_irblock(irb) |