[llvm] [LoopInterchange] Increment isDirectionNegative check to next level for scalar direction (PR #78951)

Bardia Mahjour via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 10:36:00 PST 2024


bmahjour wrote:

> > Skipping the scalar direction is incorrect. Scalar dependencies get carried from every iteration to every iteration, so they **must** be treated more conservatively than a `=` dependence.
> > I think this problem should be solved in the loop interchange pass itself where if the candidate pair of loops is nested inside other loops, and those outer loop IVs don't contribute to the index calculations in the pair of loops, then the dependence entries corresponding to the outer loops should be ignored.
> 
> Thanks for pointing the direction. :-) Could you help me to check does the latest commit as you expected?

I'm saying let's not modify DependenceAnalysis. The custom handling should be done in Loop Interchange to ignore dependencies at outer levels when they don't matter to the legality of interchange.

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


More information about the llvm-commits mailing list