summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-03-02 01:08:17 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-03-02 01:08:17 +0000
commitf06e6c2ba717429936908254d53fa579bc941388 (patch)
treeaa486bf693b76f230ec7814ebc985aac0a5aa792 /test/CodeGen/X86
parentd3fdaeb69a25bcd21914b80f75606e2c2f1b35c8 (diff)
downloadllvm-f06e6c2ba717429936908254d53fa579bc941388.tar.gz
llvm-f06e6c2ba717429936908254d53fa579bc941388.tar.bz2
llvm-f06e6c2ba717429936908254d53fa579bc941388.tar.xz
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.ll11
-rw-r--r--test/CodeGen/X86/twoaddr-lea.ll11
2 files changed, 16 insertions, 6 deletions
diff --git a/test/CodeGen/X86/iabs.ll b/test/CodeGen/X86/iabs.ll
index 6a79ee8792..a8ba0155fd 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 ec16dfe172..a1d797feea 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
+}