[llvm] ba0ec1b - [X86] X86ExpandPseudo.cpp - try to pass DebugLoc by const-ref to avoid costly TrackingMDNodeRef copies. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu May 13 05:34:35 PDT 2021


Author: Simon Pilgrim
Date: 2021-05-13T13:31:54+01:00
New Revision: ba0ec1be2916eae1798ad4c56480f471a65f7ce9

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

LOG: [X86] X86ExpandPseudo.cpp - try to pass DebugLoc by const-ref to avoid costly TrackingMDNodeRef copies. NFCI.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ExpandPseudo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ExpandPseudo.cpp b/llvm/lib/Target/X86/X86ExpandPseudo.cpp
index ce794ba46fdc..66f92f827da2 100644
--- a/llvm/lib/Target/X86/X86ExpandPseudo.cpp
+++ b/llvm/lib/Target/X86/X86ExpandPseudo.cpp
@@ -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.


        


More information about the llvm-commits mailing list