[llvm] [LoopInterchange] Enable it by default (WIP) (PR #124911)

Ryotaro Kasuga via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 5 23:27:12 PST 2025


kasuga-fj wrote:

>  I indeed see no regressions and 3 improvements of ~70% that are real, I think. There are a couple of minor improvements, but that could be real or noise, but didn't look further into it. I did 3 runs with interchange disabled ("before") and 3 runs with interchange enabled ("after"), and lower is better:

I tried these three cases on my local and couldn't reproduce this result. I investigated and found that the loops aren't interchanged in all the three cases. I assume that all the loops that were interchanged in your experiment are the same one that initializes the array `B` in the `init_array` function, for example the following one in `cholesky.c`.

https://github.com/llvm/llvm-test-suite/blob/94ca4917f6b02da34902b65b26240c5729d55bcf/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/cholesky/cholesky.c#L62-L65

This loop has `S` dependence for the outermost loop so that it used to be able to interchange, but not anymore. My guess is that you are using an older version of the compiler that does not have the patches listed in this PR description. With future improvements, these loops should become interchangeable again. I think we should address this issue after the interchange is enabled by default. 

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


More information about the llvm-commits mailing list