[PATCH] D42358: [X86][x32] Save callee-save register used as base pointer for x32 ABI
Derek Schuff via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 2 09:50:16 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL326593: [X86][x32] Save callee-save register used as base pointer for x32 ABI (authored by dschuff, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D42358?vs=130827&id=136779#toc
Repository:
rL LLVM
https://reviews.llvm.org/D42358
Files:
llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
llvm/trunk/test/CodeGen/X86/x86-64-baseptr.ll
Index: llvm/trunk/test/CodeGen/X86/x86-64-baseptr.ll
===================================================================
--- llvm/trunk/test/CodeGen/X86/x86-64-baseptr.ll
+++ llvm/trunk/test/CodeGen/X86/x86-64-baseptr.ll
@@ -39,6 +39,7 @@
; X32ABI: # %bb.0: # %entry
; X32ABI-NEXT: pushq %rbp
; X32ABI-NEXT: movl %esp, %ebp
+; X32ABI-NEXT: pushq %rbx
; X32ABI-NEXT: andl $-32, %esp
; X32ABI-NEXT: subl $32, %esp
; X32ABI-NEXT: movl %esp, %ebx
@@ -52,7 +53,8 @@
; X32ABI-NEXT: movl %edx, %esp
; X32ABI-NEXT: negl %eax
; X32ABI-NEXT: movl $0, (%ecx,%eax)
-; X32ABI-NEXT: movl %ebp, %esp
+; X32ABI-NEXT: leal -8(%ebp), %esp
+; X32ABI-NEXT: popq %rbx
; X32ABI-NEXT: popq %rbp
; X32ABI-NEXT: retq
entry:
Index: llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
===================================================================
--- llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
+++ llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
@@ -2108,8 +2108,12 @@
TargetFrameLowering::determineCalleeSaves(MF, SavedRegs, RS);
// Spill the BasePtr if it's used.
- if (TRI->hasBasePointer(MF))
- SavedRegs.set(TRI->getBaseRegister());
+ if (TRI->hasBasePointer(MF)){
+ unsigned BasePtr = TRI->getBaseRegister();
+ if (STI.isTarget64BitILP32())
+ BasePtr = getX86SubSuperRegister(BasePtr, 64);
+ SavedRegs.set(BasePtr);
+ }
}
static bool
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42358.136779.patch
Type: text/x-patch
Size: 1410 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180302/a9c14bfd/attachment.bin>
More information about the llvm-commits
mailing list