summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/pr29022.ll
diff options
context:
space:
mode:
authorZvi Rackover <zvi.rackover@intel.com>2016-09-26 06:42:07 +0000
committerZvi Rackover <zvi.rackover@intel.com>2016-09-26 06:42:07 +0000
commit839d15a194a658dfe407e1681514231455138360 (patch)
tree554c7066bdf9216a5962edd93e21927bf4d9705c /llvm/test/CodeGen/X86/pr29022.ll
parent9d68b64c00e43a5b5430c5cdbd78f4ae85aab0b4 (diff)
downloadbcm5719-llvm-839d15a194a658dfe407e1681514231455138360.tar.gz
bcm5719-llvm-839d15a194a658dfe407e1681514231455138360.zip
[X86] Optimization for replacing LEA with MOV at frame index elimination time
Summary: Replace a LEA instruction of the form 'lea (%esp), %ebx' --> 'mov %esp, %ebx' MOV is preferable over LEA because usually there are more issue-slots available to execute MOVs than LEAs. Latest processors also support zero-latency MOVs. Fixes pr29022. Reviewers: hfinkel, delena, igorb, myatsina, mkuper Differential Revision: https://reviews.llvm.org/D24705 llvm-svn: 282385
Diffstat (limited to 'llvm/test/CodeGen/X86/pr29022.ll')
-rw-r--r--llvm/test/CodeGen/X86/pr29022.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/pr29022.ll b/llvm/test/CodeGen/X86/pr29022.ll
new file mode 100644
index 00000000000..85bfc7f1118
--- /dev/null
+++ b/llvm/test/CodeGen/X86/pr29022.ll
@@ -0,0 +1,15 @@
+; RUN: llc < %s -mcpu=skx -mtriple x86_64-unknown-linux-gnu -verify-machineinstrs | FileCheck %s
+; RUN: llc < %s -mcpu=skx -mtriple=x86_64-linux-gnux32 -verify-machineinstrs | FileCheck %s --check-prefix=X32
+
+define i32 @A() {
+; CHECK: movq %rsp, %rdi
+; CHECK-NEXT: call
+
+; X32: movl %esp, %edi
+; X32-NEXT: call
+ %alloc = alloca i32, align 8
+ %call = call i32 @foo(i32* %alloc)
+ ret i32 %call
+}
+
+declare i32 @foo(i32*)
OpenPOWER on IntegriCloud