[llvm] [LV][EVL] Simplify EVL recipe transformation by using a single EVL mask. nfc (PR #152479)
Mel Chen via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 8 05:10:27 PDT 2025
================
@@ -2227,48 +2227,47 @@ static void transformRecipestoEVLRecipes(VPlan &Plan, VPValue &EVL) {
}
}
- // Try to optimize header mask recipes away to their EVL variants.
+ // Replace header masks with a mask equivalent to predicating by EVL:
+ //
+ // icmp ule widen-canonical-iv backedge-taken-count
+ // ->
+ // icmp ult step-vector, EVL
+ VPRecipeBase *EVLR = EVL.getDefiningRecipe();
+ VPBuilder Builder(EVLR->getParent(), std::next(EVLR->getIterator()));
+ Type *EVLType = TypeInfo.inferScalarType(&EVL);
+ VPValue *EVLMask = Builder.createICmp(
+ CmpInst::ICMP_ULT,
+ Builder.createNaryOp(VPInstruction::StepVector, {}, EVLType), &EVL);
----------------
Mel-Chen wrote:
I remove it if the mask is dead.
53f0022824a69fb9dd98057effdeea989463c2dd
https://github.com/llvm/llvm-project/pull/152479
More information about the llvm-commits
mailing list