[RFC PATCH 29/48] mem2reg: extract kill_pseudo_dead_stores()

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

 



---
 mem2reg.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/mem2reg.c b/mem2reg.c
index d13af1dd2..2a976e826 100644
--- a/mem2reg.c
+++ b/mem2reg.c
@@ -200,6 +200,15 @@ static void kill_dead_stores(pseudo_t pseudo, unsigned long generation, struct b
 	} END_FOR_EACH_PTR(parent);
 }
 
+static void kill_pseudo_dead_stores(struct entrypoint *ep, pseudo_t pseudo, int local)
+{
+	struct basic_block *bb;
+	FOR_EACH_PTR(ep->bbs, bb) {
+		if (!bb->children)
+			kill_dead_stores(pseudo, ++bb_generation, bb, local);
+	} END_FOR_EACH_PTR(bb);
+}
+
 /*
  * This should see if the "insn" trivially dominates some previous store, and kill the
  * store if unnecessary.
@@ -338,11 +347,7 @@ static void promote_symbol(struct entrypoint *ep, struct symbol *sym)
 		kill_pseudo_dominated_stores(pseudo, !mod);
 
 		if (!(mod & (MOD_NONLOCAL | MOD_STATIC))) {
-			struct basic_block *bb;
-			FOR_EACH_PTR(ep->bbs, bb) {
-				if (!bb->children)
-					kill_dead_stores(pseudo, ++bb_generation, bb, !mod);
-			} END_FOR_EACH_PTR(bb);
+			kill_pseudo_dead_stores(ep, pseudo, !mod);
 		}
 	}
 
-- 
2.14.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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