[llvm] [LV] Convert uniform-address scatters to scalar store when unmasked or header-masked. (PR #166114)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 3 03:45:38 PST 2025


================
@@ -1372,6 +1372,50 @@ void VPlanTransforms::simplifyRecipes(VPlan &Plan) {
   }
 }
 
+static VPSingleDefRecipe *findHeaderMask(VPlan &Plan);
+
+/// Convert scatters with a uniform address that are either unmasked or
+/// masked by the header mask into an extract-last-element + scalar store.
+//  TODO: Add a profitability check comparing the cost of a scatter vs.
+//  extract + scalar store.
+static void optimizeScatterWithUniformAddr(VPlan &Plan) {
----------------
fhahn wrote:

Is there any reason this cannot be handled in `narrowToSingleScalar` where we already have similar transforms?

https://github.com/llvm/llvm-project/pull/166114


More information about the llvm-commits mailing list