aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/Reassociate
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-07 04:23:29 +0000
committerChris Lattner <sabre@nondot.org>2005-05-07 04:23:29 +0000
commit5cc924ac42f6ded8c560dcdf706c86634f5b0db7 (patch)
treebf73fc8365a7dd5ca1fd1f8f077cfd8da7f78959 /test/Transforms/Reassociate
parent08b43921e18f314c4fd38049291d323830934c36 (diff)
downloadexternal_llvm-5cc924ac42f6ded8c560dcdf706c86634f5b0db7.zip
external_llvm-5cc924ac42f6ded8c560dcdf706c86634f5b0db7.tar.gz
external_llvm-5cc924ac42f6ded8c560dcdf706c86634f5b0db7.tar.bz2
test that reassociate can handle shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21760 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/Reassociate')
-rw-r--r--test/Transforms/Reassociate/shifttest.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Transforms/Reassociate/shifttest.ll b/test/Transforms/Reassociate/shifttest.ll
new file mode 100644
index 0000000..6ca6622
--- /dev/null
+++ b/test/Transforms/Reassociate/shifttest.ll
@@ -0,0 +1,10 @@
+; With shl->mul reassociation, we can see that this is (shl A, 9) * A
+;
+; RUN: llvm-as < %s | opt -reassociate -instcombine | llvm-dis | grep 'shl .*, ubyte 9'
+
+int %test(int %A, int %B) {
+ %X = shl int %A, ubyte 5
+ %Y = shl int %A, ubyte 4
+ %Z = mul int %Y, %X
+ ret int %Z
+}