[llvm] [LoopInterchange] Ignore the cost-model, force interchange if legal (PR #148858)

Ryotaro Kasuga via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 15 09:21:29 PDT 2025


https://github.com/kasuga-fj commented:

What do you think about adding something like `force` [here](https://github.com/llvm/llvm-project/blob/c2e41be50f2cc3d1e99c30b1996b8873b05c4b0e/llvm/lib/Transforms/Scalar/LoopInterchange.cpp#L96-L109) instead? I personally think it could be useful in some cases, e.g., we can specify `-loop-interchange-profitabilities=cache,force`. The behavior is slightly different from `-loop-interchange-profitabilities=cache`. The former will interchange the loops if it is *not unprofitable* for the cache, while the latter will perform the interchange if it is profitable for the cache. The result will differ in cases where it is unclear whether interchanging is profitable or unprofitable for the cache.

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


More information about the llvm-commits mailing list