summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2015-07-01 23:12:13 +0000
committerQuentin Colombet <qcolombet@apple.com>2015-07-01 23:12:13 +0000
commit9729fb33156d3a6cbe7e55a389ac7dd501cc9dfe (patch)
tree32560355c7acfbe6ba70f03a0690b635f7e34393 /llvm/test/CodeGen
parent28ff26837369eed8500db03d4329b6240b076b02 (diff)
downloadbcm5719-llvm-9729fb33156d3a6cbe7e55a389ac7dd501cc9dfe.tar.gz
bcm5719-llvm-9729fb33156d3a6cbe7e55a389ac7dd501cc9dfe.zip
[TwoAddressInstructionPass] Try 3 Addr Conversion After Commuting.
TwoAddressInstructionPass stops after a successful commuting but 3 Addr conversion might be good for some cases. Consider: int foo(int a, int b) { return a + b; } Before this commit, we emit: addl %esi, %edi movl %edi, %eax ret After this commit, we try 3 Addr conversion: leal (%rsi,%rdi), %eax ret Patch by Volkan Keles <vkeles@apple.com>! Differential Revision: http://reviews.llvm.org/D10851 llvm-svn: 241206
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/X86/commute-two-addr.ll2
-rw-r--r--llvm/test/CodeGen/X86/twoaddr-lea.ll3
-rw-r--r--llvm/test/CodeGen/X86/win64_params.ll9
3 files changed, 5 insertions, 9 deletions
diff --git a/llvm/test/CodeGen/X86/commute-two-addr.ll b/llvm/test/CodeGen/X86/commute-two-addr.ll
index 656c385e2bc..5b01e2f4e90 100644
--- a/llvm/test/CodeGen/X86/commute-two-addr.ll
+++ b/llvm/test/CodeGen/X86/commute-two-addr.ll
@@ -39,7 +39,7 @@ define %0 @t3(i32 %lb, i8 zeroext %has_lb, i8 zeroext %lb_inclusive, i32 %ub, i8
entry:
; DARWIN-LABEL: t3:
; DARWIN: shlq $32, %rcx
-; DARWIN-NEXT: orq %rcx, %rax
+; DARWIN-NEXT: leaq (%rax,%rcx), %rax
; DARWIN-NEXT: shll $8
; DARWIN-NOT: leaq
%tmp21 = zext i32 %lb to i64
diff --git a/llvm/test/CodeGen/X86/twoaddr-lea.ll b/llvm/test/CodeGen/X86/twoaddr-lea.ll
index b5ca0275d8d..5779cf33ac8 100644
--- a/llvm/test/CodeGen/X86/twoaddr-lea.ll
+++ b/llvm/test/CodeGen/X86/twoaddr-lea.ll
@@ -25,8 +25,7 @@ define i32 @test2(i32 inreg %a, i32 inreg %b, i32 %c, i32 %d) nounwind {
entry:
; CHECK-LABEL: test2:
; CHECK: leal
-; CHECK-NOT: leal
-; CHECK-NOT: mov
+; CHECK-NEXT: addl
; CHECK-NEXT: addl
; CHECK-NEXT: ret
%add = add i32 %b, %a
diff --git a/llvm/test/CodeGen/X86/win64_params.ll b/llvm/test/CodeGen/X86/win64_params.ll
index 9718c86300c..a0b552d4d58 100644
--- a/llvm/test/CodeGen/X86/win64_params.ll
+++ b/llvm/test/CodeGen/X86/win64_params.ll
@@ -7,8 +7,7 @@ define i32 @f6(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %p6) nounwind re
entry:
; CHECK: movl 48(%rsp), %eax
; CHECK: addl 40(%rsp), %eax
-; LINUX: addl %r9d, %r8d
-; LINUX: movl %r8d, %eax
+; LINUX: leal (%r8,%r9), %eax
%add = add nsw i32 %p6, %p5
ret i32 %add
}
@@ -27,10 +26,8 @@ entry:
; on other platforms here (note the x86_64_sysvcc calling convention).
define x86_64_sysvcc i32 @f8(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5, i32 %p6) nounwind readnone optsize {
entry:
-; CHECK: addl %r9d, %r8d
-; CHECK: movl %r8d, %eax
-; LINUX: addl %r9d, %r8d
-; LINUX: movl %r8d, %eax
+; CHECK: leal (%r8,%r9), %eax
+; LINUX: leal (%r8,%r9), %eax
%add = add nsw i32 %p6, %p5
ret i32 %add
}
OpenPOWER on IntegriCloud