Skip to content

Commit 565e24a

Browse files
committed
Revert "update lit-tests which related to tptr"
This reverts commit 19dfc50.
1 parent 5db07cc commit 565e24a

File tree

10 files changed

+370
-520
lines changed

10 files changed

+370
-520
lines changed

test/Conversion/ReconcilePtrCasts/ptr_into_memref.mlir

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33
module {
44
func.func @bitcast_ptr_as_src(%arg0: memref<*xi32>, %arg1: memref<*xi32>, %arg2: i32, %arg3: i32, %arg4: i32, %arg5: i32, %arg6: i32, %arg7: i32) {
5-
// %0 = tptr.type_offset i32 : i32
5+
%0 = tptr.type_offset i32 : i32
66
%c1_i32 = arith.constant 1 : i32
77
%c2 = arith.constant 2 : index
88
%1 = builtin.unrealized_conversion_cast %arg1 : memref<*xi32> to !tt.ptr<i32>
9-
%2 = builtin.unrealized_conversion_cast %1 : !tt.ptr<i32> to !tt.ptr<i32>
9+
%2 = builtin.unrealized_conversion_cast %1 : !tt.ptr<i32> to !ptr.ptr<#tptr.default_memory_space>
1010
%3 = builtin.unrealized_conversion_cast %arg0 : memref<*xi32> to !tt.ptr<i32>
11-
%4 = builtin.unrealized_conversion_cast %3 : !tt.ptr<i32> to !tt.ptr<i32>
12-
// %5 = arith.muli %c1_i32, %0 : i32
13-
%6 = tptr.ptradd %4 %c1_i32 : !tt.ptr<i32>, i32 to !tt.ptr<i32>
14-
%7 = builtin.unrealized_conversion_cast %6 : !tt.ptr<i32> to !tt.ptr<i64>
11+
%4 = builtin.unrealized_conversion_cast %3 : !tt.ptr<i32> to !ptr.ptr<#tptr.default_memory_space>
12+
%5 = arith.muli %c1_i32, %0 : i32
13+
%6 = tptr.ptradd %4 %5 : !ptr.ptr<#tptr.default_memory_space>, i32 to !ptr.ptr<#tptr.default_memory_space>
14+
%7 = builtin.unrealized_conversion_cast %6 : !ptr.ptr<#tptr.default_memory_space> to !tt.ptr<i64>
1515
%8 = builtin.unrealized_conversion_cast %7 : !tt.ptr<i64> to memref<*xi64>
1616
%reinterpret_cast = memref.reinterpret_cast %8 to offset: [%c2], sizes: [16], strides: [1] : memref<*xi64> to memref<16xi64, strided<[1], offset: ?>>
1717
%alloc = memref.alloc() : memref<16xi64>
1818
memref.copy %reinterpret_cast, %alloc : memref<16xi64, strided<[1], offset: ?>> to memref<16xi64>
1919
%9 = bufferization.to_tensor %alloc restrict writable : memref<16xi64> to tensor<16xi64>
20-
%10 = tptr.ptradd %2 %c1_i32 : !tt.ptr<i32>, i32 to !tt.ptr<i32>
21-
%11 = builtin.unrealized_conversion_cast %10 : !tt.ptr<i32> to !tt.ptr<i64>
20+
%10 = tptr.ptradd %2 %5 : !ptr.ptr<#tptr.default_memory_space>, i32 to !ptr.ptr<#tptr.default_memory_space>
21+
%11 = builtin.unrealized_conversion_cast %10 : !ptr.ptr<#tptr.default_memory_space> to !tt.ptr<i64>
2222
%12 = builtin.unrealized_conversion_cast %11 : !tt.ptr<i64> to memref<*xi64>
2323
%reinterpret_cast_0 = memref.reinterpret_cast %12 to offset: [%c2], sizes: [16], strides: [1] : memref<*xi64> to memref<16xi64, strided<[1], offset: ?>>
2424
bufferization.materialize_in_destination %9 in writable %reinterpret_cast_0 : (tensor<16xi64>, memref<16xi64, strided<[1], offset: ?>>) -> ()

test/Conversion/TritonToLinalgExperimental/conditional_ptr_as_src.mlir

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,26 @@ module {
2828

2929
// CHECK-LABEL: func.func @simple_cf_into_structured_load
3030
// CHECK-SAME: ([[PARAM_0_:%.+]]: memref<*xf32>, [[PARAM_1_:%.+]]: memref<*xf32>, [[PARAM_2_:%.+]]: i32, [[PARAM_3_:%.+]]: i32, [[PARAM_4_:%.+]]: i32, [[PARAM_5_:%.+]]: i32, [[PARAM_6_:%.+]]: i32, [[PARAM_7_:%.+]]: i32, [[PARAM_8_:%.+]]: i32) {
31+
// CHECK-DAG: [[VAR_0_:%.+]] = tptr.type_offset f32 : i32
3132
// CHECK-DAG: [[CST_6_:%.+]] = arith.constant 6 : index
3233
// CHECK-DAG: [[CST_2_:%.+]] = arith.constant 2 : i32
3334
// CHECK-DAG: [[CST_1_:%.+]] = arith.constant 1 : i32
3435
// CHECK-DAG: [[VAR_cast_:%.+]] = memref.cast [[PARAM_0_]] : memref<*xf32> to memref<1xf32>
3536
// CHECK-NOT: separator of consecutive DAGs
36-
// CHECK-DAG: [[VAR_1_:%.+]] = tptr.from_memref [[VAR_cast_]] : memref<1xf32> to !tt.ptr<f32>
37+
// CHECK-DAG: [[VAR_1_:%.+]] = tptr.from_memref [[VAR_cast_]] : memref<1xf32> to <#tptr.default_memory_space>
3738
// CHECK-DAG: [[VAR_2_:%.+]] = arith.cmpi eq, [[PARAM_2_]], [[CST_1_]] : i32
3839
// CHECK-NOT: separator of consecutive DAGs
39-
// CHECK-DAG: [[VAR_3_:%.+]] = scf.if [[VAR_2_]] -> (!tt.ptr<f32>) {
40+
// CHECK-DAG: [[VAR_3_:%.+]] = scf.if [[VAR_2_]] -> (!ptr.ptr<#tptr.default_memory_space>) {
4041
// CHECK-DAG: [[VAR_6_:%.+]] = arith.muli [[PARAM_2_]], [[CST_2_]] : i32
41-
// CHECK: [[VAR_8_:%.+]] = tptr.ptradd [[VAR_1_]] [[VAR_6_]] : !tt.ptr<f32>, i32 to !tt.ptr<f32>
42-
// CHECK: scf.yield [[VAR_8_]] : !tt.ptr<f32>
42+
// CHECK: [[VAR_7_:%.+]] = arith.muli [[VAR_6_]], [[VAR_0_]] : i32
43+
// CHECK: [[VAR_8_:%.+]] = tptr.ptradd [[VAR_1_]] [[VAR_7_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
44+
// CHECK: scf.yield [[VAR_8_]] : !ptr.ptr<#tptr.default_memory_space>
4345
// CHECK: } else {
44-
// CHECK: [[VAR_7_1_:%.+]] = tptr.ptradd [[VAR_1_]] [[PARAM_2_]] : !tt.ptr<f32>, i32
45-
// CHECK: scf.yield [[VAR_7_1_]] : !tt.ptr<f32>
46+
// CHECK: [[VAR_6_1_:%.+]] = arith.muli [[PARAM_2_]], [[VAR_0_]] : i32
47+
// CHECK: [[VAR_7_1_:%.+]] = tptr.ptradd [[VAR_1_]] [[VAR_6_1_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
48+
// CHECK: scf.yield [[VAR_7_1_]] : !ptr.ptr<#tptr.default_memory_space>
4649
// CHECK: }
47-
// CHECK: [[VAR_4_:%.+]] = tptr.to_memref [[VAR_3_]] : !tt.ptr<f32> to memref<1xf32>
50+
// CHECK: [[VAR_4_:%.+]] = tptr.to_memref [[VAR_3_]] : <#tptr.default_memory_space> to memref<1xf32>
4851
// CHECK-DAG: [[VAR_reinterpret_cast_:%.+]] = memref.reinterpret_cast [[VAR_4_]] to offset: {{.}}[[CST_6_]]{{.}}, sizes: [4], strides: [1] : memref<1xf32> to memref<4xf32, strided<[1], offset: ?>>
4952
// CHECK-DAG: [[RES_:%.+]] = memref.alloc() : memref<4xf32>
5053
// CHECK: memref.copy [[VAR_reinterpret_cast_]], [[RES_]] : memref<4xf32, strided<[1], offset: ?>> to memref<4xf32>

test/Conversion/TritonToLinalgExperimental/conditional_ptr_as_src_for_yield_input.mlir

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,4 @@ module attributes {} {
3838
}
3939

4040
// CHECK-NOT: unrealized_conversion_cast
41-
// CHECK-NOT: tt\.(?!ptr) // match tt., when it's not followed by tt.ptr
42-
41+
// CHECK-NOT: tt.

test/Conversion/TritonToPtr/cast_with_int_ptr.mlir

Lines changed: 60 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -38,56 +38,66 @@ module {
3838
tt.return
3939
}
4040
}
41-
// NOTE: Assertions have been autogenerated by utils/generate-test-checks.py
4241

43-
// The script is designed to make adding checks to
44-
// a test case fast, it is *not* designed to be authoritative
45-
// about what constitutes a good test! The CHECK should be
46-
// minimized and named to reflect the test intent.
47-
48-
49-
50-
// CHECK-LABEL: func.func @cast_with_int_ptr(
51-
// CHECK-SAME: %[[VAL_0:.*]]: !tt.ptr<i32>, %[[VAL_1:.*]]: !tt.ptr<i32>, %[[VAL_2:.*]]: i32, %[[VAL_3:.*]]: i32, %[[VAL_4:.*]]: i32, %[[VAL_5:.*]]: i32, %[[VAL_6:.*]]: i32, %[[VAL_7:.*]]: i32, %[[VAL_8:.*]]: i32) {
52-
// CHECK-DAG: %[[VAL_9:.*]] = arith.constant 0 : index
53-
// CHECK-DAG: %[[VAL_10:.*]] = arith.constant 4 : i32
54-
// CHECK-DAG: %[[VAL_11:.*]] = arith.constant 3 : i32
55-
// CHECK-DAG: %[[VAL_12:.*]] = arith.constant 2 : i32
56-
// CHECK-DAG: %[[VAL_13:.*]] = arith.constant 1 : i32
57-
// CHECK-DAG: %[[VAL_14:.*]] = arith.constant 10 : i64
58-
// CHECK-DAG: %[[VAL_15:.*]] = arith.constant 9 : i32
59-
// CHECK-DAG: %[[VAL_16:.*]] = arith.constant 10 : i32
60-
// CHECK-DAG: %[[VAL_17:.*]] = arith.constant 111 : i32
61-
// CEHCK-NOT: separator of consecutive DAGs
62-
// CHECK: %[[VAL_18:.*]] = tptr.ptradd %[[VAL_0]] %[[VAL_17]] : !tt.ptr<i32>, i32 to !tt.ptr<i32>
63-
// CHECK: %[[VAL_19:.*]] = builtin.unrealized_conversion_cast %[[VAL_18]] : !tt.ptr<i32> to !tt.ptr<i8>
64-
// CHECK: %[[VAL_20:.*]] = tptr.ptradd %[[VAL_19]] %[[VAL_16]] : !tt.ptr<i8>, i32 to !tt.ptr<i8>
65-
// CHECK: %[[VAL_21:.*]] = builtin.unrealized_conversion_cast %[[VAL_20]] : !tt.ptr<i8> to !tt.ptr<i32>
66-
// CHECK: %[[VAL_22:.*]] = tptr.ptrtoint %[[VAL_1]] : !tt.ptr<i32> to i64
67-
// CHECK: %[[VAL_23:.*]] = tptr.ptradd %[[VAL_1]] %[[VAL_22]] : !tt.ptr<i32>, i64 to !tt.ptr<i32>
68-
// CHECK: %[[VAL_24:.*]] = tptr.ptradd %[[VAL_23]] %[[VAL_15]] : !tt.ptr<i32>, i32 to !tt.ptr<i32>
69-
// CHECK: %[[VAL_25:.*]] = tptr.ptrtoint %[[VAL_24]] : !tt.ptr<i32> to i64
70-
// CHECK: %[[VAL_26:.*]] = arith.remsi %[[VAL_25]], %[[VAL_14]] : i64
71-
// CHECK: %[[VAL_27:.*]] = tptr.ptradd %[[VAL_21]] %[[VAL_13]] : !tt.ptr<i32>, i32 to !tt.ptr<i32>
72-
// CHECK: %[[VAL_28:.*]] = tptr.ptradd %[[VAL_27]] %[[VAL_26]] : !tt.ptr<i32>, i64 to !tt.ptr<i32>
73-
// CHECK: %[[VAL_29:.*]] = builtin.unrealized_conversion_cast %[[VAL_28]] : !tt.ptr<i32> to !tt.ptr<i64>
74-
// CHECK: %[[VAL_30:.*]] = tptr.ptradd %[[VAL_29]] %[[VAL_12]] : !tt.ptr<i64>, i32 to !tt.ptr<i64>
75-
// CHECK: %[[VAL_31:.*]] = tptr.ptradd %[[VAL_30]] %[[VAL_2]] : !tt.ptr<i64>, i32 to !tt.ptr<i64>
76-
// CHECK: %[[VAL_32:.*]] = tptr.ptradd %[[VAL_31]] %[[VAL_11]] : !tt.ptr<i64>, i32 to !tt.ptr<i64>
77-
// CHECK: %[[VAL_33:.*]] = builtin.unrealized_conversion_cast %[[VAL_32]] : !tt.ptr<i64> to !tt.ptr<i16>
78-
// CHECK: %[[VAL_34:.*]] = tptr.ptradd %[[VAL_33]] %[[VAL_10]] : !tt.ptr<i16>, i32 to !tt.ptr<i16>
79-
// CHECK: %[[VAL_35:.*]] = tptr.ptradd %[[VAL_34]] %[[VAL_2]] : !tt.ptr<i16>, i32 to !tt.ptr<i16>
80-
// CHECK: %[[VAL_36:.*]] = tptr.ptradd %[[VAL_35]] %[[VAL_11]] : !tt.ptr<i16>, i32 to !tt.ptr<i16>
81-
// CHECK: %[[VAL_37:.*]] = builtin.unrealized_conversion_cast %[[VAL_36]] : !tt.ptr<i16> to !tt.ptr<i32>
82-
// CHECK: %[[VAL_38:.*]] = tptr.to_memref %[[VAL_37]] : !tt.ptr<i32> to memref<1xi32>
83-
// CHECK: %[[VAL_39:.*]] = memref.load %[[VAL_38]]{{\[}}%[[VAL_9]]] : memref<1xi32>
84-
// CHECK: %[[VAL_40:.*]] = arith.extsi %[[VAL_2]] : i32 to i64
85-
// CHECK: %[[VAL_41:.*]] = arith.addi %[[VAL_26]], %[[VAL_40]] : i64
86-
// CHECK: %[[VAL_42:.*]] = tptr.inttoptr %[[VAL_41]] : i64 to !tt.ptr<i32>
87-
// CHECK: %[[VAL_43:.*]] = tptr.to_memref %[[VAL_42]] : !tt.ptr<i32> to memref<1xi32>
88-
// CHECK: memref.store %[[VAL_39]], %[[VAL_43]]{{\[}}%[[VAL_9]]] : memref<1xi32>
42+
// CHECK-LABEL: func.func @cast_with_int_ptr
43+
// CHECK-SAME: ([[PARAM_0_:%.+]]: !tt.ptr<i32>, [[PARAM_1_:%.+]]: !tt.ptr<i32>, [[PARAM_2_:%.+]]: i32, [[PARAM_3_:%.+]]: i32, [[PARAM_4_:%.+]]: i32, [[PARAM_5_:%.+]]: i32, [[PARAM_6_:%.+]]: i32, [[PARAM_7_:%.+]]: i32, [[PARAM_8_:%.+]]: i32) {
44+
// CHECK-DAG: [[CST_0_:%.+]] = arith.constant 0 : index
45+
// CHECK-DAG: [[VAR_0_:%.+]] = tptr.type_offset i16 : i32
46+
// CHECK-DAG: [[VAR_1_:%.+]] = tptr.type_offset i64 : i32
47+
// CHECK-DAG: [[VAR_2_:%.+]] = tptr.type_offset i32 : i64
48+
// CHECK-DAG: [[VAR_3_:%.+]] = tptr.type_offset i8 : i32
49+
// CHECK-DAG: [[VAR_4_:%.+]] = tptr.type_offset i32 : i32
50+
// CHECK-DAG: [[CST_111_:%.+]] = arith.constant 111 : i32
51+
// CHECK-DAG: [[CST_10_:%.+]] = arith.constant 10 : i32
52+
// CHECK-DAG: [[CST_9_:%.+]] = arith.constant 9 : i32
53+
// CHECK-DAG: [[CST_10_1_:%.+]] = arith.constant 10 : i64
54+
// CHECK-DAG: [[CST_1_:%.+]] = arith.constant 1 : i32
55+
// CHECK-DAG: [[CST_2_:%.+]] = arith.constant 2 : i32
56+
// CHECK-DAG: [[CST_3_:%.+]] = arith.constant 3 : i32
57+
// CHECK-DAG: [[CST_4_:%.+]] = arith.constant 4 : i32
58+
// CHECK-DAG: [[VAR_5_:%.+]] = builtin.unrealized_conversion_cast [[PARAM_1_]] : !tt.ptr<i32> to !ptr.ptr<#tptr.default_memory_space>
59+
// CHECK-DAG: [[VAR_6_:%.+]] = builtin.unrealized_conversion_cast [[PARAM_0_]] : !tt.ptr<i32> to !ptr.ptr<#tptr.default_memory_space>
60+
// CHECK: [[VAR_7_:%.+]] = arith.muli [[CST_111_]], [[VAR_4_]] : i32
61+
// CHECK-DAG: [[VAR_8_:%.+]] = tptr.ptradd [[VAR_6_]] [[VAR_7_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
62+
// CHECK-DAG: [[VAR_9_:%.+]] = arith.muli [[CST_10_]], [[VAR_3_]] : i32
63+
// CHECK-NOT: separator of consecutive DAGs
64+
// CHECK-DAG: [[VAR_10_:%.+]] = tptr.ptradd [[VAR_8_]] [[VAR_9_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
65+
// CHECK-DAG: [[VAR_11_:%.+]] = tptr.ptrtoint [[VAR_5_]] : <#tptr.default_memory_space> to i64
66+
// CHECK: [[VAR_12_:%.+]] = arith.muli [[VAR_11_]], [[VAR_2_]] : i64
67+
// CHECK-DAG: [[VAR_13_:%.+]] = tptr.ptradd [[VAR_5_]] [[VAR_12_]] : <#tptr.default_memory_space>, i64 to <#tptr.default_memory_space>
68+
// CHECK-DAG: [[VAR_14_:%.+]] = arith.muli [[CST_9_]], [[VAR_4_]] : i32
69+
// CHECK: [[VAR_15_:%.+]] = tptr.ptradd [[VAR_13_]] [[VAR_14_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
70+
// CHECK: [[VAR_16_:%.+]] = tptr.ptrtoint [[VAR_15_]] : <#tptr.default_memory_space> to i64
71+
// CHECK-DAG: [[VAR_17_:%.+]] = arith.remsi [[VAR_16_]], [[CST_10_1_]] : i64
72+
// CHECK-DAG: [[VAR_18_:%.+]] = arith.muli [[CST_1_]], [[VAR_4_]] : i32
73+
// CHECK-NOT: separator of consecutive DAGs
74+
// CHECK-DAG: [[VAR_19_:%.+]] = tptr.ptradd [[VAR_10_]] [[VAR_18_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
75+
// CHECK-DAG: [[VAR_20_:%.+]] = arith.muli [[VAR_17_]], [[VAR_2_]] : i64
76+
// CHECK-NOT: separator of consecutive DAGs
77+
// CHECK-DAG: [[VAR_21_:%.+]] = tptr.ptradd [[VAR_19_]] [[VAR_20_]] : <#tptr.default_memory_space>, i64 to <#tptr.default_memory_space>
78+
// CHECK-DAG: [[VAR_22_:%.+]] = arith.muli [[CST_2_]], [[VAR_1_]] : i32
79+
// CHECK-NOT: separator of consecutive DAGs
80+
// CHECK-DAG: [[VAR_23_:%.+]] = tptr.ptradd [[VAR_21_]] [[VAR_22_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
81+
// CHECK-DAG: [[VAR_24_:%.+]] = arith.muli [[PARAM_2_]], [[VAR_1_]] : i32
82+
// CHECK-NOT: separator of consecutive DAGs
83+
// CHECK-DAG: [[VAR_25_:%.+]] = tptr.ptradd [[VAR_23_]] [[VAR_24_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
84+
// CHECK-DAG: [[VAR_26_:%.+]] = arith.muli [[CST_3_]], [[VAR_1_]] : i32
85+
// CHECK-NOT: separator of consecutive DAGs
86+
// CHECK-DAG: [[VAR_27_:%.+]] = tptr.ptradd [[VAR_25_]] [[VAR_26_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
87+
// CHECK-DAG: [[VAR_28_:%.+]] = arith.muli [[CST_4_]], [[VAR_0_]] : i32
88+
// CHECK-NOT: separator of consecutive DAGs
89+
// CHECK-DAG: [[VAR_29_:%.+]] = tptr.ptradd [[VAR_27_]] [[VAR_28_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
90+
// CHECK-DAG: [[VAR_30_:%.+]] = arith.muli [[PARAM_2_]], [[VAR_0_]] : i32
91+
// CHECK-NOT: separator of consecutive DAGs
92+
// CHECK-DAG: [[VAR_31_:%.+]] = tptr.ptradd [[VAR_29_]] [[VAR_30_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
93+
// CHECK-DAG: [[VAR_32_:%.+]] = arith.muli [[CST_3_]], [[VAR_0_]] : i32
94+
// CHECK: [[VAR_33_:%.+]] = tptr.ptradd [[VAR_31_]] [[VAR_32_]] : <#tptr.default_memory_space>, i32 to <#tptr.default_memory_space>
95+
// CHECK: [[VAR_34_:%.+]] = tptr.to_memref [[VAR_33_]] : <#tptr.default_memory_space> to memref<1xi32>
96+
// CHECK-DAG: [[LOAD_VAR_34_MEM_:%.+]] = memref.load [[VAR_34_]]{{.}}[[CST_0_]]{{.}} : memref<1xi32>
97+
// CHECK-DAG: [[VAR_36_:%.+]] = arith.extsi [[PARAM_2_]] : i32 to i64
98+
// CHECK: [[VAR_37_:%.+]] = arith.addi [[VAR_17_]], [[VAR_36_]] : i64
99+
// CHECK: [[VAR_38_:%.+]] = tptr.inttoptr [[VAR_37_]] : i64 to <#tptr.default_memory_space>
100+
// CHECK: [[VAR_39_:%.+]] = tptr.to_memref [[VAR_38_]] : <#tptr.default_memory_space> to memref<1xi32>
101+
// CHECK: memref.store [[LOAD_VAR_34_MEM_]], [[VAR_39_]]{{.}}[[CST_0_]]{{.}} : memref<1xi32>
89102
// CHECK: return
90103
// CHECK: }
91-
92-
93-

0 commit comments

Comments
 (0)