[PATCH] fix: remove dead OP_{SETVAL,SETFVAL,SLICE}

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

 



At linearization (and maybe in some other situations), dead
intructions are created. Currently, it's the simplification
phase's job to detect and remove these dead instructions
(cfr. dead_insn()).

However, several intructions, not otherwise concerned by
simplification are never so detected and thus never removed.

Add those instructions to simplify_instruction() and call
dead_insn() on them to remove them if dead.

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

diff --git a/simplify.c b/simplify.c
index 6f2eb1182..a399a9355 100644
--- a/simplify.c
+++ b/simplify.c
@@ -1222,6 +1222,15 @@ int simplify_instruction(struct instruction *insn)
 		if (dead_insn(insn, &insn->src, NULL, NULL))
 			return REPEAT_CSE;
 		break;
+	case OP_SLICE:
+		if (dead_insn(insn, &insn->src, NULL, NULL))
+			return REPEAT_CSE;
+		break;
+	case OP_SETVAL:
+	case OP_SETFVAL:
+		if (dead_insn(insn, NULL, NULL, NULL))
+			return REPEAT_CSE;
+		break;
 	case OP_PHI:
 		if (dead_insn(insn, NULL, NULL, NULL)) {
 			kill_use_list(insn->phi_list);
-- 
2.18.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