summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstSimplify
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2011-01-14 14:44:12 +0000
committerDuncan Sands <baldrick@free.fr>2011-01-14 14:44:12 +0000
commit571fd9a60652c793c8bdcd7163cd8ee207dc2a84 (patch)
tree4b2113b887b5d3b94ab84d90de6c4b86eb685e29 /llvm/test/Transforms/InstSimplify
parentc3eb0f4b2e4ca9e7665c8fe8aeb0f4c15d59f054 (diff)
downloadbcm5719-llvm-571fd9a60652c793c8bdcd7163cd8ee207dc2a84.tar.gz
bcm5719-llvm-571fd9a60652c793c8bdcd7163cd8ee207dc2a84.zip
Factorize common code out of the InstructionSimplify shift logic. Add in
threading of shifts over selects and phis while there. This fires here and there in the testsuite, to not much effect. For example when compiling spirit it fires 5 times, during early-cse, resulting in 6 more cse simplifications, and 3 more terminators being folded by jump threading, but the final bitcode doesn't change in any interesting way: other optimizations would have caught the opportunity anyway, only later. llvm-svn: 123441
Diffstat (limited to 'llvm/test/Transforms/InstSimplify')
-rw-r--r--llvm/test/Transforms/InstSimplify/2011-01-14-Thread.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstSimplify/2011-01-14-Thread.ll b/llvm/test/Transforms/InstSimplify/2011-01-14-Thread.ll
new file mode 100644
index 00000000000..8fc4dc5d5bb
--- /dev/null
+++ b/llvm/test/Transforms/InstSimplify/2011-01-14-Thread.ll
@@ -0,0 +1,9 @@
+; RUN: opt < %s -instsimplify -S | FileCheck %s
+
+define i32 @shift_select(i1 %cond) {
+; CHECK: @shift_select
+ %s = select i1 %cond, i32 0, i32 1
+ %r = lshr i32 %s, 1
+ ret i32 %r
+; CHECK: ret i32 0
+}
OpenPOWER on IntegriCloud