| Issue |
173375
|
| Summary |
mlir-opt crashes in llvm/include/llvm/ADT/ArrayRef.h:388
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
Emilyaxe
|
When running opt on the following IR, mlir-opt crashes.
version 2c02e4c7909a
test.mlir
```
func.func @extract_strided_loops(%arg0 : i32) {
%0 = memref.alloc() : memref<100xf32>
%c0 = arith.constant 0 : index
%cst = arith.constant 0.0 : f32
affine.for %i = 0 to 100 step 4 {
affine.store %cst, %0[%c0] : memref<100xf32>
%1 = affine.load %0[%c0] : memref<100xf32>
}
return
}
```
commads:
mlir-opt -remove-dead-values test.mlir
stacktrace
```
mlir-opt: llvm-project/llvm/include/llvm/ADT/ArrayRef.h:388: MutableArrayRef<T> llvm::MutableArrayRef<mlir::BlockArgument>::drop_front(size_t) const [T = mlir::BlockArgument]: Assertion `this->size() >= N && "Dropping more elements than exist"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: ./bin/mlir-opt -remove-dead-values test.mlir
#0 0x000056298a4c4358 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (./bin/mlir-opt+0x1e97358)
#1 0x000056298a4c1a15 llvm::sys::RunSignalHandlers() (./bin/mlir-opt+0x1e94a15)
#2 0x000056298a4c5396 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x00007f4a9cd06420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f4a9c35f00b raise /build/glibc-B3wQXB/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x00007f4a9c33e859 abort /build/glibc-B3wQXB/glibc-2.31/stdlib/abort.c:81:7
#6 0x00007f4a9c33e729 get_sysdep_segment_value /build/glibc-B3wQXB/glibc-2.31/intl/loadmsgcat.c:509:8
#7 0x00007f4a9c33e729 _nl_load_domain /build/glibc-B3wQXB/glibc-2.31/intl/loadmsgcat.c:970:34
#8 0x00007f4a9c34ffd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#9 0x00005629915b2f6d (./bin/mlir-opt+0x8f85f6d)
#10 0x00005629927e4c65 mlir::detail::LoopLikeOpInterfaceInterfaceTraits::Model<mlir::affine::AffineForOp>::getRegionIterArgs(mlir::detail::LoopLikeOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*) (./bin/mlir-opt+0xa1b7c65)
#11 0x0000562992cce253 mlir::detail::verifyLoopLikeOpInterface(mlir::Operation*) (./bin/mlir-opt+0xa6a1253)
#12 0x00005629927e774c mlir::Op<mlir::affine::AffineForOp, mlir::OpTrait::OneRegion, mlir::OpTrait::VariadicResults, mlir::OpTrait::ZeroSuccessors, mlir::OpTrait::VariadicOperands, mlir::OpTrait::AttrSizedOperandSegments, mlir::OpTrait::SingleBlock, mlir::OpTrait::SingleBlockImplicitTerminator<mlir::affine::AffineYieldOp>::Impl, mlir::OpTrait::OpInvariants, mlir::BytecodeOpInterface::Trait, mlir::OpTrait::AutomaticAllocationScope, mlir::ConditionallySpeculatable::Trait, mlir::OpTrait::HasRecursiveMemoryEffects, mlir::LoopLikeOpInterface::Trait, mlir::RegionBranchOpInterface::Trait>::verifyRegionInvariants(mlir::Operation*) (./bin/mlir-opt+0xa1ba74c)
#13 0x00005629927e371e mlir::RegisteredOperationName::Model<mlir::affine::AffineForOp>::verifyRegionInvariants(mlir::Operation*) (./bin/mlir-opt+0xa1b671e)
#14 0x0000562992e88af1 (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) Verifier.cpp:0:0
#15 0x0000562992e88c50 (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) Verifier.cpp:0:0
#16 0x0000562992e88146 mlir::verify(mlir::Operation*, bool) (./bin/mlir-opt+0xa85b146)
#17 0x0000562992b7eaa8 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (./bin/mlir-opt+0xa551aa8)
#18 0x0000562992b7f617 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (./bin/mlir-opt+0xa552617)
#19 0x0000562992b869ca mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (./bin/mlir-opt+0xa5599ca)
#20 0x0000562992b8601f mlir::PassManager::run(mlir::Operation*) (./bin/mlir-opt+0xa55901f)
#21 0x000056298a568377 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#22 0x000056298a5675a6 llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, 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::MemoryBufferRef const&, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#23 0x0000562992e99855 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::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) (./bin/mlir-opt+0xa86c855)
#24 0x000056298a55d166 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (./bin/mlir-opt+0x1f30166)
#25 0x000056298a55d4a2 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (./bin/mlir-opt+0x1f304a2)
#26 0x000056298a55d805 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (./bin/mlir-opt+0x1f30805)
#27 0x000056298a4aa9b3 main (./bin/mlir-opt+0x1e7d9b3)
#28 0x00007f4a9c340083 __libc_start_main /build/glibc-B3wQXB/glibc-2.31/csu/../csu/libc-start.c:342:3
#29 0x000056298a4aa4ee _start (./bin/mlir-opt+0x1e7d4ee)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs