Issue 148368
Summary [MLIR] crashed on `-test-vector-transfer-unrolling-patterns` pass with assertion message: `offsets.size() == sizes.size() && offsets.size() == strides.size()'
Labels mlir
Assignees
Reporter sweead
    test commit: [f2e244f](https://github.com/llvm/llvm-project/commit/f2e244f443c99f814216bef37a82f1b8d3e5975d)

step to reproduce:
```
mlir-opt test.mlir -test-vector-transfer-unrolling-patterns
```

minimal test case:

```
module {
  memref.global "private" constant @__constant_1x6x34x62xi8 : memref<1x6x34x62xi8> = dense<1> {alignment = 64 : i64}
  func.func @main() {
    %c0_i8 = arith.constant 0 : i8
    %c0 = arith.constant 0 : index
    %0 = memref.get_global @__constant_1x6x34x62xi8 : memref<1x6x34x62xi8>
    %alloc = memref.alloc() {alignment = 64 : i64} : memref<1x8x36x62xi8>
    %subview = memref.subview %alloc[0, 1, 1, 0] [1, 6, 34, 62] [1, 1, 1, 1] : memref<1x8x36x62xi8> to memref<1x6x34x62xi8, strided<[17856, 2232, 62, 1], offset: 2294>>
    %1 = vector.transfer_read %0[%c0, %c0, %c0, %c0], %c0_i8 {in_bounds = [true, true, true, true]} : memref<1x6x34x62xi8>, vector<1x6x34x62xi8>
    vector.transfer_write %1, %subview[%c0, %c0, %c0, %c0] {in_bounds = [true, true, true, true]} : vector<1x6x34x62xi8>, memref<1x6x34x62xi8, strided<[17856, 2232, 62, 1], offset: 2294>>
    return
  }
}
```

Crash backtrace:
```
mlir-opt: /home/workdir/llvm-project/mlir/lib/Dialect/Vector/IR/VectorOps.cpp:3879: Type inferStridedSliceOpResultType(VectorType, ArrayAttr, ArrayAttr, ArrayAttr): Assertion `offsets.size() == sizes.size() && offsets.size() == strides.size()' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: mlir-opt test.mlir -test-vector-transfer-unrolling-patterns
 #0 0x0000557ae2a1e028 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/workdir/llvm-project/build/bin/mlir-opt+0x1421028)
 #1 0x0000557ae2a1b6a5 llvm::sys::RunSignalHandlers() (/home/workdir/llvm-project/build/bin/mlir-opt+0x141e6a5)
 #2 0x0000557ae2a1f141 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007faa7e024520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007faa7e0789fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007faa7e024476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007faa7e00a7f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007faa7e00a71b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x00007faa7e01be96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x0000557ae57e479d (/home/workdir/llvm-project/build/bin/mlir-opt+0x41e779d)
#10 0x0000557ae57e42f6 mlir::vector::ExtractStridedSliceOp::build(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, llvm::ArrayRef<long>, llvm::ArrayRef<long>, llvm::ArrayRef<long>) (/home/workdir/llvm-project/build/bin/mlir-opt+0x41e72f6)
#11 0x0000557ae58f03e5 void mlir::OpBuilder::createOrFold<mlir::vector::ExtractStridedSliceOp, mlir::Value, llvm::SmallVector<long, 6u>&, llvm::SmallVector<long, 6u>&, llvm::SmallVector<long, 6u>&>(llvm::SmallVectorImpl<mlir::Value>&, mlir::Location, mlir::Value&&, llvm::SmallVector<long, 6u>&, llvm::SmallVector<long, 6u>&, llvm::SmallVector<long, 6u>&) (/home/workdir/llvm-project/build/bin/mlir-opt+0x42f33e5)
#12 0x0000557ae58efefd (anonymous namespace)::UnrollTransferWritePattern::matchAndRewrite(mlir::vector::TransferWriteOp, mlir::PatternRewriter&) const VectorUnroll.cpp:0:0
#13 0x0000557ae880d132 void llvm::function_ref<void ()>::callback_fn<mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>)::$_0>(long) PatternApplicator.cpp:0:0
#14 0x0000557ae8809e2f mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>) (/home/workdir/llvm-project/build/bin/mlir-opt+0x720ce2f)
#15 0x0000557ae5f7727a (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist() GreedyPatternRewriteDriver.cpp:0:0
#16 0x0000557ae5f73ad3 mlir::applyPatternsGreedily(mlir::Region&, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig, bool*) (/home/workdir/llvm-project/build/bin/mlir-opt+0x4976ad3)
#17 0x0000557ae6652088 (anonymous namespace)::TestVectorTransferUnrollingPatterns::runOnOperation() TestVectorTransforms.cpp:0:0
#18 0x0000557ae5ef5a93 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/home/workdir/llvm-project/build/bin/mlir-opt+0x48f8a93)
#19 0x0000557ae5ef6332 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/home/workdir/llvm-project/build/bin/mlir-opt+0x48f9332)
#20 0x0000557ae5efc7be 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
#21 0x0000557ae5ef7b8b mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) (/home/workdir/llvm-project/build/bin/mlir-opt+0x48fab8b)
#22 0x0000557ae5ef5bec mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/home/workdir/llvm-project/build/bin/mlir-opt+0x48f8bec)
#23 0x0000557ae5ef6332 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/home/workdir/llvm-project/build/bin/mlir-opt+0x48f9332)
#24 0x0000557ae5ef8b0e mlir::PassManager::run(mlir::Operation*) (/home/workdir/llvm-project/build/bin/mlir-opt+0x48fbb0e)
#25 0x0000557ae5ef0a7b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#26 0x0000557ae5ef06d4 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
#27 0x0000557ae5fa0425 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) (/home/workdir/llvm-project/build/bin/mlir-opt+0x49a3425)
#28 0x0000557ae5ee98c2 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/home/workdir/llvm-project/build/bin/mlir-opt+0x48ec8c2)
#29 0x0000557ae5ee9b78 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/home/workdir/llvm-project/build/bin/mlir-opt+0x48ecb78)
#30 0x0000557ae5ee9d92 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/home/workdir/llvm-project/build/bin/mlir-opt+0x48ecd92)
#31 0x0000557ae29fca67 main (/home/workdir/llvm-project/build/bin/mlir-opt+0x13ffa67)
#32 0x00007faa7e00bd90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#33 0x00007faa7e00be40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#34 0x0000557ae29fc505 _start (/home/workdir/llvm-project/build/bin/mlir-opt+0x13ff505)
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