[llvm] 8a12606 - [AVR] Remove debug location of spill/reload instructions

Ben Shi via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 13 05:58:25 PDT 2022


Author: Liqin.Weng
Date: 2022-08-13T20:58:12+08:00
New Revision: 8a12606a7ea24cb3f403eb8b043ef0b33ecf4caa

URL: https://github.com/llvm/llvm-project/commit/8a12606a7ea24cb3f403eb8b043ef0b33ecf4caa
DIFF: https://github.com/llvm/llvm-project/commit/8a12606a7ea24cb3f403eb8b043ef0b33ecf4caa.diff

LOG: [AVR] Remove debug location of spill/reload instructions

Reviewed By: MatzeB, benshi001

Differential Revision: https://reviews.llvm.org/D129262

Added: 
    

Modified: 
    llvm/lib/Target/AVR/AVRInstrInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AVR/AVRInstrInfo.cpp b/llvm/lib/Target/AVR/AVRInstrInfo.cpp
index 510000f231faa..059e627f794af 100644
--- a/llvm/lib/Target/AVR/AVRInstrInfo.cpp
+++ b/llvm/lib/Target/AVR/AVRInstrInfo.cpp
@@ -135,11 +135,6 @@ void AVRInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
 
   AFI->setHasSpills(true);
 
-  DebugLoc DL;
-  if (MI != MBB.end()) {
-    DL = MI->getDebugLoc();
-  }
-
   const MachineFrameInfo &MFI = MF.getFrameInfo();
 
   MachineMemOperand *MMO = MF.getMachineMemOperand(
@@ -156,7 +151,7 @@ void AVRInstrInfo::storeRegToStackSlot(MachineBasicBlock &MBB,
     llvm_unreachable("Cannot store this register into a stack slot!");
   }
 
-  BuildMI(MBB, MI, DL, get(Opcode))
+  BuildMI(MBB, MI, DebugLoc(), get(Opcode))
       .addFrameIndex(FrameIndex)
       .addImm(0)
       .addReg(SrcReg, getKillRegState(isKill))
@@ -168,11 +163,6 @@ void AVRInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
                                         Register DestReg, int FrameIndex,
                                         const TargetRegisterClass *RC,
                                         const TargetRegisterInfo *TRI) const {
-  DebugLoc DL;
-  if (MI != MBB.end()) {
-    DL = MI->getDebugLoc();
-  }
-
   MachineFunction &MF = *MBB.getParent();
   const MachineFrameInfo &MFI = MF.getFrameInfo();
 
@@ -192,7 +182,7 @@ void AVRInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB,
     llvm_unreachable("Cannot load this register from a stack slot!");
   }
 
-  BuildMI(MBB, MI, DL, get(Opcode), DestReg)
+  BuildMI(MBB, MI, DebugLoc(), get(Opcode), DestReg)
       .addFrameIndex(FrameIndex)
       .addImm(0)
       .addMemOperand(MMO);


        


More information about the llvm-commits mailing list