diff options
Diffstat (limited to 'llvm/lib/Target/X86/X86FrameLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/X86FrameLowering.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp index 545248ac100..34febe679db 100644 --- a/llvm/lib/Target/X86/X86FrameLowering.cpp +++ b/llvm/lib/Target/X86/X86FrameLowering.cpp @@ -2108,8 +2108,12 @@ void X86FrameLowering::determineCalleeSaves(MachineFunction &MF, 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 |

