Issue 203216
Summary [mlir] Assertion `LLVM::isCompatibleVectorType(vectorType) && "expected vector type compatible with the LLVM dialect"' failed
Labels
Assignees
Reporter Anonymous7i0em3yd
    git version: aec0da1e9455356a32ec797430794025628b4210

system: `Ubuntu 18.04.6 LTS`

reproduce with: `mlir-opt -test-llvm-legalize-patterns a.mlir`

a.mlir:  

```mlir
module {
  pdl_interp.func @matcher(%arg0: !pdl.operation) {
    pdl_interp.finalize
  }
  module @rewriters {
  }
 func.func @int_vector(%arg0: vector<2xi8>, %arg1: vector<2xsi4>, %arg2: vector<2xi16>, %arg3: vector<2xi32>, %arg4: vector<2xi64>) {
    return
 }
}

```

stack trace:

```
mlir-opt: /data/szy/MLIR/llvm-release/llvm-project/mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp:645: FailureOr<Type> mlir::LLVMTypeConverter::convertVectorType(VectorType) const: Assertion `LLVM::isCompatibleVectorType(vectorType) && "expected vector type compatible with the LLVM dialect"' 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 -test-llvm-legalize-patterns 2.mlir
 #0 0x00005609b41cc658 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fda658)
 #1 0x00005609b41c94f1 llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fd74f1)
 #2 0x00005609b41cd776 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007ffb18a8d420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007ffb180ca00b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007ffb180a9859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
 #6 0x00007ffb180a9729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
 #7 0x00007ffb180a9729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
 #8 0x00007ffb180bafd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #9 0x00005609ba2b4f9c mlir::LLVMTypeConverter::convertVectorType(mlir::VectorType) const (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x80c2f9c)
#10 0x00005609ba2b6d95 std::_Function_handler<std::optional<llvm::LogicalResult> (llvm::PointerUnion<mlir::Type, mlir::Value>, llvm::SmallVectorImpl<mlir::Type>&), std::enable_if<std::is_invocable_v<mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_7, mlir::VectorType, llvm::SmallVectorImpl<mlir::Type>&> && std::is_base_of_v<mlir::Type, mlir::VectorType>, std::function<std::optional<llvm::LogicalResult> (llvm::PointerUnion<mlir::Type, mlir::Value>, llvm::SmallVectorImpl<mlir::Type>&)>>::type mlir::TypeConverter::wrapCallback<mlir::VectorType, std::enable_if<std::is_invocable_v<mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_7, mlir::VectorType>, std::function<std::optional<llvm::LogicalResult> (llvm::PointerUnion<mlir::Type, mlir::Value>, llvm::SmallVectorImpl<mlir::Type>&)>>::type mlir::TypeConverter::wrapCallback<mlir::VectorType, mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_7>(mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_7&&)::'lambda'(mlir::VectorType, llvm::SmallVectorImpl<mlir::Type>&)>(mlir::LLVMTypeConverter::LLVMTypeConverter(mlir::MLIRContext*, mlir::LowerToLLVMOptions const&, mlir::DataLayoutAnalysis const*)::$_7&&) const::'lambda'(llvm::PointerUnion<mlir::Type, mlir::Value>, llvm::SmallVectorImpl<mlir::Type>&)>::_M_invoke(std::_Any_data const&, llvm::PointerUnion<mlir::Type, mlir::Value>&&, llvm::SmallVectorImpl<mlir::Type>&) TypeConverter.cpp:0:0
#11 0x00005609bca549d4 mlir::TypeConverter::convertTypeImpl(llvm::PointerUnion<mlir::Type, mlir::Value>, llvm::SmallVectorImpl<mlir::Type>&) const (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa8629d4)
#12 0x00005609ba2b3228 mlir::LLVMTypeConverter::convertFunctionSignatureImpl(mlir::FunctionType, bool, bool, mlir::TypeConverter::SignatureConversion&, llvm::SmallVectorImpl<std::optional<mlir::NamedAttribute>>*) const (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x80c1228)
#13 0x00005609ba2b3ac6 mlir::LLVMTypeConverter::convertFunctionSignature(mlir::FunctionOpInterface, bool, bool, mlir::TypeConverter::SignatureConversion&, llvm::SmallVectorImpl<std::optional<mlir::NamedAttribute>>&) const (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x80c1ac6)
#14 0x00005609b9284765 mlir::convertFuncOpToLLVMFuncOp(mlir::FunctionOpInterface, mlir::ConversionPatternRewriter&, mlir::LLVMTypeConverter const&, mlir::SymbolTableCollection*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x7092765)
#15 0x00005609b92895c9 (anonymous namespace)::FuncOpConversion::matchAndRewrite(mlir::func::FuncOp, mlir::func::FuncOpAdaptor, mlir::ConversionPatternRewriter&) const FuncToLLVM.cpp:0:0
#16 0x00005609b428da1e llvm::LogicalResult mlir::ConversionPattern::dispatchTo1To1<mlir::ConvertOpToLLVMPattern<mlir::func::FuncOp, false>, mlir::func::FuncOp>(mlir::ConvertOpToLLVMPattern<mlir::func::FuncOp, false> const&, mlir::func::FuncOp, mlir::func::FuncOp::GenericAdaptor<llvm::ArrayRef<mlir::ValueRange>>, mlir::ConversionPatternRewriter&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x209ba1e)
#17 0x00005609b428d417 mlir::ConvertOpToLLVMPattern<mlir::func::FuncOp, false>::matchAndRewrite(mlir::Operation*, llvm::ArrayRef<mlir::ValueRange>, mlir::ConversionPatternRewriter&) const (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x209b417)
#18 0x00005609bca4fbd4 mlir::ConversionPattern::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa85dbd4)
#19 0x00005609bca9db3d 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
#20 0x00005609bca9a49a 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&)>) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa8a849a)
#21 0x00005609bca5198a (anonymous namespace)::OperationLegalizer::legalize(mlir::Operation*) DialectConversion.cpp:0:0
#22 0x00005609bca5114c mlir::OperationConverter::convert(mlir::Operation*, bool) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa85f14c)
#23 0x00005609bca524b0 mlir::OperationConverter::applyConversion(llvm::ArrayRef<mlir::Operation*>) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa8604b0)
#24 0x00005609bca60669 void llvm::function_ref<void ()>::callback_fn<applyConversion(llvm::ArrayRef<mlir::Operation*>, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig, (anonymous namespace)::OpConversionMode)::$_0>(long) DialectConversion.cpp:0:0
#25 0x00005609bca577a7 applyConversion(llvm::ArrayRef<mlir::Operation*>, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig, (anonymous namespace)::OpConversionMode) DialectConversion.cpp:0:0
#26 0x00005609bca5788b mlir::applyPartialConversion(mlir::Operation*, mlir::ConversionTarget const&, mlir::FrozenRewritePatternSet const&, mlir::ConversionConfig) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa86588b)
#27 0x00005609b4a1a462 (anonymous namespace)::TestLLVMLegalizePatternsPass::runOnOperation() TestPatterns.cpp:0:0
#28 0x00005609bcaf8f42 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa906f42)
#29 0x00005609bcaf9d84 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+0xa907d84)
#30 0x00005609bcb00c9a mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa90ec9a)
#31 0x00005609bcb005cf mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa90e5cf)
#32 0x00005609b427e56b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#33 0x00005609b427d7a6 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
#34 0x00005609bce4d815 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+0xac5b815)
#35 0x00005609b42733a6 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+0x20813a6)
#36 0x00005609b4273785 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x2081785)
#37 0x00005609b4273ae5 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x2081ae5)
#38 0x00005609b41b20e2 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fc00e2)
#39 0x00007ffb180ab083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#40 0x00005609b41b1c1e _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fbfc1e)
Aborted (core dumped)
```

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

Reply via email to