summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2017-08-28 18:00:08 +0000
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>2017-08-28 18:00:08 +0000
commit312c557b3b1d989faaf4437107cb8487bca6d515 (patch)
treec3e18c030d115668c64c61468edd2334456cfcd1 /llvm/test/CodeGen
parentea2683ecb8a6e45da255af1ff84f7e25478ee9b5 (diff)
downloadbcm5719-llvm-312c557b3b1d989faaf4437107cb8487bca6d515.tar.gz
bcm5719-llvm-312c557b3b1d989faaf4437107cb8487bca6d515.zip
[AMDGPU] Fix regression in AMDGPULibCalls allowing native for doubles
Under -cl-fast-relaxed-math we could use native_sqrt, but f64 was allowed to produce HSAIL's nsqrt instruction. HSAIL is not here and we stick with non-existing native_sqrt(double) as a result. Add check for f64 to not return native functions and also remove handling of f64 case for fold_sqrt. Differential Revision: https://reviews.llvm.org/D37223 llvm-svn: 311900
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/AMDGPU/simplify-libcalls.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AMDGPU/simplify-libcalls.ll b/llvm/test/CodeGen/AMDGPU/simplify-libcalls.ll
index e487f3c417e..eab1fe4c70f 100644
--- a/llvm/test/CodeGen/AMDGPU/simplify-libcalls.ll
+++ b/llvm/test/CodeGen/AMDGPU/simplify-libcalls.ll
@@ -641,7 +641,18 @@ entry:
ret void
}
+; GCN-LABEL: {{^}}define amdgpu_kernel void @test_dont_use_native_sqrt_fast_f64
+; GCN: tail call fast double @_Z4sqrtd(double %tmp)
+define amdgpu_kernel void @test_dont_use_native_sqrt_fast_f64(double addrspace(1)* nocapture %a) {
+entry:
+ %tmp = load double, double addrspace(1)* %a, align 8
+ %call = tail call fast double @_Z4sqrtd(double %tmp)
+ store double %call, double addrspace(1)* %a, align 8
+ ret void
+}
+
declare float @_Z4sqrtf(float)
+declare double @_Z4sqrtd(double)
; GCN-LABEL: {{^}}define amdgpu_kernel void @test_use_native_rsqrt
; GCN-NATIVE: tail call fast float @_Z12native_rsqrtf(float %tmp)
OpenPOWER on IntegriCloud