[llvm] [VPlan] Add vputils::recipesOnly that returns a downcasted range (NFC) (PR #222770)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 14 06:59:16 PDT 2026
================
@@ -1089,18 +1089,18 @@ void VPlanTransforms::expandSCEVsToVPInstructions(VPlan &Plan,
VPSCEVExpander Expander(Builder, SE, DL);
// Expand VPExpandSCEVRecipes to VPInstructions using VPSCEVExpander.
- for (VPRecipeBase &R : make_early_inc_range(*Entry)) {
- auto *ExpSCEV = dyn_cast<VPExpandSCEVRecipe>(&R);
- if (!ExpSCEV || ExpSCEV->user_empty())
+ for (VPExpandSCEVRecipe &ExpSCEV :
+ make_early_inc_range(vputils::recipesOnly<VPExpandSCEVRecipe>(*Entry))) {
----------------
fhahn wrote:
I think it is probably best to use `recipesOnly` inside of `make_early_inc_range`, because the former may skip elements.
https://github.com/llvm/llvm-project/pull/222770
More information about the llvm-commits
mailing list