[llvm] [LoopReduceMotion] Improve loop by extract reduction instruction (PR #179215)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 3 19:32:02 PST 2026
Anjian-Wen wrote:
> I think this would be detrimental to any architectures that preferred inloop reductions or could perform the reduction as or more efficiently than the add. (I was trying to test it, but it crashed and looks like it is fairly limited to what it can transform at the moment).
>
> This probably needs to be cost-modelled, although the cost-model can be difficult as there are so many operations potentially transformed into a single instruction.
@davemgreen Thanks for your reivews. I previously only considered loop-reduction code motion and didn't consider the possibility that in-loop reductions might be more efficient. I will try to find if we can introduce a cost model to represent this. Besides, could you provide any case about in-loop reduction more efficient for testing?
https://github.com/llvm/llvm-project/pull/179215
More information about the llvm-commits
mailing list