summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2015-11-10 16:48:53 +0000
committerSanjay Patel <spatel@rotateright.com>2015-11-10 16:48:53 +0000
commit766589efdce379bd905a126180fead66760acda7 (patch)
tree263e27585632cd11256314f909c4074800cf656d /llvm/test
parent8b05278b4ebbce338fbd5604340a64dab6c8d415 (diff)
downloadbcm5719-llvm-766589efdce379bd905a126180fead66760acda7.tar.gz
bcm5719-llvm-766589efdce379bd905a126180fead66760acda7.zip
add 'MustReduceDepth' as an objective/cost-metric for the MachineCombiner
This is one of the problems noted in PR25016: https://llvm.org/bugs/show_bug.cgi?id=25016 and: http://lists.llvm.org/pipermail/llvm-dev/2015-October/090998.html The spilling problem is independent and not addressed by this patch. The MachineCombiner was doing reassociations that don't improve or even worsen the critical path. This is caused by inclusion of the "slack" factor when calculating the critical path of the original code sequence. If we don't add that, then we have a more conservative cost comparison of the old code sequence vs. a new sequence. The more liberal calculation must be preserved, however, for the AArch64 MULADD patterns because benchmark regressions were observed without that. The two failing test cases now have identical asm that does what we want: a + b + c + d ---> (a + b) + (c + d) Differential Revision: http://reviews.llvm.org/D13417 llvm-svn: 252616
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/machine-combiner.ll11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/test/CodeGen/X86/machine-combiner.ll b/llvm/test/CodeGen/X86/machine-combiner.ll
index efcf51bba92..3fbb233696c 100644
--- a/llvm/test/CodeGen/X86/machine-combiner.ll
+++ b/llvm/test/CodeGen/X86/machine-combiner.ll
@@ -632,10 +632,10 @@ define double @reassociate_adds_from_calls() {
; AVX-NEXT: callq bar
; AVX-NEXT: vmovsd %xmm0, (%rsp)
; AVX-NEXT: callq bar
-; AVX-NEXT: vmovsd (%rsp), %xmm1
-; AVX: vaddsd 8(%rsp), %xmm1, %xmm1
+; AVX-NEXT: vmovsd 8(%rsp), %xmm1
+; AVX: vaddsd 16(%rsp), %xmm1, %xmm1
+; AVX-NEXT: vaddsd (%rsp), %xmm0, %xmm0
; AVX-NEXT: vaddsd %xmm0, %xmm1, %xmm0
-; AVX-NEXT: vaddsd 16(%rsp), %xmm0, %xmm0
%x0 = call double @bar()
%x1 = call double @bar()
@@ -656,9 +656,10 @@ define double @already_reassociated() {
; AVX-NEXT: callq bar
; AVX-NEXT: vmovsd %xmm0, (%rsp)
; AVX-NEXT: callq bar
+; AVX-NEXT: vmovsd 8(%rsp), %xmm1
+; AVX: vaddsd 16(%rsp), %xmm1, %xmm1
; AVX-NEXT: vaddsd (%rsp), %xmm0, %xmm0
-; AVX-NEXT: vaddsd 8(%rsp), %xmm0, %xmm0
-; AVX-NEXT: vaddsd 16(%rsp), %xmm0, %xmm0
+; AVX-NEXT: vaddsd %xmm0, %xmm1, %xmm0
%x0 = call double @bar()
%x1 = call double @bar()
OpenPOWER on IntegriCloud