Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/Analysis/AxisInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,9 +1084,9 @@ LogicalResult AxisInfoAnalysis::visitOperation(

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

AxisInfo::DimVectorT knownContiguity(1, 1);
AxisInfo::DimVectorT knownDivisibility(1, 1);
Expand Down
29 changes: 29 additions & 0 deletions test/TritonGPU/coalesce.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,32 @@ module attributes {"triton_gpu.num-warps" = 4 : i32, "triton_gpu.threads-per-war
tt.return
}
}

// -----

// COM: Reproducer for issue #5122
// CHECK-LABEL: @test_5122
module {
tt.func public @test_5122(%arg0: i32) attributes {noinline = false} {
%c1_i32 = arith.constant 1 : i32
%0 = arith.cmpi sgt, %arg0, %c1_i32 : i32
scf.if %0 {
%1 = scf.if %0 -> (i32) {
scf.yield %c1_i32 : i32
} else {
scf.yield %c1_i32 : i32
}
%2 = arith.cmpi sgt, %1, %c1_i32 : i32
%3 = scf.if %2 -> (i32) {
scf.yield %c1_i32 : i32
} else {
scf.yield %c1_i32 : i32
}
%4 = scf.for %arg1 = %1 to %1 step %c1_i32 iter_args(%arg2 = %3) -> (i32) : i32 {
%5 = arith.addi %arg2, %c1_i32 : i32
scf.yield %5 : i32
}
}
tt.return
}
}
Loading