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

    <tr>
        <th>Summary</th>
        <td>
            [mlir] inline pass triggered Assertion Failure "(succeeded(ConcreteT::verify(getDefaultDiagnosticEmitFn(ctx), args...)))"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    MLIR built at commit  398cddf6
Reproduced with:  
`mlir-opt --inline temp.mlir`

temp.mlir:
``` milr 
module {
  func.func private @func1() {
    %7 = tensor.empty() : tensor<13x13x16xi1>
    %c2 = arith.constant 2 : index
    %c6 = arith.constant 6 : index
    %c7 = arith.constant 7 : index
    %c15 = arith.constant 15 : index
    %36 = affine.apply affine_map<(d0) -> (d0)>(%c6)
    %56 = affine.apply affine_map<(d0) -> (-((d0 - (d0 - 2)) mod 4))>(%c7)
    %61 = index.ceildivs %c2, %36
    %cast_29 = tensor.cast %7 : tensor<13x13x16xi1> to tensor<?x?x?xi1>
    %alloc_32 = memref.alloc(%c15, %56, %61) : memref<?x?x?xi1>
    linalg.transpose ins(%cast_29 : tensor<?x?x?xi1>) outs(%alloc_32 : memref<?x?x?xi1>) permutation = [2, 0, 1] 
    return
  }
}

```
 
trace:
```console  
<unknown>:0: error: invalid memref size
Assertion failed: (succeeded(ConcreteT::verify(getDefaultDiagnosticEmitFn(ctx), args...))), function get, file StorageUniquerSupport.h, line 174.
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 --inline temp.mlir
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mlir-opt                 0x000000010258a5b4 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  mlir-opt 0x000000010258961c llvm::sys::RunSignalHandlers() + 112
2 mlir-opt                 0x000000010258ac4c SignalHandler(int) + 344
3 libsystem_platform.dylib 0x000000019cc194c4 _sigtramp + 56
4 libsystem_pthread.dylib  0x000000019cc01ee0 pthread_kill + 288
5 libsystem_c.dylib        0x000000019cb3c340 abort + 168
6 libsystem_c.dylib        0x000000019cb3b754 err + 0
7  mlir-opt 0x00000001044d6b74 mlir::MemRefType::getChecked(llvm::function_ref<mlir::InFlightDiagnostic ()>, llvm::ArrayRef<long long>, mlir::Type, mlir::MemRefLayoutAttrInterface, mlir::Attribute) (.cold.1) + 0
8  mlir-opt 0x0000000103e21e40 mlir::MemRefType mlir::detail::StorageUserBase<mlir::MemRefType, mlir::BaseMemRefType, mlir::detail::MemRefTypeStorage, mlir::detail::TypeUniquer, mlir::ShapedType::Trait>::get<llvm::ArrayRef<long long>, mlir::Type, mlir::MemRefLayoutAttrInterface, mlir::Attribute>(mlir::MLIRContext*, llvm::ArrayRef<long long>, mlir::Type, mlir::MemRefLayoutAttrInterface, mlir::Attribute) + 288
9  mlir-opt                 0x0000000103e21d08 mlir::MemRefType::get(llvm::ArrayRef<long long>, mlir::Type, mlir::MemRefLayoutAttrInterface, mlir::Attribute) + 160
10 mlir-opt 0x0000000102f9e250 (anonymous namespace)::SimplifyAllocConst<mlir::memref::AllocOp>::matchAndRewrite(mlir::memref::AllocOp, mlir::PatternRewriter&) const + 1048
11 mlir-opt 0x0000000103ff4924 mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>) + 1420
12 mlir-opt                 0x0000000103d9ebd0 (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist() + 1924
13 mlir-opt                 0x0000000103d9c5ac mlir::applyPatternsAndFoldGreedily(mlir::Region&, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig) + 1556
14 mlir-opt                 0x0000000103d62e7c (anonymous namespace)::Canonicalizer::runOnOperation() + 160
15 mlir-opt 0x0000000103d4dac0 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 428
16 mlir-opt                 0x0000000103d4dff0 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
17 mlir-opt                 0x0000000103d71c8c (anonymous namespace)::InlinerPass::optimizeSCCAsync(llvm::MutableArrayRef<mlir::CallGraphNode*>, mlir::MLIRContext*)::$_0::operator()(mlir::CallGraphNode*) const + 332
18 mlir-opt                 0x0000000103d7179c (anonymous namespace)::InlinerPass::inlineSCC((anonymous namespace)::Inliner&, (anonymous namespace)::CGUseList&, (anonymous namespace)::CallGraphSCC&, mlir::MLIRContext*) + 7928
19 mlir-opt                 0x0000000103d69c94 (anonymous namespace)::InlinerPass::runOnOperation() + 1216
20 mlir-opt 0x0000000103d4dac0 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 428
21 mlir-opt 0x0000000103d4dff0 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
22 mlir-opt                 0x0000000103d4f960 mlir::PassManager::run(mlir::Operation*) + 1148
23 mlir-opt 0x0000000103d48e80 performActions(llvm::raw_ostream&, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) + 476
24 mlir-opt 0x0000000103d48a80 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_1>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) + 520
25 mlir-opt                 0x0000000103db2e54 mlir::splitAndProcessBuffer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) + 656
26 mlir-opt 0x0000000103d46cc8 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) + 132
27 mlir-opt 0x0000000103d474b8 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 1972
28 mlir-opt 0x00000001024273c0 main + 108
29 dyld 0x00000001078e5088 start + 516

```
 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWt1T67gV_2vMi-ZmbPkj9gMPIcAuM1AYuNtO-5KRpZNERZZcSeaS-9d3JNuJnQ_I3ba77U4ZSGzr6Oh8_s6RDDGGryTAZZBeBen1BWnsWunLuRJC1UrbxoQXpWKby4f7u2dUNlxYRCyiqqq4RSgucsrYMgvC6yCcPUOtFWsoMPSN23UQzxBqR4IsrATXX1Rt0ZcvXAouAVmo6ol7HGRhR-Y_d8_j2XZ6-4sqLnTHs1KsEYCC6VV7j9CykXTiPlCt-RuxgIIkdPdRgPMAF0NahAKcTlEQXyML0ig9gaq2m54wnnWPg3gexe_uN3vnURDfjBhQ7DkQze16QpU0lkiLsJ_PJYP3MX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