[AArch64][GlobalISel] Mark G_FCONSTANT as legal when there is full fp16 support
authorJessica Paquette <jpaquette@apple.com>
Wed, 11 Nov 2020 21:21:35 +0000 (13:21 -0800)
committerJessica Paquette <jpaquette@apple.com>
Wed, 11 Nov 2020 21:25:11 +0000 (13:25 -0800)
commit7a70a2f04d6463013921e9ff1bdad0b02b26b880
tree28b22956023a76026614944a07ffbd8e719896bc
parent6e0ae20f3b98b7bb5a44ced22c3da42a8fe5dbc8
[AArch64][GlobalISel] Mark G_FCONSTANT as legal when there is full fp16 support

When there is full fp16 support, there is no reason to widen 16-bit
G_FCONSTANTs to 32 bits. Mark them as legal in this case.

Also, we currently import a pattern for materializing a 16-bit 0.0.
Add a testcase showing we select it.

(All other 16-bit G_FCONSTANTS are not yet selected.)

Differential Revision: https://reviews.llvm.org/D89164
llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
llvm/test/CodeGen/AArch64/GlobalISel/legalize-fp16-fconstant.mir [new file with mode: 0644]
llvm/test/CodeGen/AArch64/GlobalISel/legalizer-info-validation.mir
llvm/test/CodeGen/AArch64/GlobalISel/select-fp16-fconstant.mir [new file with mode: 0644]