44// spirv.ARM.Graph and spirv.ARM.GraphOutputs
55//===----------------------------------------------------------------------===//
66
7- spirv.module Logical Vulkan requires #spirv.vce <v1.0 , [VulkanMemoryModel , Int8 , TensorsARM , GraphARM ], [SPV_ARM_tensors , SPV_ARM_graph ]> {
8- // CHECK: spirv.ARM.Graph {{@.*}}({{%.*}}: !spirv.arm.tensor<14x19xi16>) -> !spirv.arm.tensor<14x19xi16> {
9- spirv.ARM.Graph @graphAndOutputs (%arg0 : !spirv.arm.tensor <14 x19 xi16 >) -> !spirv.arm.tensor <14 x19 xi16 > {
10- // CHECK: spirv.ARM.GraphOutputs {{%.*}} : !spirv.arm.tensor<14x19xi16>
11- spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor <14 x19 xi16 >
12- }
7+ // CHECK: spirv.ARM.Graph {{@.*}}({{%.*}}: !spirv.arm.tensor<14x19xi16>) -> !spirv.arm.tensor<14x19xi16> {
8+ spirv.ARM.Graph @graphAndOutputs (%arg0 : !spirv.arm.tensor <14 x19 xi16 >) -> !spirv.arm.tensor <14 x19 xi16 > {
9+ // CHECK: spirv.ARM.GraphOutputs {{%.*}} : !spirv.arm.tensor<14x19xi16>
10+ spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor <14 x19 xi16 >
1311}
1412
1513// -----
@@ -18,52 +16,109 @@ spirv.module Logical Vulkan requires #spirv.vce<v1.0, [VulkanMemoryModel, Int8,
1816// spirv.ARM.GraphConstant
1917//===----------------------------------------------------------------------===//
2018
21- spirv.module Logical Vulkan requires #spirv.vce <v1.0 , [VulkanMemoryModel , Int8 , TensorsARM , GraphARM ], [SPV_ARM_tensors , SPV_ARM_graph ]> {
22- // CHECK: spirv.ARM.Graph {{@.*}}() -> !spirv.arm.tensor<2x3xi16> {
23- spirv.ARM.Graph @graphConstant () -> !spirv.arm.tensor <2 x3 xi16 > {
24- // CHECK: [[CONST:%.*]] = spirv.ARM.GraphConstant {graph_constant_id = 42 : i32} : !spirv.arm.tensor<2x3xi16>
25- %0 = spirv.ARM.GraphConstant { graph_constant_id = 42 : i32 } : !spirv.arm.tensor <2 x3 xi16 >
26- // CHECK: spirv.ARM.GraphOutputs [[CONST:%.*]] : !spirv.arm.tensor<2x3xi16>
27- spirv.ARM.GraphOutputs %0 : !spirv.arm.tensor <2 x3 xi16 >
28- }
19+ // CHECK: spirv.ARM.Graph {{@.*}}() -> !spirv.arm.tensor<2x3xi16> {
20+ spirv.ARM.Graph @graphConstant () -> !spirv.arm.tensor <2 x3 xi16 > {
21+ // CHECK: [[CONST:%.*]] = spirv.ARM.GraphConstant {graph_constant_id = 42 : i32} : !spirv.arm.tensor<2x3xi16>
22+ %0 = spirv.ARM.GraphConstant { graph_constant_id = 42 : i32 } : !spirv.arm.tensor <2 x3 xi16 >
23+ // CHECK: spirv.ARM.GraphOutputs [[CONST:%.*]] : !spirv.arm.tensor<2x3xi16>
24+ spirv.ARM.GraphOutputs %0 : !spirv.arm.tensor <2 x3 xi16 >
2925}
3026// -----
3127
3228//===----------------------------------------------------------------------===//
3329// spirv.ARM.GraphEntryPoint
3430//===----------------------------------------------------------------------===//
3531
32+ // CHECK: spirv.GlobalVariable [[VARARG0:@.*]] bind(0, 0) : !spirv.ptr<!spirv.arm.tensor<14x19xi16>, UniformConstant>
33+ spirv.GlobalVariable @entrypoint_arg_0 bind (0 , 0 ) : !spirv.ptr <!spirv.arm.tensor <14 x19 xi16 >, UniformConstant >
34+ // CHECK: spirv.GlobalVariable [[VARRES0:@.*]] bind(0, 1) : !spirv.ptr<!spirv.arm.tensor<14x19xi16>, UniformConstant>
35+ spirv.GlobalVariable @entrypoint_res_0 bind (0 , 1 ) : !spirv.ptr <!spirv.arm.tensor <14 x19 xi16 >, UniformConstant >
36+ // CHECK: spirv.ARM.GraphEntryPoint [[GN:@.*]], [[VARARG0]], [[VARRES0]]
37+ spirv.ARM.GraphEntryPoint @entrypoint , @entrypoint_arg_0 , @entrypoint_res_0
3638
37- spirv.module Logical Vulkan requires #spirv.vce <v1.0 , [VulkanMemoryModel , Int8 , TensorsARM , GraphARM ], [SPV_ARM_tensors , SPV_ARM_graph ]> {
38- // CHECK: spirv.GlobalVariable [[VARARG0:@.*]] bind(0, 0) : !spirv.ptr<!spirv.arm.tensor<14x19xi16>, UniformConstant>
39- spirv.GlobalVariable @entrypoint_arg_0 bind (0 , 0 ) : !spirv.ptr <!spirv.arm.tensor <14 x19 xi16 >, UniformConstant >
40- // CHECK: spirv.GlobalVariable [[VARRES0:@.*]] bind(0, 1) : !spirv.ptr<!spirv.arm.tensor<14x19xi16>, UniformConstant>
41- spirv.GlobalVariable @entrypoint_res_0 bind (0 , 1 ) : !spirv.ptr <!spirv.arm.tensor <14 x19 xi16 >, UniformConstant >
42- // CHECK: spirv.ARM.GraphEntryPoint [[GN:@.*]], [[VARARG0]], [[VARRES0]]
43- spirv.ARM.GraphEntryPoint @entrypoint , @entrypoint_arg_0 , @entrypoint_res_0
44- // CHECK: spirv.ARM.Graph [[GN]]({{%.*}}: !spirv.arm.tensor<14x19xi16>) -> !spirv.arm.tensor<14x19xi16> {
45- spirv.ARM.Graph @entrypoint (%arg0 : !spirv.arm.tensor <14 x19 xi16 >) -> !spirv.arm.tensor <14 x19 xi16 > {
46- // CHECK: spirv.ARM.GraphOutputs {{%.*}} : !spirv.arm.tensor<14x19xi16>
47- spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor <14 x19 xi16 >
48- }
39+ // -----
40+
41+ //===----------------------------------------------------------------------===//
42+ // spirv.ARM.Graph with no terminator
43+ //===----------------------------------------------------------------------===//
44+
45+ // expected-error @+1 {{empty block: expect at least a terminator}}
46+ spirv.ARM.Graph @graphNoterminator (%arg0 : !spirv.arm.tensor <14 x19 xi16 >) -> !spirv.arm.tensor <14 x19 xi16 > {
47+ }
48+
49+ // -----
50+
51+ //===----------------------------------------------------------------------===//
52+ // spirv.ARM.Graph with no result types
53+ //===----------------------------------------------------------------------===//
54+
55+ // expected-error @+1 {{'spirv.ARM.Graph' op there should be at least one result}}
56+ spirv.ARM.Graph @graphNoOutputs (%arg0 : !spirv.arm.tensor <14 x19 xi16 >) -> () {
4957}
5058
5159// -----
5260
5361//===----------------------------------------------------------------------===//
54- // Multiple spirv.ARM.Graphs
62+ // spirv.ARM.GraphConstant outside graph scope
5563//===----------------------------------------------------------------------===//
5664
57- spirv.module Logical Vulkan requires #spirv.vce <v1.0 , [VulkanMemoryModel , Int8 , TensorsARM , GraphARM ], [SPV_ARM_tensors , SPV_ARM_graph ]> {
58- // CHECK: spirv.ARM.Graph {{@.*}}({{%.*}}: !spirv.arm.tensor<14x19xi16>) -> !spirv.arm.tensor<14x19xi16> {
59- spirv.ARM.Graph @graph1 (%arg0 : !spirv.arm.tensor <14 x19 xi16 >) -> !spirv.arm.tensor <14 x19 xi16 > {
60- // CHECK: spirv.ARM.GraphOutputs {{%.*}} : !spirv.arm.tensor<14x19xi16>
61- spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor <14 x19 xi16 >
62- }
65+ // expected-error @+1 {{'spirv.ARM.GraphConstant' op failed to verify that op must appear in a spirv.ARM.Graph op's block}}
66+ %0 = spirv.ARM.GraphConstant { graph_constant_id = 42 : i32 } : !spirv.arm.tensor <2 x3 xi16 >
67+ // -----
68+
69+ //===----------------------------------------------------------------------===//
70+ // spirv.ARM.GraphOutputs outside graph scope
71+ //===----------------------------------------------------------------------===//
72+
73+ %0 = spirv.Constant dense <1 > : !spirv.arm.tensor <1 xi16 >
74+ // expected-error @+1 {{'spirv.ARM.GraphOutputs' op failed to verify that op must appear in a spirv.ARM.Graph op's block}}
75+ spirv.ARM.GraphOutputs %0 : !spirv.arm.tensor <1 xi16 >
76+
77+ // -----
78+
79+ //===----------------------------------------------------------------------===//
80+ // spirv.ARM.Graph return type does not match spirv.ARM.GraphOutputs
81+ //===----------------------------------------------------------------------===//
82+
83+ spirv.ARM.Graph @graphAndOutputs (%arg0 : !spirv.arm.tensor <14 x19 xi16 >) -> !spirv.arm.tensor <5 x3 xi16 > {
84+ // expected-error @+1 {{type of return operand 0 ('!spirv.arm.tensor<14x19xi16>') doesn't match graph result type ('!spirv.arm.tensor<5x3xi16>')}}
85+ spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor <14 x19 xi16 >
86+ }
87+
88+ // -----
89+
90+ //===----------------------------------------------------------------------===//
91+ // spirv.ARM.Graph return type does not match number of results in spirv.ARM.GraphOutputs
92+ //===----------------------------------------------------------------------===//
93+
94+ spirv.ARM.Graph @graphAndOutputs (%arg0 : !spirv.arm.tensor <14 x19 xi16 >) -> (!spirv.arm.tensor <14 x19 xi16 >, !spirv.arm.tensor <14 x19 xi16 >) {
95+ // expected-error @+1 {{'spirv.ARM.GraphOutputs' op is returning 1 value(s) but enclosing spirv.ARM.Graph requires 2 result(s)}}
96+ spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor <14 x19 xi16 >
97+ }
98+
99+ // -----
100+
101+ spirv.ARM.Graph @graphAndOutputs (%arg0 : !spirv.arm.tensor <14 x19 xi16 >) -> !spirv.arm.tensor <14 x19 xi16 > {
102+ // expected-error @+1 {{'spirv.ARM.GraphOutputs' op is returning 2 value(s) but enclosing spirv.ARM.Graph requires 1 result(s)}}
103+ spirv.ARM.GraphOutputs %arg0 , %arg0 : !spirv.arm.tensor <14 x19 xi16 >, !spirv.arm.tensor <14 x19 xi16 >
104+ }
105+
106+ // -----
107+
108+ //===----------------------------------------------------------------------===//
109+ // spirv.ARM.Graph using a non TensorArmType argument
110+ //===----------------------------------------------------------------------===//
111+
112+ // expected-error @+1 {{'spirv.ARM.Graph' op type of argument #0 must be a TensorArmType, but got 'i8'}}
113+ spirv.ARM.Graph @graphAndOutputs (%arg0 : i8 ) -> !spirv.arm.tensor <14 x19 xi16 > {
114+ }
115+
116+ // -----
117+
118+ //===----------------------------------------------------------------------===//
119+ // spirv.ARM.Graph using a non TensorArmType result
120+ //===----------------------------------------------------------------------===//
63121
64- // CHECK: spirv.ARM.Graph {{@.*}}({{%.*}}: !spirv.arm.tensor<1x16x16x16xi8>) -> !spirv.arm.tensor<1x16x16x16xi8> {
65- spirv.ARM.Graph @graph2 (%arg0: !spirv.arm.tensor <1 x16 x16 x16 xi8 >) -> !spirv.arm.tensor <1 x16 x16 x16 xi8 > {
66- // CHECK: spirv.ARM.GraphOutputs {{%.*}} : !spirv.arm.tensor<1x16x16x16xi8>
67- spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor <1 x16 x16 x16 xi8 >
68- }
122+ // expected-error @+1 {{'spirv.ARM.Graph' op type of result #0 must be a TensorArmType, but got 'i8'}}
123+ spirv.ARM.Graph @graphAndOutputs (%arg0 : !spirv.arm.tensor <14 x19 xi16 >) -> i8 {
69124}
0 commit comments