Skip to content

[mlir] Crash when using --test-loop-fusion=test-loop-fusion-transformation #118224

@AnonymousBugreporter1

Description

@AnonymousBugreporter1

I have the following MLIR program:
test.mlir:

module {
  func.func @func1() {
    %cst_18 = arith.constant 1.684800e+04 : f16
    %alloc_28 = memref.alloc() : memref<6x6xf16>
    %c0 = arith.constant 0 : index
    %1 = affine.for %arg0 = 0 to 108 step 4 iter_args(%arg1 = %c0) -> (index) {
      affine.store %cst_18, %alloc_28[0, 0] : memref<6x6xf16>
      affine.yield %arg1 : index
    }
    %2 = affine.for %arg0 = 108 to 110 iter_args(%arg1 = %c0) -> (index) {
      affine.store %cst_18, %alloc_28[0, 0] : memref<6x6xf16>
      affine.yield %arg1 : index
    }
    
    vector.print %2 : index
    return
  }
}

The above MLIR program will cause a crash when using the following command:

mlir-opt --test-loop-fusion=test-loop-fusion-transformation test.mlir

And the crash backtrace is:

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /data/tmp/v1201/llvm-project/build/bin/mlir-opt --test-loop-fusion=test-loop-fusion-transformation test.mlir
 #0 0x0000561410a4be6f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x150ae6f)
 #1 0x0000561410a49624 SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f755bf91420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #3 0x0000561412c37a94 mlir::vector::PrintOp::verifyInvariantsImpl() (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x36f6a94)
 #4 0x0000561412c37d04 mlir::Op<mlir::vector::PrintOp, mlir::OpTrait::ZeroRegions, mlir::OpTrait::ZeroResults, mlir::OpTrait::ZeroSuccessors, mlir::OpTrait::VariadicOperands, mlir::OpTrait::OpInvariants, mlir::BytecodeOpInterface::Trait, mlir::MemoryEffectOpInterface::Trait>::verifyInvariants(mlir::Operation*) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x36f6d04)
 #5 0x0000561412bd217c mlir::RegisteredOperationName::Model<mlir::vector::PrintOp>::verifyInvariants(mlir::Operation*) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x369117c)
 #6 0x0000561413ae4e92 (anonymous namespace)::OperationVerifier::verifyOnEntrance(mlir::Operation&) (.isra.0) Verifier.cpp:0:0
 #7 0x0000561413ae5975 (anonymous namespace)::OperationVerifier::verifyOperation(mlir::Operation&) Verifier.cpp:0:0
 #8 0x0000561413ae746a mlir::verify(mlir::Operation*, bool) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x45a646a)
 #9 0x00005614138c6203 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x4385203)
#10 0x00005614138c6451 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x4385451)
#11 0x00005614138c4f16 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x4383f16)
#12 0x00005614138c5959 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x4384959)
#13 0x00005614138c6451 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x4385451)
#14 0x00005614138c74f6 mlir::PassManager::run(mlir::Operation*) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x43864f6)
#15 0x00005614138b7973 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#16 0x00005614138b86af processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, llvm::ThreadPoolInterface*) MlirOptMain.cpp:0:0
#17 0x00005614138b87f4 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&)::'lambda'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#18 0x00005614139baae5 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) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x4479ae5)
#19 0x00005614138b0de9 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x436fde9)
#20 0x00005614138b8961 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x4377961)
#21 0x00005614138b8e26 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x4377e26)
#22 0x0000561410984a7b main (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x1443a7b)
#23 0x00007f755ba3f083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#24 0x0000561410a2035e _start (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x14df35e)
Segmentation fault (core dumped)

My git version is 22417ec.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions