diff options
| author | Florian Hahn <flo@fhahn.com> | 2025-08-21 22:03:26 +0100 |
|---|---|---|
| committer | Florian Hahn <flo@fhahn.com> | 2025-08-21 22:03:26 +0100 |
| commit | 300d2c6d2037eb5ea751bd0451d8adc2a1bd5c5d (patch) | |
| tree | c6ea4969c299807f369288f714372af7631f1215 /llvm/lib/Transforms/Vectorize/VPlanTransforms.h | |
| parent | 38f0b9e6d965b46a2c747a0010809fc6ba103045 (diff) | |
[VPlan] Move SCEV expansion to VPlan transform. (NFCI).
Move the logic to expand SCEVs directly to a late VPlan transform that
expands SCEVs in the entry block. This turns VPExpandSCEVRecipe into an
abstract recipe without execute, which clarifies how the recipe is
handled, i.e. it is not executed like regular recipes.
It also helps to simplify construction, as now scalar evolution isn't
required to be passed to the recipe.
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/VPlanTransforms.h')
| -rw-r--r-- | llvm/lib/Transforms/Vectorize/VPlanTransforms.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/VPlanTransforms.h b/llvm/lib/Transforms/Vectorize/VPlanTransforms.h index 5b3d18b237ef..b1d986892ca6 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanTransforms.h +++ b/llvm/lib/Transforms/Vectorize/VPlanTransforms.h @@ -100,7 +100,7 @@ struct VPlanTransforms { VPlanPtr &Plan, function_ref<const InductionDescriptor *(PHINode *)> GetIntOrFpInductionDescriptor, - ScalarEvolution &SE, const TargetLibraryInfo &TLI); + const TargetLibraryInfo &TLI); /// Try to have all users of fixed-order recurrences appear after the recipe /// defining their previous value, by either sinking users or hoisting recipes @@ -282,6 +282,13 @@ struct VPlanTransforms { static void materializeVFAndVFxUF(VPlan &Plan, VPBasicBlock *VectorPH, ElementCount VF); + /// Expand VPExpandSCEVRecipes in \p Plan's entry block. Each + /// VPExpandSCEVRecipe is replaced with a live-in wrapping the expanded IR + /// value. A mapping from SCEV expressions to their expanded IR value is + /// returned. + static DenseMap<const SCEV *, Value *> expandSCEVs(VPlan &Plan, + ScalarEvolution &SE); + /// Try to convert a plan with interleave groups with VF elements to a plan /// with the interleave groups replaced by wide loads and stores processing VF /// elements, if all transformed interleave groups access the full vector |
