Skip to content

Commit c644f0c

Browse files
committed
Remove UnsafeFPMath in AMDGPULibCalls.cpp
1 parent 92c8eda commit c644f0c

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

119117
protected:
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-
422415
bool 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

427419
bool AMDGPULibCalls::canIncreasePrecisionOfConstantFold(
428420
const FPMathOperator *FPOp) const {
429421
// TODO: Refine to approxFunc or contract
430-
return isUnsafeMath(FPOp);
422+
return FPOp->isFast();
431423
}
432424

433425
void 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

Comments
 (0)