From a166c3545534a699ee86379c4e58b28547952988 Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Thu, 30 Aug 2018 00:12:29 +0000 Subject: [PATCH] [SimplifyCFG] Rename a variable for readibility of a future change [NFC] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341004 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/SimplifyCFG.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp index f0ed075cce6..62a635fa38e 100644 --- a/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/lib/Transforms/Utils/SimplifyCFG.cpp @@ -2713,16 +2713,16 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, unsigned BonusInstThreshold) { // Clone Cond into the predecessor basic block, and or/and the // two conditions together. - Instruction *New = Cond->clone(); - RemapInstruction(New, VMap, + Instruction *CondInPred = Cond->clone(); + RemapInstruction(CondInPred, VMap, RF_NoModuleLevelChanges | RF_IgnoreMissingLocals); - PredBlock->getInstList().insert(PBI->getIterator(), New); - New->takeName(Cond); - Cond->setName(New->getName() + ".old"); + PredBlock->getInstList().insert(PBI->getIterator(), CondInPred); + CondInPred->takeName(Cond); + Cond->setName(CondInPred->getName() + ".old"); if (BI->isConditional()) { Instruction *NewCond = cast( - Builder.CreateBinOp(Opc, PBI->getCondition(), New, "or.cond")); + Builder.CreateBinOp(Opc, PBI->getCondition(), CondInPred, "or.cond")); PBI->setCondition(NewCond); uint64_t PredTrueWeight, PredFalseWeight, SuccTrueWeight, SuccFalseWeight; @@ -2786,7 +2786,8 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, unsigned BonusInstThreshold) { Instruction *NotCond = cast( Builder.CreateNot(PBI->getCondition(), "not.cond")); MergedCond = cast( - Builder.CreateBinOp(Instruction::And, NotCond, New, "and.cond")); + Builder.CreateBinOp(Instruction::And, NotCond, CondInPred, + "and.cond")); if (PBI_C->isOne()) MergedCond = cast(Builder.CreateBinOp( Instruction::Or, PBI->getCondition(), MergedCond, "or.cond")); @@ -2795,7 +2796,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, unsigned BonusInstThreshold) { // PBI_C is true: (PBI_Cond and BI_Value) or (!PBI_Cond) // is false: PBI_Cond and BI_Value MergedCond = cast(Builder.CreateBinOp( - Instruction::And, PBI->getCondition(), New, "and.cond")); + Instruction::And, PBI->getCondition(), CondInPred, "and.cond")); if (PBI_C->isOne()) { Instruction *NotCond = cast( Builder.CreateNot(PBI->getCondition(), "not.cond")); -- 2.11.0