[llvm] [NFCI][VPlan] Split initial mem-widening into a separate transformation (PR #182592)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 27 14:54:16 PDT 2026
================
@@ -90,6 +78,26 @@ class VPRecipeBuilder {
VPRecipeBase *tryToCreateWidenNonPhiRecipe(VPSingleDefRecipe *R,
VFRange &Range);
+ /// Check if the load or store instruction \p VPI should widened for \p
+ /// Range.Start and potentially masked. Such instructions are handled by a
+ /// recipe that takes an additional VPInstruction for the mask.
+ VPRecipeBase *tryToWidenMemory(VPInstruction *VPI, VFRange &Range);
+
+ /// If \p VPI represents a histogram operation (as determined by
+ /// LoopVectorizationLegality) make that safe for vectorization, by emitting a
+ /// llvm.experimental.vector.histogram.add intrinsic in place of the Load +
+ /// Add|Sub + Store operations that perform the histogram in the original
+ /// scalar loop.
+ VPHistogramRecipe *widenIfHistogram(VPInstruction *VPI);
+
+ /// The stores with invariant address inside the loop will be deleted, and in
----------------
fhahn wrote:
nit: would be good to tie the comment to the passed in VPI, perhaps something along the lines below.
```suggestion
/// If \p VPI is a store with an invariant address, delete it. If it is the final store of a reduction result, a uniform store recipe will be created for the final invariant store of the reduction result in the middle block.
```
https://github.com/llvm/llvm-project/pull/182592
More information about the llvm-commits
mailing list