Issue 127176
Summary 【opt】incorrect oupput dependence in loop interchange pass
Labels new issue
Assignees
Reporter shanksjoe
    ```
void test(float *indices, float init_i, int M, int K) {
  if (M < 0 || K < 0)
    return;
  for (int j = 0; j < K; ++j) {
    for (int i = 0; i < M; ++i) {
      indices[i * K + j] = init_i + i;
    }
  }
}
```
```
$ clang test.c -O2 -S -emit-llvm -floop-interchange -mllvm -debug-_only_=loop-interchange
Processing LoopList of size = 2
Found 1 Loads and Stores to analyze
Found output dependency between Src and Dst
 Src:  store float %add, ptr %arrayidx, align 4, !tbaa !7
 Dst:  store float %add, ptr %arrayidx, align 4, !tbaa !7
Dependency matrix before interchange:
* * 
Processing InnerLoopId = 1 and OuterLoopId = 0
Failed interchange InnerLoopId = 1 and OuterLoopId = 0 due to dependence
Not interchanging loops. Cannot prove legality.
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to