summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AArch64/literal_pools_float.ll
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-03-18 18:45:57 +0000
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-03-18 18:45:57 +0000
commita3cefa5d6492a4ba593b74b1aa615f00a5b6166d (patch)
treed8376cb3cd79b6fb89b4421c0936a5d3337a29ac /llvm/test/CodeGen/AArch64/literal_pools_float.ll
parent664c1ef52849623ef509e34968e0807a21b7bf15 (diff)
downloadbcm5719-llvm-a3cefa5d6492a4ba593b74b1aa615f00a5b6166d.tar.gz
bcm5719-llvm-a3cefa5d6492a4ba593b74b1aa615f00a5b6166d.zip
[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 llvm-svn: 356390
Diffstat (limited to 'llvm/test/CodeGen/AArch64/literal_pools_float.ll')
-rw-r--r--llvm/test/CodeGen/AArch64/literal_pools_float.ll11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/test/CodeGen/AArch64/literal_pools_float.ll b/llvm/test/CodeGen/AArch64/literal_pools_float.ll
index 1a673949d7f..4031e072f1f 100644
--- a/llvm/test/CodeGen/AArch64/literal_pools_float.ll
+++ b/llvm/test/CodeGen/AArch64/literal_pools_float.ll
@@ -31,16 +31,19 @@ define void @floating_lits() {
%doubleval = load double, double* @vardouble
%newdouble = fadd double %doubleval, 129.0
-; CHECK: adrp x[[LITBASE:[0-9]+]], [[CURLIT:.LCPI[0-9]+_[0-9]+]]
-; CHECK: ldr [[LIT129:d[0-9]+]], [x[[LITBASE]], {{#?}}:lo12:[[CURLIT]]]
; CHECK-NOFP-NOT: ldr {{d[0-9]+}},
+; CHECK: mov [[W129:x[0-9]+]], #35184372088832
+; CHECK: movk [[W129]], #16480, lsl #48
+; CHECK: fmov {{d[0-9]+}}, [[W129]]
; CHECK-NOFP-NOT: fadd
-; CHECK-TINY: ldr [[LIT129:d[0-9]+]], [[CURLIT:.LCPI[0-9]+_[0-9]+]]
+; CHECK-TINY: mov [[W129:x[0-9]+]], #35184372088832
+; CHECK-TINY: movk [[W129]], #16480, lsl #48
+; CHECK-TINY: fmov {{d[0-9]+}}, [[W129]]
; CHECK-NOFP-TINY-NOT: ldr {{d[0-9]+}},
; CHECK-NOFP-TINY-NOT: fadd
-; CHECK-LARGE: movz x[[LITADDR:[0-9]+]], #:abs_g0_nc:[[CURLIT:.LCPI[0-9]+_[0-9]+]]
+; CHECK-LARGE: movz x[[LITADDR:[0-9]+]], #:abs_g0_nc:[[CURLIT:vardouble]]
; CHECK-LARGE: movk x[[LITADDR]], #:abs_g1_nc:[[CURLIT]]
; CHECK-LARGE: movk x[[LITADDR]], #:abs_g2_nc:[[CURLIT]]
; CHECK-LARGE: movk x[[LITADDR]], #:abs_g3:[[CURLIT]]
OpenPOWER on IntegriCloud