[PATCH 3/8] trivial-phi: make clean_up_phi() more sequential

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reorganize clean_up_phi() so that the tests in the loop
are more sequential. It functionally identical but will
help to detect other, less trivial, trivial phi-nodes.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 simplify.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/simplify.c b/simplify.c
index e9995a546..f6471a4ef 100644
--- a/simplify.c
+++ b/simplify.c
@@ -187,12 +187,13 @@ static int clean_up_phi(struct instruction *insn)
 		def = phi->def;
 		if (def->phi_src == VOID || !def->bb)
 			continue;
-		if (last) {
-			if (last->phi_src != def->phi_src)
-				same = 0;
+		if (!last) {
+			last = def;
 			continue;
 		}
-		last = def;
+		if (last->phi_src == def->phi_src)
+			continue;
+		same = 0;
 	} END_FOR_EACH_PTR(phi);
 
 	if (same) {
-- 
2.18.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux