Skip to content

Commit 8de55ee

Browse files
committed
[LoopInterchange] Fix depends() check parameters
1 parent 1a11302 commit 8de55ee

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

llvm/lib/Transforms/Scalar/LoopInterchange.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ static bool populateDependencyMatrix(CharMatrix &DepMatrix, unsigned Level,
115115
for (I = MemInstr.begin(), IE = MemInstr.end(); I != IE; ++I) {
116116
for (J = I + 1, JE = MemInstr.end(); J != JE; ++J) {
117117
std::vector<char> Dep;
118-
Instruction *Src = cast<Instruction>(*I);
119-
Instruction *Dst = cast<Instruction>(*J);
118+
Instruction *Src = cast<Instruction>(*J);
119+
Instruction *Dst = cast<Instruction>(*I);
120120
// Ignore Input dependencies.
121121
if (isa<LoadInst>(Src) && isa<LoadInst>(Dst))
122122
continue;

llvm/test/Transforms/LoopInterchange/interchange-s231.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
;; for (int j = 1; j < 256; j++)
1111
;; aa[j][i] = aa[j - 1][i] + bb[j][i];
1212

13-
; CHECK: Found anti dependency between Src and Dst
14-
; CHECK: Src: %1 = load float, ptr %arrayidx10, align 4
15-
; CHECK: Dst: store float %add, ptr %arrayidx18, align 4
13+
; CHECK: Found flow dependency between Src and Dst
14+
; CHECK: Src: store float %add, ptr %arrayidx18, align 4
15+
; CHECK: Dst: %1 = load float, ptr %arrayidx10, align 4
1616
; CHECK: Processing InnerLoopId = 2 and OuterLoopId = 1
17-
; CHECK: Not interchanging loops. Cannot prove legality.
17+
; CHECK: Loops interchanged.
1818

1919
define float @s231() {
2020
entry:

0 commit comments

Comments
 (0)