[llvm] [LV] Vectorize uncountable early exit store loops with combined conditions (PR #205109)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 19 13:34:13 PDT 2026
================
@@ -4659,6 +4659,61 @@ bool VPlanTransforms::handleUncountableEarlyExits(
}
}
+ // If we didn't find any, perhaps the exit was combined.
+ if (Exits.empty() && Plan.getExitBlocks().size() == 1) {
+ // TODO: Make this work with other styles.
+ if (Style != UncountableExitStyle::MaskedHandleExitInScalarLoop)
+ return false;
+
+ // TODO: Relax assumptions to cover more loops.
+ VPValue *Uncounted = nullptr;
+ VPValue *Counted = nullptr;
+ auto *IV = cast<VPSingleDefRecipe>(&HeaderVPBB->front());
+ VPRecipeBase *LatchBr = LatchVPBB->getTerminator();
+
+ if (!match(
+ LatchBr,
+ m_BranchOnCond(m_c_LogicalOr(
+ m_VPValue(Uncounted,
+ m_Cmp(m_VPInstruction<Instruction::Load>(m_VPValue()),
+ m_VPValue())),
+ m_VPValue(Counted, m_Cmp(m_Add(m_Specific(IV), m_VPValue()),
----------------
fhahn wrote:
Could we just use SCEV here (getSCEVExprForVPValue) to check for the induction? Similarly, it may be worth doing this in the IR matching as well?
https://github.com/llvm/llvm-project/pull/205109
More information about the llvm-commits
mailing list