Issue 129043
Summary [MLIR]`--pass-pipeline="builtin.module(func.func(test-match-reduction))"` triggers Assertion `Index < this->size() && "Invalid index!"' failed.
Labels mlir
Assignees
Reporter xisang0
    Test on commit: https://github.com/llvm/llvm-project/commit/01cc1d13cd0c54bd4c29185b052fa5c16285dca7
steps to reproduce:
```
./mlir-opt test.mlir --pass-pipeline="builtin.module(func.func(test-match-reduction))"
```
test case:
```
func.func @pooling_ncw_sum_tensor(%input: tensor<1x3x10xf32>, 
 %kernel: tensor<3xf32>, 
 %output: tensor<1x3x8xf32>) {
  %result = linalg.pooling_ncw_sum 
            {strides = dense<[1]> : tensor<1xi64>, 
              dilations = dense<[1]> : tensor<1xi64>}
 ins(%input, %kernel : tensor<1x3x10xf32>, tensor<3xf32>) 
 outs(%output : tensor<1x3x8xf32>) -> tensor<1x3x8xf32>
 return
}
```
crash trace:
```
mlir-opt: /home/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:446: T &llvm::MutableArrayRef<mlir::OpOperand>::operator[](size_t) const [T = mlir::OpOperand]: Assertion `Index < this->size() && "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: build/bin/mlir-opt test.mlir --pass-pipeline=builtin.module(func.func(test-match-reduction))
 #0 0x00005648b7c8bdd8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build/bin/mlir-opt+0x10c8dd8)
 #1 0x00005648b7c898fe llvm::sys::RunSignalHandlers() (build/bin/mlir-opt+0x10c68fe)
 #2 0x00005648b7c8c7e1 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007fcbbaac0520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007fcbbab149fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007fcbbaac0476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007fcbbaaa67f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007fcbbaaa671b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x00007fcbbaab7e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x00005648b80add1b (build/bin/mlir-opt+0x14ead1b)
#10 0x00005648bac9e4da mlir::matchReduction(llvm::ArrayRef<mlir::BlockArgument>, unsigned int, llvm::SmallVectorImpl<mlir::Operation*>&) (build/bin/mlir-opt+0x40db4da)
#11 0x00005648baec2ff5 void llvm::function_ref<void (mlir::Operation*)>::callback_fn<(anonymous namespace)::TestMatchReductionPass::runOnOperation()::'lambda'(mlir::Operation*)>(long, mlir::Operation*) TestMatchReduction.cpp:0:0
#12 0x00005648b7d9de86 void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (build/bin/mlir-opt+0x11dae86)
#13 0x00005648b7d9df1e void mlir::detail::walk<mlir::ForwardIterator>(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) (build/bin/mlir-opt+0x11daf1e)
#14 0x00005648baec2de9 (anonymous namespace)::TestMatchReductionPass::runOnOperation() TestMatchReduction.cpp:0:0
#15 0x00005648bacc1373 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (build/bin/mlir-opt+0x40fe373)
#16 0x00005648bacc1c12 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (build/bin/mlir-opt+0x40fec12)
#17 0x00005648bacc718e auto void mlir::parallelForEach<__gnu_cxx::__normal_iterator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_0>(mlir::MLIRContext*, __gnu_cxx::__normal_iterator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>>, __gnu_cxx::__normal_iterator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_0&&)::'lambda'(__gnu_cxx::__normal_iterator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>>&&)::operator()<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&>(__gnu_cxx::__normal_iterator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*, std::vector<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo, std::allocator<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo>>>&&) const Pass.cpp:0:0
#18 0x00005648bacc346b mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) (build/bin/mlir-opt+0x410046b)
#19 0x00005648bacc14cc mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (build/bin/mlir-opt+0x40fe4cc)
#20 0x00005648bacc1c12 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (build/bin/mlir-opt+0x40fec12)
#21 0x00005648bacc43ee mlir::PassManager::run(mlir::Operation*) (build/bin/mlir-opt+0x41013ee)
#22 0x00005648bacbc9ab performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#23 0x00005648bacbc603 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&)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#24 0x00005648bad66415 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) (build/bin/mlir-opt+0x41a3415)
#25 0x00005648bacb6262 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (build/bin/mlir-opt+0x40f3262)
#26 0x00005648bacb6513 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (build/bin/mlir-opt+0x40f3513)
#27 0x00005648bacb6722 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (build/bin/mlir-opt+0x40f3722)
#28 0x00005648b7c694f7 main (build/bin/mlir-opt+0x10a64f7)
#29 0x00007fcbbaaa7d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#30 0x00007fcbbaaa7e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#31 0x00005648b7c69055 _start (build/bin/mlir-opt+0x10a6055)
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to