[llvm] [InstCombine] Combine interleaved PHI reduction chains. (PR #143878)

Ricardo Jesus via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 16 10:54:56 PDT 2025


rj-jesus wrote:

Thanks for the review, @antoniofrighetto - I believe I should have addressed everything. Please let me know if you have any other comments. :)

> I know. Obviously the combined version is faster. I just wonder if we can avoid introducing this pattern in LoopVectorizer by making some adjustments to cost modeling...

@dtcxzyw I see, thanks, I think that should also work. I think if we go down that route, we just need to be careful with loops such as [this](https://godbolt.org/z/68Ybx7v3d) where interleaving **is** beneficial since these loops are currently not optimised by indvars or other such passes (as far as I'm aware). So, in these cases, interleaving and folding away the reduction chains separately seemed to be the most straightforward approach. 

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


More information about the llvm-commits mailing list