When rematerializing, use the debug location of the original
authorDan Gohman <gohman@apple.com>
Fri, 7 May 2010 01:28:10 +0000 (01:28 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 7 May 2010 01:28:10 +0000 (01:28 +0000)
instruction, rather than a location near where the new instruction
is being inserted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103232 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86InstrInfo.cpp

index a89596efbcd388a499a2a04034fc11c9dc83f869..fb3cbed33672ed6fb3d922e7995e211fb3bfcd26 100644 (file)
@@ -1065,7 +1065,7 @@ void X86InstrInfo::reMaterialize(MachineBasicBlock &MBB,
                                  unsigned DestReg, unsigned SubIdx,
                                  const MachineInstr *Orig,
                                  const TargetRegisterInfo *TRI) const {
-  DebugLoc DL = MBB.findDebugLoc(I);
+  DebugLoc DL = Orig->getDebugLoc();
 
   if (SubIdx && TargetRegisterInfo::isPhysicalRegister(DestReg)) {
     DestReg = TRI->getSubReg(DestReg, SubIdx);