[CodeGen][SVE] Legalisation of extends with scalable types
authorKerry McLaughlin <kerry.mclaughlin@arm.com>
Fri, 5 Jun 2020 10:11:50 +0000 (11:11 +0100)
committerKerry McLaughlin <kerry.mclaughlin@arm.com>
Fri, 5 Jun 2020 11:08:42 +0000 (12:08 +0100)
commit89fc0166f53252956705935bfebbb70f06c47c8e
tree24588dc874698538e6b559f8540f0d6d42ae0041
parentc4b5a66e44f031eb89c9d6ea32b144f1169bdbae
[CodeGen][SVE] Legalisation of extends with scalable types

Summary:
This patch adds legalisation of extensions where the operand
of the extend is a legal scalable type but the result is not.

EXTRACT_SUBVECTOR is used to split the result, before
being replaced by target-specific [S|U]UNPK[HI|LO] operations.

For example:

```
zext <vscale x 16 x i8> %a to <vscale x 16 x i16>
```
should emit:

```
uunpklo z2.h, z0.b
uunpkhi z1.h, z0.b
```

Reviewers: sdesmalen, efriedma, david-arm

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, huihuiz, cfe-commits, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79587
llvm/include/llvm/CodeGen/ValueTypes.h
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/lib/CodeGen/ValueTypes.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.h
llvm/test/CodeGen/AArch64/sve-sext-zext.ll