-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Open
Labels
Description
I have the following MLIR program:
test.mlir:
module {
func.func @func1() {
%c0 = arith.constant 0 : index
%c17 = arith.constant 17 : index
%alloc_33 = memref.alloc(%c17) : memref<?xi64>
affine.for %arg0 = 0 to 79 {
%492 = affine.for %arg1 = 0 to 64 iter_args(%arg2 = %alloc_33) -> (memref<?xi64>) {
%dim_89 = memref.dim %arg2, %c0 : memref<?xi64>
affine.yield %arg2 : memref<?xi64>
}
}
return
}
}
The above MLIR program will cause a crash when using the following command:
mlir-opt --affine-loop-coalescing 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 --affine-loop-coalescing test.mlir
#0 0x00005596d2fb2e6f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x150ae6f)
#1 0x00005596d2fb0624 SignalHandler(int) Signals.cpp:0:0
#2 0x00007fdad986e420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#3 0x00005596d43b3bdc mlir::memref::__mlir_ods_local_type_constraint_MemRefOps9(mlir::Operation*, mlir::Type, llvm::StringRef, unsigned int) (.constprop.0) MemRefOps.cpp:0:0
#4 0x00005596d43b3e39 mlir::memref::DimOp::verifyInvariantsImpl() (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x290be39)
#5 0x00005596d4347685 mlir::Op<mlir::memref::DimOp, mlir::OpTrait::ZeroRegions, mlir::OpTrait::OneResult, mlir::OpTrait::OneTypedResult<mlir::IndexType>::Impl, mlir::OpTrait::ZeroSuccessors, mlir::OpTrait::NOperands<2u>::Impl, mlir::OpTrait::OpInvariants, mlir::OpAsmOpInterface::Trait, mlir::OpTrait::MemRefsNormalizable, mlir::ConditionallySpeculatable::Trait, mlir::MemoryEffectOpInterface::Trait, mlir::ShapedDimOpInterface::Trait, mlir::InferTypeOpInterface::Trait>::verifyInvariants(mlir::Operation*) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x289f685)
#6 0x00005596d435d79b mlir::RegisteredOperationName::Model<mlir::memref::DimOp>::verifyInvariants(mlir::Operation*) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x28b579b)
#7 0x00005596d604be92 (anonymous namespace)::OperationVerifier::verifyOnEntrance(mlir::Operation&) (.isra.0) Verifier.cpp:0:0
#8 0x00005596d604c975 (anonymous namespace)::OperationVerifier::verifyOperation(mlir::Operation&) Verifier.cpp:0:0
#9 0x00005596d604e46a mlir::verify(mlir::Operation*, bool) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x45a646a)
#10 0x00005596d5e2d203 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x4385203)
#11 0x00005596d5e2d451 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)
#12 0x00005596d5e2bf16 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x4383f16)
#13 0x00005596d5e2c959 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x4384959)
#14 0x00005596d5e2d451 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)
#15 0x00005596d5e2e4f6 mlir::PassManager::run(mlir::Operation*) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x43864f6)
#16 0x00005596d5e1e973 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#17 0x00005596d5e1f6af 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
#18 0x00005596d5e1f7f4 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
#19 0x00005596d5f21ae5 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)
#20 0x00005596d5e17de9 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)
#21 0x00005596d5e1f961 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x4377961)
#22 0x00005596d5e1fe26 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x4377e26)
#23 0x00005596d2eeba7b main (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x1443a7b)
#24 0x00007fdad931c083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#25 0x00005596d2f8735e _start (/data/tmp/v1201/llvm-project/build/bin/mlir-opt+0x14df35e)
Segmentation fault (core dumped)
My git version is 22417ec.