[clang] 6593360 - AMDGPU: Fix consistently backwards logic for default denormal mode
Matt Arsenault via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 1 09:36:40 PDT 2020
Author: Matt Arsenault
Date: 2020-04-01T12:36:22-04:00
New Revision: 6593360ee760c0c98cf7fb05be70aa4ea455a42a
URL: https://github.com/llvm/llvm-project/commit/6593360ee760c0c98cf7fb05be70aa4ea455a42a
DIFF: https://github.com/llvm/llvm-project/commit/6593360ee760c0c98cf7fb05be70aa4ea455a42a.diff
LOG: AMDGPU: Fix consistently backwards logic for default denormal mode
I forgot to squash this into c9d65a48af1d7bbfed7e785613cc9d9acf71821b
Added:
Modified:
clang/lib/Driver/ToolChains/AMDGPU.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/AMDGPU.cpp b/clang/lib/Driver/ToolChains/AMDGPU.cpp
index e6a5af99b203..2cec0dc9de22 100644
--- a/clang/lib/Driver/ToolChains/AMDGPU.cpp
+++ b/clang/lib/Driver/ToolChains/AMDGPU.cpp
@@ -109,11 +109,10 @@ bool AMDGPUToolChain::getDefaultDenormsAreZeroForTarget(
// Default to enabling f32 denormals by default on subtargets where fma is
// fast with denormals
- const bool DefaultDenormsAreZeroForTarget =
+ const bool BothDenormAndFMAFast =
(ArchAttr & llvm::AMDGPU::FEATURE_FAST_FMA_F32) &&
(ArchAttr & llvm::AMDGPU::FEATURE_FAST_DENORMAL_F32);
-
- return DefaultDenormsAreZeroForTarget;
+ return !BothDenormAndFMAFast;
}
llvm::DenormalMode AMDGPUToolChain::getDefaultDenormalModeForType(
@@ -137,7 +136,7 @@ llvm::DenormalMode AMDGPUToolChain::getDefaultDenormalModeForType(
// TODO: There are way too many flags that change this. Do we need to check
// them all?
bool DAZ = DriverArgs.hasArg(options::OPT_cl_denorms_are_zero) ||
- !getDefaultDenormsAreZeroForTarget(Kind);
+ getDefaultDenormsAreZeroForTarget(Kind);
// Outputs are flushed to zero, preserving sign
return DAZ ? llvm::DenormalMode::getPreserveSign() :
llvm::DenormalMode::getIEEE();
More information about the cfe-commits
mailing list