Skip to content

Commit 2f3adc5

Browse files
ergawyantiagainst
authored andcommitted
[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
1 parent c77aefb commit 2f3adc5

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

mlir/docs/Dialects/SPIR-V.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ The SPIR-V dialect adopts the following conventions for IR:
9292
(de)serialization.
9393
* Ops with `mlir.snake_case` names are those that have no corresponding
9494
instructions (or concepts) in the binary format. They are introduced to
95-
satisfy MLIR structural requirements. For example, `spv.mlir.module_end` and
95+
satisfy MLIR structural requirements. For example, `spv.mlir.endmodule` and
9696
`spv.mlir.merge`. They map to no instructions during (de)serialization.
9797

9898
(TODO: consider merging the last two cases and adopting `spv.mlir.` prefix for

mlir/docs/SPIRVToLLVMDialectConversion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ Module in SPIR-V has one region that contains one block. It is defined via
787787
`spv.module` is converted into `ModuleOp`. This plays a role of enclosing scope
788788
to LLVM ops. At the moment, SPIR-V module attributes are ignored.
789789

790-
`spv._module_end` is mapped to an equivalent terminator `ModuleTerminatorOp`.
790+
`spv.mlir.endmodule` is mapped to an equivalent terminator `ModuleTerminatorOp`.
791791

792792
## `mlir-spirv-cpu-runner`
793793

mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def SPV_ModuleOp : SPV_Op<"module",
373373
implicitly capture values from the enclosing environment.
374374

375375
This op has only one region, which only contains one block. The block
376-
must be terminated via the `spv._module_end` op.
376+
must be terminated via the `spv.mlir.endmodule` op.
377377

378378
<!-- End of AutoGen section -->
379379

@@ -443,7 +443,7 @@ def SPV_ModuleOp : SPV_Op<"module",
443443

444444
// -----
445445

446-
def SPV_ModuleEndOp : SPV_Op<"_module_end", [InModuleScope, Terminator]> {
446+
def SPV_ModuleEndOp : SPV_Op<"mlir.endmodule", [InModuleScope, Terminator]> {
447447
let summary = "The pseudo op that ends a SPIR-V module";
448448

449449
let description = [{

mlir/test/Conversion/SPIRVToLLVM/module-ops-to-llvm.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], [SPV_KHR_16bit_stor
1616
// CHECK: module
1717
spv.module Logical GLSL450 {
1818
// CHECK: }
19-
spv._module_end
19+
spv.mlir.endmodule
2020
}
2121

2222
// CHECK: module

mlir/test/Dialect/SPIRV/structure-ops.mlir

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,10 @@ spv.module Logical GLSL450
390390
requires #spv.vce<v1.0, [Shader], [SPV_KHR_16bit_storage]>
391391
attributes {foo = "bar"} { }
392392

393-
// Module with explicit spv._module_end
393+
// Module with explicit spv.mlir.endmodule
394394
// CHECK: spv.module
395395
spv.module Logical GLSL450 {
396-
spv._module_end
396+
spv.mlir.endmodule
397397
}
398398

399399
// Module with function
@@ -442,8 +442,8 @@ spv.module Logical GLSL450 {
442442
// -----
443443

444444
// Module with wrong terminator
445-
// expected-error@+2 {{expects regions to end with 'spv._module_end'}}
446-
// expected-note@+1 {{in custom textual format, the absence of terminator implies 'spv._module_end'}}
445+
// expected-error@+2 {{expects regions to end with 'spv.mlir.endmodule'}}
446+
// expected-note@+1 {{in custom textual format, the absence of terminator implies 'spv.mlir.endmodule'}}
447447
"spv.module"() ({
448448
%0 = spv.constant true
449449
}) {addressing_model = 0 : i32, memory_model = 1 : i32} : () -> ()
@@ -477,12 +477,12 @@ spv.module Logical GLSL450 {
477477
// -----
478478

479479
//===----------------------------------------------------------------------===//
480-
// spv._module_end
480+
// spv.mlir.endmodule
481481
//===----------------------------------------------------------------------===//
482482

483483
func @module_end_not_in_module() -> () {
484484
// expected-error @+1 {{op must appear in a module-like op's block}}
485-
spv._module_end
485+
spv.mlir.endmodule
486486
}
487487

488488
// -----

0 commit comments

Comments
 (0)