Skip to content

Commit 4fcffdb

Browse files
committed
Update unit tests
Signed-off-by: Ettore Tiotto <[email protected]>
1 parent ca49589 commit 4fcffdb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/Triton/Intel/RemoveBoundaryChecks/remove-boundary-checks.mlir

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ tt.func public @simple_load(%load_ptr: !tt.ptr<f16> {tt.divisibility = 16 : i32}
99
%c0_i32 = arith.constant 0 : i32
1010
%x = arith.constant 10 : i32
1111
%in = tt.make_tensor_ptr %load_ptr, [%c1_i64, %c64_i64, %c1024_i64], [%c512_i64, %c64_i64, %c1_i64], [%c0_i32, %c0_i32, %x] {order = array<i32: 2, 1, 0>} : <tensor<1x64x64xf16>>
12+
// boundaryCheck is unnecessary because %x + loadResType.shape[2] - 1 = 10 + 64 - 1 = 73 < 1024
1213
%load = tt.load %in {boundaryCheck = array<i32: 2>} : !tt.ptr<tensor<1x64x64xf16>>
1314
tt.return
1415
}
@@ -43,8 +44,8 @@ tt.func public @load_in_for_loop(%load_ptr0: !tt.ptr<f16> {tt.divisibility = 16
4344
%ptr1 = tt.make_tensor_ptr %load_ptr1, [%c512_i64, %c64_i64, %c1024_i64], [%c65536_i64, %c1_i64, %c64_i64], [%x, %c0_i32, %z] {order = array<i32: 2, 0, 1>} : <tensor<1x64x64xf16>>
4445
// a. boundaryCheck = 1 checks the block ptr offset at index 2 (%z)
4546
// b. boundaryCheck = 2 checks the block ptr offset at index 1 (%y)
46-
// Check (a) is unnecessary because max(%z) = 920 which is less than %s2 (1024)
47-
// Check (a) is trivially unnecessary because %y(zero) < %s1(64)
47+
// Check (a) is unnecessary because max(%z) + loadResType.shape[2] - 1 = 960 + 64 - 1 = 1023, which is less than 1024.
48+
// Check (b) is unnecessary because max(0) + loadResType.shape[1] - 1 = 0 + 64 -1 = 63, which is less than 64.
4849
%load1 = tt.load %ptr1 {boundaryCheck = array<i32: 1, 2>} : !tt.ptr<tensor<1x64x64xf16>>
4950
}
5051
}

0 commit comments

Comments
 (0)