aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-07 20:23:54 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-08 02:29:17 +0100
commit29c405153720add05185351a13dcc68a5f39d3ff (patch)
treebd0f0a340bde51cfd9375a45619aa51062672bab /validation/optim
parent467fce3048571227e49beee068f783fb1c76a1e7 (diff)
downloadsparse-dev-29c405153720add05185351a13dcc68a5f39d3ff.tar.gz
select: simplify handling of select(x, 0, x) --> 0
This simplification is already handled but explicitly kills it's 2 operands while this is done automatically when killing the instruction. Also, it uses replace_with_value(0) which needs to recreate the pseudo for 0 while it's already available via its operands. So, changes to use replace_with_pseudo() and without the unneeded kills. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim')
-rw-r--r--validation/optim/select-self-zero.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/validation/optim/select-self-zero.c b/validation/optim/select-self-zero.c
new file mode 100644
index 00000000..ea309894
--- /dev/null
+++ b/validation/optim/select-self-zero.c
@@ -0,0 +1,9 @@
+int sel_self0x(int x) { return (x ? 0 : x) == 0; }
+
+/*
+ * check-name: select-self-zero
+ * check-command: test-linearize -Wno-decl $file
+ *
+ * check-output-ignore
+ * check-output-returns: 1
+ */