diff mbox series

[1/5] let replace_with_pseudo() use kill_instruction()

Message ID 20201129144922.56209-2-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series use replace_with_pseudo() for simplify_memops() | expand

Commit Message

Luc Van Oostenryck Nov. 29, 2020, 2:49 p.m. UTC
In replace_with_pseudo(), the replaced instruction needs to be killed
and for this contains ts own code.

But this is a duplication of what is already done in kill_instruction().

So, replace this part of the code by a cal to kill_instruction().

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 simplify.c | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
diff mbox series

Patch

diff --git a/simplify.c b/simplify.c
index de03d315ec33..29b368e94ff4 100644
--- a/simplify.c
+++ b/simplify.c
@@ -445,23 +445,7 @@  static inline int replace_pseudo(struct instruction *insn, pseudo_t *pp, pseudo_
 static int replace_with_pseudo(struct instruction *insn, pseudo_t pseudo)
 {
 	convert_instruction_target(insn, pseudo);
-
-	switch (insn->opcode) {
-	case OP_SEL:
-	case OP_RANGE:
-		kill_use(&insn->src3);
-	case OP_BINARY ... OP_BINCMP_END:
-		kill_use(&insn->src2);
-	case OP_UNOP ... OP_UNOP_END:
-	case OP_SYMADDR:
-		kill_use(&insn->src1);
-		break;
-
-	default:
-		assert(0);
-	}
-	insn->bb = NULL;
-	return REPEAT_CSE;
+	return kill_instruction(insn);
 }
 
 static inline int replace_with_value(struct instruction *insn, long long val)