llvm-project
llvm-project copied to clipboard
[mlir]Test-Elements-Attr-Interface Pass triggered Assertion failure "cast<Ty>() argument of incompatible type"
MLIR built at commit https://github.com/llvm/llvm-project/commit/034bab4c Reproduced with:
mlir-opt --test-elements-attr-interface temp.mlir
temp.mlir:
module { // RUN: mlir-opt %s --convert-memref-to-llvm | \
module attributes {llvm.data_layout = ""} {
memref.global "private" constant @"__constant_32xcomplex<f32>_0" : memref<32xcomplex<f32>> =
sparse<[[1], [28], [31]],
[(1.000000e+00,0.000000e+00), (2.000000e+00,0.000000e+00), (3.000000e+00,0.000000e+00)]
> {alignment = 128 : i64}
}
}
trace:
Assertion failed: (isa<To>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file Casting.h, line 567.
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-elements-attr-interface temp.mlir
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 mlir-opt 0x000000010436cd04 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 mlir-opt 0x000000010436bd6c llvm::sys::RunSignalHandlers() + 112
2 mlir-opt 0x000000010436d39c SignalHandler(int) + 344
3 libsystem_platform.dylib 0x00000001a56894c4 _sigtramp + 56
4 libsystem_pthread.dylib 0x00000001a5671ee0 pthread_kill + 288
5 libsystem_c.dylib 0x00000001a55ac340 abort + 168
6 libsystem_c.dylib 0x00000001a55ab754 err + 0
7 mlir-opt 0x0000000105cd3c20 llvm::APInt std::__1::__invoke_void_return_wrapper<llvm::APInt, false>::__call<mlir::FailureOr<llvm::mapped_iterator<llvm::detail::SafeIntIterator<long, false>, std::__1::function<llvm::APInt (long)>, decltype(std::declval<std::__1::function<llvm::APInt (long)>>()(*decltype(__declval<llvm::APInt>(0)) std::__1::declval<llvm::detail::SafeIntIterator<long, false>>()()))>> mlir::SparseElementsAttr::try_value_begin_impl<llvm::APInt>(mlir::detail::ElementsAttrTrait<mlir::SparseElementsAttr>::OverloadToken<llvm::APInt>) const::'lambda'(long)&, long>(mlir::FailureOr<llvm::mapped_iterator<llvm::detail::SafeIntIterator<long, false>, std::__1::function<llvm::APInt (long)>, decltype(std::declval<std::__1::function<llvm::APInt (long)>>()(*decltype(__declval<llvm::APInt>(0)) std::__1::declval<llvm::detail::SafeIntIterator<long, false>>()()))>> mlir::SparseElementsAttr::try_value_begin_impl<llvm::APInt>(mlir::detail::ElementsAttrTrait<mlir::SparseElementsAttr>::OverloadToken<llvm::APInt>) const::'lambda'(long)&, long&&) (.cold.1) + 0
8 mlir-opt 0x0000000105640b0c mlir::FailureOr<llvm::mapped_iterator<llvm::detail::SafeIntIterator<long, false>, std::__1::function<llvm::APInt (long)>, decltype(std::declval<std::__1::function<llvm::APInt (long)>>()(*decltype(__declval<llvm::APInt>(0)) std::__1::declval<llvm::detail::SafeIntIterator<long, false>>()()))>> mlir::SparseElementsAttr::try_value_begin_impl<llvm::APInt>(mlir::detail::ElementsAttrTrait<mlir::SparseElementsAttr>::OverloadToken<llvm::APInt>) const + 924
9 mlir-opt 0x00000001056405dc mlir::FailureOr<mlir::detail::ElementsAttrIndexer> mlir::detail::ElementsAttrTrait<mlir::SparseElementsAttr>::buildValueResult<llvm::APInt>(std::__1::integral_constant<bool, false>) const + 48
10 mlir-opt 0x000000010563fa9c mlir::detail::ElementsAttrInterfaceTraits::Model<mlir::SparseElementsAttr>::getValuesImpl(mlir::detail::ElementsAttrInterfaceTraits::Concept const*, mlir::Attribute, mlir::TypeID) + 152
11 mlir-opt 0x00000001055169bc std::__1::enable_if<std::is_same<mlir::Attribute, llvm::APInt>::value || !std::is_base_of<mlir::Attribute, llvm::APInt>::value, std::__1::optional<mlir::detail::ElementsAttrIterator<llvm::APInt>>>::type mlir::ElementsAttr::try_value_begin<llvm::APInt>() const + 52
12 mlir-opt 0x00000001055167bc std::__1::enable_if<std::is_same<mlir::Attribute, llvm::APInt>::value || !std::is_base_of<mlir::Attribute, llvm::APInt>::value, std::__1::optional<mlir::detail::ElementsAttrRange<mlir::detail::ElementsAttrIterator<llvm::APInt>>>>::type mlir::ElementsAttr::tryGetValues<llvm::APInt>() const + 36
13 mlir-opt 0x00000001055152a0 void llvm::function_ref<void (mlir::Operation*)>::callback_fn<(anonymous namespace)::TestElementsAttrInterface::runOnOperation()::'lambda'(mlir::Operation*)>(long, mlir::Operation*) + 2300
14 mlir-opt 0x00000001056b7160 mlir::detail::walk(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) + 216
15 mlir-opt 0x00000001056b7160 mlir::detail::walk(mlir::Operation*, llvm::function_ref<void (mlir::Operation*)>, mlir::WalkOrder) + 216
16 mlir-opt 0x00000001055148e4 (anonymous namespace)::TestElementsAttrInterface::runOnOperation() + 76
17 mlir-opt 0x0000000105593384 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 420
18 mlir-opt 0x00000001055938b4 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
19 mlir-opt 0x0000000105595230 mlir::PassManager::run(mlir::Operation*) + 1148
20 mlir-opt 0x000000010558e6e8 performActions(llvm::raw_ostream&, bool, bool, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, bool, bool) + 504
21 mlir-opt 0x000000010558e2b8 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) + 704
22 mlir-opt 0x00000001055f9834 mlir::splitAndProcessBuffer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) + 656
23 mlir-opt 0x000000010558c6e0 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool) + 216
24 mlir-opt 0x000000010558cbd4 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 1208
25 mlir-opt 0x000000010420f7a4 main + 108
26 dyld 0x0000000108d45088 start + 516
@llvm/issue-subscribers-mlir
Patch submitted at https://reviews.llvm.org/D151675