Skip to content

Commit 2df7e89

Browse files
committed
VPlanTransforms: fix style after cursory reading (NFC)
1 parent 4f07508 commit 2df7e89

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ void VPlanTransforms::optimizeForVFAndUF(VPlan &Plan, ElementCount BestVF,
716716
}
717717

718718
#ifndef NDEBUG
719-
static VPRegionBlock *GetReplicateRegion(VPRecipeBase *R) {
719+
static VPRegionBlock *getReplicateRegion(VPRecipeBase *R) {
720720
auto *Region = dyn_cast_or_null<VPRegionBlock>(R->getParent()->getParent());
721721
if (Region && Region->isReplicator()) {
722722
assert(Region->getNumSuccessors() == 1 &&
@@ -749,9 +749,9 @@ static bool properlyDominates(const VPRecipeBase *A, const VPRecipeBase *B,
749749
if (ParentA == ParentB)
750750
return LocalComesBefore(A, B);
751751

752-
assert(!GetReplicateRegion(const_cast<VPRecipeBase *>(A)) &&
752+
assert(!getReplicateRegion(const_cast<VPRecipeBase *>(A)) &&
753753
"No replicate regions expected at this point");
754-
assert(!GetReplicateRegion(const_cast<VPRecipeBase *>(B)) &&
754+
assert(!getReplicateRegion(const_cast<VPRecipeBase *>(B)) &&
755755
"No replicate regions expected at this point");
756756
return VPDT.properlyDominates(ParentA, ParentB);
757757
}
@@ -1100,10 +1100,11 @@ void VPlanTransforms::truncateToMinimalBitwidths(
11001100
ResultVPV->replaceAllUsesWith(Ext);
11011101
Ext->setOperand(0, ResultVPV);
11021102
assert(OldResSizeInBits > NewResSizeInBits && "Nothing to shrink?");
1103-
} else
1103+
} else {
11041104
assert(
11051105
match(&R, m_Binary<Instruction::ICmp>(m_VPValue(), m_VPValue())) &&
11061106
"Only ICmps should not need extending the result.");
1107+
}
11071108

11081109
assert(!isa<VPWidenStoreRecipe>(&R) && "stores cannot be narrowed");
11091110
if (isa<VPWidenLoadRecipe>(&R))
@@ -1242,7 +1243,7 @@ static VPActiveLaneMaskPHIRecipe *addVPLaneMaskPhiAndUpdateExitBranch(
12421243

12431244
// Now create the ActiveLaneMaskPhi recipe in the main loop using the
12441245
// preheader ActiveLaneMask instruction.
1245-
auto LaneMaskPhi = new VPActiveLaneMaskPHIRecipe(EntryALM, DebugLoc());
1246+
auto *LaneMaskPhi = new VPActiveLaneMaskPHIRecipe(EntryALM, DebugLoc());
12461247
LaneMaskPhi->insertAfter(CanonicalIVPHI);
12471248

12481249
// Create the active lane mask for the next iteration of the loop before the
@@ -1318,7 +1319,7 @@ void VPlanTransforms::addActiveLaneMask(
13181319
"DataAndControlFlowWithoutRuntimeCheck implies "
13191320
"UseActiveLaneMaskForControlFlow");
13201321

1321-
auto FoundWidenCanonicalIVUser =
1322+
auto *FoundWidenCanonicalIVUser =
13221323
find_if(Plan.getCanonicalIV()->users(),
13231324
[](VPUser *U) { return isa<VPWidenCanonicalIVRecipe>(U); });
13241325
assert(FoundWidenCanonicalIVUser &&
@@ -1468,14 +1469,13 @@ void VPlanTransforms::dropPoisonGeneratingRecipes(
14681469
// Collect recipes in the backward slice of `Root` that may generate a poison
14691470
// value that is used after vectorization.
14701471
SmallPtrSet<VPRecipeBase *, 16> Visited;
1471-
auto collectPoisonGeneratingInstrsInBackwardSlice([&](VPRecipeBase *Root) {
1472+
auto CollectPoisonGeneratingInstrsInBackwardSlice([&](VPRecipeBase *Root) {
14721473
SmallVector<VPRecipeBase *, 16> Worklist;
14731474
Worklist.push_back(Root);
14741475

14751476
// Traverse the backward slice of Root through its use-def chain.
14761477
while (!Worklist.empty()) {
1477-
VPRecipeBase *CurRec = Worklist.back();
1478-
Worklist.pop_back();
1478+
VPRecipeBase *CurRec = Worklist.pop_back_val();
14791479

14801480
if (!Visited.insert(CurRec).second)
14811481
continue;
@@ -1521,8 +1521,8 @@ void VPlanTransforms::dropPoisonGeneratingRecipes(
15211521
}
15221522

15231523
// Add new definitions to the worklist.
1524-
for (VPValue *operand : CurRec->operands())
1525-
if (VPRecipeBase *OpDef = operand->getDefiningRecipe())
1524+
for (VPValue *Operand : CurRec->operands())
1525+
if (VPRecipeBase *OpDef = Operand->getDefiningRecipe())
15261526
Worklist.push_back(OpDef);
15271527
}
15281528
});
@@ -1538,7 +1538,7 @@ void VPlanTransforms::dropPoisonGeneratingRecipes(
15381538
VPRecipeBase *AddrDef = WidenRec->getAddr()->getDefiningRecipe();
15391539
if (AddrDef && WidenRec->isConsecutive() &&
15401540
BlockNeedsPredication(UnderlyingInstr.getParent()))
1541-
collectPoisonGeneratingInstrsInBackwardSlice(AddrDef);
1541+
CollectPoisonGeneratingInstrsInBackwardSlice(AddrDef);
15421542
} else if (auto *InterleaveRec = dyn_cast<VPInterleaveRecipe>(&Recipe)) {
15431543
VPRecipeBase *AddrDef = InterleaveRec->getAddr()->getDefiningRecipe();
15441544
if (AddrDef) {
@@ -1554,7 +1554,7 @@ void VPlanTransforms::dropPoisonGeneratingRecipes(
15541554
}
15551555

15561556
if (NeedPredication)
1557-
collectPoisonGeneratingInstrsInBackwardSlice(AddrDef);
1557+
CollectPoisonGeneratingInstrsInBackwardSlice(AddrDef);
15581558
}
15591559
}
15601560
}

0 commit comments

Comments
 (0)