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

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 23 22:34:43 PST 2024


ShivaChen wrote:

> I would need a more convincing argument than "it makes my case work".
> 
> Suppose the scalar dependency is an implicit `<` dependencies.
> 
> ```
> for (int i = 0; i < n; ++i)
>   a=a/i;
> ```
> 
> This example would not be reversed because there is no inner level but consider this to be the "either way goes" case. Reversing the scalar dependence would make a `>`-dependence out of it, which is definitely wrong because it would make it depend on the future (which `normalize()` is supposed to normalize).
> 
> Possibly, `normalize()` would also need to reverse the direction of scalar dependencies, but I would need some more thoughts on why

Thanks for the case. That make sense to me.

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


More information about the llvm-commits mailing list