[X86] X86ExpandPseudo.cpp - try to pass DebugLoc by const-ref to avoid costly Trackin...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 13 May 2021 12:27:01 +0000 (13:27 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 13 May 2021 12:31:54 +0000 (13:31 +0100)
llvm/lib/Target/X86/X86ExpandPseudo.cpp

index ce794ba..66f92f8 100644 (file)
@@ -95,7 +95,7 @@ void X86ExpandPseudo::ExpandICallBranchFunnel(
   ++InsPt;
 
   std::vector<std::pair<MachineBasicBlock *, unsigned>> TargetMBBs;
-  DebugLoc DL = JTInst->getDebugLoc();
+  const DebugLoc &DL = JTInst->getDebugLoc();
   MachineOperand Selector = JTInst->getOperand(0);
   const GlobalValue *CombinedGlobal = JTInst->getOperand(1).getGlobal();
 
@@ -193,7 +193,7 @@ bool X86ExpandPseudo::ExpandMI(MachineBasicBlock &MBB,
                                MachineBasicBlock::iterator MBBI) {
   MachineInstr &MI = *MBBI;
   unsigned Opcode = MI.getOpcode();
-  DebugLoc DL = MBBI->getDebugLoc();
+  const DebugLoc &DL = MBBI->getDebugLoc();
   switch (Opcode) {
   default:
     return false;
@@ -546,7 +546,7 @@ void X86ExpandPseudo::ExpandVastartSaveXmmRegs(
 
   MachineFunction *Func = EntryBlk->getParent();
   const TargetInstrInfo *TII = STI->getInstrInfo();
-  DebugLoc DL = VAStartPseudoInstr->getDebugLoc();
+  const DebugLoc &DL = VAStartPseudoInstr->getDebugLoc();
   Register CountReg = VAStartPseudoInstr->getOperand(0).getReg();
 
   // Calculate liveins for newly created blocks.