Skip to content

Commit 3108ae5

Browse files
PTOASPTOAS
authored andcommitted
Improve tile_buf asm printing and add tests
1 parent c48e54c commit 3108ae5

29 files changed

Lines changed: 607 additions & 144 deletions

lib/PTO/IR/PTOTypeDefs.cpp

Lines changed: 311 additions & 144 deletions
Large diffs are not rendered by default.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// RUN: ptoas --print-ir-after-all --print-ir-after-all-func-filter=tilebuf_asm --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s
2+
3+
module {
4+
func.func @tilebuf_asm(
5+
%arg0: !pto.tile_buf<loc=vec, dtype=f32, rows=1, cols=16, v_row=1, v_col=16,
6+
blayout=row_major, slayout=none_box, fractal=512, pad=0>,
7+
%arg1: !pto.tile_buf<vec, 16x128xf32, valid=16x1, blayout=col_major,
8+
slayout=row_major, fractal=1024, pad=2>) {
9+
return
10+
}
11+
12+
func.func @tilebuf_asm_dynamic(
13+
%arg0: !pto.tile_buf<loc=vec, dtype=f16, rows=32, cols=32, v_row=?, v_col=?,
14+
blayout=row_major, slayout=none_box, fractal=512, pad=0>,
15+
%arg1: !pto.tile_buf<acc, 16x16xbf16, valid=?x8, blayout=col_major>) {
16+
return
17+
}
18+
}
19+
20+
// CHECK: func.func @tilebuf_asm
21+
// CHECK: !pto.tile_buf<vec, 1x16xf32>
22+
// CHECK: !pto.tile_buf<vec, 16x128xf32, valid=16x1, blayout=col_major, slayout=row_major, fractal=1024, pad=2>
23+
24+
// CHECK: func.func @tilebuf_asm_dynamic
25+
// CHECK: !pto.tile_buf<vec, 32x32xf16, valid=?x?>
26+
// CHECK: !pto.tile_buf<acc, 16x16xbf16, valid=?x8, blayout=col_major>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s
2+
3+
module {
4+
func.func @tilebuf_asm_cols_negative(
5+
%arg0: !pto.tile_buf<loc=vec, dtype=f32, rows=1, cols=-1>) {
6+
return
7+
}
8+
}
9+
10+
// CHECK: error: cols must be non-negative
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s
2+
3+
module {
4+
func.func @tilebuf_asm_conflicting_cols(
5+
%arg0: !pto.tile_buf<vec, 16x16xf32, cols=8, rows=16>) {
6+
return
7+
}
8+
}
9+
10+
// CHECK: error: conflicting cols values
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s
2+
3+
module {
4+
func.func @tilebuf_asm_conflicting_dtype(
5+
%arg0: !pto.tile_buf<vec, 16x16xf32, dtype=f16>) {
6+
return
7+
}
8+
}
9+
10+
// CHECK: error: conflicting dtype values
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s
2+
3+
module {
4+
func.func @tilebuf_asm_conflicting_loc(
5+
%arg0: !pto.tile_buf<vec, loc=acc, 16x16xf32>) {
6+
return
7+
}
8+
}
9+
10+
// CHECK: error: conflicting loc values
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s
2+
3+
module {
4+
func.func @tilebuf_asm_conflicting_positional_dtype(
5+
%arg0: !pto.tile_buf<vec, 16x16xf32, 16x16xbf16>) {
6+
return
7+
}
8+
}
9+
10+
// CHECK: error: conflicting dtype values
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s
2+
3+
module {
4+
func.func @tilebuf_asm_conflicting_positional_shape(
5+
%arg0: !pto.tile_buf<vec, 16x16xf32, 8x16xf32>) {
6+
return
7+
}
8+
}
9+
10+
// CHECK: error: conflicting rows/cols values
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s
2+
3+
module {
4+
func.func @tilebuf_asm_conflicting_rows(
5+
%arg0: !pto.tile_buf<vec, 16x16xf32, rows=8, cols=16>) {
6+
return
7+
}
8+
}
9+
10+
// CHECK: error: conflicting rows values
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s
2+
3+
module {
4+
func.func @tilebuf_asm_invalid_blayout(
5+
%arg0: !pto.tile_buf<vec, 16x16xf32, blayout=bad>) {
6+
return
7+
}
8+
}
9+
10+
// CHECK: error: unknown blayout: bad

0 commit comments

Comments
 (0)