[llvm] [InstCombine] Fold binary op of reductions. (PR #121567)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 20 23:27:31 PST 2025
davemgreen wrote:
If we change what we consider is canonical, we would need to make sure no backends regress by handling the backwards transform.
So long as it uses getExtendedReductionCost and getMulAccReductionCost to detect the reduction costs then moving this to VectorCombine sounds reasonable to me. The default cost-model will not detect the lower cost at the moment, but that could be changed if it could recognise the different types of reductions. It is just a bit awkward to recognise large patterns normally, when there are multiple instructions.
https://github.com/llvm/llvm-project/pull/121567
More information about the llvm-commits
mailing list