summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2016-07-26 23:25:44 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2016-07-26 23:25:44 +0000
commite3862cdc933da4864598aa8616a33b076d99077c (patch)
treee394808494c9b8404e7afbd6b74d608ee91db503 /llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
parent685e8ff95305b35c7be889d4a0f82d2ca567779c (diff)
downloadbcm5719-llvm-e3862cdc933da4864598aa8616a33b076d99077c.tar.gz
bcm5719-llvm-e3862cdc933da4864598aa8616a33b076d99077c.zip
AMDGPU: Use rcp for fdiv 1, x with fpmath metadata
Using rcp should be OK for safe math usually, so this should not be replacing the original fdiv. llvm-svn: 276823
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp b/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
index 0627708485c..b955e231699 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
@@ -76,7 +76,7 @@ static bool shouldKeepFDivF32(Value *Num, bool UnsafeDiv) {
return false;
// Reciprocal f32 is handled separately without denormals.
- return UnsafeDiv && CNum->isExactlyValue(+1.0);
+ return UnsafeDiv || CNum->isExactlyValue(+1.0);
}
// Insert an intrinsic for fast fdiv for safe math situations where we can
OpenPOWER on IntegriCloud