summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-02-24 02:00:40 +0000
committerDan Gohman <gohman@apple.com>2009-02-24 02:00:40 +0000
commit4f356bb9b0a9dfc6e3d195d13ba45b4cfc1ed4c1 (patch)
treec121dab1093a2c0a8ee18730e801999f84d4adc6 /llvm/test
parent5d1f458f0fc996dd15c8047d358963fe623878e8 (diff)
downloadbcm5719-llvm-4f356bb9b0a9dfc6e3d195d13ba45b4cfc1ed4c1.tar.gz
bcm5719-llvm-4f356bb9b0a9dfc6e3d195d13ba45b4cfc1ed4c1.zip
Fix a ValueTracking rule: RHS means operand 1, not 0. Add a simple
ashr instcombine to help expose this code. And apply the fix to SelectionDAG's copy of this code too. llvm-svn: 65364
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Transforms/InstCombine/ashr-nop.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/ashr-nop.ll b/llvm/test/Transforms/InstCombine/ashr-nop.ll
new file mode 100644
index 00000000000..bb0da346b0c
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/ashr-nop.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep ashr
+
+define i32 @foo(i32 %x) {
+ %o = and i32 %x, 1
+ %n = add i32 %o, -1
+ %t = ashr i32 %n, 17
+ ret i32 %t
+}
OpenPOWER on IntegriCloud