From: Ben Shi Date: Sat, 15 Apr 2023 04:44:30 +0000 (+0800) Subject: [LoongArch] Use empty debug location for register spill/reload X-Git-Tag: upstream/17.0.6~11474 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=06fd423de16b8b362ce902704ca061556c4146b4;p=platform%2Fupstream%2Fllvm.git [LoongArch] Use empty debug location for register spill/reload Spill/reload instructions are automatically generated by the compiler and have no relation to the original source code. So it would be better to not attach any debug location to them. The X86/AArch64/ARM/Thumb backends all follow this way. Reviewed By: xen0n Differential Revision: https://reviews.llvm.org/D148304 --- diff --git a/llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp b/llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp index 3e19f3e..a7c5e4d 100644 --- a/llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp +++ b/llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp @@ -81,9 +81,6 @@ void LoongArchInstrInfo::storeRegToStackSlot( MachineBasicBlock &MBB, MachineBasicBlock::iterator I, Register SrcReg, bool IsKill, int FI, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg) const { - DebugLoc DL; - if (I != MBB.end()) - DL = I->getDebugLoc(); MachineFunction *MF = MBB.getParent(); MachineFrameInfo &MFI = MF->getFrameInfo(); @@ -105,7 +102,7 @@ void LoongArchInstrInfo::storeRegToStackSlot( MachinePointerInfo::getFixedStack(*MF, FI), MachineMemOperand::MOStore, MFI.getObjectSize(FI), MFI.getObjectAlign(FI)); - BuildMI(MBB, I, DL, get(Opcode)) + BuildMI(MBB, I, DebugLoc(), get(Opcode)) .addReg(SrcReg, getKillRegState(IsKill)) .addFrameIndex(FI) .addImm(0) @@ -118,9 +115,6 @@ void LoongArchInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, Register VReg) const { - DebugLoc DL; - if (I != MBB.end()) - DL = I->getDebugLoc(); MachineFunction *MF = MBB.getParent(); MachineFrameInfo &MFI = MF->getFrameInfo(); @@ -142,7 +136,7 @@ void LoongArchInstrInfo::loadRegFromStackSlot(MachineBasicBlock &MBB, MachinePointerInfo::getFixedStack(*MF, FI), MachineMemOperand::MOLoad, MFI.getObjectSize(FI), MFI.getObjectAlign(FI)); - BuildMI(MBB, I, DL, get(Opcode), DstReg) + BuildMI(MBB, I, DebugLoc(), get(Opcode), DstReg) .addFrameIndex(FI) .addImm(0) .addMemOperand(MMO);