[llvm] [LoopInterchange] Bail out for Scalar Dependencies (PR #119345)

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 07:10:54 PST 2025


sjoerdmeijer wrote:

> I honestly never understood why a dependency that is "scalar" (that is, the dimension is not referenced in the index expression) is handled fundamentally different. If not references it should be equivalent to accessing (any of) the previous iteration. How about we remove
> 
> ```
>           if (D->isScalar(II)) {
>             Direction = 'S';
>             Dep.push_back(Direction);
> ```
> 
> in populateDependencyMatrix entirely, so a dependency is never `S`?
> 
> In any case, the patch in the current form should be conservatively correct.

I would be happy to remove it in the way you suggested, @Meinersbur. My only minor concern is that if we want to deal with these sort of dependencies later, we would need to restore some of this logic, so removing it now would mean more churn later? But let me know what you prefer, I am happy either way (leave it as it is because it is conservative/correct as you say, or implement your suggestion).

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


More information about the llvm-commits mailing list