[Mlir-commits] [mlir] 9bd50ab - [MLIR][SPIRV] Rename `spv._merge` to `spv.mlir.merge`

Lei Zhang llvmlistbot at llvm.org
Thu Nov 19 07:05:08 PST 2020


Author: ergawy
Date: 2020-11-19T10:04:35-05:00
New Revision: 9bd50abc4ca150d5dfb89bf40de26549e4ec31e5

URL: https://github.com/llvm/llvm-project/commit/9bd50abc4ca150d5dfb89bf40de26549e4ec31e5
DIFF: https://github.com/llvm/llvm-project/commit/9bd50abc4ca150d5dfb89bf40de26549e4ec31e5.diff

LOG: [MLIR][SPIRV] Rename `spv._merge` to `spv.mlir.merge`

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/D91797

Added: 
    

Modified: 
    mlir/docs/Dialects/SPIR-V.md
    mlir/docs/SPIRVToLLVMDialectConversion.md
    mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
    mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
    mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
    mlir/test/Conversion/GPUToSPIRV/if.mlir
    mlir/test/Conversion/GPUToSPIRV/loop.mlir
    mlir/test/Conversion/LinalgToSPIRV/linalg-to-spirv.mlir
    mlir/test/Conversion/SPIRVToLLVM/control-flow-ops-to-llvm.mlir
    mlir/test/Dialect/SPIRV/Serialization/debug.mlir
    mlir/test/Dialect/SPIRV/Serialization/function-call.mlir
    mlir/test/Dialect/SPIRV/Serialization/loop.mlir
    mlir/test/Dialect/SPIRV/Serialization/phi.mlir
    mlir/test/Dialect/SPIRV/Serialization/selection.mlir
    mlir/test/Dialect/SPIRV/Transforms/inlining.mlir
    mlir/test/Dialect/SPIRV/canonicalize.mlir
    mlir/test/Dialect/SPIRV/control-flow-ops.mlir

Removed: 
    


################################################################################
diff  --git a/mlir/docs/Dialects/SPIR-V.md b/mlir/docs/Dialects/SPIR-V.md
index 1627beded6d0..76d47cce3353 100644
--- a/mlir/docs/Dialects/SPIR-V.md
+++ b/mlir/docs/Dialects/SPIR-V.md
@@ -90,10 +90,10 @@ The SPIR-V dialect adopts the following conventions for IR:
     ops are mostly for defining the SPIR-V structure. For example, `spv.module`
     and `spv.constant`. They may correspond to one or more instructions during
     (de)serialization.
-*   Ops with `_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
-    satisfy MLIR structural requirements. For example, `spv._module_end` and
-    `spv._merge`. They map to no instructions during (de)serialization.
+    satisfy MLIR structural requirements. For example, `spv.mlir.module_end` and
+    `spv.mlir.merge`. They map to no instructions during (de)serialization.
 
 (TODO: consider merging the last two cases and adopting `spv.mlir.` prefix for
 them.)
@@ -510,7 +510,7 @@ MLIR system.
 
 We introduce a `spv.selection` and `spv.loop` op for structured selections and
 loops, respectively. The merge targets are the next ops following them. Inside
-their regions, a special terminator, `spv._merge` is introduced for branching to
+their regions, a special terminator, `spv.mlir.merge` is introduced for branching to
 the merge target.
 
 ### Selection
@@ -522,7 +522,7 @@ merge block.
 *   The selection header block should be the first block. It should contain the
     `spv.BranchConditional` or `spv.Switch` op.
 *   The merge block should be the last block. The merge block should only
-    contain a `spv._merge` op. Any block can branch to the merge block for early
+    contain a `spv.mlir.merge` op. Any block can branch to the merge block for early
     exit.
 
 ```
@@ -581,7 +581,7 @@ func @selection(%cond: i1) -> () {
     spv.Branch ^merge
 
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
 
   // ...
@@ -598,7 +598,7 @@ continue block, one merge block.
 *   The entry block should be the first block and it should jump to the loop
     header block, which is the second block.
 *   The merge block should be the last block. The merge block should only
-    contain a `spv._merge` op. Any block except the entry block can branch to
+    contain a `spv.mlir.merge` op. Any block except the entry block can branch to
     the merge block for early exit.
 *   The continue block should be the second to last block and it should have a
     branch to the loop header block.
@@ -675,7 +675,7 @@ func @loop(%count : i32) -> () {
     spv.Branch ^header
 
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   return
 }
@@ -731,7 +731,7 @@ func @foo() -> () {
     spv.Return
 
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   spv.Return
 }

diff  --git a/mlir/docs/SPIRVToLLVMDialectConversion.md b/mlir/docs/SPIRVToLLVMDialectConversion.md
index 903f53f8fd7b..bf4ceee42cdb 100644
--- a/mlir/docs/SPIRVToLLVMDialectConversion.md
+++ b/mlir/docs/SPIRVToLLVMDialectConversion.md
@@ -665,7 +665,7 @@ spv.selection {
   spv.Branch ^merge                                     llvm.br ^merge
 
 ^merge:                                               ^merge:
-  spv._merge                                            llvm.br ^continue
+  spv.mlir.merge                                            llvm.br ^continue
 }
 // Remaining code																			^continue:
                                                         // Remaining code
@@ -690,7 +690,7 @@ spv.loop {
   spv.Branch ^header                                    llvm.br ^header
 
 ^merge:                                               ^merge:
-  spv._merge                                            llvm.br ^remaining
+  spv.mlir.merge                                            llvm.br ^remaining
 }
 // Remaining code                                     ^remaining:
                                                         // Remaining code

diff  --git a/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td b/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
index dd1bc9ed3519..76fdc64e59da 100644
--- a/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
+++ b/mlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
@@ -272,7 +272,7 @@ def SPV_LoopOp : SPV_Op<"loop", [InFunctionScope]> {
     one loop header block, one loop continue block, one loop merge block.
     The entry block should be the first block and it should jump to the loop
     header block, which is the second block. The loop merge block should be the
-    last block. The merge block should only contain a `spv._merge` op.
+    last block. The merge block should only contain a `spv.mlir.merge` op.
     The continue block should be the second to last block and it should have a
     branch to the loop header block. The loop continue block should be the only
     block, except the entry block, branching to the header block.
@@ -302,7 +302,7 @@ def SPV_LoopOp : SPV_Op<"loop", [InFunctionScope]> {
     Block *getMergeBlock();
 
     // Adds an empty entry block and loop merge block containing one
-    // spv._merge op.
+    // spv.mlir.merge op.
     void addEntryAndMergeBlock();
   }];
 
@@ -313,7 +313,7 @@ def SPV_LoopOp : SPV_Op<"loop", [InFunctionScope]> {
 
 // -----
 
-def SPV_MergeOp : SPV_Op<"_merge", [NoSideEffect, Terminator]> {
+def SPV_MergeOp : SPV_Op<"mlir.merge", [NoSideEffect, Terminator]> {
   let summary = "A special terminator for merging a structured selection/loop.";
 
   let description = [{
@@ -435,7 +435,7 @@ def SPV_SelectionOp : SPV_Op<"selection", [InFunctionScope]> {
     The `spv.selection` region should contain at least two blocks: one selection
     header block, and one selection merge. The selection header block should be
     the first block. The selection merge block should be the last block.
-    The merge block should only contain a `spv._merge` op.
+    The merge block should only contain a `spv.mlir.merge` op.
   }];
 
   let arguments = (ins
@@ -453,7 +453,7 @@ def SPV_SelectionOp : SPV_Op<"selection", [InFunctionScope]> {
     /// Returns the selection merge block.
     Block *getMergeBlock();
 
-    /// Adds a selection merge block containing one spv._merge op.
+    /// Adds a selection merge block containing one spv.mlir.merge op.
     void addMergeBlock();
 
     /// Creates a spv.selection op for `if (<condition>) then { <thenBody> }`

diff  --git a/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp b/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
index 887d662d0040..6638cf9830f0 100644
--- a/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
+++ b/mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
@@ -641,7 +641,7 @@ static Type getElementType(Type type, Attribute indices, OpAsmParser &parser,
   return getElementType(type, indices, errorFn);
 }
 
-/// Returns true if the given `block` only contains one `spv._merge` op.
+/// Returns true if the given `block` only contains one `spv.mlir.merge` op.
 static inline bool isMergeBlock(Block &block) {
   return !block.empty() && std::next(block.begin()) == block.end() &&
          isa<spirv::MergeOp>(block.front());
@@ -2320,7 +2320,7 @@ static LogicalResult verify(spirv::LoopOp loopOp) {
   Block &merge = region.back();
   if (!isMergeBlock(merge))
     return loopOp.emitOpError(
-        "last block must be the merge block with only one 'spv._merge' op");
+        "last block must be the merge block with only one 'spv.mlir.merge' op");
 
   if (std::next(region.begin()) == region.end())
     return loopOp.emitOpError(
@@ -2397,12 +2397,12 @@ void spirv::LoopOp::addEntryAndMergeBlock() {
   body().push_back(mergeBlock);
   OpBuilder builder = OpBuilder::atBlockEnd(mergeBlock);
 
-  // Add a spv._merge op into the merge block.
+  // Add a spv.mlir.merge op into the merge block.
   builder.create<spirv::MergeOp>(getLoc());
 }
 
 //===----------------------------------------------------------------------===//
-// spv._merge
+// spv.mlir.merge
 //===----------------------------------------------------------------------===//
 
 static LogicalResult verify(spirv::MergeOp mergeOp) {
@@ -2697,7 +2697,7 @@ static LogicalResult verify(spirv::SelectionOp selectionOp) {
   // The last block is the merge block.
   if (!isMergeBlock(region.back()))
     return selectionOp.emitOpError(
-        "last block must be the merge block with only one 'spv._merge' op");
+        "last block must be the merge block with only one 'spv.mlir.merge' op");
 
   if (std::next(region.begin()) == region.end())
     return selectionOp.emitOpError("must have a selection header block");
@@ -2723,7 +2723,7 @@ void spirv::SelectionOp::addMergeBlock() {
   body().push_back(mergeBlock);
   OpBuilder builder = OpBuilder::atBlockEnd(mergeBlock);
 
-  // Add a spv._merge op into the merge block.
+  // Add a spv.mlir.merge op into the merge block.
   builder.create<spirv::MergeOp>(getLoc());
 }
 

diff  --git a/mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp b/mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
index 4b80802e8dac..8781b6bf17c4 100644
--- a/mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
+++ b/mlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
@@ -1748,7 +1748,7 @@ LogicalResult Serializer::processSelectionOp(spirv::SelectionOp selectionOp) {
     return failure();
 
   // There is nothing to do for the merge block in the selection, which just
-  // contains a spv._merge op, itself. But we need to have an OpLabel
+  // contains a spv.mlir.merge op, itself. But we need to have an OpLabel
   // instruction to start a new SPIR-V block for ops following this SelectionOp.
   // The block should use the <id> for the merge block.
   return encodeInstructionInto(functionBody, spirv::Opcode::OpLabel, {mergeID});
@@ -1808,7 +1808,7 @@ LogicalResult Serializer::processLoopOp(spirv::LoopOp loopOp) {
     return failure();
 
   // There is nothing to do for the merge block in the loop, which just contains
-  // a spv._merge op, itself. But we need to have an OpLabel instruction to
+  // a spv.mlir.merge op, itself. But we need to have an OpLabel instruction to
   // start a new SPIR-V block for ops following this LoopOp. The block should
   // use the <id> for the merge block.
   return encodeInstructionInto(functionBody, spirv::Opcode::OpLabel, {mergeID});

diff  --git a/mlir/test/Conversion/GPUToSPIRV/if.mlir b/mlir/test/Conversion/GPUToSPIRV/if.mlir
index e650b9b2f427..e5e4a4fc7e97 100644
--- a/mlir/test/Conversion/GPUToSPIRV/if.mlir
+++ b/mlir/test/Conversion/GPUToSPIRV/if.mlir
@@ -25,7 +25,7 @@ module attributes {
       // CHECK-NEXT:  [[TRUE]]:
       // CHECK:         spv.Branch [[MERGE]]
       // CHECK-NEXT:  [[MERGE]]:
-      // CHECK-NEXT:    spv._merge
+      // CHECK-NEXT:    spv.mlir.merge
       // CHECK-NEXT:  }
       // CHECK-NEXT:  spv.Return
 
@@ -51,7 +51,7 @@ module attributes {
       // CHECK-NEXT:    [[FALSE_NESTED_TRUE_PATH]]:
       // CHECK:           spv.Branch [[MERGE_NESTED_TRUE_PATH]]
       // CHECK-NEXT:    [[MERGE_NESTED_TRUE_PATH]]:
-      // CHECK-NEXT:      spv._merge
+      // CHECK-NEXT:      spv.mlir.merge
       // CHECK-NEXT:    }
       // CHECK-NEXT:    spv.Branch [[MERGE_TOP:\^.*]]
       // CHECK-NEXT:  [[FALSE_TOP]]:
@@ -62,11 +62,11 @@ module attributes {
       // CHECK-NEXT:    [[FALSE_NESTED_FALSE_PATH]]:
       // CHECK:           spv.Branch [[MERGE_NESTED_FALSE_PATH]]
       // CHECK:         [[MERGE_NESTED_FALSE_PATH]]:
-      // CHECK-NEXT:      spv._merge
+      // CHECK-NEXT:      spv.mlir.merge
       // CHECK-NEXT:    }
       // CHECK-NEXT:    spv.Branch [[MERGE_TOP]]
       // CHECK-NEXT:  [[MERGE_TOP]]:
-      // CHECK-NEXT:    spv._merge
+      // CHECK-NEXT:    spv.mlir.merge
       // CHECK-NEXT:  }
       // CHECK-NEXT:  spv.Return
 
@@ -109,7 +109,7 @@ module attributes {
       // CHECK-DAG:     spv.Store "Function" %[[VAR2]], %[[RET2FALSE]] : f32
       // CHECK:         spv.Branch ^[[MERGE]]
       // CHECK-NEXT:  ^[[MERGE]]:
-      // CHECK:         spv._merge
+      // CHECK:         spv.mlir.merge
       // CHECK-NEXT:  }
       // CHECK-DAG:   %[[OUT1:.*]] = spv.Load "Function" %[[VAR1]] : f32
       // CHECK-DAG:   %[[OUT2:.*]] = spv.Load "Function" %[[VAR2]] : f32
@@ -145,7 +145,7 @@ module attributes {
     // CHECK:         spv.Store "Function" %[[VAR]], {{%.*}} : !spv.ptr<!spv.struct<(!spv.array<10 x f32, stride=4> [0])>, StorageBuffer>
     // CHECK:         spv.Branch ^[[MERGE]]
     // CHECK-NEXT:  ^[[MERGE]]:
-    // CHECK:         spv._merge
+    // CHECK:         spv.mlir.merge
     // CHECK-NEXT:  }
     // CHECK:       %[[OUT:.*]] = spv.Load "Function" %[[VAR]] : !spv.ptr<!spv.struct<(!spv.array<10 x f32, stride=4> [0])>, StorageBuffer>
     // CHECK:       %[[ADD:.*]] = spv.AccessChain %[[OUT]][{{%.*}}, {{%.*}}] : !spv.ptr<!spv.struct<(!spv.array<10 x f32, stride=4> [0])>, StorageBuffer>

diff  --git a/mlir/test/Conversion/GPUToSPIRV/loop.mlir b/mlir/test/Conversion/GPUToSPIRV/loop.mlir
index 2cfef2b9cf33..812007c1fd64 100644
--- a/mlir/test/Conversion/GPUToSPIRV/loop.mlir
+++ b/mlir/test/Conversion/GPUToSPIRV/loop.mlir
@@ -43,7 +43,7 @@ module attributes {
       // CHECK:        %[[INCREMENT:.*]] = spv.IAdd %[[INDVAR]], %[[STEP]] : i32
       // CHECK:        spv.Branch ^[[HEADER]](%[[INCREMENT]] : i32)
       // CHECK:      ^[[MERGE]]
-      // CHECK:        spv._merge
+      // CHECK:        spv.mlir.merge
       // CHECK:      }
       scf.for %arg4 = %lb to %ub step %step {
         %1 = load %arg2[%arg4] : memref<10xf32>
@@ -80,7 +80,7 @@ module attributes {
       // CHECK-DAG:   spv.Store "Function" %[[VAR2]], %[[UPDATED]] : f32
       // CHECK: spv.Branch ^[[HEADER]](%[[INCREMENT]], %[[UPDATED]], %[[UPDATED]] : i32, f32, f32)
       // CHECK: ^[[MERGE]]:
-      // CHECK:   spv._merge
+      // CHECK:   spv.mlir.merge
       // CHECK: }
       %result:2 = scf.for %i0 = %lb to %ub step %step iter_args(%si = %s0, %sj = %s1) -> (f32, f32) {
         %sn = addf %si, %si : f32

diff  --git a/mlir/test/Conversion/LinalgToSPIRV/linalg-to-spirv.mlir b/mlir/test/Conversion/LinalgToSPIRV/linalg-to-spirv.mlir
index 0fac017f2e68..c0cba8c360ca 100644
--- a/mlir/test/Conversion/LinalgToSPIRV/linalg-to-spirv.mlir
+++ b/mlir/test/Conversion/LinalgToSPIRV/linalg-to-spirv.mlir
@@ -40,7 +40,7 @@ module attributes {
 // CHECK:          spv.AtomicIAdd "Device" "AcquireRelease" %[[OUTPTR]], %[[ADD]]
 // CHECK:          spv.Branch ^bb2
 // CHECK:        ^bb2:
-// CHECK:          spv._merge
+// CHECK:          spv.mlir.merge
 // CHECK:        }
 // CHECK:        spv.Return
 

diff  --git a/mlir/test/Conversion/SPIRVToLLVM/control-flow-ops-to-llvm.mlir b/mlir/test/Conversion/SPIRVToLLVM/control-flow-ops-to-llvm.mlir
index 6427ce47dc16..75a06748c3ed 100644
--- a/mlir/test/Conversion/SPIRVToLLVM/control-flow-ops-to-llvm.mlir
+++ b/mlir/test/Conversion/SPIRVToLLVM/control-flow-ops-to-llvm.mlir
@@ -112,7 +112,7 @@ spv.module Logical GLSL450 {
       // Do nothing
       spv.Branch ^header
     ^merge:
-      spv._merge
+      spv.mlir.merge
     }
     spv.Return
   }
@@ -138,7 +138,7 @@ spv.module Logical GLSL450 {
     spv.selection {
       spv.BranchConditional %cond, ^merge, ^merge
     ^merge:
-      spv._merge
+      spv.mlir.merge
     }
     spv.Return
   }
@@ -156,7 +156,7 @@ spv.module Logical GLSL450 {
     // CHECK: ^bb2:
     ^merge:
       // CHECK: llvm.br ^bb3
-      spv._merge
+      spv.mlir.merge
     }
     // CHECK: ^bb3:
     // CHECK-NEXT: llvm.return
@@ -180,7 +180,7 @@ spv.module Logical GLSL450 {
     // CHECK: ^bb3:
     ^merge:
       // CHECK: llvm.br ^bb4
-      spv._merge
+      spv.mlir.merge
     }
     // CHECK: ^bb4:
     // CHECK-NEXT: llvm.return
@@ -200,7 +200,7 @@ spv.module Logical GLSL450 {
     // CHECK: ^bb2:
     ^merge:
       // CHECK: llvm.br ^bb3
-      spv._merge
+      spv.mlir.merge
     }
     // CHECK: ^bb3:
     %one = spv.constant 1 : i32

diff  --git a/mlir/test/Dialect/SPIRV/Serialization/debug.mlir b/mlir/test/Dialect/SPIRV/Serialization/debug.mlir
index a6b8ed3bc71c..1b4abefd4dbe 100644
--- a/mlir/test/Dialect/SPIRV/Serialization/debug.mlir
+++ b/mlir/test/Dialect/SPIRV/Serialization/debug.mlir
@@ -101,7 +101,7 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
         spv.Branch ^header
       ^merge:
         // CHECK: loc({{".*debug.mlir"}}:85:7)
-        spv._merge
+        spv.mlir.merge
         // CHECK: loc({{".*debug.mlir"}}:85:7)
       }
       // CHECK: loc({{".*debug.mlir"}}:108:7)
@@ -114,7 +114,7 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
       spv.Branch ^header
     ^merge:
       // CHECK: loc({{".*debug.mlir"}}:75:5)
-      spv._merge
+      spv.mlir.merge
     // CHECK: loc({{".*debug.mlir"}}:75:5)
     }
     spv.Return
@@ -138,7 +138,7 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
       spv.Branch ^merge
     ^merge:
       // CHECK: loc({{".*debug.mlir"}}:128:5)
-      spv._merge
+      spv.mlir.merge
     // CHECK: loc({{".*debug.mlir"}}:128:5)
     }
     spv.Return

diff  --git a/mlir/test/Dialect/SPIRV/Serialization/function-call.mlir b/mlir/test/Dialect/SPIRV/Serialization/function-call.mlir
index fe0290c9bfdb..04d375af2079 100644
--- a/mlir/test/Dialect/SPIRV/Serialization/function-call.mlir
+++ b/mlir/test/Dialect/SPIRV/Serialization/function-call.mlir
@@ -39,7 +39,7 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
       spv.FunctionCall @f_inc(%var) : (!spv.ptr<i32, Function>) -> ()
       spv.Branch ^header
     ^merge:
-      spv._merge
+      spv.mlir.merge
     }
     spv.Return
   }

diff  --git a/mlir/test/Dialect/SPIRV/Serialization/loop.mlir b/mlir/test/Dialect/SPIRV/Serialization/loop.mlir
index 5609c5fbe572..d54754e86494 100644
--- a/mlir/test/Dialect/SPIRV/Serialization/loop.mlir
+++ b/mlir/test/Dialect/SPIRV/Serialization/loop.mlir
@@ -44,9 +44,9 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
       spv.Branch ^header
 
 // CHECK-NEXT:   ^bb4:
-// CHECK-NEXT:     spv._merge
+// CHECK-NEXT:     spv.mlir.merge
     ^merge:
-      spv._merge
+      spv.mlir.merge
     }
     spv.Return
   }
@@ -94,8 +94,8 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
       spv.Branch ^header(%14 : i32)
 // CHECK-NEXT:   ^bb3:
     ^merge:
-// CHECK-NEXT:     spv._merge
-      spv._merge
+// CHECK-NEXT:     spv.mlir.merge
+      spv.mlir.merge
     }
     spv.Return
   }
@@ -174,8 +174,8 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
 
 // CHECK-NEXT:     ^bb4:
       ^merge:
-// CHECK-NEXT:       spv._merge
-        spv._merge
+// CHECK-NEXT:       spv.mlir.merge
+        spv.mlir.merge
       } // end inner loop
 
 // CHECK:          spv.Branch ^bb4
@@ -194,9 +194,9 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
       spv.Branch ^header
 
 // CHECK-NEXT:   ^bb5:
-// CHECK-NEXT:     spv._merge
+// CHECK-NEXT:     spv.mlir.merge
     ^merge:
-      spv._merge
+      spv.mlir.merge
     } // end outer loop
     spv.Return
   }

diff  --git a/mlir/test/Dialect/SPIRV/Serialization/phi.mlir b/mlir/test/Dialect/SPIRV/Serialization/phi.mlir
index fe54bbef1217..bb94ecc1bacc 100644
--- a/mlir/test/Dialect/SPIRV/Serialization/phi.mlir
+++ b/mlir/test/Dialect/SPIRV/Serialization/phi.mlir
@@ -142,8 +142,8 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
 
 // CHECK-NEXT: ^bb4:
     ^merge:
-// CHECK-NEXT:   spv._merge
-      spv._merge
+// CHECK-NEXT:   spv.mlir.merge
+      spv.mlir.merge
     }
     spv.Return
   }
@@ -218,8 +218,8 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
         spv.Branch ^bb1(%48 : i32)
 // CHECK:     ^[[LP2_MG]]:
       ^bb3:
-// CHECK:       spv._merge
-        spv._merge
+// CHECK:       spv.mlir.merge
+        spv.mlir.merge
       }
 // CHECK:     %[[ADD2:.*]] = spv.IAdd %[[LP1_HDR_ARG]]
       %36 = spv.IAdd %32, %31 : i32
@@ -227,8 +227,8 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
       spv.Branch ^bb1(%36 : i32)
 // CHECK:   ^[[LP1_MG]]:
     ^bb3:
-// CHECK:     spv._merge
-      spv._merge
+// CHECK:     spv.mlir.merge
+      spv.mlir.merge
     }
     spv.Return
   }
@@ -261,7 +261,7 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
       %loop1_add = spv.IAdd %loop1_bb_arg, %cst4 : i32
       spv.Branch ^bb1(%loop1_add : i32)
     ^bb3:
-      spv._merge
+      spv.mlir.merge
     }
 
 // CHECK:        spv.constant 44
@@ -277,7 +277,7 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
       %loop2_add = spv.IAdd %loop2_bb_arg, %cst4 : i32
       spv.Branch ^bb1(%loop2_add : i32)
     ^bb3:
-      spv._merge
+      spv.mlir.merge
     }
 
     spv.Return

diff  --git a/mlir/test/Dialect/SPIRV/Serialization/selection.mlir b/mlir/test/Dialect/SPIRV/Serialization/selection.mlir
index 9e6ff5698f8a..e05f4a135144 100644
--- a/mlir/test/Dialect/SPIRV/Serialization/selection.mlir
+++ b/mlir/test/Dialect/SPIRV/Serialization/selection.mlir
@@ -36,8 +36,8 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
 
 // CHECK-NEXT:   ^bb3:
     ^merge:
-// CHECK-NEXT:     spv._merge
-      spv._merge
+// CHECK-NEXT:     spv.mlir.merge
+      spv.mlir.merge
     }
 
     spv.Return
@@ -72,8 +72,8 @@ spv.module Logical GLSL450 requires #spv.vce<v1.0, [Shader], []> {
 
 // CHECK:        ^bb2:
     ^merge:
-// CHECK-NEXT:     spv._merge
-      spv._merge
+// CHECK-NEXT:     spv.mlir.merge
+      spv.mlir.merge
     }
 
     %one = spv.constant 1 : i32

diff  --git a/mlir/test/Dialect/SPIRV/Transforms/inlining.mlir b/mlir/test/Dialect/SPIRV/Transforms/inlining.mlir
index ed7f18e9658b..36b1f8fd8a31 100644
--- a/mlir/test/Dialect/SPIRV/Transforms/inlining.mlir
+++ b/mlir/test/Dialect/SPIRV/Transforms/inlining.mlir
@@ -74,7 +74,7 @@ spv.module Logical GLSL450 {
     ^then:
       spv.Return
     ^merge:
-      spv._merge
+      spv.mlir.merge
     }
     spv.Return
   }
@@ -97,7 +97,7 @@ spv.module Logical GLSL450 {
     ^then:
       spv.Branch ^merge
     ^merge:
-      spv._merge
+      spv.mlir.merge
     }
     spv.Return
   }
@@ -111,7 +111,7 @@ spv.module Logical GLSL450 {
     // CHECK-NEXT: ^bb1:
     // CHECK-NEXT:   spv.Branch ^bb2
     // CHECK-NEXT: ^bb2:
-    // CHECK-NEXT:   spv._merge
+    // CHECK-NEXT:   spv.mlir.merge
     spv.FunctionCall @callee(%0) : (i1) -> ()
     spv.Return
   }
@@ -130,7 +130,7 @@ spv.module Logical GLSL450 {
     ^continue:
       spv.Branch ^header
     ^merge:
-      spv._merge
+      spv.mlir.merge
     }
     spv.Return
   }
@@ -157,7 +157,7 @@ spv.module Logical GLSL450 {
     ^continue:
       spv.Branch ^header
     ^merge:
-      spv._merge
+      spv.mlir.merge
     }
     spv.Return
   }
@@ -175,7 +175,7 @@ spv.module Logical GLSL450 {
     // CHECK-NEXT: ^bb3:
     // CHECK-NEXT:   spv.Branch ^bb1
     // CHECK-NEXT: ^bb4:
-    // CHECK-NEXT:   spv._merge
+    // CHECK-NEXT:   spv.mlir.merge
     spv.FunctionCall @callee(%0) : (i1) -> ()
     spv.Return
   }
@@ -211,7 +211,7 @@ spv.module Logical GLSL450 {
       spv.FunctionCall @atomic_add(%5, %7) : (i32, !spv.ptr<i32, StorageBuffer>) -> ()
       spv.Branch ^bb2
     ^bb2 : // 2 preds: ^bb0, ^bb1
-      spv._merge
+      spv.mlir.merge
     }
     // CHECK: spv.Return
     spv.Return

diff  --git a/mlir/test/Dialect/SPIRV/canonicalize.mlir b/mlir/test/Dialect/SPIRV/canonicalize.mlir
index 2f514805edc6..cb955b4512ee 100644
--- a/mlir/test/Dialect/SPIRV/canonicalize.mlir
+++ b/mlir/test/Dialect/SPIRV/canonicalize.mlir
@@ -507,7 +507,7 @@ func @canonicalize_selection_op_scalar_type(%cond: i1) -> () {
     spv.Branch ^merge
 
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   spv.Return
 }
@@ -538,7 +538,7 @@ func @canonicalize_selection_op_vector_type(%cond: i1) -> () {
     spv.Branch ^merge
 
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   spv.Return
 }
@@ -575,7 +575,7 @@ func @cannot_canonicalize_selection_op_0(%cond: i1) -> () {
     spv.Branch ^merge
 
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   spv.Return
 }
@@ -611,7 +611,7 @@ func @cannot_canonicalize_selection_op_1(%cond: i1) -> () {
     spv.Branch ^merge
 
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   spv.Return
 }
@@ -643,7 +643,7 @@ func @cannot_canonicalize_selection_op_2(%cond: i1) -> () {
     spv.Branch ^then
 
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   spv.Return
 }
@@ -675,7 +675,7 @@ func @cannot_canonicalize_selection_op_3(%cond: i1) -> () {
     spv.Branch ^merge
 
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   spv.Return
 }
@@ -707,7 +707,7 @@ func @cannot_canonicalize_selection_op_4(%cond: i1) -> () {
     spv.Branch ^merge
 
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   spv.Return
 }

diff  --git a/mlir/test/Dialect/SPIRV/control-flow-ops.mlir b/mlir/test/Dialect/SPIRV/control-flow-ops.mlir
index 267c45b080fa..61d27c5416a7 100644
--- a/mlir/test/Dialect/SPIRV/control-flow-ops.mlir
+++ b/mlir/test/Dialect/SPIRV/control-flow-ops.mlir
@@ -300,7 +300,7 @@ func @loop(%count : i32) -> () {
 
   // CHECK-NEXT: ^bb4:
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   return
 }
@@ -328,7 +328,7 @@ func @loop_with_control() -> () {
 // -----
 
 func @wrong_merge_block() -> () {
-  // expected-error @+1 {{last block must be the merge block with only one 'spv._merge' op}}
+  // expected-error @+1 {{last block must be the merge block with only one 'spv.mlir.merge' op}}
   spv.loop {
     spv.Return
   }
@@ -340,7 +340,7 @@ func @wrong_merge_block() -> () {
 func @missing_entry_block() -> () {
   // expected-error @+1 {{must have an entry block branching to the loop header block}}
   spv.loop {
-    spv._merge
+    spv.mlir.merge
   }
   return
 }
@@ -353,7 +353,7 @@ func @missing_header_block() -> () {
   ^entry:
     spv.Branch ^merge
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   return
 }
@@ -368,7 +368,7 @@ func @entry_should_branch_to_header() -> () {
   ^header:
     spv.Branch ^merge
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   return
 }
@@ -383,7 +383,7 @@ func @missing_continue_block() -> () {
   ^header:
     spv.Branch ^merge
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   return
 }
@@ -400,7 +400,7 @@ func @continue_should_branch_to_header() -> () {
   ^continue:
     spv.Branch ^merge
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   return
 }
@@ -419,7 +419,7 @@ func @only_entry_and_continue_branch_to_header() -> () {
   ^cont2:
     spv.Branch ^header
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   return
 }
@@ -427,12 +427,12 @@ func @only_entry_and_continue_branch_to_header() -> () {
 // -----
 
 //===----------------------------------------------------------------------===//
-// spv._merge
+// spv.mlir.merge
 //===----------------------------------------------------------------------===//
 
 func @merge() -> () {
   // expected-error @+1 {{expected parent op to be 'spv.selection' or 'spv.loop'}}
-  spv._merge
+  spv.mlir.merge
 }
 
 // -----
@@ -448,10 +448,10 @@ func @only_allowed_in_last_block(%cond : i1) -> () {
   ^then:
     spv.Store "Function" %var, %one : i32
     // expected-error @+1 {{can only be used in the last block of 'spv.selection' or 'spv.loop'}}
-    spv._merge
+    spv.mlir.merge
 
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
 
   spv.Return
@@ -467,11 +467,11 @@ func @only_allowed_in_last_block() -> () {
     spv.BranchConditional %true, ^body, ^merge
   ^body:
     // expected-error @+1 {{can only be used in the last block of 'spv.selection' or 'spv.loop'}}
-    spv._merge
+    spv.mlir.merge
   ^continue:
     spv.Branch ^header
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   return
 }
@@ -490,7 +490,7 @@ func @in_selection(%cond : i1) -> () {
     // CHECK: spv.Return
     spv.Return
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   spv.Return
 }
@@ -507,7 +507,7 @@ func @in_loop(%cond : i1) -> () {
   ^continue:
     spv.Branch ^header
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   spv.Return
 }
@@ -545,7 +545,7 @@ spv.module Logical GLSL450 {
       // expected-error @+1 {{cannot be used in functions returning value}}
       spv.Return
     ^merge:
-      spv._merge
+      spv.mlir.merge
     }
 
     %zero = spv.constant 0: i32
@@ -574,7 +574,7 @@ func @in_selection(%cond : i1) -> (i32) {
     // CHECK: spv.ReturnValue
     spv.ReturnValue %zero : i32
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   %one = spv.constant 1 : i32
   spv.ReturnValue %one : i32
@@ -593,7 +593,7 @@ func @in_loop(%cond : i1) -> (i32) {
   ^continue:
     spv.Branch ^header
   ^merge:
-    spv._merge
+    spv.mlir.merge
   }
   %one = spv.constant 1 : i32
   spv.ReturnValue %one : i32
@@ -644,7 +644,7 @@ spv.module Logical GLSL450 {
       // expected-error @+1 {{op returns 1 value but enclosing function requires 0 results}}
       spv.ReturnValue %cst: i32
     ^merge:
-      spv._merge
+      spv.mlir.merge
     }
 
     spv.Return
@@ -675,8 +675,8 @@ func @selection(%cond: i1) -> () {
 
   // CHECK: ^bb2
   ^merge:
-    // CHECK-NEXT: spv._merge
-    spv._merge
+    // CHECK-NEXT: spv.mlir.merge
+    spv.mlir.merge
   }
 
   spv.Return
@@ -709,8 +709,8 @@ func @selection(%cond: i1) -> () {
 
   // CHECK: ^bb3
   ^merge:
-    // CHECK-NEXT: spv._merge
-    spv._merge
+    // CHECK-NEXT: spv.mlir.merge
+    spv.mlir.merge
   }
 
   spv.Return
@@ -739,7 +739,7 @@ func @selection_with_control() -> () {
 // -----
 
 func @wrong_merge_block() -> () {
-  // expected-error @+1 {{last block must be the merge block with only one 'spv._merge' op}}
+  // expected-error @+1 {{last block must be the merge block with only one 'spv.mlir.merge' op}}
   spv.selection {
     spv.Return
   }
@@ -751,7 +751,7 @@ func @wrong_merge_block() -> () {
 func @missing_entry_block() -> () {
   // expected-error @+1 {{must have a selection header block}}
   spv.selection {
-    spv._merge
+    spv.mlir.merge
   }
   return
 }


        


More information about the Mlir-commits mailing list