When the inline spiller rematerializes an instruction, take the debug location from the instruction
that immediately follows the rematerialization point. Patch by Andrea DiBiagio. Differential Revision: http://reviews.llvm.org/D23539 llvm-svn: 278822
This commit is contained in:
@@ -550,12 +550,18 @@ bool InlineSpiller::reMaterializeFor(LiveInterval &VirtReg, MachineInstr &MI) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Alocate a new register for the remat.
|
||||
// Allocate a new register for the remat.
|
||||
unsigned NewVReg = Edit->createFrom(Original);
|
||||
|
||||
// Finally we can rematerialize OrigMI before MI.
|
||||
SlotIndex DefIdx =
|
||||
Edit->rematerializeAt(*MI.getParent(), MI, NewVReg, RM, TRI);
|
||||
|
||||
// We take the DebugLoc from MI, since OrigMI may be attributed to a
|
||||
// different source location.
|
||||
auto *NewMI = LIS.getInstructionFromIndex(DefIdx);
|
||||
NewMI->setDebugLoc(MI.getDebugLoc());
|
||||
|
||||
(void)DefIdx;
|
||||
DEBUG(dbgs() << "\tremat: " << DefIdx << '\t'
|
||||
<< *LIS.getInstructionFromIndex(DefIdx));
|
||||
|
||||
Reference in New Issue
Block a user