aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-07-23 11:41:34 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-07-25 11:38:16 +0200
commitd95d9a999d06cc5c90b10807975b904584beb4ea (patch)
treebf2f3e4976ba27a16df2cf55310a8bbdece33d61
parentb03237b8deef238a1321752fe4d401f10934f084 (diff)
downloadsparse-dev-d95d9a999d06cc5c90b10807975b904584beb4ea.tar.gz
kill dead OP_FADD & friends
The floating-point binops (OP_FADD, ...) are never simplified. They are thus absent from simplify_instruction() and as such they are never removed if dead. Fix this by adding them to simplify_instruction() but only do the usual check with dead_insn(). Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--simplify.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/simplify.c b/simplify.c
index 741b1272..4c3b3dbc 100644
--- a/simplify.c
+++ b/simplify.c
@@ -1250,6 +1250,13 @@ int simplify_instruction(struct instruction *insn)
return simplify_switch(insn);
case OP_RANGE:
return simplify_range(insn);
+ case OP_FADD:
+ case OP_FSUB:
+ case OP_FMUL:
+ case OP_FDIV:
+ if (dead_insn(insn, &insn->src1, &insn->src2, NULL))
+ return REPEAT_CSE;
+ break;
}
return 0;
}