diff --git a/mlir/docs/Dialects/SPIR-V.md b/mlir/docs/Dialects/SPIR-V.md --- a/mlir/docs/Dialects/SPIR-V.md +++ b/mlir/docs/Dialects/SPIR-V.md @@ -176,7 +176,7 @@ #### Adopt symbol-based global variables and specialization constant -* Global variables are defined with the `spv.globalVariable` op. They do not +* Global variables are defined with the `spv.GlobalVariable` op. They do not generate SSA values. Instead they have symbols and should be referenced via symbols. To use global variables in a function block, `spv.mlir.addressof` is needed to turn the symbol into an SSA value. @@ -982,11 +982,11 @@ * `OpType*` instructions will be converted into proper `mlir::Type`s. * `OpConstant*` instructions are materialized as `spv.constant` at each use site. -* `OpVariable` instructions will be converted to `spv.globalVariable` ops if +* `OpVariable` instructions will be converted to `spv.GlobalVariable` ops if in module-level; otherwise they will be converted into `spv.Variable` ops. * Every use of a module-level `OpVariable` instruction will materialize a `spv.mlir.addressof` op to turn the symbol of the corresponding - `spv.globalVariable` into an SSA value. + `spv.GlobalVariable` into an SSA value. * Every use of a `OpSpecConstant` instruction will materialize a `spv.mlir.referenceof` op to turn the symbol of the corresponding `spv.specConstant` into an SSA value. @@ -1069,7 +1069,7 @@ point function and its ABI consistent with the Vulkan validation rules. Specifically, -* Creates `spv.globalVariable`s for the arguments, and replaces all uses of +* Creates `spv.GlobalVariable`s for the arguments, and replaces all uses of the argument with this variable. The SSA value used for replacement is obtained using the `spv.mlir.addressof` operation. * Adds the `spv.EntryPoint` and `spv.ExecutionMode` operations into the @@ -1078,15 +1078,15 @@ #### Setting layout for shader interface variables SPIR-V validation rules for shaders require composite objects to be explicitly -laid out. If a `spv.globalVariable` is not explicitly laid out, the utility +laid out. If a `spv.GlobalVariable` is not explicitly laid out, the utility method `mlir::spirv::decorateType` implements a layout consistent with the [Vulkan shader requirements][VulkanShaderInterface]. #### Creating builtin variables -In SPIR-V dialect, builtins are represented using `spv.globalVariable`s, with +In SPIR-V dialect, builtins are represented using `spv.GlobalVariable`s, with `spv.mlir.addressof` used to get a handle to the builtin as an SSA value. The -method `mlir::spirv::getBuiltinVariableValue` creates a `spv.globalVariable` for +method `mlir::spirv::getBuiltinVariableValue` creates a `spv.GlobalVariable` for the builtin in the current `spv.module` if it does not exist already, and returns an SSA value generated from an `spv.mlir.addressof` operation. diff --git a/mlir/docs/SPIRVToLLVMDialectConversion.md b/mlir/docs/SPIRVToLLVMDialectConversion.md --- a/mlir/docs/SPIRVToLLVMDialectConversion.md +++ b/mlir/docs/SPIRVToLLVMDialectConversion.md @@ -466,9 +466,9 @@ (`MakePointerAvailable`, `MakePointerVisible`, `NonPrivatePointer`) are not supported yet. -#### `spv.globalVariable` and `spv.mlir.addressof` +#### `spv.GlobalVariable` and `spv.mlir.addressof` -`spv.globalVariable` is modelled with `llvm.mlir.global` op. However, there +`spv.GlobalVariable` is modelled with `llvm.mlir.global` op. However, there is a difference that has to be pointed out. In SPIR-V dialect, the global variable returns a pointer, whereas in LLVM @@ -479,7 +479,7 @@ ```mlir // Original SPIR-V module spv.module Logical GLSL450 { - spv.globalVariable @struct : !spv.ptr>, Private> + spv.GlobalVariable @struct : !spv.ptr>, Private> spv.func @func() -> () "None" { %0 = spv.mlir.addressof @struct : !spv.ptr>, Private> spv.Return @@ -517,7 +517,7 @@ flag is added to LLVM op: ```mlir -spv.globalVariable @var : !spv.ptr => llvm.mlir.global external constant @var() : f32 +spv.GlobalVariable @var : !spv.ptr => llvm.mlir.global external constant @var() : f32 ``` #### `spv.Variable` @@ -873,7 +873,7 @@ ```mlir spv.module @__spv__foo /*VCE triple and other metadata here*/ { - spv.globalVariable @__spv__foo_arg bind(0,0) : ... + spv.GlobalVariable @__spv__foo_arg bind(0,0) : ... spv.func @bar() { // Kernel code. } @@ -897,7 +897,7 @@ ```mlir spv.module @__spv__foo /*VCE triple and other metadata here*/ { - spv.globalVariable @__spv__foo_arg bind(0,0) : ... + spv.GlobalVariable @__spv__foo_arg bind(0,0) : ... spv.func @bar() { // Kernel code. } diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVStructureOps.td @@ -148,11 +148,11 @@ OpEntryPoint instructions with the same Execution Model and the same Name string. - Interface is a list of symbol references to `spv.globalVariable` + Interface is a list of symbol references to `spv.GlobalVariable` operations. These declare the set of global variables from a module that form the interface of this entry point. The set of Interface symbols must be equal to or a superset of the - `spv.globalVariable`s referenced by the entry point’s static call + `spv.GlobalVariable`s referenced by the entry point’s static call tree, within the interface’s storage classes. Before version 1.4, the interface’s storage classes are limited to the Input and Output storage classes. Starting with version 1.4, the interface’s @@ -325,7 +325,7 @@ // ----- -def SPV_GlobalVariableOp : SPV_Op<"globalVariable", [InModuleScope, Symbol]> { +def SPV_GlobalVariableOp : SPV_Op<"GlobalVariable", [InModuleScope, Symbol]> { let summary = [{ Allocate an object in memory at module scope. The object is referenced using a symbol name. @@ -343,13 +343,13 @@ Initializer is optional. If Initializer is present, it will be the initial value of the variable’s memory content. Initializer must be an symbol defined from a constant instruction or other - `spv.globalVariable` operation in module scope. Initializer must + `spv.GlobalVariable` operation in module scope. Initializer must have the same type as the type of the defined symbol. ``` - variable-op ::= `spv.globalVariable` spirv-type symbol-ref-id + variable-op ::= `spv.GlobalVariable` spirv-type symbol-ref-id (`initializer(` symbol-ref-id `)`)? (`bind(` integer-literal, integer-literal `)`)? (`built_in(` string-literal `)`)? @@ -363,10 +363,10 @@ #### Example: ```mlir - spv.globalVariable @var0 : !spv.ptr @var0 - spv.globalVariable @var1 initializer(@var0) : !spv.ptr - spv.globalVariable @var2 bind(1, 2) : !spv.ptr - spv.globalVariable @var3 built_in("GlobalInvocationId") : !spv.ptr, Input> + spv.GlobalVariable @var0 : !spv.ptr @var0 + spv.GlobalVariable @var1 initializer(@var0) : !spv.ptr + spv.GlobalVariable @var2 bind(1, 2) : !spv.ptr + spv.GlobalVariable @var3 built_in("GlobalInvocationId") : !spv.ptr, Input> ``` }]; diff --git a/mlir/include/mlir/Dialect/SPIRV/Linking/ModuleCombiner.h b/mlir/include/mlir/Dialect/SPIRV/Linking/ModuleCombiner.h --- a/mlir/include/mlir/Dialect/SPIRV/Linking/ModuleCombiner.h +++ b/mlir/include/mlir/Dialect/SPIRV/Linking/ModuleCombiner.h @@ -41,7 +41,7 @@ /// /// For deduplication, the following 3 cases are taken into consideration: /// -/// - If 2 spv.globalVariable's have either the same descriptor set + binding +/// - If 2 spv.GlobalVariable's have either the same descriptor set + binding /// or the same build_in attribute value, then replace one of them using the /// other. /// - If 2 spv.specConstant's have the same spec_id attribute value, then diff --git a/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp b/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp --- a/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp +++ b/mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp @@ -94,7 +94,7 @@ /// Fills `globalVariableMap` with SPIR-V global variables that represent kernel /// arguments from the given SPIR-V module. We assume that the module contains a -/// single entry point function. Hence, all `spv.globalVariable`s with a bind +/// single entry point function. Hence, all `spv.GlobalVariable`s with a bind /// attribute are kernel arguments. static LogicalResult getKernelGlobalVariables( spirv::ModuleOp module, diff --git a/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp b/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp --- a/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp +++ b/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp @@ -706,7 +706,7 @@ } }; -/// Converts `spv.globalVariable` to `llvm.mlir.global`. Note that SPIR-V global +/// Converts `spv.GlobalVariable` to `llvm.mlir.global`. Note that SPIR-V global /// returns a pointer, whereas in LLVM dialect the global holds an actual value. /// This difference is handled by `spv.mlir.addressof` and /// `llvm.mlir.addressof`ops that both return a pointer. diff --git a/mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.cpp b/mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.cpp --- a/mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.cpp +++ b/mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.cpp @@ -250,7 +250,7 @@ // Get the SPIR-V type for the allocation. Type spirvType = getTypeConverter()->convertType(allocType); - // Insert spv.globalVariable for this allocation. + // Insert spv.GlobalVariable for this allocation. Operation *parent = SymbolTable::getNearestSymbolTable(operation->getParentOp()); if (!parent) diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp --- a/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp +++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp @@ -1064,7 +1064,7 @@ SymbolTable::lookupNearestSymbolFrom(addressOfOp->getParentOp(), addressOfOp.variable())); if (!varOp) { - return addressOfOp.emitOpError("expected spv.globalVariable symbol"); + return addressOfOp.emitOpError("expected spv.GlobalVariable symbol"); } if (addressOfOp.pointer().getType() != varOp.type()) { return addressOfOp.emitOpError( @@ -1959,7 +1959,7 @@ } //===----------------------------------------------------------------------===// -// spv.globalVariable +// spv.GlobalVariable //===----------------------------------------------------------------------===// void spirv::GlobalVariableOp::build(OpBuilder &builder, OperationState &state, @@ -2067,7 +2067,7 @@ if (!initOp || !isa(initOp)) { return varOp.emitOpError("initializer must be result of a " - "spv.specConstant or spv.globalVariable op"); + "spv.specConstant or spv.GlobalVariable op"); } } @@ -2593,7 +2593,7 @@ auto variableOp = table.lookup(varSymRef.getValue()); if (!variableOp) { - return entryPointOp.emitError("expected spv.globalVariable " + return entryPointOp.emitError("expected spv.GlobalVariable " "symbol reference instead of'") << varSymRef << "'"; } @@ -3000,7 +3000,7 @@ if (varOp.storage_class() != spirv::StorageClass::Function) { return varOp.emitOpError( "can only be used to model function-level variables. Use " - "spv.globalVariable for module-level variables."); + "spv.GlobalVariable for module-level variables."); } auto pointerType = varOp.pointer().getType().cast(); @@ -3016,7 +3016,7 @@ spirv::ReferenceOfOp, // for spec constant spirv::AddressOfOp>(initOp)) return varOp.emitOpError("initializer must be the result of a " - "constant or spv.globalVariable op"); + "constant or spv.GlobalVariable op"); } // TODO: generate these strings using ODS. @@ -3031,7 +3031,7 @@ for (const auto &attr : {descriptorSetName, bindingName, builtInName}) { if (op->getAttr(attr)) return varOp.emitOpError("cannot have '") - << attr << "' attribute (only allowed in spv.globalVariable)"; + << attr << "' attribute (only allowed in spv.GlobalVariable)"; } return success(); diff --git a/mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp b/mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp --- a/mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp +++ b/mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp @@ -527,7 +527,7 @@ static spirv::GlobalVariableOp getBuiltinVariable(Block &body, spirv::BuiltIn builtin) { // Look through all global variables in the given `body` block and check if - // there is a spv.globalVariable that has the same `builtin` attribute. + // there is a spv.GlobalVariable that has the same `builtin` attribute. for (auto varOp : body.getOps()) { if (auto builtinAttr = varOp->getAttrOfType( spirv::SPIRVDialect::getAttributeName( diff --git a/mlir/lib/Target/SPIRV/Deserialization/Deserializer.h b/mlir/lib/Target/SPIRV/Deserialization/Deserializer.h --- a/mlir/lib/Target/SPIRV/Deserialization/Deserializer.h +++ b/mlir/lib/Target/SPIRV/Deserialization/Deserializer.h @@ -239,7 +239,7 @@ /// Processes the OpVariable instructions at current `offset` into `binary`. /// It is expected that this method is used for variables that are to be - /// defined at module scope and will be deserialized into a spv.globalVariable + /// defined at module scope and will be deserialized into a spv.GlobalVariable /// instruction. LogicalResult processGlobalVariable(ArrayRef operands); diff --git a/mlir/test/Conversion/GPUToSPIRV/builtins.mlir b/mlir/test/Conversion/GPUToSPIRV/builtins.mlir --- a/mlir/test/Conversion/GPUToSPIRV/builtins.mlir +++ b/mlir/test/Conversion/GPUToSPIRV/builtins.mlir @@ -9,7 +9,7 @@ } // CHECK-LABEL: spv.module @{{.*}} Logical GLSL450 - // CHECK: spv.globalVariable [[WORKGROUPID:@.*]] built_in("WorkgroupId") + // CHECK: spv.GlobalVariable [[WORKGROUPID:@.*]] built_in("WorkgroupId") gpu.module @kernels { gpu.func @builtin_workgroup_id_x() kernel attributes {spv.entry_point_abi = {local_size = dense<[16, 1, 1]>: vector<3xi32>}} { @@ -33,7 +33,7 @@ } // CHECK-LABEL: spv.module @{{.*}} Logical GLSL450 - // CHECK: spv.globalVariable [[WORKGROUPID:@.*]] built_in("WorkgroupId") + // CHECK: spv.GlobalVariable [[WORKGROUPID:@.*]] built_in("WorkgroupId") gpu.module @kernels { gpu.func @builtin_workgroup_id_y() kernel attributes {spv.entry_point_abi = {local_size = dense<[16, 1, 1]>: vector<3xi32>}} { @@ -57,7 +57,7 @@ } // CHECK-LABEL: spv.module @{{.*}} Logical GLSL450 - // CHECK: spv.globalVariable [[WORKGROUPID:@.*]] built_in("WorkgroupId") + // CHECK: spv.GlobalVariable [[WORKGROUPID:@.*]] built_in("WorkgroupId") gpu.module @kernels { gpu.func @builtin_workgroup_id_z() kernel attributes {spv.entry_point_abi = {local_size = dense<[16, 1, 1]>: vector<3xi32>}} { @@ -150,7 +150,7 @@ } // CHECK-LABEL: spv.module @{{.*}} Logical GLSL450 - // CHECK: spv.globalVariable [[LOCALINVOCATIONID:@.*]] built_in("LocalInvocationId") + // CHECK: spv.GlobalVariable [[LOCALINVOCATIONID:@.*]] built_in("LocalInvocationId") gpu.module @kernels { gpu.func @builtin_local_id_x() kernel attributes {spv.entry_point_abi = {local_size = dense<[16, 1, 1]>: vector<3xi32>}} { @@ -174,7 +174,7 @@ } // CHECK-LABEL: spv.module @{{.*}} Logical GLSL450 - // CHECK: spv.globalVariable [[NUMWORKGROUPS:@.*]] built_in("NumWorkgroups") + // CHECK: spv.GlobalVariable [[NUMWORKGROUPS:@.*]] built_in("NumWorkgroups") gpu.module @kernels { gpu.func @builtin_num_workgroups_x() kernel attributes {spv.entry_point_abi = {local_size = dense<[16, 1, 1]>: vector<3xi32>}} { @@ -191,7 +191,7 @@ module attributes {gpu.container_module} { // CHECK-LABEL: spv.module @{{.*}} Logical GLSL450 - // CHECK: spv.globalVariable [[SUBGROUPID:@.*]] built_in("SubgroupId") + // CHECK: spv.GlobalVariable [[SUBGROUPID:@.*]] built_in("SubgroupId") gpu.module @kernels { gpu.func @builtin_subgroup_id() kernel attributes {spv.entry_point_abi = {local_size = dense<[16, 1, 1]>: vector<3xi32>}} { @@ -207,7 +207,7 @@ module attributes {gpu.container_module} { // CHECK-LABEL: spv.module @{{.*}} Logical GLSL450 - // CHECK: spv.globalVariable [[NUMSUBGROUPS:@.*]] built_in("NumSubgroups") + // CHECK: spv.GlobalVariable [[NUMSUBGROUPS:@.*]] built_in("NumSubgroups") gpu.module @kernels { gpu.func @builtin_num_subgroups() kernel attributes {spv.entry_point_abi = {local_size = dense<[16, 1, 1]>: vector<3xi32>}} { @@ -223,7 +223,7 @@ module attributes {gpu.container_module} { // CHECK-LABEL: spv.module @{{.*}} Logical GLSL450 - // CHECK: spv.globalVariable [[SUBGROUPSIZE:@.*]] built_in("SubgroupSize") + // CHECK: spv.GlobalVariable [[SUBGROUPSIZE:@.*]] built_in("SubgroupSize") gpu.module @kernels { gpu.func @builtin_subgroup_size() kernel attributes {spv.entry_point_abi = {local_size = dense<[16, 1, 1]>: vector<3xi32>}} { diff --git a/mlir/test/Conversion/GPUToSPIRV/load-store.mlir b/mlir/test/Conversion/GPUToSPIRV/load-store.mlir --- a/mlir/test/Conversion/GPUToSPIRV/load-store.mlir +++ b/mlir/test/Conversion/GPUToSPIRV/load-store.mlir @@ -24,9 +24,9 @@ // CHECK-LABEL: spv.module @{{.*}} Logical GLSL450 gpu.module @kernels { - // CHECK-DAG: spv.globalVariable @[[NUMWORKGROUPSVAR:.*]] built_in("NumWorkgroups") : !spv.ptr, Input> - // CHECK-DAG: spv.globalVariable @[[$LOCALINVOCATIONIDVAR:.*]] built_in("LocalInvocationId") : !spv.ptr, Input> - // CHECK-DAG: spv.globalVariable @[[$WORKGROUPIDVAR:.*]] built_in("WorkgroupId") : !spv.ptr, Input> + // CHECK-DAG: spv.GlobalVariable @[[NUMWORKGROUPSVAR:.*]] built_in("NumWorkgroups") : !spv.ptr, Input> + // CHECK-DAG: spv.GlobalVariable @[[$LOCALINVOCATIONIDVAR:.*]] built_in("LocalInvocationId") : !spv.ptr, Input> + // CHECK-DAG: spv.GlobalVariable @[[$WORKGROUPIDVAR:.*]] built_in("WorkgroupId") : !spv.ptr, Input> // CHECK-LABEL: spv.func @load_store_kernel // CHECK-SAME: %[[ARG0:.*]]: !spv.ptr [0])>, StorageBuffer> {spv.interface_var_abi = #spv.interface_var_abi<(0, 0)>} // CHECK-SAME: %[[ARG1:.*]]: !spv.ptr [0])>, StorageBuffer> {spv.interface_var_abi = #spv.interface_var_abi<(0, 1)>} diff --git a/mlir/test/Conversion/GPUToVulkan/lower-gpu-launch-vulkan-launch.mlir b/mlir/test/Conversion/GPUToVulkan/lower-gpu-launch-vulkan-launch.mlir --- a/mlir/test/Conversion/GPUToVulkan/lower-gpu-launch-vulkan-launch.mlir +++ b/mlir/test/Conversion/GPUToVulkan/lower-gpu-launch-vulkan-launch.mlir @@ -6,7 +6,7 @@ module attributes {gpu.container_module} { spv.module Logical GLSL450 requires #spv.vce { - spv.globalVariable @kernel_arg_0 bind(0, 0) : !spv.ptr [0])>, StorageBuffer> + spv.GlobalVariable @kernel_arg_0 bind(0, 0) : !spv.ptr [0])>, StorageBuffer> spv.func @kernel() "None" attributes {workgroup_attributions = 0 : i64} { %0 = spv.mlir.addressof @kernel_arg_0 : !spv.ptr [0])>, StorageBuffer> %2 = spv.constant 0 : i32 diff --git a/mlir/test/Conversion/LinalgToSPIRV/linalg-to-spirv.mlir b/mlir/test/Conversion/LinalgToSPIRV/linalg-to-spirv.mlir --- a/mlir/test/Conversion/LinalgToSPIRV/linalg-to-spirv.mlir +++ b/mlir/test/Conversion/LinalgToSPIRV/linalg-to-spirv.mlir @@ -17,7 +17,7 @@ #spv.vce, {}> } { -// CHECK: spv.globalVariable +// CHECK: spv.GlobalVariable // CHECK-SAME: built_in("LocalInvocationId") // CHECK: @single_workgroup_reduction diff --git a/mlir/test/Conversion/SPIRVToLLVM/lower-host-to-llvm-calls.mlir b/mlir/test/Conversion/SPIRVToLLVM/lower-host-to-llvm-calls.mlir --- a/mlir/test/Conversion/SPIRVToLLVM/lower-host-to-llvm-calls.mlir +++ b/mlir/test/Conversion/SPIRVToLLVM/lower-host-to-llvm-calls.mlir @@ -6,7 +6,7 @@ // CHECK: llvm.func @__spv__foo_bar() // CHECK: spv.module @__spv__foo - // CHECK: spv.globalVariable @bar_arg_0 bind(0, 0) : !spv.ptr [0])>, StorageBuffer> + // CHECK: spv.GlobalVariable @bar_arg_0 bind(0, 0) : !spv.ptr [0])>, StorageBuffer> // CHECK: spv.func @__spv__foo_bar // CHECK: spv.EntryPoint "GLCompute" @__spv__foo_bar @@ -22,7 +22,7 @@ // CHECK-NEXT: "llvm.intr.memcpy"(%[[SRC]], %[[DEST]], %[[SIZE]], %{{.*}}) : (!llvm.ptr, !llvm.ptr)>>, i64, i1) -> () spv.module @__spv__foo Logical GLSL450 requires #spv.vce { - spv.globalVariable @bar_arg_0 bind(0, 0) : !spv.ptr [0])>, StorageBuffer> + spv.GlobalVariable @bar_arg_0 bind(0, 0) : !spv.ptr [0])>, StorageBuffer> spv.func @bar() "None" attributes {workgroup_attributions = 0 : i64} { %0 = spv.mlir.addressof @bar_arg_0 : !spv.ptr [0])>, StorageBuffer> spv.Return diff --git a/mlir/test/Conversion/SPIRVToLLVM/memory-ops-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/memory-ops-to-llvm.mlir --- a/mlir/test/Conversion/SPIRVToLLVM/memory-ops-to-llvm.mlir +++ b/mlir/test/Conversion/SPIRVToLLVM/memory-ops-to-llvm.mlir @@ -26,19 +26,19 @@ } //===----------------------------------------------------------------------===// -// spv.globalVariable and spv.mlir.addressof +// spv.GlobalVariable and spv.mlir.addressof //===----------------------------------------------------------------------===// spv.module Logical GLSL450 { // CHECK: llvm.mlir.global external constant @var() : f32 - spv.globalVariable @var : !spv.ptr + spv.GlobalVariable @var : !spv.ptr } spv.module Logical GLSL450 { // CHECK: llvm.mlir.global private @struct() : !llvm.struct)> // CHECK-LABEL: @func // CHECK: llvm.mlir.addressof @struct : !llvm.ptr)>> - spv.globalVariable @struct : !spv.ptr)>, Private> + spv.GlobalVariable @struct : !spv.ptr)>, Private> spv.func @func() "None" { %0 = spv.mlir.addressof @struct : !spv.ptr)>, Private> spv.Return @@ -49,7 +49,7 @@ // CHECK: llvm.mlir.global external @bar_descriptor_set0_binding0() : i32 // CHECK-LABEL: @foo // CHECK: llvm.mlir.addressof @bar_descriptor_set0_binding0 : !llvm.ptr - spv.globalVariable @bar bind(0, 0) : !spv.ptr + spv.GlobalVariable @bar bind(0, 0) : !spv.ptr spv.func @foo() "None" { %0 = spv.mlir.addressof @bar : !spv.ptr spv.Return @@ -60,7 +60,7 @@ // CHECK: llvm.mlir.global external @name_bar_descriptor_set0_binding0() : i32 // CHECK-LABEL: @foo // CHECK: llvm.mlir.addressof @name_bar_descriptor_set0_binding0 : !llvm.ptr - spv.globalVariable @bar bind(0, 0) : !spv.ptr + spv.GlobalVariable @bar bind(0, 0) : !spv.ptr spv.func @foo() "None" { %0 = spv.mlir.addressof @bar : !spv.ptr spv.Return diff --git a/mlir/test/Conversion/StandardToSPIRV/alloc.mlir b/mlir/test/Conversion/StandardToSPIRV/alloc.mlir --- a/mlir/test/Conversion/StandardToSPIRV/alloc.mlir +++ b/mlir/test/Conversion/StandardToSPIRV/alloc.mlir @@ -17,7 +17,7 @@ return } } -// CHECK: spv.globalVariable @[[VAR:.+]] : !spv.ptr)>, Workgroup> +// CHECK: spv.GlobalVariable @[[VAR:.+]] : !spv.ptr)>, Workgroup> // CHECK: func @alloc_dealloc_workgroup_mem // CHECK-NOT: alloc // CHECK: %[[PTR:.+]] = spv.mlir.addressof @[[VAR]] @@ -44,7 +44,7 @@ } } -// CHECK: spv.globalVariable @__workgroup_mem__{{[0-9]+}} +// CHECK: spv.GlobalVariable @__workgroup_mem__{{[0-9]+}} // CHECK-SAME: !spv.ptr)>, Workgroup> // CHECK_LABEL: spv.func @alloc_dealloc_workgroup_mem // CHECK: %[[VAR:.+]] = spv.mlir.addressof @__workgroup_mem__0 @@ -71,9 +71,9 @@ } } -// CHECK-DAG: spv.globalVariable @__workgroup_mem__{{[0-9]+}} +// CHECK-DAG: spv.GlobalVariable @__workgroup_mem__{{[0-9]+}} // CHECK-SAME: !spv.ptr)>, Workgroup> -// CHECK-DAG: spv.globalVariable @__workgroup_mem__{{[0-9]+}} +// CHECK-DAG: spv.GlobalVariable @__workgroup_mem__{{[0-9]+}} // CHECK-SAME: !spv.ptr)>, Workgroup> // CHECK: spv.func @two_allocs() // CHECK: spv.Return @@ -92,9 +92,9 @@ } } -// CHECK-DAG: spv.globalVariable @__workgroup_mem__{{[0-9]+}} +// CHECK-DAG: spv.GlobalVariable @__workgroup_mem__{{[0-9]+}} // CHECK-SAME: !spv.ptr, stride=8>)>, Workgroup> -// CHECK-DAG: spv.globalVariable @__workgroup_mem__{{[0-9]+}} +// CHECK-DAG: spv.GlobalVariable @__workgroup_mem__{{[0-9]+}} // CHECK-SAME: !spv.ptr, stride=16>)>, Workgroup> // CHECK: spv.func @two_allocs_vector() // CHECK: spv.Return diff --git a/mlir/test/Dialect/SPIRV/IR/memory-ops.mlir b/mlir/test/Dialect/SPIRV/IR/memory-ops.mlir --- a/mlir/test/Dialect/SPIRV/IR/memory-ops.mlir +++ b/mlir/test/Dialect/SPIRV/IR/memory-ops.mlir @@ -340,7 +340,7 @@ // ----- spv.module Logical GLSL450 { - spv.globalVariable @var0 : !spv.ptr + spv.GlobalVariable @var0 : !spv.ptr // CHECK_LABEL: @simple_load spv.func @simple_load() -> () "None" { // CHECK: spv.Load "Input" {{%.*}} : f32 @@ -463,7 +463,7 @@ // ----- spv.module Logical GLSL450 { - spv.globalVariable @var0 : !spv.ptr + spv.GlobalVariable @var0 : !spv.ptr spv.func @simple_store(%arg0 : f32) -> () "None" { %0 = spv.mlir.addressof @var0 : !spv.ptr // CHECK: spv.Store "Input" {{%.*}}, {{%.*}} : f32 @@ -496,7 +496,7 @@ // ----- spv.module Logical GLSL450 { - spv.globalVariable @global : !spv.ptr + spv.GlobalVariable @global : !spv.ptr spv.func @variable_init_global_variable() -> () "None" { %0 = spv.mlir.addressof @global : !spv.ptr // CHECK: spv.Variable init({{.*}}) : !spv.ptr, Function> @@ -521,7 +521,7 @@ // ----- func @variable_bind() -> () { - // expected-error @+1 {{cannot have 'descriptor_set' attribute (only allowed in spv.globalVariable)}} + // expected-error @+1 {{cannot have 'descriptor_set' attribute (only allowed in spv.GlobalVariable)}} %0 = spv.Variable bind(1, 2) : !spv.ptr return } @@ -530,7 +530,7 @@ func @variable_init_bind() -> () { %0 = spv.constant 4.0 : f32 - // expected-error @+1 {{cannot have 'binding' attribute (only allowed in spv.globalVariable)}} + // expected-error @+1 {{cannot have 'binding' attribute (only allowed in spv.GlobalVariable)}} %1 = spv.Variable init(%0) {binding = 5 : i32} : !spv.ptr return } @@ -538,7 +538,7 @@ // ----- func @variable_builtin() -> () { - // expected-error @+1 {{cannot have 'built_in' attribute (only allowed in spv.globalVariable)}} + // expected-error @+1 {{cannot have 'built_in' attribute (only allowed in spv.GlobalVariable)}} %1 = spv.Variable built_in("GlobalInvocationID") : !spv.ptr, Function> return } @@ -554,7 +554,7 @@ // ----- func @variable_init(%arg0: f32) -> () { - // expected-error @+1 {{op initializer must be the result of a constant or spv.globalVariable op}} + // expected-error @+1 {{op initializer must be the result of a constant or spv.GlobalVariable op}} %0 = spv.Variable init(%arg0) : !spv.ptr return } @@ -562,7 +562,7 @@ // ----- func @cannot_be_generic_storage_class(%arg0: f32) -> () { - // expected-error @+1 {{op can only be used to model function-level variables. Use spv.globalVariable for module-level variables}} + // expected-error @+1 {{op can only be used to model function-level variables. Use spv.GlobalVariable for module-level variables}} %0 = spv.Variable : !spv.ptr return } diff --git a/mlir/test/Dialect/SPIRV/IR/structure-ops.mlir b/mlir/test/Dialect/SPIRV/IR/structure-ops.mlir --- a/mlir/test/Dialect/SPIRV/IR/structure-ops.mlir +++ b/mlir/test/Dialect/SPIRV/IR/structure-ops.mlir @@ -5,7 +5,7 @@ //===----------------------------------------------------------------------===// spv.module Logical GLSL450 { - spv.globalVariable @var1 : !spv.ptr)>, Input> + spv.GlobalVariable @var1 : !spv.ptr)>, Input> spv.func @access_chain() -> () "None" { %0 = spv.constant 1: i32 // CHECK: [[VAR1:%.*]] = spv.mlir.addressof @var1 : !spv.ptr)>, Input> @@ -19,7 +19,7 @@ // ----- // Allow taking address of global variables in other module-like ops -spv.globalVariable @var : !spv.ptr)>, Input> +spv.GlobalVariable @var : !spv.ptr)>, Input> func @addressof() -> () { // CHECK: spv.mlir.addressof @var %1 = spv.mlir.addressof @var : !spv.ptr)>, Input> @@ -29,9 +29,9 @@ // ----- spv.module Logical GLSL450 { - spv.globalVariable @var1 : !spv.ptr)>, Input> + spv.GlobalVariable @var1 : !spv.ptr)>, Input> spv.func @foo() -> () "None" { - // expected-error @+1 {{expected spv.globalVariable symbol}} + // expected-error @+1 {{expected spv.GlobalVariable symbol}} %0 = spv.mlir.addressof @var2 : !spv.ptr)>, Input> } } @@ -39,7 +39,7 @@ // ----- spv.module Logical GLSL450 { - spv.globalVariable @var1 : !spv.ptr)>, Input> + spv.GlobalVariable @var1 : !spv.ptr)>, Input> spv.func @foo() -> () "None" { // expected-error @+1 {{result type mismatch with the referenced global variable's type}} %0 = spv.mlir.addressof @var1 : !spv.ptr @@ -144,8 +144,8 @@ } spv.module Logical GLSL450 { - spv.globalVariable @var2 : !spv.ptr - spv.globalVariable @var3 : !spv.ptr + spv.GlobalVariable @var2 : !spv.ptr + spv.GlobalVariable @var3 : !spv.ptr spv.func @do_something(%arg0 : !spv.ptr, %arg1 : !spv.ptr) -> () "None" { %1 = spv.Load "Input" %arg0 : f32 spv.Store "Output" %arg1, %1 : f32 @@ -298,93 +298,93 @@ // ----- //===----------------------------------------------------------------------===// -// spv.globalVariable +// spv.GlobalVariable //===----------------------------------------------------------------------===// spv.module Logical GLSL450 { - // CHECK: spv.globalVariable @var0 : !spv.ptr - spv.globalVariable @var0 : !spv.ptr + // CHECK: spv.GlobalVariable @var0 : !spv.ptr + spv.GlobalVariable @var0 : !spv.ptr } // TODO: Fix test case after initialization with normal constant is addressed // spv.module Logical GLSL450 { // %0 = spv.constant 4.0 : f32 // // CHECK1: spv.Variable init(%0) : !spv.ptr -// spv.globalVariable @var1 init(%0) : !spv.ptr +// spv.GlobalVariable @var1 init(%0) : !spv.ptr // } // ----- spv.module Logical GLSL450 { spv.specConstant @sc = 4.0 : f32 - // CHECK: spv.globalVariable @var initializer(@sc) : !spv.ptr - spv.globalVariable @var initializer(@sc) : !spv.ptr + // CHECK: spv.GlobalVariable @var initializer(@sc) : !spv.ptr + spv.GlobalVariable @var initializer(@sc) : !spv.ptr } // ----- // Allow initializers coming from other module-like ops spv.specConstant @sc = 4.0 : f32 -// CHECK: spv.globalVariable @var initializer(@sc) -spv.globalVariable @var initializer(@sc) : !spv.ptr +// CHECK: spv.GlobalVariable @var initializer(@sc) +spv.GlobalVariable @var initializer(@sc) : !spv.ptr // ----- spv.module Logical GLSL450 { - // CHECK: spv.globalVariable @var0 bind(1, 2) : !spv.ptr - spv.globalVariable @var0 bind(1, 2) : !spv.ptr + // CHECK: spv.GlobalVariable @var0 bind(1, 2) : !spv.ptr + spv.GlobalVariable @var0 bind(1, 2) : !spv.ptr } // TODO: Fix test case after initialization with constant is addressed // spv.module Logical GLSL450 { // %0 = spv.constant 4.0 : f32 -// // CHECK1: spv.globalVariable @var1 initializer(%0) {binding = 5 : i32} : !spv.ptr -// spv.globalVariable @var1 initializer(%0) {binding = 5 : i32} : !spv.ptr +// // CHECK1: spv.GlobalVariable @var1 initializer(%0) {binding = 5 : i32} : !spv.ptr +// spv.GlobalVariable @var1 initializer(%0) {binding = 5 : i32} : !spv.ptr // } // ----- spv.module Logical GLSL450 { - // CHECK: spv.globalVariable @var1 built_in("GlobalInvocationID") : !spv.ptr, Input> - spv.globalVariable @var1 built_in("GlobalInvocationID") : !spv.ptr, Input> - // CHECK: spv.globalVariable @var2 built_in("GlobalInvocationID") : !spv.ptr, Input> - spv.globalVariable @var2 {built_in = "GlobalInvocationID"} : !spv.ptr, Input> + // CHECK: spv.GlobalVariable @var1 built_in("GlobalInvocationID") : !spv.ptr, Input> + spv.GlobalVariable @var1 built_in("GlobalInvocationID") : !spv.ptr, Input> + // CHECK: spv.GlobalVariable @var2 built_in("GlobalInvocationID") : !spv.ptr, Input> + spv.GlobalVariable @var2 {built_in = "GlobalInvocationID"} : !spv.ptr, Input> } // ----- // Allow in other module-like ops module { - // CHECK: spv.globalVariable - spv.globalVariable @var0 : !spv.ptr + // CHECK: spv.GlobalVariable + spv.GlobalVariable @var0 : !spv.ptr } // ----- spv.module Logical GLSL450 { // expected-error @+1 {{expected spv.ptr type}} - spv.globalVariable @var0 : f32 + spv.GlobalVariable @var0 : f32 } // ----- spv.module Logical GLSL450 { - // expected-error @+1 {{op initializer must be result of a spv.specConstant or spv.globalVariable op}} - spv.globalVariable @var0 initializer(@var1) : !spv.ptr + // expected-error @+1 {{op initializer must be result of a spv.specConstant or spv.GlobalVariable op}} + spv.GlobalVariable @var0 initializer(@var1) : !spv.ptr } // ----- spv.module Logical GLSL450 { // expected-error @+1 {{storage class cannot be 'Generic'}} - spv.globalVariable @var0 : !spv.ptr + spv.GlobalVariable @var0 : !spv.ptr } // ----- spv.module Logical GLSL450 { // expected-error @+1 {{storage class cannot be 'Function'}} - spv.globalVariable @var0 : !spv.ptr + spv.GlobalVariable @var0 : !spv.ptr } // ----- @@ -392,7 +392,7 @@ spv.module Logical GLSL450 { spv.func @foo() "None" { // expected-error @+1 {{op must appear in a module-like op's block}} - spv.globalVariable @var0 : !spv.ptr + spv.GlobalVariable @var0 : !spv.ptr spv.Return } } diff --git a/mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/conflict-resolution.mlir b/mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/conflict-resolution.mlir --- a/mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/conflict-resolution.mlir +++ b/mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/conflict-resolution.mlir @@ -240,7 +240,7 @@ // CHECK-NEXT: spv.ReturnValue // CHECK-NEXT: } -// CHECK-NEXT: spv.globalVariable @foo_1 +// CHECK-NEXT: spv.GlobalVariable @foo_1 // CHECK-NEXT: } module { @@ -251,7 +251,7 @@ } spv.module Logical GLSL450 { - spv.globalVariable @foo bind(1, 0) : !spv.ptr + spv.GlobalVariable @foo bind(1, 0) : !spv.ptr } } @@ -266,7 +266,7 @@ // CHECK-NEXT: spv.ReturnValue // CHECK-NEXT: } -// CHECK-NEXT: spv.globalVariable @foo_1 +// CHECK-NEXT: spv.GlobalVariable @foo_1 // CHECK-NEXT: spv.func @bar // CHECK-NEXT: spv.mlir.addressof @foo_1 // CHECK-NEXT: spv.Load @@ -282,7 +282,7 @@ } spv.module Logical GLSL450 { - spv.globalVariable @foo bind(1, 0) : !spv.ptr + spv.GlobalVariable @foo bind(1, 0) : !spv.ptr spv.func @bar() -> f32 "None" { %0 = spv.mlir.addressof @foo : !spv.ptr @@ -299,7 +299,7 @@ // CHECK: module { // CHECK-NEXT: spv.module Logical GLSL450 { -// CHECK-NEXT: spv.globalVariable @foo_1 +// CHECK-NEXT: spv.GlobalVariable @foo_1 // CHECK-NEXT: spv.func @bar // CHECK-NEXT: spv.mlir.addressof @foo_1 // CHECK-NEXT: spv.Load @@ -313,7 +313,7 @@ module { spv.module Logical GLSL450 { - spv.globalVariable @foo bind(1, 0) : !spv.ptr + spv.GlobalVariable @foo bind(1, 0) : !spv.ptr spv.func @bar() -> f32 "None" { %0 = spv.mlir.addressof @foo : !spv.ptr @@ -582,18 +582,18 @@ // CHECK: module { // CHECK-NEXT: spv.module Logical GLSL450 { -// CHECK-NEXT: spv.globalVariable @foo_1 bind(1, 0) +// CHECK-NEXT: spv.GlobalVariable @foo_1 bind(1, 0) -// CHECK-NEXT: spv.globalVariable @foo bind(2, 0) +// CHECK-NEXT: spv.GlobalVariable @foo bind(2, 0) // CHECK-NEXT: } module { spv.module Logical GLSL450 { - spv.globalVariable @foo bind(1, 0) : !spv.ptr + spv.GlobalVariable @foo bind(1, 0) : !spv.ptr } spv.module Logical GLSL450 { - spv.globalVariable @foo bind(2, 0) : !spv.ptr + spv.GlobalVariable @foo bind(2, 0) : !spv.ptr } } @@ -601,18 +601,18 @@ // CHECK: module { // CHECK-NEXT: spv.module Logical GLSL450 { -// CHECK-NEXT: spv.globalVariable @foo_1 built_in("GlobalInvocationId") +// CHECK-NEXT: spv.GlobalVariable @foo_1 built_in("GlobalInvocationId") -// CHECK-NEXT: spv.globalVariable @foo built_in("LocalInvocationId") +// CHECK-NEXT: spv.GlobalVariable @foo built_in("LocalInvocationId") // CHECK-NEXT: } module { spv.module Logical GLSL450 { - spv.globalVariable @foo built_in("GlobalInvocationId") : !spv.ptr, Input> + spv.GlobalVariable @foo built_in("GlobalInvocationId") : !spv.ptr, Input> } spv.module Logical GLSL450 { - spv.globalVariable @foo built_in("LocalInvocationId") : !spv.ptr, Input> + spv.GlobalVariable @foo built_in("LocalInvocationId") : !spv.ptr, Input> } } @@ -622,14 +622,14 @@ // CHECK: module { // CHECK-NEXT: spv.module Logical GLSL450 { -// CHECK-NEXT: spv.globalVariable @foo_1 +// CHECK-NEXT: spv.GlobalVariable @foo_1 // CHECK-NEXT: spv.specConstant @foo // CHECK-NEXT: } module { spv.module Logical GLSL450 { - spv.globalVariable @foo bind(1, 0) : !spv.ptr + spv.GlobalVariable @foo bind(1, 0) : !spv.ptr } spv.module Logical GLSL450 { @@ -645,7 +645,7 @@ // CHECK-NEXT: spv.module Logical GLSL450 { // CHECK-NEXT: spv.specConstant @foo_1 -// CHECK-NEXT: spv.globalVariable @foo +// CHECK-NEXT: spv.GlobalVariable @foo // CHECK-NEXT: } module { @@ -654,7 +654,7 @@ } spv.module Logical GLSL450 { - spv.globalVariable @foo bind(1, 0) : !spv.ptr + spv.GlobalVariable @foo bind(1, 0) : !spv.ptr } } @@ -664,7 +664,7 @@ // CHECK: module { // CHECK-NEXT: spv.module Logical GLSL450 { -// CHECK-NEXT: spv.globalVariable @foo_1 +// CHECK-NEXT: spv.GlobalVariable @foo_1 // CHECK-NEXT: spv.specConstant @bar // CHECK-NEXT: spv.specConstantComposite @foo (@bar, @bar) @@ -672,7 +672,7 @@ module { spv.module Logical GLSL450 { - spv.globalVariable @foo bind(1, 0) : !spv.ptr + spv.GlobalVariable @foo bind(1, 0) : !spv.ptr } spv.module Logical GLSL450 { @@ -690,7 +690,7 @@ // CHECK-NEXT: spv.specConstant @bar // CHECK-NEXT: spv.specConstantComposite @foo_1 (@bar, @bar) -// CHECK-NEXT: spv.globalVariable @foo +// CHECK-NEXT: spv.GlobalVariable @foo // CHECK-NEXT: } module { @@ -700,6 +700,6 @@ } spv.module Logical GLSL450 { - spv.globalVariable @foo bind(1, 0) : !spv.ptr + spv.GlobalVariable @foo bind(1, 0) : !spv.ptr } } diff --git a/mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/deduplication.mlir b/mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/deduplication.mlir --- a/mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/deduplication.mlir +++ b/mlir/test/Dialect/SPIRV/Linking/ModuleCombiner/deduplication.mlir @@ -4,7 +4,7 @@ // CHECK: module { // CHECK-NEXT: spv.module Logical GLSL450 { -// CHECK-NEXT: spv.globalVariable @foo +// CHECK-NEXT: spv.GlobalVariable @foo // CHECK-NEXT: spv.func @use_foo // CHECK-NEXT: spv.mlir.addressof @foo @@ -23,7 +23,7 @@ module { spv.module Logical GLSL450 { - spv.globalVariable @foo bind(1, 0) : !spv.ptr + spv.GlobalVariable @foo bind(1, 0) : !spv.ptr spv.func @use_foo() -> f32 "None" { %0 = spv.mlir.addressof @foo : !spv.ptr @@ -33,7 +33,7 @@ } spv.module Logical GLSL450 { - spv.globalVariable @bar bind(1, 0) : !spv.ptr + spv.GlobalVariable @bar bind(1, 0) : !spv.ptr spv.func @use_bar() -> f32 "None" { %0 = spv.mlir.addressof @bar : !spv.ptr @@ -50,9 +50,9 @@ // CHECK: module { // CHECK-NEXT: spv.module Logical GLSL450 { -// CHECK-NEXT: spv.globalVariable @foo bind(1, 0) +// CHECK-NEXT: spv.GlobalVariable @foo bind(1, 0) -// CHECK-NEXT: spv.globalVariable @bar bind(1, 0) +// CHECK-NEXT: spv.GlobalVariable @bar bind(1, 0) // CHECK-NEXT: spv.func @use_bar // CHECK-NEXT: spv.mlir.addressof @bar @@ -64,11 +64,11 @@ module { spv.module Logical GLSL450 { - spv.globalVariable @foo bind(1, 0) : !spv.ptr + spv.GlobalVariable @foo bind(1, 0) : !spv.ptr } spv.module Logical GLSL450 { - spv.globalVariable @bar bind(1, 0) : !spv.ptr + spv.GlobalVariable @bar bind(1, 0) : !spv.ptr spv.func @use_bar() -> f32 "None" { %0 = spv.mlir.addressof @bar : !spv.ptr @@ -84,7 +84,7 @@ // CHECK: module { // CHECK-NEXT: spv.module Logical GLSL450 { -// CHECK-NEXT: spv.globalVariable @foo built_in("GlobalInvocationId") +// CHECK-NEXT: spv.GlobalVariable @foo built_in("GlobalInvocationId") // CHECK-NEXT: spv.func @use_bar // CHECK-NEXT: spv.mlir.addressof @foo // CHECK-NEXT: spv.Load @@ -95,11 +95,11 @@ module { spv.module Logical GLSL450 { - spv.globalVariable @foo built_in("GlobalInvocationId") : !spv.ptr, Input> + spv.GlobalVariable @foo built_in("GlobalInvocationId") : !spv.ptr, Input> } spv.module Logical GLSL450 { - spv.globalVariable @bar built_in("GlobalInvocationId") : !spv.ptr, Input> + spv.GlobalVariable @bar built_in("GlobalInvocationId") : !spv.ptr, Input> spv.func @use_bar() -> vector<3xi32> "None" { %0 = spv.mlir.addressof @bar : !spv.ptr, Input> diff --git a/mlir/test/Dialect/SPIRV/Transforms/abi-interface.mlir b/mlir/test/Dialect/SPIRV/Transforms/abi-interface.mlir --- a/mlir/test/Dialect/SPIRV/Transforms/abi-interface.mlir +++ b/mlir/test/Dialect/SPIRV/Transforms/abi-interface.mlir @@ -7,8 +7,8 @@ // CHECK-LABEL: spv.module spv.module Logical GLSL450 { - // CHECK-DAG: spv.globalVariable [[VAR0:@.*]] bind(0, 0) : !spv.ptr, StorageBuffer> - // CHECK-DAG: spv.globalVariable [[VAR1:@.*]] bind(0, 1) : !spv.ptr [0])>, StorageBuffer> + // CHECK-DAG: spv.GlobalVariable [[VAR0:@.*]] bind(0, 0) : !spv.ptr, StorageBuffer> + // CHECK-DAG: spv.GlobalVariable [[VAR1:@.*]] bind(0, 1) : !spv.ptr [0])>, StorageBuffer> // CHECK: spv.func [[FN:@.*]]() spv.func @kernel( %arg0: f32 diff --git a/mlir/test/Dialect/SPIRV/Transforms/abi-load-store.mlir b/mlir/test/Dialect/SPIRV/Transforms/abi-load-store.mlir --- a/mlir/test/Dialect/SPIRV/Transforms/abi-load-store.mlir +++ b/mlir/test/Dialect/SPIRV/Transforms/abi-load-store.mlir @@ -7,21 +7,21 @@ // CHECK-LABEL: spv.module spv.module Logical GLSL450 { - // CHECK-DAG: spv.globalVariable [[WORKGROUPSIZE:@.*]] built_in("WorkgroupSize") - spv.globalVariable @__builtin_var_WorkgroupSize__ built_in("WorkgroupSize") : !spv.ptr, Input> - // CHECK-DAG: spv.globalVariable [[NUMWORKGROUPS:@.*]] built_in("NumWorkgroups") - spv.globalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr, Input> - // CHECK-DAG: spv.globalVariable [[LOCALINVOCATIONID:@.*]] built_in("LocalInvocationId") - spv.globalVariable @__builtin_var_LocalInvocationId__ built_in("LocalInvocationId") : !spv.ptr, Input> - // CHECK-DAG: spv.globalVariable [[WORKGROUPID:@.*]] built_in("WorkgroupId") - spv.globalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr, Input> - // CHECK-DAG: spv.globalVariable [[VAR0:@.*]] bind(0, 0) : !spv.ptr, stride=16> [0])>, StorageBuffer> - // CHECK-DAG: spv.globalVariable [[VAR1:@.*]] bind(0, 1) : !spv.ptr, stride=16> [0])>, StorageBuffer> - // CHECK-DAG: spv.globalVariable [[VAR2:@.*]] bind(0, 2) : !spv.ptr, stride=16> [0])>, StorageBuffer> - // CHECK-DAG: spv.globalVariable [[VAR3:@.*]] bind(0, 3) : !spv.ptr, StorageBuffer> - // CHECK-DAG: spv.globalVariable [[VAR4:@.*]] bind(0, 4) : !spv.ptr, StorageBuffer> - // CHECK-DAG: spv.globalVariable [[VAR5:@.*]] bind(0, 5) : !spv.ptr, StorageBuffer> - // CHECK-DAG: spv.globalVariable [[VAR6:@.*]] bind(0, 6) : !spv.ptr, StorageBuffer> + // CHECK-DAG: spv.GlobalVariable [[WORKGROUPSIZE:@.*]] built_in("WorkgroupSize") + spv.GlobalVariable @__builtin_var_WorkgroupSize__ built_in("WorkgroupSize") : !spv.ptr, Input> + // CHECK-DAG: spv.GlobalVariable [[NUMWORKGROUPS:@.*]] built_in("NumWorkgroups") + spv.GlobalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr, Input> + // CHECK-DAG: spv.GlobalVariable [[LOCALINVOCATIONID:@.*]] built_in("LocalInvocationId") + spv.GlobalVariable @__builtin_var_LocalInvocationId__ built_in("LocalInvocationId") : !spv.ptr, Input> + // CHECK-DAG: spv.GlobalVariable [[WORKGROUPID:@.*]] built_in("WorkgroupId") + spv.GlobalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr, Input> + // CHECK-DAG: spv.GlobalVariable [[VAR0:@.*]] bind(0, 0) : !spv.ptr, stride=16> [0])>, StorageBuffer> + // CHECK-DAG: spv.GlobalVariable [[VAR1:@.*]] bind(0, 1) : !spv.ptr, stride=16> [0])>, StorageBuffer> + // CHECK-DAG: spv.GlobalVariable [[VAR2:@.*]] bind(0, 2) : !spv.ptr, stride=16> [0])>, StorageBuffer> + // CHECK-DAG: spv.GlobalVariable [[VAR3:@.*]] bind(0, 3) : !spv.ptr, StorageBuffer> + // CHECK-DAG: spv.GlobalVariable [[VAR4:@.*]] bind(0, 4) : !spv.ptr, StorageBuffer> + // CHECK-DAG: spv.GlobalVariable [[VAR5:@.*]] bind(0, 5) : !spv.ptr, StorageBuffer> + // CHECK-DAG: spv.GlobalVariable [[VAR6:@.*]] bind(0, 6) : !spv.ptr, StorageBuffer> // CHECK: spv.func [[FN:@.*]]() spv.func @load_store_kernel( %arg0: !spv.ptr>)>, StorageBuffer> diff --git a/mlir/test/Dialect/SPIRV/Transforms/inlining.mlir b/mlir/test/Dialect/SPIRV/Transforms/inlining.mlir --- a/mlir/test/Dialect/SPIRV/Transforms/inlining.mlir +++ b/mlir/test/Dialect/SPIRV/Transforms/inlining.mlir @@ -33,7 +33,7 @@ // ----- spv.module Logical GLSL450 { - spv.globalVariable @data bind(0, 0) : !spv.ptr [0])>, StorageBuffer> + spv.GlobalVariable @data bind(0, 0) : !spv.ptr [0])>, StorageBuffer> spv.func @callee() "None" { %0 = spv.mlir.addressof @data : !spv.ptr [0])>, StorageBuffer> %1 = spv.constant 0: i32 @@ -184,8 +184,8 @@ // ----- spv.module Logical GLSL450 { - spv.globalVariable @arg_0 bind(0, 0) : !spv.ptr, StorageBuffer> - spv.globalVariable @arg_1 bind(0, 1) : !spv.ptr, StorageBuffer> + spv.GlobalVariable @arg_0 bind(0, 0) : !spv.ptr, StorageBuffer> + spv.GlobalVariable @arg_1 bind(0, 1) : !spv.ptr, StorageBuffer> // CHECK: @inline_into_selection_region spv.func @inline_into_selection_region() "None" { diff --git a/mlir/test/Dialect/SPIRV/Transforms/layout-decoration.mlir b/mlir/test/Dialect/SPIRV/Transforms/layout-decoration.mlir --- a/mlir/test/Dialect/SPIRV/Transforms/layout-decoration.mlir +++ b/mlir/test/Dialect/SPIRV/Transforms/layout-decoration.mlir @@ -1,23 +1,23 @@ // RUN: mlir-opt -decorate-spirv-composite-type-layout -split-input-file -verify-diagnostics %s -o - | FileCheck %s spv.module Logical GLSL450 { - // CHECK: spv.globalVariable @var0 bind(0, 1) : !spv.ptr [4], f32 [12])>, Uniform> - spv.globalVariable @var0 bind(0,1) : !spv.ptr, f32)>, Uniform> + // CHECK: spv.GlobalVariable @var0 bind(0, 1) : !spv.ptr [4], f32 [12])>, Uniform> + spv.GlobalVariable @var0 bind(0,1) : !spv.ptr, f32)>, Uniform> - // CHECK: spv.globalVariable @var1 bind(0, 2) : !spv.ptr [0], f32 [256])>, StorageBuffer> - spv.globalVariable @var1 bind(0,2) : !spv.ptr, f32)>, StorageBuffer> + // CHECK: spv.GlobalVariable @var1 bind(0, 2) : !spv.ptr [0], f32 [256])>, StorageBuffer> + spv.GlobalVariable @var1 bind(0,2) : !spv.ptr, f32)>, StorageBuffer> - // CHECK: spv.globalVariable @var2 bind(1, 0) : !spv.ptr [0], f32 [256])> [0], i32 [260])>, StorageBuffer> - spv.globalVariable @var2 bind(1,0) : !spv.ptr, f32)>, i32)>, StorageBuffer> + // CHECK: spv.GlobalVariable @var2 bind(1, 0) : !spv.ptr [0], f32 [256])> [0], i32 [260])>, StorageBuffer> + spv.GlobalVariable @var2 bind(1,0) : !spv.ptr, f32)>, i32)>, StorageBuffer> - // CHECK: spv.globalVariable @var3 : !spv.ptr [8])>, stride=72> [0], f32 [1152])>, StorageBuffer> - spv.globalVariable @var3 : !spv.ptr)>>, f32)>, StorageBuffer> + // CHECK: spv.GlobalVariable @var3 : !spv.ptr [8])>, stride=72> [0], f32 [1152])>, StorageBuffer> + spv.GlobalVariable @var3 : !spv.ptr)>>, f32)>, StorageBuffer> - // CHECK: spv.globalVariable @var4 bind(1, 2) : !spv.ptr [0], f32 [16], i1 [20])> [0], i1 [24])>, StorageBuffer> - spv.globalVariable @var4 bind(1,2) : !spv.ptr, f32, i1)>, i1)>, StorageBuffer> + // CHECK: spv.GlobalVariable @var4 bind(1, 2) : !spv.ptr [0], f32 [16], i1 [20])> [0], i1 [24])>, StorageBuffer> + spv.GlobalVariable @var4 bind(1,2) : !spv.ptr, f32, i1)>, i1)>, StorageBuffer> - // CHECK: spv.globalVariable @var5 bind(1, 3) : !spv.ptr [0])>, StorageBuffer> - spv.globalVariable @var5 bind(1,3) : !spv.ptr)>, StorageBuffer> + // CHECK: spv.GlobalVariable @var5 bind(1, 3) : !spv.ptr [0])>, StorageBuffer> + spv.GlobalVariable @var5 bind(1,3) : !spv.ptr)>, StorageBuffer> spv.func @kernel() -> () "None" { %c0 = spv.constant 0 : i32 @@ -32,68 +32,68 @@ // ----- spv.module Logical GLSL450 { - // CHECK: spv.globalVariable @var0 : !spv.ptr [0], i1 [16])> [0], i1 [24])> [0], i1 [32])> [0], i1 [40])>, Uniform> - spv.globalVariable @var0 : !spv.ptr, i1)>, i1)>, i1)>, i1)>, Uniform> + // CHECK: spv.GlobalVariable @var0 : !spv.ptr [0], i1 [16])> [0], i1 [24])> [0], i1 [32])> [0], i1 [40])>, Uniform> + spv.GlobalVariable @var0 : !spv.ptr, i1)>, i1)>, i1)>, i1)>, Uniform> - // CHECK: spv.globalVariable @var1 : !spv.ptr [8], f32 [24])> [0], f32 [32])>, Uniform> - spv.globalVariable @var1 : !spv.ptr, f32)>, f32)>, Uniform> + // CHECK: spv.GlobalVariable @var1 : !spv.ptr [8], f32 [24])> [0], f32 [32])>, Uniform> + spv.GlobalVariable @var1 : !spv.ptr, f32)>, f32)>, Uniform> - // CHECK: spv.globalVariable @var2 : !spv.ptr, stride=128> [8])> [8], f32 [2064])> [0], f32 [2072])>, Uniform> - spv.globalVariable @var2 : !spv.ptr>)>, f32)>, f32)>, Uniform> + // CHECK: spv.GlobalVariable @var2 : !spv.ptr, stride=128> [8])> [8], f32 [2064])> [0], f32 [2072])>, Uniform> + spv.GlobalVariable @var2 : !spv.ptr>)>, f32)>, f32)>, Uniform> - // CHECK: spv.globalVariable @var3 : !spv.ptr [0], i1 [512])> [0], i1 [520])>, Uniform> - spv.globalVariable @var3 : !spv.ptr, i1)>, i1)>, Uniform> + // CHECK: spv.GlobalVariable @var3 : !spv.ptr [0], i1 [512])> [0], i1 [520])>, Uniform> + spv.GlobalVariable @var3 : !spv.ptr, i1)>, i1)>, Uniform> - // CHECK: spv.globalVariable @var4 : !spv.ptr [8], i1 [24])>, Uniform> - spv.globalVariable @var4 : !spv.ptr, i1)>, Uniform> + // CHECK: spv.GlobalVariable @var4 : !spv.ptr [8], i1 [24])>, Uniform> + spv.GlobalVariable @var4 : !spv.ptr, i1)>, Uniform> - // CHECK: spv.globalVariable @var5 : !spv.ptr [8], i1 [24])>, Uniform> - spv.globalVariable @var5 : !spv.ptr, i1)>, Uniform> + // CHECK: spv.GlobalVariable @var5 : !spv.ptr [8], i1 [24])>, Uniform> + spv.GlobalVariable @var5 : !spv.ptr, i1)>, Uniform> - // CHECK: spv.globalVariable @var6 : !spv.ptr [8], i1 [24])>, Uniform> - spv.globalVariable @var6 : !spv.ptr, i1)>, Uniform> + // CHECK: spv.GlobalVariable @var6 : !spv.ptr [8], i1 [24])>, Uniform> + spv.GlobalVariable @var6 : !spv.ptr, i1)>, Uniform> - // CHECK: spv.globalVariable @var7 : !spv.ptr [0], i1 [16])> [8], i1 [32])>, Uniform> - spv.globalVariable @var7 : !spv.ptr, i1)>, i1)>, Uniform> + // CHECK: spv.GlobalVariable @var7 : !spv.ptr [0], i1 [16])> [8], i1 [32])>, Uniform> + spv.GlobalVariable @var7 : !spv.ptr, i1)>, i1)>, Uniform> } // ----- spv.module Logical GLSL450 { - // CHECK: spv.globalVariable @var0 : !spv.ptr [0], f32 [8])>, StorageBuffer> - spv.globalVariable @var0 : !spv.ptr, f32)>, StorageBuffer> + // CHECK: spv.GlobalVariable @var0 : !spv.ptr [0], f32 [8])>, StorageBuffer> + spv.GlobalVariable @var0 : !spv.ptr, f32)>, StorageBuffer> - // CHECK: spv.globalVariable @var1 : !spv.ptr [0], f32 [12])>, StorageBuffer> - spv.globalVariable @var1 : !spv.ptr, f32)>, StorageBuffer> + // CHECK: spv.GlobalVariable @var1 : !spv.ptr [0], f32 [12])>, StorageBuffer> + spv.GlobalVariable @var1 : !spv.ptr, f32)>, StorageBuffer> - // CHECK: spv.globalVariable @var2 : !spv.ptr [0], f32 [16])>, StorageBuffer> - spv.globalVariable @var2 : !spv.ptr, f32)>, StorageBuffer> + // CHECK: spv.GlobalVariable @var2 : !spv.ptr [0], f32 [16])>, StorageBuffer> + spv.GlobalVariable @var2 : !spv.ptr, f32)>, StorageBuffer> } // ----- spv.module Logical GLSL450 { - // CHECK: spv.globalVariable @emptyStructAsMember : !spv.ptr [0])>, StorageBuffer> - spv.globalVariable @emptyStructAsMember : !spv.ptr)>, StorageBuffer> + // CHECK: spv.GlobalVariable @emptyStructAsMember : !spv.ptr [0])>, StorageBuffer> + spv.GlobalVariable @emptyStructAsMember : !spv.ptr)>, StorageBuffer> - // CHECK: spv.globalVariable @arrayType : !spv.ptr>, StorageBuffer> - spv.globalVariable @arrayType : !spv.ptr>, StorageBuffer> + // CHECK: spv.GlobalVariable @arrayType : !spv.ptr>, StorageBuffer> + spv.GlobalVariable @arrayType : !spv.ptr>, StorageBuffer> - // CHECK: spv.globalVariable @InputStorage : !spv.ptr)>, Input> - spv.globalVariable @InputStorage : !spv.ptr)>, Input> + // CHECK: spv.GlobalVariable @InputStorage : !spv.ptr)>, Input> + spv.GlobalVariable @InputStorage : !spv.ptr)>, Input> - // CHECK: spv.globalVariable @customLayout : !spv.ptr, Uniform> - spv.globalVariable @customLayout : !spv.ptr, Uniform> + // CHECK: spv.GlobalVariable @customLayout : !spv.ptr, Uniform> + spv.GlobalVariable @customLayout : !spv.ptr, Uniform> - // CHECK: spv.globalVariable @emptyStruct : !spv.ptr, Uniform> - spv.globalVariable @emptyStruct : !spv.ptr, Uniform> + // CHECK: spv.GlobalVariable @emptyStruct : !spv.ptr, Uniform> + spv.GlobalVariable @emptyStruct : !spv.ptr, Uniform> } // ----- spv.module Logical GLSL450 { - // CHECK: spv.globalVariable @var0 : !spv.ptr, PushConstant> - spv.globalVariable @var0 : !spv.ptr, PushConstant> - // CHECK: spv.globalVariable @var1 : !spv.ptr, PhysicalStorageBuffer> - spv.globalVariable @var1 : !spv.ptr, PhysicalStorageBuffer> + // CHECK: spv.GlobalVariable @var0 : !spv.ptr, PushConstant> + spv.GlobalVariable @var0 : !spv.ptr, PushConstant> + // CHECK: spv.GlobalVariable @var1 : !spv.ptr, PhysicalStorageBuffer> + spv.GlobalVariable @var1 : !spv.ptr, PhysicalStorageBuffer> } diff --git a/mlir/test/Dialect/SPIRV/Transforms/vce-deduction.mlir b/mlir/test/Dialect/SPIRV/Transforms/vce-deduction.mlir --- a/mlir/test/Dialect/SPIRV/Transforms/vce-deduction.mlir +++ b/mlir/test/Dialect/SPIRV/Transforms/vce-deduction.mlir @@ -192,6 +192,6 @@ #spv.vce, {}> } { - spv.globalVariable @data : !spv.ptr, Uniform> - spv.globalVariable @img : !spv.ptr, UniformConstant> + spv.GlobalVariable @data : !spv.ptr, Uniform> + spv.GlobalVariable @img : !spv.ptr, UniformConstant> } diff --git a/mlir/test/Target/SPIRV/array.mlir b/mlir/test/Target/SPIRV/array.mlir --- a/mlir/test/Target/SPIRV/array.mlir +++ b/mlir/test/Target/SPIRV/array.mlir @@ -11,8 +11,8 @@ // ----- spv.module Logical GLSL450 requires #spv.vce { - // CHECK: spv.globalVariable {{@.*}} : !spv.ptr, StorageBuffer> - spv.globalVariable @var0 : !spv.ptr, StorageBuffer> - // CHECK: spv.globalVariable {{@.*}} : !spv.ptr>, Input> - spv.globalVariable @var1 : !spv.ptr>, Input> + // CHECK: spv.GlobalVariable {{@.*}} : !spv.ptr, StorageBuffer> + spv.GlobalVariable @var0 : !spv.ptr, StorageBuffer> + // CHECK: spv.GlobalVariable {{@.*}} : !spv.ptr>, Input> + spv.GlobalVariable @var1 : !spv.ptr>, Input> } diff --git a/mlir/test/Target/SPIRV/debug.mlir b/mlir/test/Target/SPIRV/debug.mlir --- a/mlir/test/Target/SPIRV/debug.mlir +++ b/mlir/test/Target/SPIRV/debug.mlir @@ -2,7 +2,7 @@ spv.module Logical GLSL450 requires #spv.vce { // CHECK: loc({{".*debug.mlir"}}:5:3) - spv.globalVariable @var0 bind(0, 1) : !spv.ptr + spv.GlobalVariable @var0 bind(0, 1) : !spv.ptr spv.func @arithmetic(%arg0 : vector<4xf32>, %arg1 : vector<4xf32>) "None" { // CHECK: loc({{".*debug.mlir"}}:8:10) %0 = spv.FAdd %arg0, %arg1 : vector<4xf32> diff --git a/mlir/test/Target/SPIRV/decorations.mlir b/mlir/test/Target/SPIRV/decorations.mlir --- a/mlir/test/Target/SPIRV/decorations.mlir +++ b/mlir/test/Target/SPIRV/decorations.mlir @@ -2,21 +2,21 @@ spv.module Logical GLSL450 requires #spv.vce { // CHECK: location = 0 : i32 - spv.globalVariable @var {location = 0 : i32} : !spv.ptr, Input> + spv.GlobalVariable @var {location = 0 : i32} : !spv.ptr, Input> } // ----- spv.module Logical GLSL450 requires #spv.vce { // CHECK: no_perspective - spv.globalVariable @var {no_perspective} : !spv.ptr, Input> + spv.GlobalVariable @var {no_perspective} : !spv.ptr, Input> } // ----- spv.module Logical GLSL450 requires #spv.vce { // CHECK: flat - spv.globalVariable @var {flat} : !spv.ptr + spv.GlobalVariable @var {flat} : !spv.ptr } // ----- @@ -24,28 +24,28 @@ spv.module Logical GLSL450 requires #spv.vce { // CHECK: aliased // CHECK: aliased - spv.globalVariable @var1 bind(0, 0) {aliased} : !spv.ptr[0])>, StorageBuffer> - spv.globalVariable @var2 bind(0, 0) {aliased} : !spv.ptr[0])>, StorageBuffer> + spv.GlobalVariable @var1 bind(0, 0) {aliased} : !spv.ptr[0])>, StorageBuffer> + spv.GlobalVariable @var2 bind(0, 0) {aliased} : !spv.ptr[0])>, StorageBuffer> } // ----- spv.module Logical GLSL450 requires #spv.vce { // CHECK: non_readable - spv.globalVariable @var bind(0, 0) {non_readable} : !spv.ptr[0])>, StorageBuffer> + spv.GlobalVariable @var bind(0, 0) {non_readable} : !spv.ptr[0])>, StorageBuffer> } // ----- spv.module Logical GLSL450 requires #spv.vce { // CHECK: non_writable - spv.globalVariable @var bind(0, 0) {non_writable} : !spv.ptr[0])>, StorageBuffer> + spv.GlobalVariable @var bind(0, 0) {non_writable} : !spv.ptr[0])>, StorageBuffer> } // ----- spv.module Logical GLSL450 requires #spv.vce { // CHECK: restrict - spv.globalVariable @var bind(0, 0) {restrict} : !spv.ptr[0])>, StorageBuffer> + spv.GlobalVariable @var bind(0, 0) {restrict} : !spv.ptr[0])>, StorageBuffer> } diff --git a/mlir/test/Target/SPIRV/entry-point.mlir b/mlir/test/Target/SPIRV/entry-point.mlir --- a/mlir/test/Target/SPIRV/entry-point.mlir +++ b/mlir/test/Target/SPIRV/entry-point.mlir @@ -13,12 +13,12 @@ // ----- spv.module Logical GLSL450 requires #spv.vce { - // CHECK: spv.globalVariable @var2 : !spv.ptr - // CHECK-NEXT: spv.globalVariable @var3 : !spv.ptr + // CHECK: spv.GlobalVariable @var2 : !spv.ptr + // CHECK-NEXT: spv.GlobalVariable @var3 : !spv.ptr // CHECK-NEXT: spv.func @noop({{%.*}}: !spv.ptr, {{%.*}}: !spv.ptr) "None" // CHECK: spv.EntryPoint "GLCompute" @noop, @var2, @var3 - spv.globalVariable @var2 : !spv.ptr - spv.globalVariable @var3 : !spv.ptr + spv.GlobalVariable @var2 : !spv.ptr + spv.GlobalVariable @var3 : !spv.ptr spv.func @noop(%arg0 : !spv.ptr, %arg1 : !spv.ptr) -> () "None" { spv.Return } diff --git a/mlir/test/Target/SPIRV/function-call.mlir b/mlir/test/Target/SPIRV/function-call.mlir --- a/mlir/test/Target/SPIRV/function-call.mlir +++ b/mlir/test/Target/SPIRV/function-call.mlir @@ -1,7 +1,7 @@ // RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s spv.module Logical GLSL450 requires #spv.vce { - spv.globalVariable @var1 : !spv.ptr, Input> + spv.GlobalVariable @var1 : !spv.ptr, Input> spv.func @fmain() -> i32 "None" { %0 = spv.constant 16 : i32 %1 = spv.mlir.addressof @var1 : !spv.ptr, Input> diff --git a/mlir/test/Target/SPIRV/global-variable.mlir b/mlir/test/Target/SPIRV/global-variable.mlir --- a/mlir/test/Target/SPIRV/global-variable.mlir +++ b/mlir/test/Target/SPIRV/global-variable.mlir @@ -1,30 +1,30 @@ // RUN: mlir-translate -test-spirv-roundtrip -split-input-file %s | FileCheck %s -// CHECK: spv.globalVariable @var0 bind(1, 0) : !spv.ptr -// CHECK-NEXT: spv.globalVariable @var1 bind(0, 1) : !spv.ptr -// CHECK-NEXT: spv.globalVariable @var2 built_in("GlobalInvocationId") : !spv.ptr, Input> -// CHECK-NEXT: spv.globalVariable @var3 built_in("GlobalInvocationId") : !spv.ptr, Input> +// CHECK: spv.GlobalVariable @var0 bind(1, 0) : !spv.ptr +// CHECK-NEXT: spv.GlobalVariable @var1 bind(0, 1) : !spv.ptr +// CHECK-NEXT: spv.GlobalVariable @var2 built_in("GlobalInvocationId") : !spv.ptr, Input> +// CHECK-NEXT: spv.GlobalVariable @var3 built_in("GlobalInvocationId") : !spv.ptr, Input> spv.module Logical GLSL450 requires #spv.vce { - spv.globalVariable @var0 bind(1, 0) : !spv.ptr - spv.globalVariable @var1 bind(0, 1) : !spv.ptr - spv.globalVariable @var2 {built_in = "GlobalInvocationId"} : !spv.ptr, Input> - spv.globalVariable @var3 built_in("GlobalInvocationId") : !spv.ptr, Input> + spv.GlobalVariable @var0 bind(1, 0) : !spv.ptr + spv.GlobalVariable @var1 bind(0, 1) : !spv.ptr + spv.GlobalVariable @var2 {built_in = "GlobalInvocationId"} : !spv.ptr, Input> + spv.GlobalVariable @var3 built_in("GlobalInvocationId") : !spv.ptr, Input> } // ----- spv.module Logical GLSL450 requires #spv.vce { - // CHECK: spv.globalVariable @var1 : !spv.ptr - // CHECK-NEXT: spv.globalVariable @var2 initializer(@var1) bind(1, 0) : !spv.ptr - spv.globalVariable @var1 : !spv.ptr - spv.globalVariable @var2 initializer(@var1) bind(1, 0) : !spv.ptr + // CHECK: spv.GlobalVariable @var1 : !spv.ptr + // CHECK-NEXT: spv.GlobalVariable @var2 initializer(@var1) bind(1, 0) : !spv.ptr + spv.GlobalVariable @var1 : !spv.ptr + spv.GlobalVariable @var2 initializer(@var1) bind(1, 0) : !spv.ptr } // ----- spv.module Logical GLSL450 requires #spv.vce { - spv.globalVariable @globalInvocationID built_in("GlobalInvocationId") : !spv.ptr, Input> + spv.GlobalVariable @globalInvocationID built_in("GlobalInvocationId") : !spv.ptr, Input> spv.func @foo() "None" { // CHECK: %[[ADDR:.*]] = spv.mlir.addressof @globalInvocationID : !spv.ptr, Input> %0 = spv.mlir.addressof @globalInvocationID : !spv.ptr, Input> diff --git a/mlir/test/Target/SPIRV/image.mlir b/mlir/test/Target/SPIRV/image.mlir --- a/mlir/test/Target/SPIRV/image.mlir +++ b/mlir/test/Target/SPIRV/image.mlir @@ -2,11 +2,11 @@ spv.module Logical GLSL450 requires #spv.vce { // CHECK: !spv.ptr, UniformConstant> - spv.globalVariable @var0 bind(0, 1) : !spv.ptr, UniformConstant> + spv.GlobalVariable @var0 bind(0, 1) : !spv.ptr, UniformConstant> // CHECK: !spv.ptr, UniformConstant> - spv.globalVariable @var1 : !spv.ptr, UniformConstant> + spv.GlobalVariable @var1 : !spv.ptr, UniformConstant> // CHECK: !spv.ptr, UniformConstant> - spv.globalVariable @var2 : !spv.ptr, UniformConstant> + spv.GlobalVariable @var2 : !spv.ptr, UniformConstant> } diff --git a/mlir/test/Target/SPIRV/loop.mlir b/mlir/test/Target/SPIRV/loop.mlir --- a/mlir/test/Target/SPIRV/loop.mlir +++ b/mlir/test/Target/SPIRV/loop.mlir @@ -60,8 +60,8 @@ // ----- spv.module Logical GLSL450 requires #spv.vce { - spv.globalVariable @GV1 bind(0, 0) : !spv.ptr [0])>, StorageBuffer> - spv.globalVariable @GV2 bind(0, 1) : !spv.ptr [0])>, StorageBuffer> + spv.GlobalVariable @GV1 bind(0, 0) : !spv.ptr [0])>, StorageBuffer> + spv.GlobalVariable @GV2 bind(0, 1) : !spv.ptr [0])>, StorageBuffer> spv.func @loop_kernel() "None" { %0 = spv.mlir.addressof @GV1 : !spv.ptr [0])>, StorageBuffer> %1 = spv.constant 0 : i32 diff --git a/mlir/test/Target/SPIRV/matrix.mlir b/mlir/test/Target/SPIRV/matrix.mlir --- a/mlir/test/Target/SPIRV/matrix.mlir +++ b/mlir/test/Target/SPIRV/matrix.mlir @@ -48,12 +48,12 @@ // ----- spv.module Logical GLSL450 requires #spv.vce { - // CHECK: spv.globalVariable {{@.*}} : !spv.ptr>, StorageBuffer> - spv.globalVariable @var0 : !spv.ptr>, StorageBuffer> + // CHECK: spv.GlobalVariable {{@.*}} : !spv.ptr>, StorageBuffer> + spv.GlobalVariable @var0 : !spv.ptr>, StorageBuffer> - // CHECK: spv.globalVariable {{@.*}} : !spv.ptr>, StorageBuffer> - spv.globalVariable @var1 : !spv.ptr>, StorageBuffer> + // CHECK: spv.GlobalVariable {{@.*}} : !spv.ptr>, StorageBuffer> + spv.GlobalVariable @var1 : !spv.ptr>, StorageBuffer> - // CHECK: spv.globalVariable {{@.*}} : !spv.ptr>, StorageBuffer> - spv.globalVariable @var2 : !spv.ptr>, StorageBuffer> + // CHECK: spv.GlobalVariable {{@.*}} : !spv.ptr>, StorageBuffer> + spv.GlobalVariable @var2 : !spv.ptr>, StorageBuffer> } diff --git a/mlir/test/Target/SPIRV/phi.mlir b/mlir/test/Target/SPIRV/phi.mlir --- a/mlir/test/Target/SPIRV/phi.mlir +++ b/mlir/test/Target/SPIRV/phi.mlir @@ -159,8 +159,8 @@ // Test nested loops with block arguments spv.module Logical GLSL450 requires #spv.vce { - spv.globalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr, Input> - spv.globalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr, Input> + spv.GlobalVariable @__builtin_var_NumWorkgroups__ built_in("NumWorkgroups") : !spv.ptr, Input> + spv.GlobalVariable @__builtin_var_WorkgroupId__ built_in("WorkgroupId") : !spv.ptr, Input> spv.func @fmul_kernel() "None" { %3 = spv.constant 12 : i32 %4 = spv.constant 32 : i32 diff --git a/mlir/test/Target/SPIRV/sampled-image.mlir b/mlir/test/Target/SPIRV/sampled-image.mlir --- a/mlir/test/Target/SPIRV/sampled-image.mlir +++ b/mlir/test/Target/SPIRV/sampled-image.mlir @@ -2,11 +2,11 @@ spv.module Logical GLSL450 requires #spv.vce { // CHECK: !spv.ptr>, UniformConstant> - spv.globalVariable @var0 bind(0, 1) : !spv.ptr>, UniformConstant> + spv.GlobalVariable @var0 bind(0, 1) : !spv.ptr>, UniformConstant> // CHECK: !spv.ptr>, UniformConstant> - spv.globalVariable @var1 bind(0, 0) : !spv.ptr>, UniformConstant> + spv.GlobalVariable @var1 bind(0, 0) : !spv.ptr>, UniformConstant> // CHECK: !spv.ptr>, UniformConstant> - spv.globalVariable @var2 bind(0, 0) : !spv.ptr>, UniformConstant> + spv.GlobalVariable @var2 bind(0, 0) : !spv.ptr>, UniformConstant> } diff --git a/mlir/test/Target/SPIRV/struct.mlir b/mlir/test/Target/SPIRV/struct.mlir --- a/mlir/test/Target/SPIRV/struct.mlir +++ b/mlir/test/Target/SPIRV/struct.mlir @@ -2,47 +2,47 @@ spv.module Logical GLSL450 requires #spv.vce { // CHECK: !spv.ptr [0])>, Input> - spv.globalVariable @var0 bind(0, 1) : !spv.ptr [0])>, Input> + spv.GlobalVariable @var0 bind(0, 1) : !spv.ptr [0])>, Input> // CHECK: !spv.ptr [4])> [4])>, Input> - spv.globalVariable @var1 bind(0, 2) : !spv.ptr [4])> [4])>, Input> + spv.GlobalVariable @var1 bind(0, 2) : !spv.ptr [4])> [4])>, Input> // CHECK: !spv.ptr, StorageBuffer> - spv.globalVariable @var2 : !spv.ptr, StorageBuffer> + spv.GlobalVariable @var2 : !spv.ptr, StorageBuffer> // CHECK: !spv.ptr [0])>, stride=512> [0])>, StorageBuffer> - spv.globalVariable @var3 : !spv.ptr [0])>, stride=512> [0])>, StorageBuffer> + spv.GlobalVariable @var3 : !spv.ptr [0])>, stride=512> [0])>, StorageBuffer> // CHECK: !spv.ptr, StorageBuffer> - spv.globalVariable @var4 : !spv.ptr, StorageBuffer> + spv.GlobalVariable @var4 : !spv.ptr, StorageBuffer> // CHECK: !spv.ptr, StorageBuffer> - spv.globalVariable @var5 : !spv.ptr, StorageBuffer> + spv.GlobalVariable @var5 : !spv.ptr, StorageBuffer> // CHECK: !spv.ptr, StorageBuffer> - spv.globalVariable @var6 : !spv.ptr, StorageBuffer> + spv.GlobalVariable @var6 : !spv.ptr, StorageBuffer> // CHECK: !spv.ptr> [0, ColMajor, MatrixStride=16])>, StorageBuffer> - spv.globalVariable @var7 : !spv.ptr> [0, ColMajor, MatrixStride=16])>, StorageBuffer> + spv.GlobalVariable @var7 : !spv.ptr> [0, ColMajor, MatrixStride=16])>, StorageBuffer> // CHECK: !spv.ptr, StorageBuffer> - spv.globalVariable @empty : !spv.ptr, StorageBuffer> + spv.GlobalVariable @empty : !spv.ptr, StorageBuffer> // CHECK: !spv.ptr, StorageBuffer> - spv.globalVariable @id_empty : !spv.ptr, StorageBuffer> + spv.GlobalVariable @id_empty : !spv.ptr, StorageBuffer> // CHECK: !spv.ptr [0])>, Input> - spv.globalVariable @id_var0 : !spv.ptr [0])>, Input> + spv.GlobalVariable @id_var0 : !spv.ptr [0])>, Input> // CHECK: !spv.ptr, StorageBuffer>)>, StorageBuffer> - spv.globalVariable @recursive_simple : !spv.ptr, StorageBuffer>)>, StorageBuffer> + spv.GlobalVariable @recursive_simple : !spv.ptr, StorageBuffer>)>, StorageBuffer> // CHECK: !spv.ptr, Uniform>)>, Uniform>)>, Uniform> - spv.globalVariable @recursive_2 : !spv.ptr, Uniform>)>, Uniform>)>, Uniform> + spv.GlobalVariable @recursive_2 : !spv.ptr, Uniform>)>, Uniform>)>, Uniform> // CHECK: !spv.ptr, Uniform>, !spv.ptr, Uniform>)>, Uniform>)>, Uniform> - spv.globalVariable @recursive_3 : !spv.ptr, Uniform>, !spv.ptr, Uniform>)>, Uniform>)>, Uniform> + spv.GlobalVariable @recursive_3 : !spv.ptr, Uniform>, !spv.ptr, Uniform>)>, Uniform>)>, Uniform> // CHECK: !spv.ptr [0])>, Input>, // CHECK-SAME: !spv.ptr [0])>, Output>