Skip to content

[mlir] Canonicalize triggers Assertion Failure "(succeeded(ConcreteT::verify(getDefaultDiagnosticEmitFn(ctx), args...)))" #61056

@Colloportus0

Description

@Colloportus0

MLIR built at commit 398cddf
Reproduced with:
mlir-opt -canonicalize temp.mlir

temp.mlir:

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:

<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

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashPrefer [crash-on-valid] or [crash-on-invalid]mlir

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions