Skip to content

Commit 0a193cb

Browse files
authored
[VPlan] Use IsaPred to improve code (NFC) (#156037)
1 parent c128b8c commit 0a193cb

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,12 +2084,10 @@ static VPActiveLaneMaskPHIRecipe *addVPLaneMaskPhiAndUpdateExitBranch(
20842084
/// for the header-mask pattern manually.
20852085
static VPSingleDefRecipe *findHeaderMask(VPlan &Plan) {
20862086
SmallVector<VPValue *> WideCanonicalIVs;
2087-
auto *FoundWidenCanonicalIVUser =
2088-
find_if(Plan.getCanonicalIV()->users(),
2089-
[](VPUser *U) { return isa<VPWidenCanonicalIVRecipe>(U); });
2087+
auto *FoundWidenCanonicalIVUser = find_if(Plan.getCanonicalIV()->users(),
2088+
IsaPred<VPWidenCanonicalIVRecipe>);
20902089
assert(count_if(Plan.getCanonicalIV()->users(),
2091-
[](VPUser *U) { return isa<VPWidenCanonicalIVRecipe>(U); }) <=
2092-
1 &&
2090+
IsaPred<VPWidenCanonicalIVRecipe>) <= 1 &&
20932091
"Must have at most one VPWideCanonicalIVRecipe");
20942092
if (FoundWidenCanonicalIVUser != Plan.getCanonicalIV()->users().end()) {
20952093
auto *WideCanonicalIV =
@@ -2132,9 +2130,8 @@ void VPlanTransforms::addActiveLaneMask(
21322130
"DataAndControlFlowWithoutRuntimeCheck implies "
21332131
"UseActiveLaneMaskForControlFlow");
21342132

2135-
auto *FoundWidenCanonicalIVUser =
2136-
find_if(Plan.getCanonicalIV()->users(),
2137-
[](VPUser *U) { return isa<VPWidenCanonicalIVRecipe>(U); });
2133+
auto *FoundWidenCanonicalIVUser = find_if(Plan.getCanonicalIV()->users(),
2134+
IsaPred<VPWidenCanonicalIVRecipe>);
21382135
assert(FoundWidenCanonicalIVUser &&
21392136
"Must have widened canonical IV when tail folding!");
21402137
VPSingleDefRecipe *HeaderMask = findHeaderMask(Plan);

0 commit comments

Comments
 (0)