[llvm] r340997 - [SimplifyCFG] Common debug handling [NFC]

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 29 16:22:07 PDT 2018


Author: reames
Date: Wed Aug 29 16:22:07 2018
New Revision: 340997

URL: http://llvm.org/viewvc/llvm-project?rev=340997&view=rev
Log:
[SimplifyCFG] Common debug handling [NFC]


Modified:
    llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp

Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=340997&r1=340996&r2=340997&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Wed Aug 29 16:22:07 2018
@@ -2688,8 +2688,6 @@ bool llvm::FoldBranchToCommonDest(Branch
     // all instructions before Cond other than DbgInfoIntrinsic are bonus
     // instructions.
     for (auto BonusInst = BB->begin(); Cond != &*BonusInst; ++BonusInst) {
-      if (isa<DbgInfoIntrinsic>(BonusInst))
-        continue;
       Instruction *NewBonusInst = BonusInst->clone();
       RemapInstruction(NewBonusInst, VMap,
                        RF_NoModuleLevelChanges | RF_IgnoreMissingLocals);
@@ -2816,12 +2814,6 @@ bool llvm::FoldBranchToCommonDest(Branch
 
     // TODO: If BB is reachable from all paths through PredBlock, then we
     // could replace PBI's branch probabilities with BI's.
-
-    // Copy any debug value intrinsics into the end of PredBlock.
-    for (Instruction &I : *BB)
-      if (isa<DbgInfoIntrinsic>(I))
-        I.clone()->insertBefore(PBI);
-
     return true;
   }
   return false;




More information about the llvm-commits mailing list