diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAtomicOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAtomicOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAtomicOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVAtomicOps.td @@ -290,14 +290,14 @@ ``` atomic-fadd-op ::= - `spv.AtomicFAddEXT` scope memory-semantics + `spv.EXT.AtomicFAdd` scope memory-semantics ssa-use `,` ssa-use `:` spv-pointer-type ``` #### Example: ```mlir - %0 = spv.AtomicFAddEXT "Device" "None" %pointer, %value : + %0 = spv.EXT.AtomicFAdd "Device" "None" %pointer, %value : !spv.ptr ```mlir }]; diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td @@ -4545,7 +4545,7 @@ // Op, e.g., OpCooperativeMatrixStoreNV. class SPV_VendorOp traits = []> : - SPV_Op { + SPV_Op { string spirvOpName = "Op" # mnemonic # vendorName; } diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCooperativeMatrixOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCooperativeMatrixOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCooperativeMatrixOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVCooperativeMatrixOps.td @@ -28,14 +28,14 @@ Type is a cooperative matrix type. ``` {.ebnf} - cooperative-matrix-length-op ::= ssa-id `=` `spv.CooperativeMatrixLengthNV + cooperative-matrix-length-op ::= ssa-id `=` `spv.NV.CooperativeMatrixLength ` : ` cooperative-matrix-type ``` For example: ``` - %0 = spv.CooperativeMatrixLengthNV : !spv.coopmatrix + %0 = spv.NV.CooperativeMatrixLength : !spv.coopmatrix ``` }]; @@ -100,7 +100,7 @@ ### Custom assembly form ``` {.ebnf} - cooperative-matrixload-op ::= ssa-id `=` `spv.CooperativeMatrixLoadNV` + cooperative-matrixload-op ::= ssa-id `=` `spv.NV.CooperativeMatrixLoad` ssa-use `,` ssa-use `,` ssa-use (`[` memory-access `]`)? ` : ` pointer-type `as` @@ -110,7 +110,7 @@ For example: ``` - %0 = spv.CooperativeMatrixLoadNV %ptr, %stride, %colMajor + %0 = spv.NV.CooperativeMatrixLoad %ptr, %stride, %colMajor : !spv.ptr as !spv.coopmatrix ``` }]; @@ -172,7 +172,7 @@ the scope of the operation). ``` {.ebnf} - cooperative-matrixmuladd-op ::= ssa-id `=` `spv.CooperativeMatrixMulAddNV` + cooperative-matrixmuladd-op ::= ssa-id `=` `spv.NV.CooperativeMatrixMulAdd` ssa-use `,` ssa-use `,` ssa-use ` : ` a-cooperative-matrix-type, b-cooperative-matrix-type -> @@ -181,7 +181,7 @@ For example: ``` - %0 = spv.CooperativeMatrixMulAddNV %arg0, %arg1, %arg2, : + %0 = spv.NV.CooperativeMatrixMulAdd %arg0, %arg1, %arg2, : !spv.coopmatrix ``` }]; @@ -236,7 +236,7 @@ same as specifying None. ``` {.ebnf} - coop-matrix-store-op ::= `spv.CooperativeMatrixStoreNV ` + coop-matrix-store-op ::= `spv.NV.CooperativeMatrixStore ` ssa-use `, ` ssa-use `, ` ssa-use `, ` ssa-use `, ` (`[` memory-access `]`)? `:` @@ -246,7 +246,7 @@ For example: ``` - spv.CooperativeMatrixStoreNV %arg0, %arg2, %arg1, %arg3 : + spv.NV.CooperativeMatrixStore %arg0, %arg2, %arg1, %arg3 : !spv.ptr, !spv.coopmatrix ``` }]; diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGroupOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGroupOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGroupOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVGroupOps.td @@ -113,14 +113,14 @@ ``` - subgroup-ballot-op ::= ssa-id `=` `spv.SubgroupBallotKHR` + subgroup-ballot-op ::= ssa-id `=` `spv.KHR.SubgroupBallot` ssa-use `:` `vector` `<` 4 `x` `i32` `>` ``` #### Example: ```mlir - %0 = spv.SubgroupBallotKHR %predicate : vector<4xi32> + %0 = spv.KHR.SubgroupBallot %predicate : vector<4xi32> ``` }]; @@ -168,14 +168,14 @@ ``` - subgroup-block-read-INTEL-op ::= ssa-id `=` `spv.SubgroupBlockReadINTEL` + subgroup-block-read-INTEL-op ::= ssa-id `=` `spv.INTEL.SubgroupBlockRead` storage-class ssa_use `:` spirv-element-type ```mlir #### Example: ``` - %0 = spv.SubgroupBlockReadINTEL "StorageBuffer" %ptr : i32 + %0 = spv.INTEL.SubgroupBlockRead "StorageBuffer" %ptr : i32 ``` }]; @@ -218,14 +218,14 @@ ``` - subgroup-block-write-INTEL-op ::= ssa-id `=` `spv.SubgroupBlockWriteINTEL` + subgroup-block-write-INTEL-op ::= ssa-id `=` `spv.INTEL.SubgroupBlockWrite` storage-class ssa_use `,` ssa-use `:` spirv-element-type ```mlir #### Example: ``` - spv.SubgroupBlockWriteINTEL "StorageBuffer" %ptr, %value : i32 + spv.INTEL.SubgroupBlockWrite "StorageBuffer" %ptr, %value : i32 ``` }]; diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVJointMatrixOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVJointMatrixOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVJointMatrixOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVJointMatrixOps.td @@ -28,14 +28,14 @@ Type is a joint matrix type. ``` {.ebnf} - joint-matrix-length-op ::= ssa-id `=` `spv.JointMatrixWorkItemLengthINTEL + joint-matrix-length-op ::= ssa-id `=` `spv.INTEL.JointMatrixWorkItemLength ` : ` joint-matrix-type ``` For example: ``` - %0 = spv.JointMatrixWorkItemLengthINTEL : !spv.jointmatrix + %0 = spv.INTEL.JointMatrixWorkItemLength : !spv.jointmatrix ``` }]; @@ -85,7 +85,7 @@ #### Example: ```mlir - %0 = spv.JointMatrixLoadINTEL %ptr, %stride + %0 = spv.INTEL.JointMatrixLoad %ptr, %stride {memory_access = #spv.memory_access} : (!spv.ptr, i32) -> !spv.jointmatrix<8x16xi32, ColumnMajor, Subgroup> @@ -149,7 +149,7 @@ #### Example: ```mlir - %r = spv.JointMatrixMadINTEL %a, %b, %c : + %r = spv.INTEL.JointMatrixMad %a, %b, %c : !spv.jointmatrix<8x32xi8, RowMajor, Subgroup>, !spv.jointmatrix<32x8xi8, ColumnMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> @@ -212,7 +212,7 @@ #### Example: ```mlir - spv.JointMatrixStoreINTEL %ptr, %m, %stride + spv.INTEL.JointMatrixStore %ptr, %m, %stride {memory_access = #spv.memory_access} : (!spv.ptr, !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, i32) ``` diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMiscOps.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMiscOps.td --- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMiscOps.td +++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVMiscOps.td @@ -27,13 +27,13 @@ ``` - assumetruekhr-op ::= `spv.AssumeTrueKHR` ssa-use + assumetruekhr-op ::= `spv.KHR.AssumeTrue` ssa-use ```mlir #### Example: ``` - spv.AssumeTrueKHR %arg + spv.KHR.AssumeTrue %arg ``` }]; 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 @@ -1332,7 +1332,7 @@ } //===----------------------------------------------------------------------===// -// spv.AtomicFAddEXTOp +// spv.EXT.AtomicFAddOp //===----------------------------------------------------------------------===// LogicalResult spirv::EXTAtomicFAddOp::verify() { @@ -2643,7 +2643,7 @@ } //===----------------------------------------------------------------------===// -// spv.SubgroupBlockReadINTEL +// spv.INTEL.SubgroupBlockRead //===----------------------------------------------------------------------===// ParseResult spirv::INTELSubgroupBlockReadOp::parse(OpAsmParser &parser, @@ -2681,7 +2681,7 @@ } //===----------------------------------------------------------------------===// -// spv.SubgroupBlockWriteINTEL +// spv.INTEL.SubgroupBlockWrite //===----------------------------------------------------------------------===// ParseResult spirv::INTELSubgroupBlockWriteOp::parse(OpAsmParser &parser, @@ -3813,7 +3813,7 @@ } //===----------------------------------------------------------------------===// -// spv.CooperativeMatrixLoadNV +// spv.NV.CooperativeMatrixLoad //===----------------------------------------------------------------------===// ParseResult spirv::NVCooperativeMatrixLoadOp::parse(OpAsmParser &parser, @@ -3871,7 +3871,7 @@ } //===----------------------------------------------------------------------===// -// spv.CooperativeMatrixStoreNV +// spv.NV.CooperativeMatrixStore //===----------------------------------------------------------------------===// ParseResult spirv::NVCooperativeMatrixStoreOp::parse(OpAsmParser &parser, @@ -3911,7 +3911,7 @@ } //===----------------------------------------------------------------------===// -// spv.CooperativeMatrixMulAddNV +// spv.NV.CooperativeMatrixMulAdd //===----------------------------------------------------------------------===// static LogicalResult @@ -3960,7 +3960,7 @@ } //===----------------------------------------------------------------------===// -// spv.JointMatrixLoadINTEL +// spv.INTEL.JointMatrixLoad //===----------------------------------------------------------------------===// LogicalResult spirv::INTELJointMatrixLoadOp::verify() { @@ -3969,7 +3969,7 @@ } //===----------------------------------------------------------------------===// -// spv.JointMatrixStoreINTEL +// spv.INTEL.JointMatrixStore //===----------------------------------------------------------------------===// LogicalResult spirv::INTELJointMatrixStoreOp::verify() { @@ -3978,7 +3978,7 @@ } //===----------------------------------------------------------------------===// -// spv.JointMatrixMadINTEL +// spv.INTEL.JointMatrixMad //===----------------------------------------------------------------------===// static LogicalResult verifyJointMatrixMad(spirv::INTELJointMatrixMadOp op) { diff --git a/mlir/test/Dialect/SPIRV/IR/atomic-ops.mlir b/mlir/test/Dialect/SPIRV/IR/atomic-ops.mlir --- a/mlir/test/Dialect/SPIRV/IR/atomic-ops.mlir +++ b/mlir/test/Dialect/SPIRV/IR/atomic-ops.mlir @@ -240,12 +240,12 @@ // ----- //===----------------------------------------------------------------------===// -// spv.AtomicFAddEXT +// spv.EXT.AtomicFAdd //===----------------------------------------------------------------------===// func.func @atomic_fadd(%ptr : !spv.ptr, %value : f32) -> f32 { - // CHECK: spv.AtomicFAddEXT "Device" "None" %{{.*}}, %{{.*}} : !spv.ptr - %0 = spv.AtomicFAddEXT "Device" "None" %ptr, %value : !spv.ptr + // CHECK: spv.EXT.AtomicFAdd "Device" "None" %{{.*}}, %{{.*}} : !spv.ptr + %0 = spv.EXT.AtomicFAdd "Device" "None" %ptr, %value : !spv.ptr return %0 : f32 } @@ -253,7 +253,7 @@ func.func @atomic_fadd(%ptr : !spv.ptr, %value : f32) -> f32 { // expected-error @+1 {{pointer operand must point to an float value, found 'i32'}} - %0 = "spv.AtomicFAddEXT"(%ptr, %value) {memory_scope = #spv.scope, semantics = #spv.memory_semantics} : (!spv.ptr, f32) -> (f32) + %0 = "spv.EXT.AtomicFAdd"(%ptr, %value) {memory_scope = #spv.scope, semantics = #spv.memory_semantics} : (!spv.ptr, f32) -> (f32) return %0 : f32 } @@ -261,7 +261,7 @@ func.func @atomic_fadd(%ptr : !spv.ptr, %value : f64) -> f64 { // expected-error @+1 {{expected value to have the same type as the pointer operand's pointee type 'f32', but found 'f64'}} - %0 = "spv.AtomicFAddEXT"(%ptr, %value) {memory_scope = #spv.scope, semantics = #spv.memory_semantics} : (!spv.ptr, f64) -> (f64) + %0 = "spv.EXT.AtomicFAdd"(%ptr, %value) {memory_scope = #spv.scope, semantics = #spv.memory_semantics} : (!spv.ptr, f64) -> (f64) return %0 : f64 } @@ -269,6 +269,6 @@ func.func @atomic_fadd(%ptr : !spv.ptr, %value : f32) -> f32 { // expected-error @+1 {{expected at most one of these four memory constraints to be set: `Acquire`, `Release`,`AcquireRelease` or `SequentiallyConsistent`}} - %0 = spv.AtomicFAddEXT "Device" "Acquire|Release" %ptr, %value : !spv.ptr + %0 = spv.EXT.AtomicFAdd "Device" "Acquire|Release" %ptr, %value : !spv.ptr return %0 : f32 } diff --git a/mlir/test/Dialect/SPIRV/IR/cooperative-matrix-ops.mlir b/mlir/test/Dialect/SPIRV/IR/cooperative-matrix-ops.mlir --- a/mlir/test/Dialect/SPIRV/IR/cooperative-matrix-ops.mlir +++ b/mlir/test/Dialect/SPIRV/IR/cooperative-matrix-ops.mlir @@ -2,51 +2,51 @@ // CHECK-LABEL: @cooperative_matrix_load spv.func @cooperative_matrix_load(%ptr : !spv.ptr, %stride : i32, %b : i1) "None" { - // CHECK: {{%.*}} = spv.CooperativeMatrixLoadNV {{%.*}}, {{%.*}}, {{%.*}} : !spv.ptr as !spv.coopmatrix<16x8xi32, Workgroup> - %0 = spv.CooperativeMatrixLoadNV %ptr, %stride, %b : !spv.ptr as !spv.coopmatrix<16x8xi32, Workgroup> + // CHECK: {{%.*}} = spv.NV.CooperativeMatrixLoad {{%.*}}, {{%.*}}, {{%.*}} : !spv.ptr as !spv.coopmatrix<16x8xi32, Workgroup> + %0 = spv.NV.CooperativeMatrixLoad %ptr, %stride, %b : !spv.ptr as !spv.coopmatrix<16x8xi32, Workgroup> spv.Return } // ----- // CHECK-LABEL: @cooperative_matrix_load_memaccess spv.func @cooperative_matrix_load_memaccess(%ptr : !spv.ptr, %stride : i32, %b : i1) "None" { - // CHECK: {{%.*}} = spv.CooperativeMatrixLoadNV {{%.*}}, {{%.*}}, {{%.*}} ["Volatile"] : !spv.ptr as !spv.coopmatrix<8x16xi32, Subgroup> - %0 = spv.CooperativeMatrixLoadNV %ptr, %stride, %b ["Volatile"] : !spv.ptr as !spv.coopmatrix<8x16xi32, Subgroup> + // CHECK: {{%.*}} = spv.NV.CooperativeMatrixLoad {{%.*}}, {{%.*}}, {{%.*}} ["Volatile"] : !spv.ptr as !spv.coopmatrix<8x16xi32, Subgroup> + %0 = spv.NV.CooperativeMatrixLoad %ptr, %stride, %b ["Volatile"] : !spv.ptr as !spv.coopmatrix<8x16xi32, Subgroup> spv.Return } // CHECK-LABEL: @cooperative_matrix_load_diff_ptr_type spv.func @cooperative_matrix_load_diff_ptr_type(%ptr : !spv.ptr, StorageBuffer>, %stride : i32, %b : i1) "None" { - // CHECK: {{%.*}} = spv.CooperativeMatrixLoadNV {{%.*}}, {{%.*}}, {{%.*}} ["Volatile"] : !spv.ptr, StorageBuffer> as !spv.coopmatrix<8x16xi32, Subgroup> - %0 = spv.CooperativeMatrixLoadNV %ptr, %stride, %b ["Volatile"] : !spv.ptr, StorageBuffer> as !spv.coopmatrix<8x16xi32, Subgroup> + // CHECK: {{%.*}} = spv.NV.CooperativeMatrixLoad {{%.*}}, {{%.*}}, {{%.*}} ["Volatile"] : !spv.ptr, StorageBuffer> as !spv.coopmatrix<8x16xi32, Subgroup> + %0 = spv.NV.CooperativeMatrixLoad %ptr, %stride, %b ["Volatile"] : !spv.ptr, StorageBuffer> as !spv.coopmatrix<8x16xi32, Subgroup> spv.Return } // CHECK-LABEL: @cooperative_matrix_store spv.func @cooperative_matrix_store(%ptr : !spv.ptr, %stride : i32, %m : !spv.coopmatrix<8x16xi32, Workgroup>, %b : i1) "None" { - // CHECK: spv.CooperativeMatrixStoreNV {{%.*}}, {{%.*}}, {{%.*}} : !spv.ptr, !spv.coopmatrix<8x16xi32, Workgroup> - spv.CooperativeMatrixStoreNV %ptr, %m, %stride, %b : !spv.ptr, !spv.coopmatrix<8x16xi32, Workgroup> + // CHECK: spv.NV.CooperativeMatrixStore {{%.*}}, {{%.*}}, {{%.*}} : !spv.ptr, !spv.coopmatrix<8x16xi32, Workgroup> + spv.NV.CooperativeMatrixStore %ptr, %m, %stride, %b : !spv.ptr, !spv.coopmatrix<8x16xi32, Workgroup> spv.Return } // CHECK-LABEL: @cooperative_matrix_store_memaccess spv.func @cooperative_matrix_store_memaccess(%ptr : !spv.ptr, %m : !spv.coopmatrix<8x16xi32, Subgroup>, %stride : i32, %b : i1) "None" { - // CHECK: spv.CooperativeMatrixStoreNV {{%.*}}, {{%.*}}, {{%.*}} ["Volatile"] : !spv.ptr, !spv.coopmatrix<8x16xi32, Subgroup> - spv.CooperativeMatrixStoreNV %ptr, %m, %stride, %b ["Volatile"] : !spv.ptr, !spv.coopmatrix<8x16xi32, Subgroup> + // CHECK: spv.NV.CooperativeMatrixStore {{%.*}}, {{%.*}}, {{%.*}} ["Volatile"] : !spv.ptr, !spv.coopmatrix<8x16xi32, Subgroup> + spv.NV.CooperativeMatrixStore %ptr, %m, %stride, %b ["Volatile"] : !spv.ptr, !spv.coopmatrix<8x16xi32, Subgroup> spv.Return } // CHECK-LABEL: @cooperative_matrix_length spv.func @cooperative_matrix_length() -> i32 "None" { - // CHECK: {{%.*}} = spv.CooperativeMatrixLengthNV : !spv.coopmatrix<8x16xi32, Subgroup> - %0 = spv.CooperativeMatrixLengthNV : !spv.coopmatrix<8x16xi32, Subgroup> + // CHECK: {{%.*}} = spv.NV.CooperativeMatrixLength : !spv.coopmatrix<8x16xi32, Subgroup> + %0 = spv.NV.CooperativeMatrixLength : !spv.coopmatrix<8x16xi32, Subgroup> spv.ReturnValue %0 : i32 } // CHECK-LABEL: @cooperative_matrix_muladd spv.func @cooperative_matrix_muladd(%a : !spv.coopmatrix<8x32xi8, Subgroup>, %b : !spv.coopmatrix<32x8xi8, Subgroup>, %c : !spv.coopmatrix<8x8xi32, Subgroup>) "None" { - // CHECK: {{%.*}} = spv.CooperativeMatrixMulAddNV {{%.*}}, {{%.*}}, {{%.*}} : !spv.coopmatrix<8x32xi8, Subgroup>, !spv.coopmatrix<32x8xi8, Subgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> - %r = spv.CooperativeMatrixMulAddNV %a, %b, %c : !spv.coopmatrix<8x32xi8, Subgroup>, !spv.coopmatrix<32x8xi8, Subgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> + // CHECK: {{%.*}} = spv.NV.CooperativeMatrixMulAdd {{%.*}}, {{%.*}}, {{%.*}} : !spv.coopmatrix<8x32xi8, Subgroup>, !spv.coopmatrix<32x8xi8, Subgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> + %r = spv.NV.CooperativeMatrixMulAdd %a, %b, %c : !spv.coopmatrix<8x32xi8, Subgroup>, !spv.coopmatrix<32x8xi8, Subgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> spv.Return } @@ -112,24 +112,24 @@ // ----- spv.func @cooperative_matrix_muladd(%a : !spv.coopmatrix<16x16xi32, Subgroup>, %b : !spv.coopmatrix<16x8xi32, Subgroup>, %c : !spv.coopmatrix<8x8xi32, Subgroup>) "None" { - // expected-error @+1 {{'spv.CooperativeMatrixMulAddNV' op matrix size must match}} - %r = spv.CooperativeMatrixMulAddNV %a, %b, %c : !spv.coopmatrix<16x16xi32, Subgroup>, !spv.coopmatrix<16x8xi32, Subgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> + // expected-error @+1 {{'spv.NV.CooperativeMatrixMulAdd' op matrix size must match}} + %r = spv.NV.CooperativeMatrixMulAdd %a, %b, %c : !spv.coopmatrix<16x16xi32, Subgroup>, !spv.coopmatrix<16x8xi32, Subgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> spv.Return } // ----- spv.func @cooperative_matrix_muladd(%a : !spv.coopmatrix<8x16xi32, Subgroup>, %b : !spv.coopmatrix<8x8xi32, Subgroup>, %c : !spv.coopmatrix<8x8xi32, Subgroup>) "None" { - // expected-error @+1 {{'spv.CooperativeMatrixMulAddNV' op matrix size must match}} - %r = spv.CooperativeMatrixMulAddNV %a, %b, %c : !spv.coopmatrix<8x16xi32, Subgroup>, !spv.coopmatrix<8x8xi32, Subgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> + // expected-error @+1 {{'spv.NV.CooperativeMatrixMulAdd' op matrix size must match}} + %r = spv.NV.CooperativeMatrixMulAdd %a, %b, %c : !spv.coopmatrix<8x16xi32, Subgroup>, !spv.coopmatrix<8x8xi32, Subgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> spv.Return } // ----- spv.func @cooperative_matrix_muladd(%a : !spv.coopmatrix<8x16xi32, Subgroup>, %b : !spv.coopmatrix<16x8xi32, Workgroup>, %c : !spv.coopmatrix<8x8xi32, Subgroup>) "None" { - // expected-error @+1 {{'spv.CooperativeMatrixMulAddNV' op matrix scope must match}} - %r = spv.CooperativeMatrixMulAddNV %a, %b, %c : !spv.coopmatrix<8x16xi32, Subgroup>, !spv.coopmatrix<16x8xi32, Workgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> + // expected-error @+1 {{'spv.NV.CooperativeMatrixMulAdd' op matrix scope must match}} + %r = spv.NV.CooperativeMatrixMulAdd %a, %b, %c : !spv.coopmatrix<8x16xi32, Subgroup>, !spv.coopmatrix<16x8xi32, Workgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> spv.Return } @@ -137,7 +137,7 @@ spv.func @cooperative_matrix_muladd(%a : !spv.coopmatrix<8x16xf32, Subgroup>, %b : !spv.coopmatrix<16x8xi32, Subgroup>, %c : !spv.coopmatrix<8x8xi32, Subgroup>) "None" { // expected-error @+1 {{matrix element type must match}} - %r = spv.CooperativeMatrixMulAddNV %a, %b, %c : !spv.coopmatrix<8x16xf32, Subgroup>, !spv.coopmatrix<16x8xi32, Subgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> + %r = spv.NV.CooperativeMatrixMulAdd %a, %b, %c : !spv.coopmatrix<8x16xf32, Subgroup>, !spv.coopmatrix<16x8xi32, Subgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> spv.Return } @@ -145,7 +145,7 @@ spv.func @cooperative_matrix_load_memaccess(%ptr : !spv.ptr, StorageBuffer>, %stride : i32, %b : i1) "None" { // expected-error @+1 {{Pointer must point to a scalar or vector type}} - %0 = spv.CooperativeMatrixLoadNV %ptr, %stride, %b : !spv.ptr, StorageBuffer> as !spv.coopmatrix<8x16xi32, Subgroup> + %0 = spv.NV.CooperativeMatrixLoad %ptr, %stride, %b : !spv.ptr, StorageBuffer> as !spv.coopmatrix<8x16xi32, Subgroup> spv.Return } @@ -153,6 +153,6 @@ spv.func @cooperative_matrix_load_memaccess(%ptr : !spv.ptr, %stride : i32, %b : i1) "None" { // expected-error @+1 {{Pointer storage class must be Workgroup, StorageBuffer or PhysicalStorageBufferEXT}} - %0 = spv.CooperativeMatrixLoadNV %ptr, %stride, %b : !spv.ptr as !spv.coopmatrix<8x16xi32, Subgroup> + %0 = spv.NV.CooperativeMatrixLoad %ptr, %stride, %b : !spv.ptr as !spv.coopmatrix<8x16xi32, Subgroup> spv.Return } diff --git a/mlir/test/Dialect/SPIRV/IR/group-ops.mlir b/mlir/test/Dialect/SPIRV/IR/group-ops.mlir --- a/mlir/test/Dialect/SPIRV/IR/group-ops.mlir +++ b/mlir/test/Dialect/SPIRV/IR/group-ops.mlir @@ -1,12 +1,12 @@ // RUN: mlir-opt -split-input-file -verify-diagnostics %s | FileCheck %s //===----------------------------------------------------------------------===// -// spv.SubgroupBallotKHR +// spv.KHR.SubgroupBallot //===----------------------------------------------------------------------===// func.func @subgroup_ballot(%predicate: i1) -> vector<4xi32> { - // CHECK: %{{.*}} = spv.SubgroupBallotKHR %{{.*}} : vector<4xi32> - %0 = spv.SubgroupBallotKHR %predicate: vector<4xi32> + // CHECK: %{{.*}} = spv.KHR.SubgroupBallot %{{.*}} : vector<4xi32> + %0 = spv.KHR.SubgroupBallot %predicate: vector<4xi32> return %0: vector<4xi32> } @@ -65,50 +65,50 @@ // ----- //===----------------------------------------------------------------------===// -// spv.SubgroupBallotKHR +// spv.KHR.SubgroupBallot //===----------------------------------------------------------------------===// func.func @subgroup_ballot(%predicate: i1) -> vector<4xi32> { - %0 = spv.SubgroupBallotKHR %predicate: vector<4xi32> + %0 = spv.KHR.SubgroupBallot %predicate: vector<4xi32> return %0: vector<4xi32> } // ----- //===----------------------------------------------------------------------===// -// spv.SubgroupBlockReadINTEL +// spv.INTEL.SubgroupBlockRead //===----------------------------------------------------------------------===// func.func @subgroup_block_read_intel(%ptr : !spv.ptr) -> i32 { - // CHECK: spv.SubgroupBlockReadINTEL %{{.*}} : i32 - %0 = spv.SubgroupBlockReadINTEL "StorageBuffer" %ptr : i32 + // CHECK: spv.INTEL.SubgroupBlockRead %{{.*}} : i32 + %0 = spv.INTEL.SubgroupBlockRead "StorageBuffer" %ptr : i32 return %0: i32 } // ----- func.func @subgroup_block_read_intel_vector(%ptr : !spv.ptr) -> vector<3xi32> { - // CHECK: spv.SubgroupBlockReadINTEL %{{.*}} : vector<3xi32> - %0 = spv.SubgroupBlockReadINTEL "StorageBuffer" %ptr : vector<3xi32> + // CHECK: spv.INTEL.SubgroupBlockRead %{{.*}} : vector<3xi32> + %0 = spv.INTEL.SubgroupBlockRead "StorageBuffer" %ptr : vector<3xi32> return %0: vector<3xi32> } // ----- //===----------------------------------------------------------------------===// -// spv.SubgroupBlockWriteINTEL +// spv.INTEL.SubgroupBlockWrite //===----------------------------------------------------------------------===// func.func @subgroup_block_write_intel(%ptr : !spv.ptr, %value: i32) -> () { - // CHECK: spv.SubgroupBlockWriteINTEL %{{.*}}, %{{.*}} : i32 - spv.SubgroupBlockWriteINTEL "StorageBuffer" %ptr, %value : i32 + // CHECK: spv.INTEL.SubgroupBlockWrite %{{.*}}, %{{.*}} : i32 + spv.INTEL.SubgroupBlockWrite "StorageBuffer" %ptr, %value : i32 return } // ----- func.func @subgroup_block_write_intel_vector(%ptr : !spv.ptr, %value: vector<3xi32>) -> () { - // CHECK: spv.SubgroupBlockWriteINTEL %{{.*}}, %{{.*}} : vector<3xi32> - spv.SubgroupBlockWriteINTEL "StorageBuffer" %ptr, %value : vector<3xi32> + // CHECK: spv.INTEL.SubgroupBlockWrite %{{.*}}, %{{.*}} : vector<3xi32> + spv.INTEL.SubgroupBlockWrite "StorageBuffer" %ptr, %value : vector<3xi32> return } diff --git a/mlir/test/Dialect/SPIRV/IR/joint-matrix-ops.mlir b/mlir/test/Dialect/SPIRV/IR/joint-matrix-ops.mlir --- a/mlir/test/Dialect/SPIRV/IR/joint-matrix-ops.mlir +++ b/mlir/test/Dialect/SPIRV/IR/joint-matrix-ops.mlir @@ -2,75 +2,75 @@ // CHECK-LABEL: @joint_matrix_load spv.func @joint_matrix_load(%ptr : !spv.ptr, %stride : i32) "None" { - // CHECK: {{%.*}} = spv.JointMatrixLoadINTEL {{%.*}}, {{%.*}} : (!spv.ptr, i32) -> !spv.jointmatrix<16x8xi32, RowMajor, Workgroup> - %0 = spv.JointMatrixLoadINTEL %ptr, %stride : (!spv.ptr, i32) -> !spv.jointmatrix<16x8xi32, RowMajor, Workgroup> + // CHECK: {{%.*}} = spv.INTEL.JointMatrixLoad {{%.*}}, {{%.*}} : (!spv.ptr, i32) -> !spv.jointmatrix<16x8xi32, RowMajor, Workgroup> + %0 = spv.INTEL.JointMatrixLoad %ptr, %stride : (!spv.ptr, i32) -> !spv.jointmatrix<16x8xi32, RowMajor, Workgroup> spv.Return } // ----- // CHECK-LABEL: @joint_matrix_load_memaccess spv.func @joint_matrix_load_memaccess(%ptr : !spv.ptr, %stride : i32) "None" { - // CHECK: {{%.*}} = spv.JointMatrixLoadINTEL {{%.*}}, {{%.*}} {memory_access = #spv.memory_access} : (!spv.ptr, i32) -> !spv.jointmatrix<8x16xi32, ColumnMajor, Subgroup> - %0 = spv.JointMatrixLoadINTEL %ptr, %stride {memory_access = #spv.memory_access} : (!spv.ptr, i32) -> !spv.jointmatrix<8x16xi32, ColumnMajor, Subgroup> + // CHECK: {{%.*}} = spv.INTEL.JointMatrixLoad {{%.*}}, {{%.*}} {memory_access = #spv.memory_access} : (!spv.ptr, i32) -> !spv.jointmatrix<8x16xi32, ColumnMajor, Subgroup> + %0 = spv.INTEL.JointMatrixLoad %ptr, %stride {memory_access = #spv.memory_access} : (!spv.ptr, i32) -> !spv.jointmatrix<8x16xi32, ColumnMajor, Subgroup> spv.Return } // CHECK-LABEL: @joint_matrix_load_diff_ptr_type spv.func @joint_matrix_load_diff_ptr_type(%ptr : !spv.ptr, Workgroup>, %stride : i32) "None" { - // CHECK: {{%.*}} = spv.JointMatrixLoadINTEL {{%.*}}, {{%.*}} {memory_access = #spv.memory_access} : (!spv.ptr, Workgroup>, i32) -> !spv.jointmatrix<8x16xi32, RowMajor, Workgroup> - %0 = spv.JointMatrixLoadINTEL %ptr, %stride {memory_access = #spv.memory_access} : (!spv.ptr, Workgroup>, i32) -> !spv.jointmatrix<8x16xi32, RowMajor, Workgroup> + // CHECK: {{%.*}} = spv.INTEL.JointMatrixLoad {{%.*}}, {{%.*}} {memory_access = #spv.memory_access} : (!spv.ptr, Workgroup>, i32) -> !spv.jointmatrix<8x16xi32, RowMajor, Workgroup> + %0 = spv.INTEL.JointMatrixLoad %ptr, %stride {memory_access = #spv.memory_access} : (!spv.ptr, Workgroup>, i32) -> !spv.jointmatrix<8x16xi32, RowMajor, Workgroup> spv.Return } // CHECK-LABEL: @joint_matrix_store spv.func @joint_matrix_store(%ptr : !spv.ptr, %stride : i32, %m : !spv.jointmatrix<8x16xi32, RowMajor, Workgroup>) "None" { - // CHECK: spv.JointMatrixStoreINTEL {{%.*}}, {{%.*}}, {{%.*}} : (!spv.ptr, !spv.jointmatrix<8x16xi32, RowMajor, Workgroup>, i32) - spv.JointMatrixStoreINTEL %ptr, %m, %stride : (!spv.ptr, !spv.jointmatrix<8x16xi32, RowMajor, Workgroup>, i32) + // CHECK: spv.INTEL.JointMatrixStore {{%.*}}, {{%.*}}, {{%.*}} : (!spv.ptr, !spv.jointmatrix<8x16xi32, RowMajor, Workgroup>, i32) + spv.INTEL.JointMatrixStore %ptr, %m, %stride : (!spv.ptr, !spv.jointmatrix<8x16xi32, RowMajor, Workgroup>, i32) spv.Return } // CHECK-LABEL: @joint_matrix_store_memaccess spv.func @joint_matrix_store_memaccess(%ptr : !spv.ptr, %m : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, %stride : i32) "None" { - // CHECK: spv.JointMatrixStoreINTEL {{%.*}}, {{%.*}}, {{%.*}} {Volatile} : (!spv.ptr, !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, i32) - spv.JointMatrixStoreINTEL %ptr, %m, %stride {Volatile} : (!spv.ptr, !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, i32) + // CHECK: spv.INTEL.JointMatrixStore {{%.*}}, {{%.*}}, {{%.*}} {Volatile} : (!spv.ptr, !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, i32) + spv.INTEL.JointMatrixStore %ptr, %m, %stride {Volatile} : (!spv.ptr, !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, i32) spv.Return } // CHECK-LABEL: @joint_matrix_length spv.func @joint_matrix_length() -> i32 "None" { - // CHECK: {{%.*}} = spv.JointMatrixWorkItemLengthINTEL : !spv.jointmatrix<8x16xi32, PackedB, Subgroup> - %0 = spv.JointMatrixWorkItemLengthINTEL : !spv.jointmatrix<8x16xi32, PackedB, Subgroup> + // CHECK: {{%.*}} = spv.INTEL.JointMatrixWorkItemLength : !spv.jointmatrix<8x16xi32, PackedB, Subgroup> + %0 = spv.INTEL.JointMatrixWorkItemLength : !spv.jointmatrix<8x16xi32, PackedB, Subgroup> spv.ReturnValue %0 : i32 } // CHECK-LABEL: @joint_matrix_muladd spv.func @joint_matrix_muladd(%a : !spv.jointmatrix<8x32xi8, RowMajor, Subgroup>, %b : !spv.jointmatrix<32x8xi8, ColumnMajor, Subgroup>, %c : !spv.jointmatrix<8x8xi32, RowMajor, Subgroup>) "None" { - // CHECK: {{%.*}} = spv.JointMatrixMadINTEL {{%.*}}, {{%.*}}, {{%.*}} : !spv.jointmatrix<8x32xi8, RowMajor, Subgroup>, !spv.jointmatrix<32x8xi8, ColumnMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> - %r = spv.JointMatrixMadINTEL %a, %b, %c : !spv.jointmatrix<8x32xi8, RowMajor, Subgroup>, !spv.jointmatrix<32x8xi8, ColumnMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> + // CHECK: {{%.*}} = spv.INTEL.JointMatrixMad {{%.*}}, {{%.*}}, {{%.*}} : !spv.jointmatrix<8x32xi8, RowMajor, Subgroup>, !spv.jointmatrix<32x8xi8, ColumnMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> + %r = spv.INTEL.JointMatrixMad %a, %b, %c : !spv.jointmatrix<8x32xi8, RowMajor, Subgroup>, !spv.jointmatrix<32x8xi8, ColumnMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> spv.Return } // ----- spv.func @joint_matrix_muladd(%a : !spv.jointmatrix<16x16xi32, RowMajor, Subgroup>, %b : !spv.jointmatrix<16x8xi32, RowMajor, Subgroup>, %c : !spv.jointmatrix<8x8xi32, RowMajor, Subgroup>) "None" { - // expected-error @+1 {{'spv.JointMatrixMadINTEL' op matrix size must match}} - %r = spv.JointMatrixMadINTEL %a, %b, %c : !spv.jointmatrix<16x16xi32, RowMajor, Subgroup>, !spv.jointmatrix<16x8xi32, RowMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> + // expected-error @+1 {{'spv.INTEL.JointMatrixMad' op matrix size must match}} + %r = spv.INTEL.JointMatrixMad %a, %b, %c : !spv.jointmatrix<16x16xi32, RowMajor, Subgroup>, !spv.jointmatrix<16x8xi32, RowMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> spv.Return } // ----- spv.func @joint_matrix_muladd(%a : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, %b : !spv.jointmatrix<8x8xi32, RowMajor, Subgroup>, %c : !spv.jointmatrix<8x8xi32, RowMajor, Subgroup>) "None" { - // expected-error @+1 {{'spv.JointMatrixMadINTEL' op matrix size must match}} - %r = spv.JointMatrixMadINTEL %a, %b, %c : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> + // expected-error @+1 {{'spv.INTEL.JointMatrixMad' op matrix size must match}} + %r = spv.INTEL.JointMatrixMad %a, %b, %c : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> spv.Return } // ----- spv.func @joint_matrix_muladd(%a : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, %b : !spv.jointmatrix<16x8xi32, RowMajor, Workgroup>, %c : !spv.jointmatrix<8x8xi32, RowMajor, Subgroup>) "None" { - // expected-error @+1 {{'spv.JointMatrixMadINTEL' op matrix scope must match}} - %r = spv.JointMatrixMadINTEL %a, %b, %c : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, !spv.jointmatrix<16x8xi32, RowMajor, Workgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> + // expected-error @+1 {{'spv.INTEL.JointMatrixMad' op matrix scope must match}} + %r = spv.INTEL.JointMatrixMad %a, %b, %c : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, !spv.jointmatrix<16x8xi32, RowMajor, Workgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> spv.Return } @@ -78,7 +78,7 @@ spv.func @joint_matrix_muladd(%a : !spv.jointmatrix<8x16xf32, RowMajor, Subgroup>, %b : !spv.jointmatrix<16x8xi32, RowMajor, Subgroup>, %c : !spv.jointmatrix<8x8xi32, RowMajor, Subgroup>) "None" { // expected-error @+1 {{matrix element type must match}} - %r = spv.JointMatrixMadINTEL %a, %b, %c : !spv.jointmatrix<8x16xf32, RowMajor, Subgroup>, !spv.jointmatrix<16x8xi32, RowMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> + %r = spv.INTEL.JointMatrixMad %a, %b, %c : !spv.jointmatrix<8x16xf32, RowMajor, Subgroup>, !spv.jointmatrix<16x8xi32, RowMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> spv.Return } @@ -86,7 +86,7 @@ spv.func @joint_matrix_load_memaccess(%ptr : !spv.ptr, Workgroup>, %stride : i32) "None" { // expected-error @+1 {{Pointer must point to a scalar or vector type}} - %0 = spv.JointMatrixLoadINTEL %ptr, %stride : (!spv.ptr, Workgroup>, i32)-> !spv.jointmatrix<8x16xi32, RowMajor, Subgroup> + %0 = spv.INTEL.JointMatrixLoad %ptr, %stride : (!spv.ptr, Workgroup>, i32)-> !spv.jointmatrix<8x16xi32, RowMajor, Subgroup> spv.Return } @@ -94,6 +94,6 @@ spv.func @joint_matrix_load_memaccess(%ptr : !spv.ptr, %stride : i32) "None" { // expected-error @+1 {{Pointer storage class must be Workgroup or CrossWorkgroup}} - %0 = spv.JointMatrixLoadINTEL %ptr, %stride : (!spv.ptr, i32) -> !spv.jointmatrix<8x16xi32, RowMajor, Subgroup> + %0 = spv.INTEL.JointMatrixLoad %ptr, %stride : (!spv.ptr, i32) -> !spv.jointmatrix<8x16xi32, RowMajor, Subgroup> spv.Return } diff --git a/mlir/test/Dialect/SPIRV/IR/misc-ops.mlir b/mlir/test/Dialect/SPIRV/IR/misc-ops.mlir --- a/mlir/test/Dialect/SPIRV/IR/misc-ops.mlir +++ b/mlir/test/Dialect/SPIRV/IR/misc-ops.mlir @@ -31,8 +31,8 @@ // ----- func.func @assume_true(%arg : i1) -> () { - // CHECK: spv.AssumeTrueKHR %{{.*}} - spv.AssumeTrueKHR %arg + // CHECK: spv.KHR.AssumeTrue %{{.*}} + spv.KHR.AssumeTrue %arg spv.Return } @@ -41,6 +41,6 @@ func.func @assume_true(%arg : f32) -> () { // expected-error @+2{{use of value '%arg' expects different type than prior uses: 'i1' vs 'f32'}} // expected-note @-2 {{prior use here}} - spv.AssumeTrueKHR %arg + spv.KHR.AssumeTrue %arg spv.Return } diff --git a/mlir/test/Dialect/SPIRV/IR/target-env.mlir b/mlir/test/Dialect/SPIRV/IR/target-env.mlir --- a/mlir/test/Dialect/SPIRV/IR/target-env.mlir +++ b/mlir/test/Dialect/SPIRV/IR/target-env.mlir @@ -16,7 +16,7 @@ // spv.GroupNonUniformBallot is available starting from SPIR-V 1.3 under // GroupNonUniform capability. -// spv.SubgroupBallotKHR is available under in all SPIR-V versions under +// spv.KHR.SubgroupBallot is available under in all SPIR-V versions under // SubgroupBallotKHR capability and SPV_KHR_shader_ballot extension. // The GeometryPointSize capability implies the Geometry capability, which @@ -130,7 +130,7 @@ func.func @subgroup_ballot_suitable_extension(%predicate: i1) -> vector<4xi32> attributes { spv.target_env = #spv.target_env<#spv.vce, #spv.resource_limits<>> } { - // CHECK: spv.SubgroupBallotKHR + // CHECK: spv.KHR.SubgroupBallot %0 = "test.convert_to_subgroup_ballot_op"(%predicate): (i1) -> (vector<4xi32>) return %0: vector<4xi32> } 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 @@ -150,7 +150,7 @@ //===----------------------------------------------------------------------===// // Test deducing minimal extensions. -// spv.SubgroupBallotKHR requires the SPV_KHR_shader_ballot extension. +// spv.KHR.SubgroupBallot requires the SPV_KHR_shader_ballot extension. // CHECK: requires #spv.vce spv.module Logical GLSL450 attributes { @@ -159,7 +159,7 @@ [SPV_KHR_shader_ballot, SPV_KHR_shader_clock, SPV_KHR_variable_pointers]>, #spv.resource_limits<>> } { spv.func @subgroup_ballot(%predicate : i1) -> vector<4xi32> "None" { - %0 = spv.SubgroupBallotKHR %predicate: vector<4xi32> + %0 = spv.KHR.SubgroupBallot %predicate: vector<4xi32> spv.ReturnValue %0: vector<4xi32> } } diff --git a/mlir/test/Target/SPIRV/atomic-ops.mlir b/mlir/test/Target/SPIRV/atomic-ops.mlir --- a/mlir/test/Target/SPIRV/atomic-ops.mlir +++ b/mlir/test/Target/SPIRV/atomic-ops.mlir @@ -36,8 +36,8 @@ // CHECK-LABEL: @test_float_atomics spv.func @test_float_atomics(%ptr: !spv.ptr, %value: f32) -> f32 "None" { - // CHECK: spv.AtomicFAddEXT "Workgroup" "Acquire" %{{.*}}, %{{.*}} : !spv.ptr - %0 = spv.AtomicFAddEXT "Workgroup" "Acquire" %ptr, %value : !spv.ptr + // CHECK: spv.EXT.AtomicFAdd "Workgroup" "Acquire" %{{.*}}, %{{.*}} : !spv.ptr + %0 = spv.EXT.AtomicFAdd "Workgroup" "Acquire" %ptr, %value : !spv.ptr spv.ReturnValue %0: f32 } } diff --git a/mlir/test/Target/SPIRV/cooperative-matrix-ops.mlir b/mlir/test/Target/SPIRV/cooperative-matrix-ops.mlir --- a/mlir/test/Target/SPIRV/cooperative-matrix-ops.mlir +++ b/mlir/test/Target/SPIRV/cooperative-matrix-ops.mlir @@ -3,43 +3,43 @@ spv.module Logical GLSL450 requires #spv.vce { // CHECK-LABEL: @cooperative_matrix_load spv.func @cooperative_matrix_load(%ptr : !spv.ptr, %stride : i32, %b : i1) "None" { - // CHECK: {{%.*}} = spv.CooperativeMatrixLoadNV {{%.*}}, {{%.*}}, {{%.*}} : !spv.ptr as !spv.coopmatrix<16x8xi32, Workgroup> - %0 = spv.CooperativeMatrixLoadNV %ptr, %stride, %b : !spv.ptr as !spv.coopmatrix<16x8xi32, Workgroup> + // CHECK: {{%.*}} = spv.NV.CooperativeMatrixLoad {{%.*}}, {{%.*}}, {{%.*}} : !spv.ptr as !spv.coopmatrix<16x8xi32, Workgroup> + %0 = spv.NV.CooperativeMatrixLoad %ptr, %stride, %b : !spv.ptr as !spv.coopmatrix<16x8xi32, Workgroup> spv.Return } // CHECK-LABEL: @cooperative_matrix_load_memaccess spv.func @cooperative_matrix_load_memaccess(%ptr : !spv.ptr, %stride : i32, %b : i1) "None" { - // CHECK: {{%.*}} = spv.CooperativeMatrixLoadNV {{%.*}}, {{%.*}}, {{%.*}} ["Volatile"] : !spv.ptr as !spv.coopmatrix<8x16xi32, Subgroup> - %0 = spv.CooperativeMatrixLoadNV %ptr, %stride, %b ["Volatile"] : !spv.ptr as !spv.coopmatrix<8x16xi32, Subgroup> + // CHECK: {{%.*}} = spv.NV.CooperativeMatrixLoad {{%.*}}, {{%.*}}, {{%.*}} ["Volatile"] : !spv.ptr as !spv.coopmatrix<8x16xi32, Subgroup> + %0 = spv.NV.CooperativeMatrixLoad %ptr, %stride, %b ["Volatile"] : !spv.ptr as !spv.coopmatrix<8x16xi32, Subgroup> spv.Return } // CHECK-LABEL: @cooperative_matrix_store spv.func @cooperative_matrix_store(%ptr : !spv.ptr, %stride : i32, %m : !spv.coopmatrix<16x8xi32, Workgroup>, %b : i1) "None" { - // CHECK: spv.CooperativeMatrixStoreNV {{%.*}}, {{%.*}}, {{%.*}} : !spv.ptr, !spv.coopmatrix<16x8xi32, Workgroup> - spv.CooperativeMatrixStoreNV %ptr, %m, %stride, %b : !spv.ptr, !spv.coopmatrix<16x8xi32, Workgroup> + // CHECK: spv.NV.CooperativeMatrixStore {{%.*}}, {{%.*}}, {{%.*}} : !spv.ptr, !spv.coopmatrix<16x8xi32, Workgroup> + spv.NV.CooperativeMatrixStore %ptr, %m, %stride, %b : !spv.ptr, !spv.coopmatrix<16x8xi32, Workgroup> spv.Return } // CHECK-LABEL: @cooperative_matrix_store_memaccess spv.func @cooperative_matrix_store_memaccess(%ptr : !spv.ptr, %m : !spv.coopmatrix<8x16xi32, Subgroup>, %stride : i32, %b : i1) "None" { - // CHECK: spv.CooperativeMatrixStoreNV {{%.*}}, {{%.*}}, {{%.*}} ["Volatile"] : !spv.ptr, !spv.coopmatrix<8x16xi32, Subgroup> - spv.CooperativeMatrixStoreNV %ptr, %m, %stride, %b ["Volatile"] : !spv.ptr, !spv.coopmatrix<8x16xi32, Subgroup> + // CHECK: spv.NV.CooperativeMatrixStore {{%.*}}, {{%.*}}, {{%.*}} ["Volatile"] : !spv.ptr, !spv.coopmatrix<8x16xi32, Subgroup> + spv.NV.CooperativeMatrixStore %ptr, %m, %stride, %b ["Volatile"] : !spv.ptr, !spv.coopmatrix<8x16xi32, Subgroup> spv.Return } // CHECK-LABEL: @cooperative_matrix_length spv.func @cooperative_matrix_length() -> i32 "None" { - // CHECK: {{%.*}} = spv.CooperativeMatrixLengthNV : !spv.coopmatrix<8x16xi32, Subgroup> - %0 = spv.CooperativeMatrixLengthNV : !spv.coopmatrix<8x16xi32, Subgroup> + // CHECK: {{%.*}} = spv.NV.CooperativeMatrixLength : !spv.coopmatrix<8x16xi32, Subgroup> + %0 = spv.NV.CooperativeMatrixLength : !spv.coopmatrix<8x16xi32, Subgroup> spv.ReturnValue %0 : i32 } // CHECK-LABEL: @cooperative_matrix_muladd spv.func @cooperative_matrix_muladd(%a : !spv.coopmatrix<8x16xi32, Subgroup>, %b : !spv.coopmatrix<16x8xi32, Subgroup>, %c : !spv.coopmatrix<8x8xi32, Subgroup>) "None" { - // CHECK: {{%.*}} = spv.CooperativeMatrixMulAddNV {{%.*}}, {{%.*}}, {{%.*}} : !spv.coopmatrix<8x16xi32, Subgroup>, !spv.coopmatrix<16x8xi32, Subgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> - %r = spv.CooperativeMatrixMulAddNV %a, %b, %c : !spv.coopmatrix<8x16xi32, Subgroup>, !spv.coopmatrix<16x8xi32, Subgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> + // CHECK: {{%.*}} = spv.NV.CooperativeMatrixMulAdd {{%.*}}, {{%.*}}, {{%.*}} : !spv.coopmatrix<8x16xi32, Subgroup>, !spv.coopmatrix<16x8xi32, Subgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> + %r = spv.NV.CooperativeMatrixMulAdd %a, %b, %c : !spv.coopmatrix<8x16xi32, Subgroup>, !spv.coopmatrix<16x8xi32, Subgroup> -> !spv.coopmatrix<8x8xi32, Subgroup> spv.Return } diff --git a/mlir/test/Target/SPIRV/group-ops.mlir b/mlir/test/Target/SPIRV/group-ops.mlir --- a/mlir/test/Target/SPIRV/group-ops.mlir +++ b/mlir/test/Target/SPIRV/group-ops.mlir @@ -3,8 +3,8 @@ spv.module Logical GLSL450 requires #spv.vce { // CHECK-LABEL: @subgroup_ballot spv.func @subgroup_ballot(%predicate: i1) -> vector<4xi32> "None" { - // CHECK: %{{.*}} = spv.SubgroupBallotKHR %{{.*}}: vector<4xi32> - %0 = spv.SubgroupBallotKHR %predicate: vector<4xi32> + // CHECK: %{{.*}} = spv.KHR.SubgroupBallot %{{.*}}: vector<4xi32> + %0 = spv.KHR.SubgroupBallot %predicate: vector<4xi32> spv.ReturnValue %0: vector<4xi32> } // CHECK-LABEL: @group_broadcast_1 @@ -21,26 +21,26 @@ } // CHECK-LABEL: @subgroup_block_read_intel spv.func @subgroup_block_read_intel(%ptr : !spv.ptr) -> i32 "None" { - // CHECK: spv.SubgroupBlockReadINTEL %{{.*}} : i32 - %0 = spv.SubgroupBlockReadINTEL "StorageBuffer" %ptr : i32 + // CHECK: spv.INTEL.SubgroupBlockRead %{{.*}} : i32 + %0 = spv.INTEL.SubgroupBlockRead "StorageBuffer" %ptr : i32 spv.ReturnValue %0: i32 } // CHECK-LABEL: @subgroup_block_read_intel_vector spv.func @subgroup_block_read_intel_vector(%ptr : !spv.ptr) -> vector<3xi32> "None" { - // CHECK: spv.SubgroupBlockReadINTEL %{{.*}} : vector<3xi32> - %0 = spv.SubgroupBlockReadINTEL "StorageBuffer" %ptr : vector<3xi32> + // CHECK: spv.INTEL.SubgroupBlockRead %{{.*}} : vector<3xi32> + %0 = spv.INTEL.SubgroupBlockRead "StorageBuffer" %ptr : vector<3xi32> spv.ReturnValue %0: vector<3xi32> } // CHECK-LABEL: @subgroup_block_write_intel spv.func @subgroup_block_write_intel(%ptr : !spv.ptr, %value: i32) -> () "None" { - // CHECK: spv.SubgroupBlockWriteINTEL %{{.*}}, %{{.*}} : i32 - spv.SubgroupBlockWriteINTEL "StorageBuffer" %ptr, %value : i32 + // CHECK: spv.INTEL.SubgroupBlockWrite %{{.*}}, %{{.*}} : i32 + spv.INTEL.SubgroupBlockWrite "StorageBuffer" %ptr, %value : i32 spv.Return } // CHECK-LABEL: @subgroup_block_write_intel_vector spv.func @subgroup_block_write_intel_vector(%ptr : !spv.ptr, %value: vector<3xi32>) -> () "None" { - // CHECK: spv.SubgroupBlockWriteINTEL %{{.*}}, %{{.*}} : vector<3xi32> - spv.SubgroupBlockWriteINTEL "StorageBuffer" %ptr, %value : vector<3xi32> + // CHECK: spv.INTEL.SubgroupBlockWrite %{{.*}}, %{{.*}} : vector<3xi32> + spv.INTEL.SubgroupBlockWrite "StorageBuffer" %ptr, %value : vector<3xi32> spv.Return } } diff --git a/mlir/test/Target/SPIRV/joint-matrix-ops.mlir b/mlir/test/Target/SPIRV/joint-matrix-ops.mlir --- a/mlir/test/Target/SPIRV/joint-matrix-ops.mlir +++ b/mlir/test/Target/SPIRV/joint-matrix-ops.mlir @@ -3,43 +3,43 @@ spv.module Logical GLSL450 requires #spv.vce { // CHECK-LABEL: @joint_matrix_load spv.func @joint_matrix_load(%ptr : !spv.ptr, %stride : i32) "None" { - // CHECK: {{%.*}} = spv.JointMatrixLoadINTEL {{%.*}}, {{%.*}} : (!spv.ptr, i32) -> !spv.jointmatrix<16x8xi32, RowMajor, Workgroup> - %0 = spv.JointMatrixLoadINTEL %ptr, %stride : (!spv.ptr, i32) -> !spv.jointmatrix<16x8xi32, RowMajor, Workgroup> + // CHECK: {{%.*}} = spv.INTEL.JointMatrixLoad {{%.*}}, {{%.*}} : (!spv.ptr, i32) -> !spv.jointmatrix<16x8xi32, RowMajor, Workgroup> + %0 = spv.INTEL.JointMatrixLoad %ptr, %stride : (!spv.ptr, i32) -> !spv.jointmatrix<16x8xi32, RowMajor, Workgroup> spv.Return } // CHECK-LABEL: @joint_matrix_load_memaccess spv.func @joint_matrix_load_memaccess(%ptr : !spv.ptr, %stride : i32) "None" { - // CHECK: {{%.*}} = spv.JointMatrixLoadINTEL {{%.*}}, {{%.*}} {memory_access = #spv.memory_access} : (!spv.ptr, i32) -> !spv.jointmatrix<8x16xi32, RowMajor, Subgroup> - %0 = spv.JointMatrixLoadINTEL %ptr, %stride {memory_access = #spv.memory_access} : (!spv.ptr, i32) -> !spv.jointmatrix<8x16xi32, RowMajor, Subgroup> + // CHECK: {{%.*}} = spv.INTEL.JointMatrixLoad {{%.*}}, {{%.*}} {memory_access = #spv.memory_access} : (!spv.ptr, i32) -> !spv.jointmatrix<8x16xi32, RowMajor, Subgroup> + %0 = spv.INTEL.JointMatrixLoad %ptr, %stride {memory_access = #spv.memory_access} : (!spv.ptr, i32) -> !spv.jointmatrix<8x16xi32, RowMajor, Subgroup> spv.Return } // CHECK-LABEL: @joint_matrix_store spv.func @joint_matrix_store(%ptr : !spv.ptr, %stride : i32, %m : !spv.jointmatrix<16x8xi32, RowMajor, Workgroup>) "None" { - // CHECK: spv.JointMatrixStoreINTEL {{%.*}}, {{%.*}}, {{%.*}} : (!spv.ptr, !spv.jointmatrix<16x8xi32, RowMajor, Workgroup>, i32) - spv.JointMatrixStoreINTEL %ptr, %m, %stride : (!spv.ptr, !spv.jointmatrix<16x8xi32, RowMajor, Workgroup>, i32) + // CHECK: spv.INTEL.JointMatrixStore {{%.*}}, {{%.*}}, {{%.*}} : (!spv.ptr, !spv.jointmatrix<16x8xi32, RowMajor, Workgroup>, i32) + spv.INTEL.JointMatrixStore %ptr, %m, %stride : (!spv.ptr, !spv.jointmatrix<16x8xi32, RowMajor, Workgroup>, i32) spv.Return } // CHECK-LABEL: @joint_matrix_store_memaccess spv.func @joint_matrix_store_memaccess(%ptr : !spv.ptr, %m : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, %stride : i32) "None" { - // CHECK: spv.JointMatrixStoreINTEL {{%.*}}, {{%.*}}, {{%.*}} {memory_access = #spv.memory_access} : (!spv.ptr, !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, i32) - spv.JointMatrixStoreINTEL %ptr, %m, %stride {memory_access = #spv.memory_access} : (!spv.ptr, !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, i32) + // CHECK: spv.INTEL.JointMatrixStore {{%.*}}, {{%.*}}, {{%.*}} {memory_access = #spv.memory_access} : (!spv.ptr, !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, i32) + spv.INTEL.JointMatrixStore %ptr, %m, %stride {memory_access = #spv.memory_access} : (!spv.ptr, !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, i32) spv.Return } // CHECK-LABEL: @joint_matrix_length spv.func @joint_matrix_length() -> i32 "None" { - // CHECK: {{%.*}} = spv.JointMatrixWorkItemLengthINTEL : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup> - %0 = spv.JointMatrixWorkItemLengthINTEL : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup> + // CHECK: {{%.*}} = spv.INTEL.JointMatrixWorkItemLength : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup> + %0 = spv.INTEL.JointMatrixWorkItemLength : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup> spv.ReturnValue %0 : i32 } // CHECK-LABEL: @joint_matrix_muladd spv.func @joint_matrix_muladd(%a : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, %b : !spv.jointmatrix<16x8xi32, RowMajor, Subgroup>, %c : !spv.jointmatrix<8x8xi32, RowMajor, Subgroup>) "None" { - // CHECK: {{%.*}} = spv.JointMatrixMadINTEL {{%.*}}, {{%.*}}, {{%.*}} : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, !spv.jointmatrix<16x8xi32, RowMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> - %r = spv.JointMatrixMadINTEL %a, %b, %c : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, !spv.jointmatrix<16x8xi32, RowMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> + // CHECK: {{%.*}} = spv.INTEL.JointMatrixMad {{%.*}}, {{%.*}}, {{%.*}} : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, !spv.jointmatrix<16x8xi32, RowMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> + %r = spv.INTEL.JointMatrixMad %a, %b, %c : !spv.jointmatrix<8x16xi32, RowMajor, Subgroup>, !spv.jointmatrix<16x8xi32, RowMajor, Subgroup> -> !spv.jointmatrix<8x8xi32, RowMajor, Subgroup> spv.Return } } diff --git a/mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp b/mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp --- a/mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp +++ b/mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp @@ -233,7 +233,7 @@ ConvertToSubgroupBallot::ConvertToSubgroupBallot(MLIRContext *context) : RewritePattern("test.convert_to_subgroup_ballot_op", 1, context, - {"spv.SubgroupBallotKHR"}) {} + {"spv.KHR.SubgroupBallot"}) {} LogicalResult ConvertToSubgroupBallot::matchAndRewrite(Operation *op,