Hi all,

I am looking at using tensors where the element type is a complex number (using the complex dialect), but I have noticed that a lot of passes are not supported for this dialect (such as vectorization and bufferization) and so I want to work to enable them.

Unlike the current lowering pass of the complex dialect, I would prefer my tensors of shape `<MxNxcomplex<T>>`

to be turned to `<MxKxT>`

where K = 2*N, as I wish to represent complex numbers just as two consecutive ‘T’ (for my case: f32 or f64) and not to lower to a llvm.struct containing 2 elements.

However I am struggling to find the best way and the best “level” to do this. I have at the moment managed to somewhat extend vectorization and the vector type to accept elements of type complex, but the bufferization does not play well with this, and further lowering is still an open problem.

I was wondering if a good level to transform complex into consecutive floats would be just before bufferization, when things are still at the tensor level? I would thus have a pass that would transform something like:

```
%zero_complex= complex.constant [0.0 : f32, 0.0 : f32] : complex<f32>
%a = vector.transfer_read %A[%x, %y], %zero_complex {in_bounds = [true, true]} : tensor<16x16xcomplex<f32>>, vector<8x1xcomplex<f32>>
```

Into this:

```
%zero_f32 = arith.constant 0.0 : f32
%a = vector.transfer_read %A[%x, %y], %zero_f32 {in_bounds = [true, true]} : tensor<16x32xf32>, vector<8x2xf32>
```

And then let the compiler reduce the code further.

In your expert opinions (PSA: I am very not an expert of MLIR myself), would this be a good solution? The other option would be to extend memrefs so that they can hold complex values, but it seems strange to me as I think memrefs are sort of low-level so having complex types seems unfit for memref, right?

Anyway, I am very unsure of what the best move for all of this is (if there is one), so any suggestion/comment/help would be *greatly* appreciated…

Many thanks in advance.