[llvm] 645e7fc - [GlobalISel] Use existing MIR builder instead of creating one in combiner.

Amara Emerson via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 14:19:24 PDT 2020


Author: Amara Emerson
Date: 2020-07-23T14:16:45-07:00
New Revision: 645e7fc5421cf82055ae7b881f4aea92818a5569

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

LOG: [GlobalISel] Use existing MIR builder instead of creating one in combiner.

Added: 
    

Modified: 
    llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
index eba1a522d413..422b71b28b6f 100644
--- a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
@@ -604,8 +604,8 @@ bool CombinerHelper::matchSextTruncSextLoad(MachineInstr &MI) {
 
 bool CombinerHelper::applySextTruncSextLoad(MachineInstr &MI) {
   assert(MI.getOpcode() == TargetOpcode::G_SEXT_INREG);
-  MachineIRBuilder MIB(MI);
-  MIB.buildCopy(MI.getOperand(0).getReg(), MI.getOperand(1).getReg());
+  Builder.setInstrAndDebugLoc(MI);
+  Builder.buildCopy(MI.getOperand(0).getReg(), MI.getOperand(1).getReg());
   MI.eraseFromParent();
   return true;
 }


        


More information about the llvm-commits mailing list