@@ -53,8 +53,6 @@ class AMDGPULibCalls {
5353
5454 using FuncInfo = llvm::AMDGPULibFunc;
5555
56- bool UnsafeFPMath = false ;
57-
5856 // -fuse-native.
5957 bool AllNative = false ;
6058
@@ -117,7 +115,6 @@ class AMDGPULibCalls {
117115 bool AllowStrictFP = false );
118116
119117protected:
120- bool isUnsafeMath (const FPMathOperator *FPOp) const ;
121118 bool isUnsafeFiniteOnlyMath (const FPMathOperator *FPOp) const ;
122119
123120 bool canIncreasePrecisionOfConstantFold (const FPMathOperator *FPOp) const ;
@@ -415,23 +412,17 @@ bool AMDGPULibCalls::parseFunctionName(const StringRef &FMangledName,
415412 return AMDGPULibFunc::parse (FMangledName, FInfo);
416413}
417414
418- bool AMDGPULibCalls::isUnsafeMath (const FPMathOperator *FPOp) const {
419- return UnsafeFPMath || FPOp->isFast ();
420- }
421-
422415bool AMDGPULibCalls::isUnsafeFiniteOnlyMath (const FPMathOperator *FPOp) const {
423- return UnsafeFPMath ||
424- (FPOp->hasApproxFunc () && FPOp->hasNoNaNs () && FPOp->hasNoInfs ());
416+ return FPOp->hasApproxFunc () && FPOp->hasNoNaNs () && FPOp->hasNoInfs ();
425417}
426418
427419bool AMDGPULibCalls::canIncreasePrecisionOfConstantFold (
428420 const FPMathOperator *FPOp) const {
429421 // TODO: Refine to approxFunc or contract
430- return isUnsafeMath ( FPOp);
422+ return FPOp-> isFast ( );
431423}
432424
433425void AMDGPULibCalls::initFunction (Function &F, FunctionAnalysisManager &FAM) {
434- UnsafeFPMath = F.getFnAttribute (" unsafe-fp-math" ).getValueAsBool ();
435426 AC = &FAM.getResult <AssumptionAnalysis>(F);
436427 TLInfo = &FAM.getResult <TargetLibraryAnalysis>(F);
437428 DT = FAM.getCachedResult <DominatorTreeAnalysis>(F);
0 commit comments