|
1 | 1 | // RUN: mlir-opt -split-input-file -verify-diagnostics %s | FileCheck %s
|
2 | 2 |
|
| 3 | +//===----------------------------------------------------------------------===// |
| 4 | +// spirv.ARM.Graph and spirv.ARM.GraphOutputs |
| 5 | +//===----------------------------------------------------------------------===// |
| 6 | + |
| 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<14x19xi16>) -> !spirv.arm.tensor<14x19xi16> { |
| 10 | + // CHECK: spirv.ARM.GraphOutputs {{%.*}} : !spirv.arm.tensor<14x19xi16> |
| 11 | + spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor<14x19xi16> |
| 12 | + } |
| 13 | +} |
| 14 | + |
| 15 | +// ----- |
| 16 | + |
3 | 17 | //===----------------------------------------------------------------------===//
|
4 | 18 | // spirv.ARM.GraphConstant
|
5 | 19 | //===----------------------------------------------------------------------===//
|
6 | 20 |
|
7 |
| -spirv.module Logical Vulkan requires #spirv.vce<v1.0, [VulkanMemoryModel, Shader, Int8, TensorsARM, GraphARM], [SPV_ARM_tensors, SPV_ARM_graph]> { |
8 |
| - // CHECK: spirv.ARM.GraphConstant {graph_constant_id = 42 : i32} : !spirv.arm.tensor<14xi32> |
9 |
| - %0 = spirv.ARM.GraphConstant { graph_constant_id = 42 : i32 } : !spirv.arm.tensor<14xi32> |
| 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<2x3xi16> { |
| 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<2x3xi16> |
| 26 | + // CHECK: spirv.ARM.GraphOutputs [[CONST:%.*]] : !spirv.arm.tensor<2x3xi16> |
| 27 | + spirv.ARM.GraphOutputs %0 : !spirv.arm.tensor<2x3xi16> |
| 28 | + } |
| 29 | +} |
| 30 | +// ----- |
| 31 | + |
| 32 | +//===----------------------------------------------------------------------===// |
| 33 | +// spirv.ARM.GraphEntryPoint |
| 34 | +//===----------------------------------------------------------------------===// |
| 35 | + |
10 | 36 |
|
| 37 | +spirv.module Logical Vulkan requires #spirv.vce<v1.0, [VulkanMemoryModel, Int8, TensorsARM, GraphARM], [SPV_ARM_tensors, SPV_ARM_graph]> { |
11 | 38 | // CHECK: spirv.GlobalVariable [[VARARG0:@.*]] bind(0, 0) : !spirv.ptr<!spirv.arm.tensor<14x19xi16>, UniformConstant>
|
12 |
| - spirv.GlobalVariable @main_arg_0 bind(0, 0) : !spirv.ptr<!spirv.arm.tensor<14x19xi16>, UniformConstant> |
13 |
| - // CHECK: spirv.GlobalVariable [[VARRES0:@.*]] bind(0, 1) : !spirv.ptr<!spirv.arm.tensor<2x3xi16>, UniformConstant> |
14 |
| - spirv.GlobalVariable @main_res_0 bind(0, 1) : !spirv.ptr<!spirv.arm.tensor<2x3xi16>, UniformConstant> |
| 39 | + spirv.GlobalVariable @entrypoint_arg_0 bind(0, 0) : !spirv.ptr<!spirv.arm.tensor<14x19xi16>, 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<14x19xi16>, UniformConstant> |
15 | 42 | // CHECK: spirv.ARM.GraphEntryPoint [[GN:@.*]], [[VARARG0]], [[VARRES0]]
|
16 |
| - spirv.ARM.GraphEntryPoint @main, @main_arg_0, @main_res_0 |
17 |
| - // CHECK: spirv.ARM.Graph [[GN]]({{%.*}}: !spirv.arm.tensor<14x19xi16>) -> !spirv.arm.tensor<2x3xi16> attributes {entry_point = true} { |
18 |
| - spirv.ARM.Graph @main(%arg0 : !spirv.arm.tensor<14x19xi16>) -> !spirv.arm.tensor<2x3xi16> attributes {entry_point = true} { |
19 |
| - // CHECK: [[CONST2:%.*]] = spirv.ARM.GraphConstant {graph_constant_id = 42 : i32} : !spirv.arm.tensor<2x3xi16> |
20 |
| - %1 = spirv.ARM.GraphConstant { graph_constant_id = 42 : i32 } : !spirv.arm.tensor<2x3xi16> |
21 |
| - // CHECK: spirv.ARM.GraphOutputs [[OUT:%.*]] : !spirv.arm.tensor<2x3xi16> |
22 |
| - spirv.ARM.GraphOutputs %1 : !spirv.arm.tensor<2x3xi16> |
| 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<14x19xi16>) -> !spirv.arm.tensor<14x19xi16> { |
| 46 | + // CHECK: spirv.ARM.GraphOutputs {{%.*}} : !spirv.arm.tensor<14x19xi16> |
| 47 | + spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor<14x19xi16> |
| 48 | + } |
| 49 | +} |
| 50 | + |
| 51 | +// ----- |
| 52 | + |
| 53 | +//===----------------------------------------------------------------------===// |
| 54 | +// Multiple spirv.ARM.Graphs |
| 55 | +//===----------------------------------------------------------------------===// |
| 56 | + |
| 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<14x19xi16>) -> !spirv.arm.tensor<14x19xi16> { |
| 60 | + // CHECK: spirv.ARM.GraphOutputs {{%.*}} : !spirv.arm.tensor<14x19xi16> |
| 61 | + spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor<14x19xi16> |
23 | 62 | }
|
24 | 63 |
|
25 | 64 | // CHECK: spirv.ARM.Graph {{@.*}}({{%.*}}: !spirv.arm.tensor<1x16x16x16xi8>) -> !spirv.arm.tensor<1x16x16x16xi8> {
|
26 |
| - spirv.ARM.Graph @empty_graph(%arg0: !spirv.arm.tensor<1x16x16x16xi8>) -> !spirv.arm.tensor<1x16x16x16xi8> { |
| 65 | + spirv.ARM.Graph @graph2(%arg0: !spirv.arm.tensor<1x16x16x16xi8>) -> !spirv.arm.tensor<1x16x16x16xi8> { |
27 | 66 | // CHECK: spirv.ARM.GraphOutputs {{%.*}} : !spirv.arm.tensor<1x16x16x16xi8>
|
28 | 67 | spirv.ARM.GraphOutputs %arg0 : !spirv.arm.tensor<1x16x16x16xi8>
|
29 | 68 | }
|
|
0 commit comments