Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions llvm/lib/Analysis/ConstantFolding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
#include <cassert>
#include <cerrno>
#include <cfenv>
#include <cfloat>
#include <cmath>
#include <cstdint>

Expand Down Expand Up @@ -1699,9 +1698,9 @@ bool llvm::canConstantFoldCallTo(const CallBase *Call, const Function *F) {
Name == "sinh" || Name == "sinhf" ||
Name == "sqrt" || Name == "sqrtf";
case 't':
return Name == "tan" || Name == "tanf" || Name == "tanh" ||
Name == "tanhf" || Name == "trunc" || Name == "truncf" ||
Name == "tgamma" || Name == "tgammaf";
return Name == "tan" || Name == "tanf" ||
Name == "tanh" || Name == "tanhf" ||
Name == "trunc" || Name == "truncf";
case '_':
// Check for various function names that get used for the math functions
// when the header files are preprocessed with the macro
Expand Down Expand Up @@ -2418,14 +2417,6 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
if (TLI->has(Func))
return ConstantFoldFP(erf, APF, Ty);
break;
case LibFunc_tgamma:
case LibFunc_tgammaf:
// NOTE: These boundaries are somewhat conservative.
if (TLI->has(Func) &&
(Ty->isDoubleTy() && APF > APFloat(DBL_MIN) && APF < APFloat(171.0) ||
Ty->isFloatTy() && APF > APFloat(FLT_MIN) && APF < APFloat(35.0f)))
return ConstantFoldFP(tgamma, APF, Ty);
break;
case LibFunc_nearbyint:
case LibFunc_nearbyintf:
case LibFunc_rint:
Expand Down Expand Up @@ -3638,10 +3629,6 @@ bool llvm::isMathLibCallNoop(const CallBase *Call,
case LibFunc_sqrtf:
return Op.isNaN() || Op.isZero() || !Op.isNegative();

case LibFunc_tgamma:
case LibFunc_tgammaf:
return true;

// FIXME: Add more functions: sqrt_finite, atanh, expm1, log1p,
// maybe others?
default:
Expand Down
255 changes: 0 additions & 255 deletions llvm/test/Transforms/InstCombine/tgamma.ll

This file was deleted.

Loading