[llvm] r335365 - Initialize LiveRegs once in BranchFolder::mergeCommonTails

Krzysztof Parzyszek via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 22 09:38:38 PDT 2018


Author: kparzysz
Date: Fri Jun 22 09:38:38 2018
New Revision: 335365

URL: http://llvm.org/viewvc/llvm-project?rev=335365&view=rev
Log:
Initialize LiveRegs once in BranchFolder::mergeCommonTails

Modified:
    llvm/trunk/lib/CodeGen/BranchFolding.cpp

Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=335365&r1=335364&r2=335365&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original)
+++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Fri Jun 22 09:38:38 2018
@@ -921,11 +921,12 @@ void BranchFolder::mergeCommonTails(unsi
   if (UpdateLiveIns) {
     LivePhysRegs NewLiveIns(*TRI);
     computeLiveIns(NewLiveIns, *MBB);
+    LiveRegs.init(*TRI);
 
     // The flag merging may lead to some register uses no longer using the
     // <undef> flag, add IMPLICIT_DEFs in the predecessors as necessary.
     for (MachineBasicBlock *Pred : MBB->predecessors()) {
-      LiveRegs.init(*TRI);
+      LiveRegs.clear();
       LiveRegs.addLiveOuts(*Pred);
       MachineBasicBlock::iterator InsertBefore = Pred->getFirstTerminator();
       for (unsigned Reg : NewLiveIns) {




More information about the llvm-commits mailing list