[llvm-dev] Complex proposal v3 + roundtable agenda

David Greene via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 1 11:54:49 PST 2020


Cameron McInally via llvm-dev <llvm-dev at lists.llvm.org> writes:

> Although, it's worth noting that predication would likely be *much*
> easier with a non-interleaved representation. I think. Again, I
> haven't thought this completely through, but it's probably worth
> talking about.

This is one place where a complex type seems particularly beneficial.
Personally, I think of "vector of complex" as a vector of individual
complex value, not a vector of interleaved real and imaginary elements.
A predicated vector of complex should look like a predicated vector of
double from a masking standpoint.  With an interleaved viewpoint, you'd
basically double-up all of the mask bits.

e.g.:

<4 x complex_double> a
<4 x i1> amask = {1, 0, 1, 1}

vs.

<8 x double> a
<8 x i1> amask = {1, 1, 0, 0, 1, 1, 1, 1}

Of course lowering may require transforming the first mask into the
second depending on what the hardware has available.  This is mostly an
issue in mixed-data loops where you end up having to either track extra
masks or spend time converting between masks.

I am not sure what this looks like with intrinsics.  Do the intrinsics
accept the first kind of mask or the second?

              -David


More information about the llvm-dev mailing list