<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/114764>114764</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [MLIR]-convert-pdl-to-pdl-interp triggers Assertion Failure `inserted.second && "expected region to contain uniquely named symbol operations"'
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          xisang0
      </td>
    </tr>
</table>

<pre>
    Test on commit: (https://github.com/llvm/llvm-project/commit/18f0f709345cc7e611c4f944832edb71284caacb)
step to reproduce:
```
mlir-opt test.mlir -convert-pdl-to-pdl-interp
```
test case:
```
module attributes {transform.with_named_sequence} {
  pdl_interp.func @matcher(%arg0: !pdl.operation) {
    pdl_interp.finalize
  }
  func.func @main(%arg0: tensor<2x8x9x10x3xf32> {bufferization.access = "read"}, %arg1: tensor<5x3x6x4x3xf32> {bufferization.access = "read"}, %arg2: tensor<?xf32> {bufferization.access = "read"}) {
    call @conv3d_dynamic_bias(%arg0, %arg1, %arg2) {__inplace_operands_attr__ = ["true", "true", "true"]} : (tensor<2x8x9x10x3xf32>, tensor<5x3x6x4x3xf32>, tensor<?xf32>) -> ()
 return 
  }
  func.func @conv3d_dynamic_bias(%arg0: tensor<2x8x9x10x3xf32> {bufferization.access = "read"}, %arg1: tensor<5x3x6x4x3xf32> {bufferization.access = "read"}, %arg2: tensor<?xf32> {bufferization.access = "read"}) {
    %0 = tosa.conv3d %arg0, %arg1, %arg2 {__inplace_operands_attr__ = ["false", "false", "false"], dilation = array<i64: 1, 1, 1>, pad = array<i64: 0, 0, 0, 0, 0, 0>, stride = array<i64: 1, 1, 1>} : (tensor<2x8x9x10x3xf32>, tensor<5x3x6x4x3xf32>, tensor<?xf32>) -> tensor<?x?x?x?x?xf32>
    return
 }
}
```
crash trace:
```
mlir-opt: /home/workdir/llvm-project-19/mlir/lib/IR/SymbolTable.cpp:137: mlir::SymbolTable::SymbolTable(Operation *): Assertion `inserted.second && "expected region to contain uniquely named symbol operations"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: ./mlir-opt /home/workdir/test6.mlir -convert-pdl-to-pdl-interp
 #0 0x00005c6e10eba098 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./mlir-opt+0x1062098)
 #1 0x00005c6e10eb7bbe llvm::sys::RunSignalHandlers() (./mlir-opt+0x105fbbe)
 #2 0x00005c6e10ebaaa8 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007ed53f0e4520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007ed53f1389fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007ed53f0e4476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007ed53f0ca7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007ed53f0ca71b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x00007ed53f0dbe96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x00005c6e14296c10 mlir::SymbolTable::SymbolTable(mlir::Operation*) (./mlir-opt+0x443ec10)
#10 0x00005c6e1429bd7c mlir::SymbolTableCollection::getSymbolTable(mlir::Operation*) (./mlir-opt+0x4443d7c)
#11 0x00005c6e1429fedc mlir::Operation* llvm::function_ref<mlir::Operation* (mlir::Operation*, mlir::StringAttr)>::callback_fn<mlir::SymbolTableCollection::lookupSymbolIn(mlir::Operation*, mlir::SymbolRefAttr, llvm::SmallVectorImpl<mlir::Operation*>&)::$_0>(long, mlir::Operation*, mlir::StringAttr) SymbolTable.cpp:0:0
#12 0x00005c6e14299120 lookupSymbolInImpl(mlir::Operation*, mlir::SymbolRefAttr, llvm::SmallVectorImpl<mlir::Operation*>&, llvm::function_ref<mlir::Operation* (mlir::Operation*, mlir::StringAttr)>) SymbolTable.cpp:0:0
#13 0x00005c6e1429c016 mlir::SymbolTableCollection::lookupNearestSymbolFrom(mlir::Operation*, mlir::SymbolRefAttr) (./mlir-opt+0x4444016)
#14 0x00005c6e1409ea31 mlir::CallGraph::resolveCallable(mlir::CallOpInterface, mlir::SymbolTableCollection&) const (./mlir-opt+0x4246a31)
#15 0x00005c6e1409e390 computeCallGraph(mlir::Operation*, mlir::CallGraph&, mlir::SymbolTableCollection&, mlir::CallGraphNode*, bool) CallGraph.cpp:0:0
#16 0x00005c6e1409e510 computeCallGraph(mlir::Operation*, mlir::CallGraph&, mlir::SymbolTableCollection&, mlir::CallGraphNode*, bool) CallGraph.cpp:0:0
#17 0x00005c6e1409e510 computeCallGraph(mlir::Operation*, mlir::CallGraph&, mlir::SymbolTableCollection&, mlir::CallGraphNode*, bool) CallGraph.cpp:0:0
#18 0x00005c6e1409e27a mlir::CallGraph::CallGraph(mlir::Operation*) (./mlir-opt+0x424627a)
#19 0x00005c6e134731b3 mlir::transform::TransformDialect::verifyOperationAttribute(mlir::Operation*, mlir::NamedAttribute) (./mlir-opt+0x361b1b3)
#20 0x00005c6e142a4a23 (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) Verifier.cpp:0:0
#21 0x00005c6e142a4886 mlir::verify(mlir::Operation*, bool) (./mlir-opt+0x444c886)
#22 0x00005c6e140e3afe mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./mlir-opt+0x428bafe)
#23 0x00005c6e140e3f82 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./mlir-opt+0x428bf82)
#24 0x00005c6e140e672e mlir::PassManager::run(mlir::Operation*) (./mlir-opt+0x428e72e)
#25 0x00005c6e140df252 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#26 0x00005c6e140deebb llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#27 0x00005c6e14188725 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (./mlir-opt+0x4330725)
#28 0x00005c6e140da0b2 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./mlir-opt+0x42820b2)
#29 0x00005c6e140da363 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x4282363)
#30 0x00005c6e140da572 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./mlir-opt+0x4282572)
#31 0x00005c6e10e992e7 main (./mlir-opt+0x10412e7)
#32 0x00007ed53f0cbd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#33 0x00007ed53f0cbe40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#34 0x00005c6e10e98e55 _start (./mlir-opt+0x1040e55)
Aborted (core dumped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