[MLIR][SPIRV] Rename `spv._module_end` to `spv.mlir.endmodule`

This commit does the renaming mentioned in the title in order to bring
'spv' dialect closer to the MLIR naming conventions.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D91792
This commit is contained in:
ergawy 2020-11-19 13:22:37 -05:00 committed by Lei Zhang
parent c77aefb0ff
commit 2f3adc54b5
5 changed files with 11 additions and 11 deletions

View File

@ -92,7 +92,7 @@ The SPIR-V dialect adopts the following conventions for IR:
(de)serialization. (de)serialization.
* Ops with `mlir.snake_case` names are those that have no corresponding * Ops with `mlir.snake_case` names are those that have no corresponding
instructions (or concepts) in the binary format. They are introduced to instructions (or concepts) in the binary format. They are introduced to
satisfy MLIR structural requirements. For example, `spv.mlir.module_end` and satisfy MLIR structural requirements. For example, `spv.mlir.endmodule` and
`spv.mlir.merge`. They map to no instructions during (de)serialization. `spv.mlir.merge`. They map to no instructions during (de)serialization.
(TODO: consider merging the last two cases and adopting `spv.mlir.` prefix for (TODO: consider merging the last two cases and adopting `spv.mlir.` prefix for

View File

@ -787,7 +787,7 @@ Module in SPIR-V has one region that contains one block. It is defined via
`spv.module` is converted into `ModuleOp`. This plays a role of enclosing scope `spv.module` is converted into `ModuleOp`. This plays a role of enclosing scope
to LLVM ops. At the moment, SPIR-V module attributes are ignored. to LLVM ops. At the moment, SPIR-V module attributes are ignored.
`spv._module_end` is mapped to an equivalent terminator `ModuleTerminatorOp`. `spv.mlir.endmodule` is mapped to an equivalent terminator `ModuleTerminatorOp`.
## `mlir-spirv-cpu-runner` ## `mlir-spirv-cpu-runner`

View File

@ -373,7 +373,7 @@ def SPV_ModuleOp : SPV_Op<"module",
implicitly capture values from the enclosing environment. implicitly capture values from the enclosing environment.
This op has only one region, which only contains one block. The block This op has only one region, which only contains one block. The block
must be terminated via the `spv._module_end` op. must be terminated via the `spv.mlir.endmodule` op.
<!-- End of AutoGen section --> <!-- End of AutoGen section -->
@ -443,7 +443,7 @@ def SPV_ModuleOp : SPV_Op<"module",
// ----- // -----
def SPV_ModuleEndOp : SPV_Op<"_module_end", [InModuleScope, Terminator]> { def SPV_ModuleEndOp : SPV_Op<"mlir.endmodule", [InModuleScope, Terminator]> {
let summary = "The pseudo op that ends a SPIR-V module"; let summary = "The pseudo op that ends a SPIR-V module";
let description = [{ let description = [{

View File

@ -16,7 +16,7 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], [SPV_KHR_16bit_stor
// CHECK: module // CHECK: module
spv.module Logical GLSL450 { spv.module Logical GLSL450 {
// CHECK: } // CHECK: }
spv._module_end spv.mlir.endmodule
} }
// CHECK: module // CHECK: module

View File

@ -390,10 +390,10 @@ spv.module Logical GLSL450
requires #spv.vce<v1.0, [Shader], [SPV_KHR_16bit_storage]> requires #spv.vce<v1.0, [Shader], [SPV_KHR_16bit_storage]>
attributes {foo = "bar"} { } attributes {foo = "bar"} { }
// Module with explicit spv._module_end // Module with explicit spv.mlir.endmodule
// CHECK: spv.module // CHECK: spv.module
spv.module Logical GLSL450 { spv.module Logical GLSL450 {
spv._module_end spv.mlir.endmodule
} }
// Module with function // Module with function
@ -442,8 +442,8 @@ spv.module Logical GLSL450 {
// ----- // -----
// Module with wrong terminator // Module with wrong terminator
// expected-error@+2 {{expects regions to end with 'spv._module_end'}} // expected-error@+2 {{expects regions to end with 'spv.mlir.endmodule'}}
// expected-note@+1 {{in custom textual format, the absence of terminator implies 'spv._module_end'}} // expected-note@+1 {{in custom textual format, the absence of terminator implies 'spv.mlir.endmodule'}}
"spv.module"() ({ "spv.module"() ({
%0 = spv.constant true %0 = spv.constant true
}) {addressing_model = 0 : i32, memory_model = 1 : i32} : () -> () }) {addressing_model = 0 : i32, memory_model = 1 : i32} : () -> ()
@ -477,12 +477,12 @@ spv.module Logical GLSL450 {
// ----- // -----
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// spv._module_end // spv.mlir.endmodule
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
func @module_end_not_in_module() -> () { func @module_end_not_in_module() -> () {
// expected-error @+1 {{op must appear in a module-like op's block}} // expected-error @+1 {{op must appear in a module-like op's block}}
spv._module_end spv.mlir.endmodule
} }
// ----- // -----