@@ -2743,13 +2743,11 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
2743
2743
StringRef FPExceptionBehavior = " " ;
2744
2744
// -ffp-eval-method options: double, extended, source
2745
2745
StringRef FPEvalMethod = " " ;
2746
- const llvm::DenormalMode DefaultDenormalFPMath =
2746
+ llvm::DenormalMode DenormalFPMath =
2747
2747
TC.getDefaultDenormalModeForType (Args, JA);
2748
- const llvm::DenormalMode DefaultDenormalFP32Math =
2748
+ llvm::DenormalMode DenormalFP32Math =
2749
2749
TC.getDefaultDenormalModeForType (Args, JA, &llvm::APFloat::IEEEsingle ());
2750
2750
2751
- llvm::DenormalMode DenormalFPMath = DefaultDenormalFPMath;
2752
- llvm::DenormalMode DenormalFP32Math = DefaultDenormalFP32Math;
2753
2751
// CUDA and HIP don't rely on the frontend to pass an ffp-contract option.
2754
2752
// If one wasn't given by the user, don't pass it here.
2755
2753
StringRef FPContract;
@@ -2899,11 +2897,6 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
2899
2897
SignedZeros = true ;
2900
2898
// -fno_fast_math restores default denormal and fpcontract handling
2901
2899
FPContract = " on" ;
2902
- DenormalFPMath = llvm::DenormalMode::getIEEE ();
2903
-
2904
- // FIXME: The target may have picked a non-IEEE default mode here based on
2905
- // -cl-denorms-are-zero. Should the target consider -fp-model interaction?
2906
- DenormalFP32Math = llvm::DenormalMode::getIEEE ();
2907
2900
2908
2901
StringRef Val = A->getValue ();
2909
2902
if (OFastEnabled && !Val.equals (" fast" )) {
@@ -2924,10 +2917,6 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
2924
2917
if (Val.equals (" fast" )) {
2925
2918
FPModel = Val;
2926
2919
applyFastMath ();
2927
- // The target-specific getDefaultDenormalModeForType handler should
2928
- // account for -ffp-model=fast and choose its behavior
2929
- DenormalFPMath = DefaultDenormalFPMath;
2930
- DenormalFP32Math = DefaultDenormalFP32Math;
2931
2920
} else if (Val.equals (" precise" )) {
2932
2921
optID = options::OPT_ffp_contract;
2933
2922
FPModel = Val;
@@ -3126,9 +3115,6 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
3126
3115
TrappingMath = true ;
3127
3116
FPExceptionBehavior = " strict" ;
3128
3117
3129
- // The target may have opted to flush by default, so force IEEE.
3130
- DenormalFPMath = llvm::DenormalMode::getIEEE ();
3131
- DenormalFP32Math = llvm::DenormalMode::getIEEE ();
3132
3118
if (!JA.isDeviceOffloading (Action::OFK_Cuda) &&
3133
3119
!JA.isOffloading (Action::OFK_HIP)) {
3134
3120
if (LastSeenFfpContractOption != " " ) {
@@ -3158,9 +3144,7 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
3158
3144
ReciprocalMath = false ;
3159
3145
ApproxFunc = false ;
3160
3146
SignedZeros = true ;
3161
- // -fno_fast_math restores default denormal and fpcontract handling
3162
- DenormalFPMath = DefaultDenormalFPMath;
3163
- DenormalFP32Math = llvm::DenormalMode::getIEEE ();
3147
+ // -fno_fast_math restores default fpcontract handling
3164
3148
if (!JA.isDeviceOffloading (Action::OFK_Cuda) &&
3165
3149
!JA.isOffloading (Action::OFK_HIP)) {
3166
3150
if (LastSeenFfpContractOption != " " ) {
@@ -3175,8 +3159,6 @@ static void RenderFloatingPointOptions(const ToolChain &TC, const Driver &D,
3175
3159
// subsequent options conflict then emit warning diagnostic.
3176
3160
if (HonorINFs && HonorNaNs && !AssociativeMath && !ReciprocalMath &&
3177
3161
SignedZeros && TrappingMath && RoundingFPMath && !ApproxFunc &&
3178
- DenormalFPMath == llvm::DenormalMode::getIEEE () &&
3179
- DenormalFP32Math == llvm::DenormalMode::getIEEE () &&
3180
3162
FPContract.equals (" off" ))
3181
3163
// OK: Current Arg doesn't conflict with -ffp-model=strict
3182
3164
;
0 commit comments