]> granicus.if.org Git - llvm/commit
[AArch64] Optimize floating point materialization
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 18 Mar 2019 18:45:57 +0000 (18:45 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 18 Mar 2019 18:45:57 +0000 (18:45 +0000)
commit174d97b3b9e80490f8b965ff23c677f70cd7c789
treea9893e6f977fbacb66feaec2731ae4237855ba14
parent0ce3660e408cc281b24c24015eefb509c724ae19
[AArch64] Optimize floating point materialization

This patch follows some ideas from r352866 to optimize the floating
point materialization even further. It changes isFPImmLegal to
considere up to 2 mov instruction or up to 5 in case subtarget has
fused literals.

The rationale is the cost is the same for mov+fmov vs. adrp+ldr; but
the mov+fmov sequence is always better because of the reduced d-cache
pressure. The timings are still the same if you consider movw+movk+fmov
vs. adrp+ldr will be fused (although one instruction longer).

Reviewers: efriedma

Differential Revision: https://reviews.llvm.org/D58460

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356390 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64ISelLowering.cpp
test/CodeGen/AArch64/arm64-fp-imm-size.ll [new file with mode: 0644]
test/CodeGen/AArch64/arm64-fp-imm.ll
test/CodeGen/AArch64/fpimm.ll
test/CodeGen/AArch64/literal_pools_float.ll
test/CodeGen/AArch64/misched-fusion-lit.ll
test/CodeGen/AArch64/win_cst_pool.ll