[v2,5/5] no VOID test in convert_instruction_target()
diff mbox series

Message ID 20180725204441.91527-6-luc.vanoostenryck@gmail.com
State Under Review
Headers show
Series
  • some list optimizations
Related show

Commit Message

Luc Van Oostenryck July 25, 2018, 8:44 p.m. UTC
In convert_instruction_target(), when replacing the pseudo
in the target user list, it's first checked if the old pseudo
is not VOID and nothing is done otherwise. But this test is
not needed because:
1) the only case where VOID is stored in the user list is when
   a BB is killed and a killed instruction wouln't be converted
2) this test used to be needed when OP_PHIs were converted during
   CSE (meaning that the pseudo stored there have been removed
   from the list) but OP_PHIs are not CSEed anymore.

So, removed this unneeded test.

This gives a speedup up to 9% in some pathological workloads.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 flow.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/flow.c b/flow.c
index 9483938fb..0fdbdf44d 100644
--- a/flow.c
+++ b/flow.c
@@ -292,10 +292,7 @@  void convert_instruction_target(struct instruction *insn, pseudo_t src)
 	if (target == src)
 		return;
 	FOR_EACH_PTR(target->users, pu) {
-		if (*pu->userp != VOID) {
-			assert(*pu->userp == target);
-			*pu->userp = src;
-		}
+		*pu->userp = src;
 	} END_FOR_EACH_PTR(pu);
 	if (has_use_list(src))
 		concat_user_list(target->users, &src->users);