diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-03-02 01:08:17 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-03-02 01:08:17 +0000 |
commit | f06e6c2ba717429936908254d53fa579bc941388 (patch) | |
tree | aa486bf693b76f230ec7814ebc985aac0a5aa792 /test/CodeGen/X86 | |
parent | d3fdaeb69a25bcd21914b80f75606e2c2f1b35c8 (diff) | |
download | external_llvm-f06e6c2ba717429936908254d53fa579bc941388.zip external_llvm-f06e6c2ba717429936908254d53fa579bc941388.tar.gz external_llvm-f06e6c2ba717429936908254d53fa579bc941388.tar.bz2 |
Catch more cases where 2-address pass should 3-addressify instructions. rdar://9002648.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126811 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86')
-rw-r--r-- | test/CodeGen/X86/iabs.ll | 11 | ||||
-rw-r--r-- | test/CodeGen/X86/twoaddr-lea.ll | 11 |
2 files changed, 16 insertions, 6 deletions
diff --git a/test/CodeGen/X86/iabs.ll b/test/CodeGen/X86/iabs.ll index 6a79ee8..a8ba015 100644 --- a/test/CodeGen/X86/iabs.ll +++ b/test/CodeGen/X86/iabs.ll @@ -1,12 +1,11 @@ ; RUN: llc < %s -march=x86-64 -stats |& \ -; RUN: grep {6 .*Number of machine instrs printed} +; RUN: grep {5 .*Number of machine instrs printed} ;; Integer absolute value, should produce something at least as good as: -;; movl %edi, %eax -;; sarl $31, %eax -;; addl %eax, %edi -;; xorl %eax, %edi -;; movl %edi, %eax +;; movl %edi, %ecx +;; sarl $31, %ecx +;; leal (%rdi,%rcx), %eax +;; xorl %ecx, %eax ;; ret define i32 @test(i32 %a) nounwind { %tmp1neg = sub i32 0, %a diff --git a/test/CodeGen/X86/twoaddr-lea.ll b/test/CodeGen/X86/twoaddr-lea.ll index ec16dfe..a1d797f 100644 --- a/test/CodeGen/X86/twoaddr-lea.ll +++ b/test/CodeGen/X86/twoaddr-lea.ll @@ -34,3 +34,14 @@ entry: %add5 = add i32 %add3, %d ret i32 %add5 } + +; rdar://9002648 +define i64 @test3(i64 %x) nounwind readnone ssp { +entry: +; CHECK: test3: +; CHECK: leaq (%rdi,%rdi), %rax +; CHECK-NOT: addq +; CHECK-NEXT: ret + %0 = shl i64 %x, 1 + ret i64 %0 +} |