Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit a166c35

Browse files
committed
[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
1 parent 3972070 commit a166c35

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2713,16 +2713,16 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, unsigned BonusInstThreshold) {
27132713

27142714
// Clone Cond into the predecessor basic block, and or/and the
27152715
// two conditions together.
2716-
Instruction *New = Cond->clone();
2717-
RemapInstruction(New, VMap,
2716+
Instruction *CondInPred = Cond->clone();
2717+
RemapInstruction(CondInPred, VMap,
27182718
RF_NoModuleLevelChanges | RF_IgnoreMissingLocals);
2719-
PredBlock->getInstList().insert(PBI->getIterator(), New);
2720-
New->takeName(Cond);
2721-
Cond->setName(New->getName() + ".old");
2719+
PredBlock->getInstList().insert(PBI->getIterator(), CondInPred);
2720+
CondInPred->takeName(Cond);
2721+
Cond->setName(CondInPred->getName() + ".old");
27222722

27232723
if (BI->isConditional()) {
27242724
Instruction *NewCond = cast<Instruction>(
2725-
Builder.CreateBinOp(Opc, PBI->getCondition(), New, "or.cond"));
2725+
Builder.CreateBinOp(Opc, PBI->getCondition(), CondInPred, "or.cond"));
27262726
PBI->setCondition(NewCond);
27272727

27282728
uint64_t PredTrueWeight, PredFalseWeight, SuccTrueWeight, SuccFalseWeight;
@@ -2786,7 +2786,8 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, unsigned BonusInstThreshold) {
27862786
Instruction *NotCond = cast<Instruction>(
27872787
Builder.CreateNot(PBI->getCondition(), "not.cond"));
27882788
MergedCond = cast<Instruction>(
2789-
Builder.CreateBinOp(Instruction::And, NotCond, New, "and.cond"));
2789+
Builder.CreateBinOp(Instruction::And, NotCond, CondInPred,
2790+
"and.cond"));
27902791
if (PBI_C->isOne())
27912792
MergedCond = cast<Instruction>(Builder.CreateBinOp(
27922793
Instruction::Or, PBI->getCondition(), MergedCond, "or.cond"));
@@ -2795,7 +2796,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, unsigned BonusInstThreshold) {
27952796
// PBI_C is true: (PBI_Cond and BI_Value) or (!PBI_Cond)
27962797
// is false: PBI_Cond and BI_Value
27972798
MergedCond = cast<Instruction>(Builder.CreateBinOp(
2798-
Instruction::And, PBI->getCondition(), New, "and.cond"));
2799+
Instruction::And, PBI->getCondition(), CondInPred, "and.cond"));
27992800
if (PBI_C->isOne()) {
28002801
Instruction *NotCond = cast<Instruction>(
28012802
Builder.CreateNot(PBI->getCondition(), "not.cond"));

0 commit comments

Comments
 (0)