[llvm] 9dfc4ac - [X86] VZeroUpperInserter::insertVZeroUpper - avoid DebugLoc creation by embedding in the BuildMI calls. NFCI.

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


Author: Simon Pilgrim
Date: 2021-05-13T13:31:52+01:00
New Revision: 9dfc4ac41cedd8d7a79d7954b5a54ab33cfca05d

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

LOG: [X86] VZeroUpperInserter::insertVZeroUpper - avoid DebugLoc creation by embedding in the BuildMI calls. NFCI.

Try to pass DebugLoc by const-ref to avoid costly TrackingMDNodeRef copies.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86VZeroUpper.cpp b/llvm/lib/Target/X86/X86VZeroUpper.cpp
index c188c7443625..c3031b698552 100644
--- a/llvm/lib/Target/X86/X86VZeroUpper.cpp
+++ b/llvm/lib/Target/X86/X86VZeroUpper.cpp
@@ -182,8 +182,7 @@ static bool callHasRegMask(MachineInstr &MI) {
 /// Insert a vzeroupper instruction before I.
 void VZeroUpperInserter::insertVZeroUpper(MachineBasicBlock::iterator I,
                                           MachineBasicBlock &MBB) {
-  DebugLoc dl = I->getDebugLoc();
-  BuildMI(MBB, I, dl, TII->get(X86::VZEROUPPER));
+  BuildMI(MBB, I, I->getDebugLoc(), TII->get(X86::VZEROUPPER));
   ++NumVZU;
   EverMadeChange = true;
 }


        


More information about the llvm-commits mailing list