Skip to content

Commit

Permalink
[BACKEND] Fix ProgramPoint passing in AxisInfoAnalysis
Browse files Browse the repository at this point in the history
  • Loading branch information
aakhundov committed Nov 17, 2024
1 parent 0bd30a2 commit 385f638
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
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(&op, op.getLowerBound())->getValue();
auto step = getLatticeElementFor(&op, 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
}
}

0 comments on commit 385f638

Please sign in to comment.