aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-07-22 23:26:55 +0000
committerDan Gohman <gohman@apple.com>2009-07-22 23:26:55 +0000
commit3dffbbf52219eb0bef12e337785e78ac95eafd9a (patch)
treebc31c1906f884f84dab108f72b37f1195f7fe0df /test
parentbeee2c27e382e52631cd8c7a53746b5c3ff52ab5 (diff)
downloadexternal_llvm-3dffbbf52219eb0bef12e337785e78ac95eafd9a.zip
external_llvm-3dffbbf52219eb0bef12e337785e78ac95eafd9a.tar.gz
external_llvm-3dffbbf52219eb0bef12e337785e78ac95eafd9a.tar.bz2
x86 isel tweak: use lea (%reg,%reg) instead of lea (,%reg,2).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/avoid-lea-scale2.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/CodeGen/X86/avoid-lea-scale2.ll b/test/CodeGen/X86/avoid-lea-scale2.ll
new file mode 100644
index 0000000..c84662d
--- /dev/null
+++ b/test/CodeGen/X86/avoid-lea-scale2.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llc -march=x86-64 | grep {leal.*-2(\[%\]rdi,\[%\]rdi)}
+
+define i32 @foo(i32 %x) nounwind readnone {
+ %t0 = shl i32 %x, 1
+ %t1 = add i32 %t0, -2
+ ret i32 %t1
+}
+