From 057c5a6b2b082b62c8f33a8d6d6e942b8165757a Mon Sep 17 00:00:00 2001 From: Oleg Ranevskyy Date: Thu, 5 Nov 2015 17:50:17 +0000 Subject: [DebugInfo] Fix ARM/AArch64 prologue_end position. Related to D11268. Summary: This review is related to another review request http://reviews.llvm.org/D11268, does the same and merely fixes a couple of issues with it. D11268 is quite old and has merge conflicts against the current trunk. This request - rebases D11268 onto the new trunk; - resolves the merge conflicts; - fixes the prologue_end tests, which do not pass due to the subprogram definitions not marked as distinct. Reviewers: echristo, rengolin, kubabrecka Subscribers: aemerson, rengolin, jyknight, dsanders, llvm-commits, asl Differential Revision: http://reviews.llvm.org/D14338 llvm-svn: 252177 --- llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp | 31 +++++++++++++----------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp') diff --git a/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp b/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp index 12c4310b78f..940ea117852 100644 --- a/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp +++ b/llvm/lib/Target/SystemZ/SystemZFrameLowering.cpp @@ -130,13 +130,13 @@ spillCalleeSavedRegisters(MachineBasicBlock &MBB, return false; MachineFunction &MF = *MBB.getParent(); - const TargetInstrInfo *TII = MF.getSubtarget().getInstrInfo(); - SystemZMachineFunctionInfo *ZFI = MF.getInfo(); - bool IsVarArg = MF.getFunction()->isVarArg(); - DebugLoc DL = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc(); - - // Scan the call-saved GPRs and find the bounds of the register spill area. - unsigned LowGPR = 0; + const TargetInstrInfo *TII = MF.getSubtarget().getInstrInfo(); + SystemZMachineFunctionInfo *ZFI = MF.getInfo(); + bool IsVarArg = MF.getFunction()->isVarArg(); + DebugLoc DL; + + // Scan the call-saved GPRs and find the bounds of the register spill area. + unsigned LowGPR = 0; unsigned HighGPR = SystemZ::R15D; unsigned StartOffset = -1U; for (unsigned I = 0, E = CSI.size(); I != E; ++I) { @@ -319,13 +319,16 @@ void SystemZFrameLowering::emitPrologue(MachineFunction &MF, SystemZMachineFunctionInfo *ZFI = MF.getInfo(); MachineBasicBlock::iterator MBBI = MBB.begin(); MachineModuleInfo &MMI = MF.getMMI(); - const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo(); - const std::vector &CSI = MFFrame->getCalleeSavedInfo(); - bool HasFP = hasFP(MF); - DebugLoc DL = MBBI != MBB.end() ? MBBI->getDebugLoc() : DebugLoc(); - - // The current offset of the stack pointer from the CFA. - int64_t SPOffsetFromCFA = -SystemZMC::CFAOffsetFromInitialSP; + const MCRegisterInfo *MRI = MMI.getContext().getRegisterInfo(); + const std::vector &CSI = MFFrame->getCalleeSavedInfo(); + bool HasFP = hasFP(MF); + + // Debug location must be unknown since the first debug location is used + // to determine the end of the prologue. + DebugLoc DL; + + // The current offset of the stack pointer from the CFA. + int64_t SPOffsetFromCFA = -SystemZMC::CFAOffsetFromInitialSP; if (ZFI->getLowSavedGPR()) { // Skip over the GPR saves. -- cgit v1.2.3