diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-07-21 00:31:12 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-07-21 00:31:12 +0000 |
commit | af9e7a7c20d541cfaaaed9dfa21046ac6652cc03 (patch) | |
tree | 08c26deb36c7197cce8935a853a664a40c1e530b /test/CodeGen/Thumb2/mul_const.ll | |
parent | c95be59371e0b9ed827076953fd7e1270e418ff8 (diff) | |
download | external_llvm-af9e7a7c20d541cfaaaed9dfa21046ac6652cc03.zip external_llvm-af9e7a7c20d541cfaaaed9dfa21046ac6652cc03.tar.gz external_llvm-af9e7a7c20d541cfaaaed9dfa21046ac6652cc03.tar.bz2 |
Fix ARM isle code that optimize multiply by constants which are power-of-2 +/- 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76520 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb2/mul_const.ll')
-rw-r--r-- | test/CodeGen/Thumb2/mul_const.ll | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGen/Thumb2/mul_const.ll b/test/CodeGen/Thumb2/mul_const.ll new file mode 100644 index 0000000..ca0ede4 --- /dev/null +++ b/test/CodeGen/Thumb2/mul_const.ll @@ -0,0 +1,18 @@ +; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | FileCheck %s +; rdar://7069502 + +define i32 @t1(i32 %v) nounwind readnone { +entry: +; CHECK: t1: +; CHECK: add r0, r0, r0, lsl #3 + %0 = mul i32 %v, 9 + ret i32 %0 +} + +define i32 @t2(i32 %v) nounwind readnone { +entry: +; CHECK: t2: +; CHECK: rsb r0, r0, r0, lsl #3 + %0 = mul i32 %v, 7 + ret i32 %0 +} |