Skip to content

VPlanTransforms: fix style after cursory reading (NFC) #105827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1072,10 +1072,11 @@ void VPlanTransforms::truncateToMinimalBitwidths(
ResultVPV->replaceAllUsesWith(Ext);
Ext->setOperand(0, ResultVPV);
assert(OldResSizeInBits > NewResSizeInBits && "Nothing to shrink?");
} else
} else {
assert(
match(&R, m_Binary<Instruction::ICmp>(m_VPValue(), m_VPValue())) &&
"Only ICmps should not need extending the result.");
}

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

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

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

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

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

if (!Visited.insert(CurRec).second)
continue;
Expand Down Expand Up @@ -1493,8 +1493,8 @@ void VPlanTransforms::dropPoisonGeneratingRecipes(
}

// Add new definitions to the worklist.
for (VPValue *operand : CurRec->operands())
if (VPRecipeBase *OpDef = operand->getDefiningRecipe())
for (VPValue *Operand : CurRec->operands())
if (VPRecipeBase *OpDef = Operand->getDefiningRecipe())
Worklist.push_back(OpDef);
}
});
Expand All @@ -1510,7 +1510,7 @@ void VPlanTransforms::dropPoisonGeneratingRecipes(
VPRecipeBase *AddrDef = WidenRec->getAddr()->getDefiningRecipe();
if (AddrDef && WidenRec->isConsecutive() &&
BlockNeedsPredication(UnderlyingInstr.getParent()))
collectPoisonGeneratingInstrsInBackwardSlice(AddrDef);
CollectPoisonGeneratingInstrsInBackwardSlice(AddrDef);
} else if (auto *InterleaveRec = dyn_cast<VPInterleaveRecipe>(&Recipe)) {
VPRecipeBase *AddrDef = InterleaveRec->getAddr()->getDefiningRecipe();
if (AddrDef) {
Expand All @@ -1526,7 +1526,7 @@ void VPlanTransforms::dropPoisonGeneratingRecipes(
}

if (NeedPredication)
collectPoisonGeneratingInstrsInBackwardSlice(AddrDef);
CollectPoisonGeneratingInstrsInBackwardSlice(AddrDef);
}
}
}
Expand Down
Loading