| Issue |
71281
|
| Summary |
[mlir] --async-parallel-for crashed with assertion failure "Invalid index!"
|
| Labels |
mlir
|
| Assignees |
|
| Reporter |
anonymousMCS
|
git version: 83888a5404d46667647fe36d6fa510d075ed57ea
system: ```Ubuntu 20.04.6 LTS (Focal Fossa)```
reproduced with: ```mlir-opt --async-parallel-for a.mlir```
a.mlir:
```
llvm.func @func1() {
%c0 = arith.constant 0 : index
%c22 = arith.constant 22 : index
%c1 = arith.constant 1 : index
%53 = tensor.empty() : tensor<22xf32>
%54 = bufferization.to_memref %53 : memref<22xf32>
%alloc_4 = memref.alloc() {alignment = 64 : i64} : memref<22xf32>
scf.parallel (%arg0) = (%c0) to (%c22) step (%c1) {
%81 = memref.load %54[%arg0] : memref<22xf32>
memref.store %81, %alloc_4[%arg0] : memref<22xf32>
}
llvm.return
}
```
trace:
```
mlir-opt: /data/bin/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:257: const T& llvm::ArrayRef<T>::operator[](size_t) const [with T = mlir::StringAttr; size_t = long unsigned int]: Assertion `Index < Length && "Invalid index!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /data/bin/llvm-project/build/bin/mlir-opt --async-parallel-for a.mlir
#0 0x0000561304d3284f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/bin/llvm-project/build/bin/mlir-opt+0x15dd84f)
#1 0x0000561304d2f8a4 SignalHandler(int) Signals.cpp:0:0
#2 0x00007f9f6e293420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#3 0x00007f9f6dd7e00b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#4 0x00007f9f6dd5d859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#5 0x00007f9f6dd5d729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
#6 0x00007f9f6dd6efd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#7 0x000056130533b605 (/data/bin/llvm-project/build/bin/mlir-opt+0x1be6605)
#8 0x000056130533b74f mlir::func::FuncOp::getAttributeNameForIndex(mlir::OperationName, unsigned int) (.constprop.0) FuncOps.cpp:0:0
#9 0x000056130533d98e mlir::func::FuncOp::build(mlir::OpBuilder&, mlir::OperationState&, llvm::StringRef, mlir::FunctionType, llvm::ArrayRef<mlir::NamedAttribute>, llvm::ArrayRef<mlir::DictionaryAttr>) (/data/bin/llvm-project/build/bin/mlir-opt+0x1be898e)
#10 0x000056130534c262 mlir::func::FuncOp::create(mlir::Location, llvm::StringRef, mlir::FunctionType, llvm::ArrayRef<mlir::NamedAttribute>) (/data/bin/llvm-project/build/bin/mlir-opt+0x1bf7262)
#11 0x0000561305176d34 createParallelComputeFunction(mlir::scf::ParallelOp, (anonymous namespace)::ParallelComputeFunctionBounds const&, unsigned int, mlir::PatternRewriter&) AsyncParallelFor.cpp:0:0
#12 0x000056130517a007 (anonymous namespace)::AsyncParallelForRewrite::matchAndRewrite(mlir::scf::ParallelOp, mlir::PatternRewriter&) const::'lambda0'(mlir::OpBuilder&, mlir::Location)::operator()(mlir::OpBuilder&, mlir::Location) const AsyncParallelFor.cpp:0:0
#13 0x00005613063626eb mlir::scf::IfOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, llvm::function_ref<void (mlir::OpBuilder&, mlir::Location)>, llvm::function_ref<void (mlir::OpBuilder&, mlir::Location)>) (/data/bin/llvm-project/build/bin/mlir-opt+0x2c0d6eb)
#14 0x00005613051763bf (anonymous namespace)::AsyncParallelForRewrite::matchAndRewrite(mlir::scf::ParallelOp, mlir::PatternRewriter&) const AsyncParallelFor.cpp:0:0
#15 0x000056130a5d0b68 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&)>) (/data/bin/llvm-project/build/bin/mlir-opt+0x6e7bb68)
#16 0x00005613079768ac (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist() GreedyPatternRewriteDriver.cpp:0:0
#17 0x000056130797ad1b mlir::applyPatternsAndFoldGreedily(mlir::Region&, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig, bool*) (/data/bin/llvm-project/build/bin/mlir-opt+0x4225d1b)
#18 0x000056130516f42c (anonymous namespace)::AsyncParallelForPass::runOnOperation() AsyncParallelFor.cpp:0:0
#19 0x00005613078c12ee mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/bin/llvm-project/build/bin/mlir-opt+0x416c2ee)
#20 0x00005613078c17ca mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/bin/llvm-project/build/bin/mlir-opt+0x416c7ca)
#21 0x00005613078c1ff4 mlir::PassManager::run(mlir::Operation*) (/data/bin/llvm-project/build/bin/mlir-opt+0x416cff4)
#22 0x00005613078b2d7b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#23 0x00005613078b4234 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, llvm::ThreadPool*) MlirOptMain.cpp:0:0
#24 0x00005613078b43e4 mlir::LogicalResult llvm::function_ref<mlir::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
#25 0x00005613079b33a4 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) (/data/bin/llvm-project/build/bin/mlir-opt+0x425e3a4)
#26 0x00005613078ace97 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/bin/llvm-project/build/bin/mlir-opt+0x4157e97)
#27 0x00005613078b4531 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/bin/llvm-project/build/bin/mlir-opt+0x415f531)
#28 0x00005613078b4996 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/bin/llvm-project/build/bin/mlir-opt+0x415f996)
#29 0x0000561304c69dcb main (/data/bin/llvm-project/build/bin/mlir-opt+0x1514dcb)
#30 0x00007f9f6dd5f083 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24083)
#31 0x0000561304d02e1e _start (/data/bin/llvm-project/build/bin/mlir-opt+0x15ade1e)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs