Issue 204100
Summary [mlir] Assertion `idx < size()' failed.
Labels
Assignees
Reporter Anonymous7i0em3yd
    git version: 4281db2755459933c68aa95a17f2518ef8317889

system: `Ubuntu 18.04.6 LTS`

reproduce with: `mlir-opt -transform-interpreter a.mlir`

a.mlir: 

```mlir
module {
  func.func @add_dynamic(%arg0: memref<?x?xbf16>, %arg1: memref<?x?xbf16>, %arg2: memref<?x?xbf16>) {
    linalg.add ins(%arg0, %arg1 : memref<?x?xbf16>, memref<?x?xbf16>) outs(%arg2 : memref<?x?xbf16>)
    return
  }
  module attributes {transform.with_named_sequence} {
    transform.named_sequence @__transform_main(%arg0: !transform.any_op {transform.readonly}) {
      %0 = transform.structured.match ops{["linalg.add"]} in %arg0 : (!transform.any_op) -> !transform.any_op
 transform.structured.vectorize %0 vector_sizes [8, [16], 4] : !transform.any_op
      transform.yield 
    }
  }
}

```

stack trace:

```
mlir-opt: /data/szy/MLIR/llvm-release/llvm-project/llvm/include/llvm/ADT/SmallVector.h:300: reference llvm::SmallVectorTemplateCommon<mlir::utils::IteratorType>::operator[](size_type) [T = mlir::utils::IteratorType]: Assertion `idx < size()' 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: /data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt -transform-interpreter 33.mlir
 #0 0x000055767eb62cc8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x2023cc8)
 #1 0x000055767eb5fb61 llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x2020b61)
 #2 0x000055767eb63de6 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007f5ec2405420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007f5ec1a4200b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007f5ec1a21859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
 #6 0x00007f5ec1a21729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
 #7 0x00007f5ec1a21729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
 #8 0x00007f5ec1a32fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #9 0x000055768510369c mlir::linalg::vectorizeOpPrecondition(mlir::Operation*, llvm::ArrayRef<long>, llvm::ArrayRef<bool>, bool, bool) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x85c469c)
#10 0x00005576851044c0 mlir::linalg::vectorize(mlir::RewriterBase&, mlir::Operation*, llvm::ArrayRef<long>, llvm::ArrayRef<bool>, bool, bool, bool, bool) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x85c54c0)
#11 0x000055767f6bd287 mlir::transform::VectorizeOp::apply(mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x2b7e287)
#12 0x000055767f646831 mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Model<mlir::transform::VectorizeOp>::apply(mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x2b07831)
#13 0x0000557684c6c90a mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x812d90a)
#14 0x0000557684c2f012 applySequenceBlock(mlir::Block&, mlir::transform::FailurePropagationMode, mlir::transform::TransformState&, mlir::transform::TransformResults&) TransformOps.cpp:0:0
#15 0x0000557684c3247e mlir::transform::NamedSequenceOp::apply(mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x80f347e)
#16 0x0000557684bba331 mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Model<mlir::transform::NamedSequenceOp>::apply(mlir::transform::detail::TransformOpInterfaceInterfaceTraits::Concept const*, mlir::Operation*, mlir::transform::TransformRewriter&, mlir::transform::TransformResults&, mlir::transform::TransformState&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x807b331)
#17 0x0000557684c6c90a mlir::transform::TransformState::applyTransform(mlir::transform::TransformOpInterface) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x812d90a)
#18 0x0000557684c789d2 mlir::transform::applyTransforms(mlir::Operation*, mlir::transform::TransformOpInterface, mlir::RaggedArray<llvm::PointerUnion<mlir::Operation*, mlir::Attribute, mlir::Value>> const&, mlir::transform::TransformOptions const&, bool, llvm::function_ref<void (mlir::transform::TransformState&)>, llvm::function_ref<llvm::LogicalResult (mlir::transform::TransformState&)>) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x81399d2)
#19 0x0000557684b7ef06 mlir::transform::applyTransformNamedSequence(mlir::RaggedArray<llvm::PointerUnion<mlir::Operation*, mlir::Attribute, mlir::Value>>, mlir::transform::TransformOpInterface, mlir::ModuleOp, mlir::transform::TransformOptions const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x803ff06)
#20 0x0000557684b79ab1 (anonymous namespace)::InterpreterPass::runOnOperation() InterpreterPass.cpp:0:0
#21 0x00005576874bd3f2 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa97e3f2)
#22 0x00005576874be234 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa97f234)
#23 0x00005576874c514a mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa98614a)
#24 0x00005576874c4a7f mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa985a7f)
#25 0x000055767ec11970 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#26 0x000055767ec10ba6 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
#27 0x0000557687811795 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) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xacd2795)
#28 0x000055767ec07c06 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20c8c06)
#29 0x000055767ec07fe5 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20c8fe5)
#30 0x000055767ec08345 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20c9345)
#31 0x000055767eb48752 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x2009752)
#32 0x00007f5ec1a23083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#33 0x000055767eb4828e _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x200928e)
Aborted (core dumped)
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to