Skip to content
Open
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
477 changes: 310 additions & 167 deletions lib/PTO/IR/PTOTypeDefs.cpp

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions test/basic/tilebuf_asm_compact.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// 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

module {
func.func @tilebuf_asm(
%arg0: !pto.tile_buf<loc=vec, dtype=f32, rows=1, cols=16, v_row=1, v_col=16,
blayout=row_major, slayout=none_box, fractal=512, pad=0>,
%arg1: !pto.tile_buf<vec, 16x128xf32, valid=16x1, blayout=col_major,
slayout=row_major, fractal=1024, pad=2>) {
return
}

func.func @tilebuf_asm_dynamic(
%arg0: !pto.tile_buf<loc=vec, dtype=f16, rows=32, cols=32, v_row=?, v_col=?,
blayout=row_major, slayout=none_box, fractal=512, pad=0>,
%arg1: !pto.tile_buf<acc, 16x16xbf16, valid=?x8, blayout=col_major>) {
return
}
}

// CHECK: func.func @tilebuf_asm
// CHECK: !pto.tile_buf<vec, 1x16xf32>
// CHECK: !pto.tile_buf<vec, 16x128xf32, valid=16x1, blayout=col_major, slayout=row_major, fractal=1024, pad=2>

// CHECK: func.func @tilebuf_asm_dynamic
// CHECK: !pto.tile_buf<vec, 32x32xf16, valid=?x?>
// CHECK: !pto.tile_buf<acc, 16x16xbf16, valid=?x8, blayout=col_major>
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_cols_negative.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_cols_negative(
%arg0: !pto.tile_buf<loc=vec, dtype=f32, rows=1, cols=-1>) {
return
}
}

// CHECK: error: cols must be non-negative
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_conflicting_cols.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_conflicting_cols(
%arg0: !pto.tile_buf<vec, 16x16xf32, cols=8, rows=16>) {
return
}
}

// CHECK: error: conflicting cols values
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_conflicting_dtype.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_conflicting_dtype(
%arg0: !pto.tile_buf<vec, 16x16xf32, dtype=f16>) {
return
}
}

// CHECK: error: conflicting dtype values
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_conflicting_loc.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_conflicting_loc(
%arg0: !pto.tile_buf<vec, loc=acc, 16x16xf32>) {
return
}
}

// CHECK: error: conflicting loc values
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_conflicting_positional_dtype.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_conflicting_positional_dtype(
%arg0: !pto.tile_buf<vec, 16x16xf32, 16x16xbf16>) {
return
}
}

// CHECK: error: conflicting dtype values
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_conflicting_positional_shape.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_conflicting_positional_shape(
%arg0: !pto.tile_buf<vec, 16x16xf32, 8x16xf32>) {
return
}
}

// CHECK: error: conflicting rows/cols values
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_conflicting_rows.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_conflicting_rows(
%arg0: !pto.tile_buf<vec, 16x16xf32, rows=8, cols=16>) {
return
}
}

// CHECK: error: conflicting rows values
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_invalid_blayout.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_invalid_blayout(
%arg0: !pto.tile_buf<vec, 16x16xf32, blayout=bad>) {
return
}
}

// CHECK: error: unknown blayout: bad
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_invalid_dim_negative.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_invalid_dim_negative(
%arg0: !pto.tile_buf<vec, -1x16xf32>) {
return
}
}

// CHECK: error: rows/cols must be non-negative
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_invalid_dim_question.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_invalid_dim_question(
%arg0: !pto.tile_buf<vec, ?x?xf32, rows=16, cols=16>) {
return
}
}

// CHECK: error: conflicting rows values
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_invalid_dim_second_negative.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_invalid_dim_second_negative(
%arg0: !pto.tile_buf<vec, 16x-2xf32>) {
return
}
}

// CHECK: error: dimension must be '?' or a non-negative integer
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_invalid_fractal.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_invalid_fractal(
%arg0: !pto.tile_buf<vec, 16x16xf32, fractal=7>) {
return
}
}

// CHECK: error: unsupported s_fractal_size: 7
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_invalid_pad.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_invalid_pad(
%arg0: !pto.tile_buf<vec, 16x16xf32, pad=9>) {
return
}
}

// CHECK: error: unknown pad: 9
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_invalid_slayout.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_invalid_slayout(
%arg0: !pto.tile_buf<vec, 16x16xf32, slayout=bad>) {
return
}
}

// CHECK: error: unknown slayout: bad
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_invalid_valid_neg.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_invalid_valid_neg(
%arg0: !pto.tile_buf<vec, 16x16xf32, valid=-1x8>) {
return
}
}

// CHECK: error: valid shape expects exactly 2 dimensions
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_invalid_vcol_value.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_invalid_vcol_value(
%arg0: !pto.tile_buf<vec, 16x16xf32, v_row=1, v_col=-2>) {
return
}
}

// CHECK: error: v_col must be '?', -1, or a non-negative integer
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_invalid_vrow_value.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_invalid_vrow_value(
%arg0: !pto.tile_buf<vec, 16x16xf32, v_row=-2, v_col=1>) {
return
}
}

// CHECK: error: v_row must be '?', -1, or a non-negative integer
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_missing_dtype.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_missing_dtype(
%arg0: !pto.tile_buf<loc=vec, rows=16, cols=16>) {
return
}
}

// CHECK: error: missing dtype
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_missing_loc.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_missing_loc(
%arg0: !pto.tile_buf<1x16xf32>) {
return
}
}

// CHECK: error: missing loc
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_missing_rows_cols.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_missing_rows_cols(
%arg0: !pto.tile_buf<loc=vec, dtype=f16>) {
return
}
}

// CHECK: error: missing rows/cols
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_pad_nonint.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_pad_nonint(
%arg0: !pto.tile_buf<vec, 16x16xf32, pad=foo>) {
return
}
}

// CHECK: error: expected integer
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_rows_negative.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_rows_negative(
%arg0: !pto.tile_buf<loc=vec, dtype=f32, rows=-1, cols=16>) {
return
}
}

// CHECK: error: rows must be non-negative
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_unknown_key.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_unknown_key(
%arg0: !pto.tile_buf<loc=vec, dtype=f16, rows=16, cols=16, foo=1>) {
return
}
}

// CHECK: error: unknown key in tile_buf: foo
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_unknown_loc.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_unknown_loc(
%arg0: !pto.tile_buf<foo, 16x16xf32>) {
return
}
}

// CHECK: error: unknown loc: foo
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_valid_rank.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_invalid_valid_rank(
%arg0: !pto.tile_buf<vec, 16x16xf32, valid=16>) {
return
}
}

// CHECK: error: valid shape expects exactly 2 dimensions
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_vcol_only.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_vcol_only(
%arg0: !pto.tile_buf<vec, 16x16xf32, v_col=1>) {
return
}
}

// CHECK: error: v_row and v_col must be provided together
10 changes: 10 additions & 0 deletions test/basic/tilebuf_asm_error_vrow_only.pto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: ptoas --pto-level=level3 %s 2>&1 1>/dev/null | FileCheck %s

module {
func.func @tilebuf_asm_vrow_only(
%arg0: !pto.tile_buf<vec, 16x16xf32, v_row=1>) {
return
}
}

// CHECK: error: v_row and v_col must be provided together
Loading