summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/fp-une-cmp.ll
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-03-07 23:13:06 +0000
committerSanjay Patel <spatel@rotateright.com>2016-03-07 23:13:06 +0000
commit8c84f74f3ae3664f95a2e695587ab802c49b524a (patch)
treefde5e922f036f0a65526ff15b1008cf47cebbb2a /llvm/test/CodeGen/X86/fp-une-cmp.ll
parent55c0dd4b263f3331a112ddd8cb4b5f9055758c86 (diff)
downloadbcm5719-llvm-8c84f74f3ae3664f95a2e695587ab802c49b524a.tar.gz
bcm5719-llvm-8c84f74f3ae3664f95a2e695587ab802c49b524a.zip
[x86] add test to show missing optimization
This should make it clearer how this proposed patch: http://reviews.llvm.org/D11393 ...will change codegen. llvm-svn: 262875
Diffstat (limited to 'llvm/test/CodeGen/X86/fp-une-cmp.ll')
-rw-r--r--llvm/test/CodeGen/X86/fp-une-cmp.ll31
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/fp-une-cmp.ll b/llvm/test/CodeGen/X86/fp-une-cmp.ll
index e0b8f61ff6f..9fab5c4dc83 100644
--- a/llvm/test/CodeGen/X86/fp-une-cmp.ll
+++ b/llvm/test/CodeGen/X86/fp-une-cmp.ll
@@ -48,3 +48,34 @@ bb2:
ret double %phi
}
+; FIXME: With branch weights indicated, bb2 should be placed ahead of bb1.
+
+define double @profile_metadata(double %x, double %y) {
+; CHECK-LABEL: profile_metadata:
+; CHECK: # BB#0: # %entry
+; CHECK-NEXT: mulsd %xmm1, %xmm0
+; CHECK-NEXT: xorpd %xmm1, %xmm1
+; CHECK-NEXT: ucomisd %xmm1, %xmm0
+; CHECK-NEXT: jne .LBB1_1
+; CHECK-NEXT: jnp .LBB1_2
+; CHECK-NEXT: .LBB1_1: # %bb1
+; CHECK-NEXT: addsd {{.*}}(%rip), %xmm0
+; CHECK-NEXT: .LBB1_2: # %bb2
+; CHECK-NEXT: retq
+
+entry:
+ %mul = fmul double %x, %y
+ %cmp = fcmp une double %mul, 0.000000e+00
+ br i1 %cmp, label %bb1, label %bb2, !prof !1
+
+bb1:
+ %add = fadd double %mul, -1.000000e+00
+ br label %bb2
+
+bb2:
+ %phi = phi double [ %add, %bb1 ], [ %mul, %entry ]
+ ret double %phi
+}
+
+!1 = !{!"branch_weights", i32 1, i32 1000}
+
OpenPOWER on IntegriCloud