summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/machine-combiner.ll
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2015-08-19 21:18:46 +0000
committerSanjay Patel <spatel@rotateright.com>2015-08-19 21:18:46 +0000
commit4e3ee1e548a28eb72c235dd70117997c7691424e (patch)
tree7ff41cb1045273aab4d372d5d2d8a9ed402fca74 /llvm/test/CodeGen/X86/machine-combiner.ll
parent35f528262f47d283023ed0c6a2d12d1da4bc2df3 (diff)
downloadbcm5719-llvm-4e3ee1e548a28eb72c235dd70117997c7691424e.tar.gz
bcm5719-llvm-4e3ee1e548a28eb72c235dd70117997c7691424e.zip
[x86] enable machine combiner reassociations for scalar single-precision maximums
llvm-svn: 245504
Diffstat (limited to 'llvm/test/CodeGen/X86/machine-combiner.ll')
-rw-r--r--llvm/test/CodeGen/X86/machine-combiner.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/machine-combiner.ll b/llvm/test/CodeGen/X86/machine-combiner.ll
index 3b5e6d212e3..2335cc7f1a8 100644
--- a/llvm/test/CodeGen/X86/machine-combiner.ll
+++ b/llvm/test/CodeGen/X86/machine-combiner.ll
@@ -382,3 +382,27 @@ define float @reassociate_mins_single(float %x0, float %x1, float %x2, float %x3
ret float %sel2
}
+; Verify that SSE and AVX scalar single-precision maximum ops are reassociated.
+
+define float @reassociate_maxs_single(float %x0, float %x1, float %x2, float %x3) {
+; SSE-LABEL: reassociate_maxs_single:
+; SSE: # BB#0:
+; SSE-NEXT: divss %xmm1, %xmm0
+; SSE-NEXT: maxss %xmm3, %xmm2
+; SSE-NEXT: maxss %xmm2, %xmm0
+; SSE-NEXT: retq
+;
+; AVX-LABEL: reassociate_maxs_single:
+; AVX: # BB#0:
+; AVX-NEXT: vdivss %xmm1, %xmm0, %xmm0
+; AVX-NEXT: vmaxss %xmm3, %xmm2, %xmm1
+; AVX-NEXT: vmaxss %xmm1, %xmm0, %xmm0
+; AVX-NEXT: retq
+ %t0 = fdiv float %x0, %x1
+ %cmp1 = fcmp ogt float %x2, %t0
+ %sel1 = select i1 %cmp1, float %x2, float %t0
+ %cmp2 = fcmp ogt float %x3, %sel1
+ %sel2 = select i1 %cmp2, float %x3, float %sel1
+ ret float %sel2
+}
+
OpenPOWER on IntegriCloud