diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-04-06 00:14:59 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-04-06 00:14:59 +0000 |
commit | 25d03dbcdede75efd9fb138b97175b44893236fe (patch) | |
tree | 1c86671216f6544ad70ac826731774def1437215 /llvm/test/Transforms/SLPVectorizer | |
parent | 8deb5eb37dcb3e34f676dda50a86be1a463be74e (diff) | |
download | bcm5719-llvm-25d03dbcdede75efd9fb138b97175b44893236fe.tar.gz bcm5719-llvm-25d03dbcdede75efd9fb138b97175b44893236fe.zip |
[SLPVectorizer] Vectorize libcalls of sqrt
We didn't realize that we could transform the libcall into a vectorized
intrinsic.
llvm-svn: 265493
Diffstat (limited to 'llvm/test/Transforms/SLPVectorizer')
-rw-r--r-- | llvm/test/Transforms/SLPVectorizer/X86/call.ll | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/Transforms/SLPVectorizer/X86/call.ll b/llvm/test/Transforms/SLPVectorizer/X86/call.ll index a55cc1bf793..79f01106dc9 100644 --- a/llvm/test/Transforms/SLPVectorizer/X86/call.ll +++ b/llvm/test/Transforms/SLPVectorizer/X86/call.ll @@ -7,6 +7,7 @@ declare double @sin(double) declare double @cos(double) declare double @pow(double, double) declare double @exp2(double) +declare double @sqrt(double) declare i64 @round(i64) @@ -96,6 +97,28 @@ entry: } +; CHECK: sqrt_libm +; CHECK: call <2 x double> @llvm.sqrt.v2f64 +; CHECK: ret void +define void @sqrt_libm(double* %a, double* %b, double* %c) { +entry: + %i0 = load double, double* %a, align 8 + %i1 = load double, double* %b, align 8 + %mul = fmul double %i0, %i1 + %call = tail call double @sqrt(double %mul) nounwind readnone + %arrayidx3 = getelementptr inbounds double, double* %a, i64 1 + %i3 = load double, double* %arrayidx3, align 8 + %arrayidx4 = getelementptr inbounds double, double* %b, i64 1 + %i4 = load double, double* %arrayidx4, align 8 + %mul5 = fmul double %i3, %i4 + %call5 = tail call double @sqrt(double %mul5) nounwind readnone + store double %call, double* %c, align 8 + %arrayidx5 = getelementptr inbounds double, double* %c, i64 1 + store double %call5, double* %arrayidx5, align 8 + ret void +} + + ; Negative test case ; CHECK: round_custom ; CHECK-NOT: load <4 x i64> |