[PATCH 5/6] memops: avoid using first_pseudo()

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

 



The loop in rewrite_load_instruction() uses first_pseudo() to not have
to special case the first element.

But this slightly complicates further changes.

So, simply use a null-or-no-null test inside the loop to identify
this first element.

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

diff --git a/memops.c b/memops.c
index 119a39a180d5..897fb6bf57fe 100644
--- a/memops.c
+++ b/memops.c
@@ -19,15 +19,17 @@
 
 static void rewrite_load_instruction(struct instruction *insn, struct pseudo_list *dominators)
 {
-	pseudo_t new, phi;
+	pseudo_t new = NULL;
+	pseudo_t phi;
 
 	/*
 	 * Check for somewhat common case of duplicate
 	 * phi nodes.
 	 */
-	new = first_pseudo(dominators)->def->phi_src;
 	FOR_EACH_PTR(dominators, phi) {
-		if (new != phi->def->phi_src)
+		if (!new)
+			new = phi->def->phi_src;
+		else if (new != phi->def->phi_src)
 			goto complex_phi;
 	} END_FOR_EACH_PTR(phi);
 
-- 
2.31.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