[PATCH] D18029: [X86] Correctly select registers to pop into for x86_64

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 10 10:48:15 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL263139: [X86] Correctly select registers to pop into for x86_64 (authored by mkuper).

Changed prior to commit:
  http://reviews.llvm.org/D18029?vs=50242&id=50305#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D18029

Files:
  llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
  llvm/trunk/test/CodeGen/X86/pop-stack-cleanup.ll

Index: llvm/trunk/test/CodeGen/X86/pop-stack-cleanup.ll
===================================================================
--- llvm/trunk/test/CodeGen/X86/pop-stack-cleanup.ll
+++ llvm/trunk/test/CodeGen/X86/pop-stack-cleanup.ll
@@ -7,6 +7,7 @@
 declare void @param2(i32 %a, i32 %b)
 declare void @param3(i32 %a, i32 %b, i32 %c)
 declare void @param8(i64, i64, i64, i64, i64, i64, i64, i64)
+declare i32 @param8_ret(i64, i64, i64, i64, i64, i64, i64, i64)
 
 
 define void @test() minsize nounwind {
@@ -74,3 +75,13 @@
   call void @param8(i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8)
   ret void
 }
+
+define i32 @test_linux64_i32(i32 %size) minsize nounwind {
+; LINUX64-LABEL: test_linux64_i32:
+; LINUX64: callq param8_ret
+; LINUX64-NOT: popq %rax
+; LINUX64: retq
+  %a = alloca i64, i32 %size, align 8
+  %r = call i32 @param8_ret(i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8)
+  ret i32 %r
+}
Index: llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
+++ llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
@@ -2447,7 +2447,8 @@
 
     bool IsDef = false;
     for (const MachineOperand &MO : Prev->implicit_operands()) {
-      if (MO.isReg() && MO.isDef() && MO.getReg() == Candidate) {
+      if (MO.isReg() && MO.isDef() &&
+          TRI->isSuperOrSubRegisterEq(MO.getReg(), Candidate)) {
         IsDef = true;
         break;
       }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18029.50305.patch
Type: text/x-patch
Size: 1482 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160310/f46169e0/attachment.bin>


More information about the llvm-commits mailing list