Skip to content

Commit

Permalink
memops: we can kill addresses unconditionally
Browse files Browse the repository at this point in the history
In rewrite_load_instruction(), if the load instruction is converted
into a phi-node, its address is then no more used and must be removed.

However, this is only done when this address is not a symbol.
This was explicitly done in the following commit because of the problem
of removing an element from the usage list while walking this list:
   602f6b6 ("Leave symbol pseudo usage intact when doing phi-node conversion.")

But currently rewrite_load_instruction() is only used during memops
simplification where the usage list is not walked.

So, kill the address' usage unconditionally.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
  • Loading branch information
lucvoo committed Apr 17, 2021
1 parent b91ba64 commit ee17130
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions memops.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ static void rewrite_load_instruction(struct instruction *insn, struct pseudo_lis
goto end;

complex_phi:
/* We leave symbol pseudos with a bogus usage list here */
if (insn->src->type != PSEUDO_SYM)
kill_use(&insn->src);
kill_use(&insn->src);
insn->opcode = OP_PHI;
insn->phi_list = dominators;

Expand Down

0 comments on commit ee17130

Please sign in to comment.