[PowerPC] Add default handling for single element vectors, and split/promote vNi1...
authorAmy Kwan <amy.kwan1@ibm.com>
Fri, 11 Feb 2022 18:45:07 +0000 (12:45 -0600)
committerAmy Kwan <amy.kwan1@ibm.com>
Tue, 15 Feb 2022 14:44:08 +0000 (08:44 -0600)
commitac5a5a9cfe7c83ee5fbbc48118b4239e7e6cf6c9
tree2eb0c9ab522c020540f1cfbdcf009e3829f17513
parent0135aa7b988f87626fa5640c92fae68dff4e2897
[PowerPC] Add default handling for single element vectors, and split/promote vNi1 vectors.

This patch updates the handling of vectors in getPreferredVectorAction():

For single-element and scalable vectors, fall back to default vector legalization
handling. For vNi1 vectors, add handling to either split or promote them in
order to prevent the production of wide v256i1/v512i1 types.

The following assertion is fixed by this patch, as we ended up producing the
wide vector types (that are used for MMA) in the backend prior to this fix.

```
Assertion failed: VT.getSizeInBits() == Operand.getValueSizeInBits() &&
"Cannot BITCAST between types of different sizes!"
```

Differential Revision: https://reviews.llvm.org/D119521
llvm/lib/Target/PowerPC/PPCISelLowering.h
llvm/test/CodeGen/PowerPC/p10-handle-split-promote-vec.ll [new file with mode: 0644]