Files
clang-p2996/mlir/test/Integration/Dialect/LLVMIR/CPU/test-complex-sparse-constant.mlir
Aart Bik d926b3307e [mlir] add complex type to getZeroAttr
Fixes issue encountered with <sparse> complex constant
https://github.com/llvm/llvm-project/issues/56428

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D129325
2022-07-07 16:58:59 -07:00

17 lines
608 B
MLIR

// RUN: mlir-opt %s --convert-memref-to-llvm | \
// RUN: mlir-cpu-runner -e entry -entry-point-result=void
//
// Code should not crash on the complex32 sparse constant.
//
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
}
}