Skip to content

Commit 4280bde

Browse files
committed
[BACKEND] Fix ProgramPoint passing in AxisInfoAnalysis
1 parent 0bd30a2 commit 4280bde

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

lib/Analysis/AxisInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,9 +1084,9 @@ LogicalResult AxisInfoAnalysis::visitOperation(
10841084

10851085
void AxisInfoAnalysis::visitForOpInductionVar(
10861086
scf::ForOp op, ArrayRef<dataflow::Lattice<AxisInfo> *> argLattices) {
1087-
ProgramPoint programPoint(op);
1088-
auto lb = getLatticeElementFor(&programPoint, op.getLowerBound())->getValue();
1089-
auto step = getLatticeElementFor(&programPoint, op.getStep())->getValue();
1087+
ProgramPoint *programPoint = getProgramPointAfter(op);
1088+
auto lb = getLatticeElementFor(programPoint, op.getLowerBound())->getValue();
1089+
auto step = getLatticeElementFor(programPoint, op.getStep())->getValue();
10901090

10911091
AxisInfo::DimVectorT knownContiguity(1, 1);
10921092
AxisInfo::DimVectorT knownDivisibility(1, 1);

test/TritonGPU/coalesce.mlir

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,32 @@ module attributes {"triton_gpu.num-warps" = 4 : i32, "triton_gpu.threads-per-war
131131
tt.return
132132
}
133133
}
134+
135+
// -----
136+
137+
// COM: Reproducer for issue #5122
138+
// CHECK-LABEL: @test_5122
139+
module {
140+
tt.func public @test_5122(%arg0: i32) attributes {noinline = false} {
141+
%c1_i32 = arith.constant 1 : i32
142+
%0 = arith.cmpi sgt, %arg0, %c1_i32 : i32
143+
scf.if %0 {
144+
%1 = scf.if %0 -> (i32) {
145+
scf.yield %c1_i32 : i32
146+
} else {
147+
scf.yield %c1_i32 : i32
148+
}
149+
%2 = arith.cmpi sgt, %1, %c1_i32 : i32
150+
%3 = scf.if %2 -> (i32) {
151+
scf.yield %c1_i32 : i32
152+
} else {
153+
scf.yield %c1_i32 : i32
154+
}
155+
%4 = scf.for %arg1 = %1 to %1 step %c1_i32 iter_args(%arg2 = %3) -> (i32) : i32 {
156+
%5 = arith.addi %arg2, %c1_i32 : i32
157+
scf.yield %5 : i32
158+
}
159+
}
160+
tt.return
161+
}
162+
}

0 commit comments

Comments
 (0)