[AArch64] Materialize FP constant in code for large code model
authorJonas Hahnfeld <jonas.hahnfeld@cern.ch>
Tue, 30 Mar 2021 16:28:54 +0000 (18:28 +0200)
committerJonas Hahnfeld <jonas.hahnfeld@cern.ch>
Wed, 7 Apr 2021 19:02:05 +0000 (21:02 +0200)
commit6415f424bc2a3bbb4f2fd7bb67863968ac3c19f6
tree5707deae19760e0e6ff2e5dce412fd20eacfe08d
parent90af134473331095adcf2c7e4a511ac35d9f2f4a
[AArch64] Materialize FP constant in code for large code model

When using the large code model with FastISel (for example via
clang -O0 which adds the optnone attribute), FP constants could
still be materialized using adrp + ldr. Unconditionally enable
the existing path for MachO to materialize the constant in code.

For testing, restore literal_pools_float.ll to exercise the constant
pool and add two optnone-functions that return a float and a double,
respectively. Consolidate fpimm.ll and add a new fast-isel-fpimm.ll
to check the code paths taken with FastISel.

Differential Revision: https://reviews.llvm.org/D99607
llvm/lib/Target/AArch64/AArch64FastISel.cpp
llvm/test/CodeGen/AArch64/fast-isel-fpimm.ll [new file with mode: 0644]
llvm/test/CodeGen/AArch64/fpimm.ll
llvm/test/CodeGen/AArch64/literal_pools_float.ll