[llvm] [VPlan] Add convertToUniformRecipe transform. (PR #139150)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Thu May 15 13:38:34 PDT 2025
================
@@ -1084,6 +1084,40 @@ void VPlanTransforms::simplifyRecipes(VPlan &Plan, Type &CanonicalIVTy) {
}
}
+static void convertToUniformRecipes(VPlan &Plan) {
+ auto TryToNarrow = [](VPBasicBlock *VPBB) {
+ for (VPRecipeBase &R : make_early_inc_range(reverse(*VPBB))) {
+ // Try to narrow wide and replicating recipes to uniform recipes, based on
+ // VPlan analysis.
+ auto *Def = dyn_cast<VPSingleDefRecipe>(&R);
+ if (!Def || !isa<VPReplicateRecipe, VPWidenRecipe>(Def) ||
+ !Def->getUnderlyingValue())
----------------
fhahn wrote:
It could be asserted for `VPReplicateRecipe`, but not for `VPWidenRecipe` which does not require a underlying value.
https://github.com/llvm/llvm-project/pull/139150
More information about the llvm-commits
mailing list