[llvm] [CodeGen] Expansion of scalable vector reductions (PR #129214)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 28 01:03:41 PDT 2025
iamlouk wrote:
> Hi - If you want a way forward with this patch then I think that:
Thank you all, I do understand now that it is better to expand scalable reductions together with other scalable operations and not like other fixed-sized reductions. In any case, I will close this PR, but I am still somewhat interested in this problem/usecase, although I have no concrete plans to move forward immediately.
I guess using `PreISelIntrinsicLowering` and adding a reduction helper in https://github.com/llvm/llvm-project/blob/main/llvm/lib/Transforms/Utils/LowerVectorIntrinsics.cpp would be straight forward and code from this patch could be reused, but what sounds more tricky to me is a good place to "fuse" multiple loops generated by such cases (or to just expand into a single one from the start).
Expanding into a single loop would require a lot of changes in `PreISelIntrinsicLowering` I assume? How about running a stripped-down and simplified version of something like the LoopFuse pass on demand inside of `PreISelIntrinsicLowering` (but only if scalable vector intrinsics have been expanded)? That might later be easier to bring to non-intrinsic scalable operations needing expansion than trying to create a single loop from the start?
https://github.com/llvm/llvm-project/pull/129214
More information about the llvm-commits
mailing list