summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2016-10-28 02:47:09 +0000
committerDavide Italiano <davide@freebsd.org>2016-10-28 02:47:09 +0000
commit631cd27f29607272d58d32b3978bde69b814d2c7 (patch)
tree6c26800c30d464e50ef51c7881a2d1eb9c4aab05 /llvm/test
parent02563cd3a6150c829d050ad64217a2a91d397534 (diff)
downloadbcm5719-llvm-631cd27f29607272d58d32b3978bde69b814d2c7.tar.gz
bcm5719-llvm-631cd27f29607272d58d32b3978bde69b814d2c7.zip
[Reassociate] Removing instructions mutates the IR.
Fixes PR 30784. Discussed with Justin, who pointed out that in the new PassManager infrastructure we can have more fine-grained control on which analyses we want to preserve, but this is the best we can do with the current infrastructure. llvm-svn: 285380
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/Reassociate/reassociate-deadinst.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/test/Transforms/Reassociate/reassociate-deadinst.ll b/llvm/test/Transforms/Reassociate/reassociate-deadinst.ll
new file mode 100644
index 00000000000..6a12c4723f2
--- /dev/null
+++ b/llvm/test/Transforms/Reassociate/reassociate-deadinst.ll
@@ -0,0 +1,16 @@
+; RUN: opt -inline -functionattrs -reassociate %s -S | FileCheck %s
+
+; CHECK-NOT: func1
+; CHECK-LABEL: main
+; CHECK-NEXT: ret void
+
+define internal i16 @func1() noinline #0 {
+ ret i16 0
+}
+
+define void @main(i16 %argc, i16** %argv) #0 {
+ %_tmp0 = call i16 @func1()
+ %_tmp2 = zext i16 %_tmp0 to i32
+ ret void
+}
+attributes #0 = { minsize nounwind optsize }
OpenPOWER on IntegriCloud