Skip to content

Commit 41996e5

Browse files
[TritonGEN] Lower to GenISA for 2d_block_prefetch_16b_16r8x1c (#4690)
Signed-off-by: Whitney Tsang <[email protected]>
1 parent 1375103 commit 41996e5

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

test/TritonGEN/tritongen-2Dblockprefetch-to-llvm.mlir

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,20 @@ llvm.func @triton_gen.2Dblockprefetch(%ptr : !llvm.ptr<1>, %base_width : i32, %b
115115

116116
// -----
117117

118+
llvm.func @triton_gen.2Dblockprefetch(%ptr : !llvm.ptr<1>, %base_width : i32, %base_height : i32, %base_pitch : i32, %x : i32, %y : i32) {
119+
// CHECK: [[ELEM_BITS:%.*]] = llvm.mlir.constant(16 : i32) : i32
120+
// CHECK: [[TILE_WIDTH:%.*]] = llvm.mlir.constant(8 : i32) : i32
121+
// CHECK: [[TILE_HEIGHT:%.*]] = llvm.mlir.constant(16 : i32) : i32
122+
// CHECK: [[VBLOCKS:%.*]] = llvm.mlir.constant(1 : i32) : i32
123+
// CHECK: [[TRANSPOSE:%.*]] = llvm.mlir.constant(false) : i1
124+
// CHECK: [[VNNI:%.*]] = llvm.mlir.constant(false) : i1
125+
// CHECK: llvm.call spir_funccc @llvm.genx.GenISA.LSC2DBlockPrefetch.isVoid({{.*}}, {{.*}}, {{.*}}, {{.*}}, {{.*}}, [[ELEM_BITS]], [[TILE_WIDTH]], [[TILE_HEIGHT]], [[VBLOCKS]], [[TRANSPOSE]], [[VNNI]], {{.*}})
126+
triton_gen.2Dblockprefetch %ptr, %base_width, %base_height, %base_pitch, %x, %y {elem_size_in_bits=16, tile_width=8, tile_height=16, v_blocks=1, cache_control=Default} : (!llvm.ptr<1>, i32, i32, i32, i32, i32)
127+
llvm.return
128+
}
129+
130+
// -----
131+
118132
llvm.func @triton_gen.2Dblockprefetch(%ptr : !llvm.ptr<1>, %base_width : i32, %base_height : i32, %base_pitch : i32, %x : i32, %y : i32) {
119133
// CHECK: llvm.mlir.constant(2 : i32) : i32
120134
// CHECK: [[ElemSize:%.*]] = llvm.mlir.constant(2 : i32) : i32

third_party/intel/lib/TritonGENToLLVM/TritonGENToLLVMPass.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ static bool isSPVBuiltinAvailable(TritonGEN::Matrix2DBlockPrefetchOp op) {
197197
op.getTileWidth() == 8 && op.getVBlocks() == 1)
198198
return false;
199199

200+
// intel_sub_group_2d_block_prefetch_16b_16r8x1c
201+
if (op.getElemSizeInBits() == 16 && op.getTileHeight() == 16 &&
202+
op.getTileWidth() == 8 && op.getVBlocks() == 1)
203+
return false;
204+
200205
return true;
201206
}
202207

0 commit comments

Comments
 (0)