summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2017-07-01 03:29:33 +0000
committerDavide Italiano <davide@freebsd.org>2017-07-01 03:29:33 +0000
commit9282f1aecef7b2190c2430e190342558958f4f8f (patch)
tree1a3499702e7123700b36eb44be13d0b25407692e /llvm/test
parent32d95742b845ed2e25965bd61a52bd14806c522b (diff)
downloadbcm5719-llvm-9282f1aecef7b2190c2430e190342558958f4f8f.tar.gz
bcm5719-llvm-9282f1aecef7b2190c2430e190342558958f4f8f.zip
[Cloner] Re-map simplfied cloned instructions.
This commit pretty much rolls back the logic added in r306495 as in the testcase provided we simplify an `icmp` looking through a PHI that hasn't been mapped yet. I think instsimplify shouldn't do threading over select/phis or just looking through phis in general, but this is what we have now. Also, add a test to prevent this from happening in case somebody wants to modify this code again. Briefly discussed with Kyle Butt (thanks Kyle!). llvm-svn: 306938
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/Inline/pr33637.ll25
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/Transforms/Inline/pr33637.ll b/llvm/test/Transforms/Inline/pr33637.ll
new file mode 100644
index 00000000000..315feca27bd
--- /dev/null
+++ b/llvm/test/Transforms/Inline/pr33637.ll
@@ -0,0 +1,25 @@
+; RUN: opt -inline < %s
+
+define void @patatino() {
+for.cond:
+ br label %for.body
+
+for.body:
+ %tobool = icmp eq i32 5, 0
+ %sel = select i1 %tobool, i32 0, i32 2
+ br i1 undef, label %cleanup1.thread, label %cleanup1
+
+cleanup1.thread:
+ ret void
+
+cleanup1:
+ %cleanup.dest2 = phi i32 [ %sel, %for.body ]
+ %switch = icmp ult i32 %cleanup.dest2, 1
+ ret void
+}
+
+define void @main() {
+entry:
+ call void @patatino()
+ ret void
+}
OpenPOWER on IntegriCloud