summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-01-23 20:23:36 +0000
committerLang Hames <lhames@gmail.com>2014-01-23 20:23:36 +0000
commitd8f4348cab0f6ac58d62746aceb822b7d615807e (patch)
treeb1ca34b0efd2481c1c27d79fdfcfa5d75dc866b0 /test
parentb961ae25b4a88aab861cb298c22b17c12a2e1225 (diff)
downloadllvm-d8f4348cab0f6ac58d62746aceb822b7d615807e.tar.gz
llvm-d8f4348cab0f6ac58d62746aceb822b7d615807e.tar.bz2
llvm-d8f4348cab0f6ac58d62746aceb822b7d615807e.tar.xz
Replace vfmaddxx213 instructions with their 231-type equivalents in accumulator
loops. Writing back to the accumulator (231-type) allows the coalescer to eliminate an extra copy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199933 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/fma.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/X86/fma.ll b/test/CodeGen/X86/fma.ll
index 917eac0ca3..0cdf3cdf57 100644
--- a/test/CodeGen/X86/fma.ll
+++ b/test/CodeGen/X86/fma.ll
@@ -42,6 +42,21 @@ entry:
ret float %call
}
+; Test FMA3 variant selection
+; CHECK: fma3_select231:
+; CHECK: vfmadd231ss
+define float @fma3_select231(float %x, float %y, i32 %N) #0 {
+entry:
+ br label %while.body
+while.body: ; preds = %while.body, %while.body
+ %acc.01 = phi float [ 0.000000e+00, %entry ], [ %acc, %while.body ]
+ %acc = tail call float @llvm.fma.f32(float %x, float %y, float %acc.01) nounwind readnone
+ %b = fcmp ueq float %acc, 0.0
+ br i1 %b, label %while.body, label %while.end
+while.end: ; preds = %while.body, %entry
+ ret float %acc
+}
+
declare float @llvm.fma.f32(float, float, float) nounwind readnone
declare double @llvm.fma.f64(double, double, double) nounwind readnone
declare x86_fp80 @llvm.fma.f80(x86_fp80, x86_fp80, x86_fp80) nounwind readnone