diff mbox

[RFC,26/48] mem2reg: ignore all killed instructions

Message ID 20170823201554.90551-27-luc.vanoostenryck@gmail.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Luc Van Oostenryck Aug. 23, 2017, 8:15 p.m. UTC
---
 mem2reg.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/mem2reg.c b/mem2reg.c
index a9bf78ed4..7096a4bf2 100644
--- a/mem2reg.c
+++ b/mem2reg.c
@@ -253,14 +253,15 @@  static unsigned long externaly_visible(struct symbol *sym, unsigned long mod)
 		/* We know that the symbol-pseudo use is the "src" in the instruction */
 		struct instruction *insn = pu->insn;
 
+		if (!insn->bb)
+			continue;
+
 		switch (insn->opcode) {
 		case OP_STORE:
 			break;
 		case OP_LOAD:
 			break;
 		case OP_SYMADDR:
-			if (!insn->bb)
-				continue;
 			return MOD_ADDRESSABLE;
 		case OP_NOP:
 		case OP_SNOP: