aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-03-09 14:17:21 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-03-14 23:19:54 +0100
commitfee392ffe3d680b0a8df9ca1960998e8677e744a (patch)
tree3d9b961bcb3af242567e2f8745c5ec28fcb4fd8f
parent5744e177de56c2dd560af3e3eb551e61182dd9fa (diff)
downloadsparse-dev-fee392ffe3d680b0a8df9ca1960998e8677e744a.tar.gz
optim: load simplification should repeat optimization
convert_load_instrcution() & rewrite_load_instruction() remove a load instruction and as such should retrigger optimization of symbols. Do this by setting REPEAT_SYMBOL_CLEANUP at the end of these two functions. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--flow.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/flow.c b/flow.c
index 9d27e430..f928c268 100644
--- a/flow.c
+++ b/flow.c
@@ -306,6 +306,7 @@ void convert_load_instruction(struct instruction *insn, pseudo_t src)
{
convert_instruction_target(insn, src);
kill_instruction(insn);
+ repeat_phase |= REPEAT_SYMBOL_CLEANUP;
}
static int overlapping_memop(struct instruction *a, struct instruction *b)
@@ -459,7 +460,7 @@ void rewrite_load_instruction(struct instruction *insn, struct pseudo_list *domi
FOR_EACH_PTR(dominators, phi) {
kill_instruction(phi->def);
} END_FOR_EACH_PTR(phi);
- return;
+ goto end;
complex_phi:
/* We leave symbol pseudos with a bogus usage list here */
@@ -467,6 +468,9 @@ complex_phi:
kill_use(&insn->src);
insn->opcode = OP_PHI;
insn->phi_list = dominators;
+
+end:
+ repeat_phase |= REPEAT_SYMBOL_CLEANUP;
}
static int find_dominating_stores(pseudo_t pseudo, struct instruction *insn,