| Issue |
60581
|
| Summary |
[mlir]Test-Elements-Attr-Interface triggered Assertion failure "cast<Ty>() argument of incompatible type"
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
CelestineSmith
|
MLIR built at commit https://github.com/llvm/llvm-project/commit/034bab4c
Reproduced with:
```shell
mlir-opt --test-elements-attr-interface temp.mlir
```
`temp.mlir`:
```milr
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:
```console
Pass Manager with 11 passes:
builtin.module(convert-gpu-launch-to-vulkan-launch,scf-for-to-while,strip-debuginfo,test-print-defuse,func.func(test-vector-transfer-unrolling-patterns{reverse-unroll-order=false}),test-elements-attr-interface,spirv.module(spirv-webgpu-prepare),test-dynamic-pipeline{dynamic-pipeline= run-on-nested-operations=false run-on-parent=false},test-print-nesting,func.func(test-spirv-target-env),func.func(affine-loop-unroll{cleanup-unroll=false unroll-factor=4 unroll-full=false unroll-full-threshold=1 unroll-num-reps=1 unroll-up-to-factor=false}))
// -----// IR Dump Before ConvertGpuLaunchFuncToVulkanLaunchFunc (convert-gpu-launch-to-vulkan-launch) //----- //
module {
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}
llvm.func @entry() {
%0 = memref.get_global @"__constant_32xcomplex<f32>_0" : memref<32xcomplex<f32>>
llvm.return
}
}
}
// -----// IR Dump Before SCFForToWhileLoop (scf-for-to-while) //----- //
module {
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}
llvm.func @entry() {
%0 = memref.get_global @"__constant_32xcomplex<f32>_0" : memref<32xcomplex<f32>>
llvm.return
}
}
}
// -----// IR Dump Before StripDebugInfo (strip-debuginfo) //----- //
module {
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}
llvm.func @entry() {
llvm.return
}
}
}
// -----// IR Dump Before (anonymous namespace)::TestPrintDefUsePass (test-print-defuse) //----- //
module {
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}
llvm.func @entry() {
llvm.return
}
}
}
// -----// IR Dump Before (anonymous namespace)::TestElementsAttrInterface (test-elements-attr-interface) //----- //
module {
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}
llvm.func @entry() {
llvm.return
}
}
}
<unknown>:0: error: Test iterating `int64_t`: unable to iterate type
<unknown>:0: note: see current operation: "memref.global"() {alignment = 128 : i64, constant, initial_value = sparse<[[1], [28], [31]], [(1.000000e+00,0.000000e+00), (2.000000e+00,0.000000e+00), (3.000000e+00,0.000000e+00)]> : tensor<32xcomplex<f32>>, sym_name = "__constant_32xcomplex<f32>_0", sym_visibility = "private", type = memref<32xcomplex<f32>>} : () -> ()
<unknown>:0: error: Test iterating `uint64_t`: unable to iterate type
<unknown>:0: note: see current operation: "memref.global"() {alignment = 128 : i64, constant, initial_value = sparse<[[1], [28], [31]], [(1.000000e+00,0.000000e+00), (2.000000e+00,0.000000e+00), (3.000000e+00,0.000000e+00)]> : tensor<32xcomplex<f32>>, sym_name = "__constant_32xcomplex<f32>_0", sym_visibility = "private", type = memref<32xcomplex<f32>>} : () -> ()
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-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs