[llvm] [SLP] Support ordered FAdd reductions in SLPVectorizer (PR #146570)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 1 10:38:24 PDT 2025


================
@@ -22180,9 +22234,10 @@ class HorizontalReduction {
       // Add reduction values. The values are sorted for better vectorization
       // results.
       for (Value *V : PossibleRedVals) {
-        size_t Key, Idx;
-        std::tie(Key, Idx) = generateKeySubkey(V, &TLI, GenerateLoadsSubkey,
-                                               /*AllowAlternate=*/false);
+        size_t Key = 0, Idx = 0;
----------------
alexey-bataev wrote:

I think better to separate it from the "associative" analysis and implement it in a separate function, in case if associative does not work. It will be much easier to read and maintain. Most of the logic for associative reductions can be dropped

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


More information about the llvm-commits mailing list