Skip to content

Commit b44d9e5

Browse files
authored
VPlanTransforms: fix style after cursory reading (NFC) (#105827)
1 parent 1424336 commit b44d9e5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,10 +1072,11 @@ void VPlanTransforms::truncateToMinimalBitwidths(
10721072
ResultVPV->replaceAllUsesWith(Ext);
10731073
Ext->setOperand(0, ResultVPV);
10741074
assert(OldResSizeInBits > NewResSizeInBits && "Nothing to shrink?");
1075-
} else
1075+
} else {
10761076
assert(
10771077
match(&R, m_Binary<Instruction::ICmp>(m_VPValue(), m_VPValue())) &&
10781078
"Only ICmps should not need extending the result.");
1079+
}
10791080

10801081
assert(!isa<VPWidenStoreRecipe>(&R) && "stores cannot be narrowed");
10811082
if (isa<VPWidenLoadRecipe>(&R))
@@ -1214,7 +1215,7 @@ static VPActiveLaneMaskPHIRecipe *addVPLaneMaskPhiAndUpdateExitBranch(
12141215

12151216
// Now create the ActiveLaneMaskPhi recipe in the main loop using the
12161217
// preheader ActiveLaneMask instruction.
1217-
auto LaneMaskPhi = new VPActiveLaneMaskPHIRecipe(EntryALM, DebugLoc());
1218+
auto *LaneMaskPhi = new VPActiveLaneMaskPHIRecipe(EntryALM, DebugLoc());
12181219
LaneMaskPhi->insertAfter(CanonicalIVPHI);
12191220

12201221
// Create the active lane mask for the next iteration of the loop before the
@@ -1290,7 +1291,7 @@ void VPlanTransforms::addActiveLaneMask(
12901291
"DataAndControlFlowWithoutRuntimeCheck implies "
12911292
"UseActiveLaneMaskForControlFlow");
12921293

1293-
auto FoundWidenCanonicalIVUser =
1294+
auto *FoundWidenCanonicalIVUser =
12941295
find_if(Plan.getCanonicalIV()->users(),
12951296
[](VPUser *U) { return isa<VPWidenCanonicalIVRecipe>(U); });
12961297
assert(FoundWidenCanonicalIVUser &&
@@ -1440,14 +1441,13 @@ void VPlanTransforms::dropPoisonGeneratingRecipes(
14401441
// Collect recipes in the backward slice of `Root` that may generate a poison
14411442
// value that is used after vectorization.
14421443
SmallPtrSet<VPRecipeBase *, 16> Visited;
1443-
auto collectPoisonGeneratingInstrsInBackwardSlice([&](VPRecipeBase *Root) {
1444+
auto CollectPoisonGeneratingInstrsInBackwardSlice([&](VPRecipeBase *Root) {
14441445
SmallVector<VPRecipeBase *, 16> Worklist;
14451446
Worklist.push_back(Root);
14461447

14471448
// Traverse the backward slice of Root through its use-def chain.
14481449
while (!Worklist.empty()) {
1449-
VPRecipeBase *CurRec = Worklist.back();
1450-
Worklist.pop_back();
1450+
VPRecipeBase *CurRec = Worklist.pop_back_val();
14511451

14521452
if (!Visited.insert(CurRec).second)
14531453
continue;
@@ -1493,8 +1493,8 @@ void VPlanTransforms::dropPoisonGeneratingRecipes(
14931493
}
14941494

14951495
// Add new definitions to the worklist.
1496-
for (VPValue *operand : CurRec->operands())
1497-
if (VPRecipeBase *OpDef = operand->getDefiningRecipe())
1496+
for (VPValue *Operand : CurRec->operands())
1497+
if (VPRecipeBase *OpDef = Operand->getDefiningRecipe())
14981498
Worklist.push_back(OpDef);
14991499
}
15001500
});
@@ -1510,7 +1510,7 @@ void VPlanTransforms::dropPoisonGeneratingRecipes(
15101510
VPRecipeBase *AddrDef = WidenRec->getAddr()->getDefiningRecipe();
15111511
if (AddrDef && WidenRec->isConsecutive() &&
15121512
BlockNeedsPredication(UnderlyingInstr.getParent()))
1513-
collectPoisonGeneratingInstrsInBackwardSlice(AddrDef);
1513+
CollectPoisonGeneratingInstrsInBackwardSlice(AddrDef);
15141514
} else if (auto *InterleaveRec = dyn_cast<VPInterleaveRecipe>(&Recipe)) {
15151515
VPRecipeBase *AddrDef = InterleaveRec->getAddr()->getDefiningRecipe();
15161516
if (AddrDef) {
@@ -1526,7 +1526,7 @@ void VPlanTransforms::dropPoisonGeneratingRecipes(
15261526
}
15271527

15281528
if (NeedPredication)
1529-
collectPoisonGeneratingInstrsInBackwardSlice(AddrDef);
1529+
CollectPoisonGeneratingInstrsInBackwardSlice(AddrDef);
15301530
}
15311531
}
15321532
}

0 commit comments

Comments
 (0)