diff options
author | Matthew Devereau <matthew.devereau@arm.com> | 2024-08-09 11:12:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-09 11:12:43 +0100 |
commit | ccb2b011e577e861254f61df9c59494e9e122b38 (patch) | |
tree | 8b3cccc16731e8648199bb97b1e4c7a149ad156d /llvm/lib/Analysis/ConstantFolding.cpp | |
parent | 1b80ed457d2dfd278541b7c20e7d2b6192ecbf13 (diff) | |
download | llvm-ccb2b011e577e861254f61df9c59494e9e122b38.zip llvm-ccb2b011e577e861254f61df9c59494e9e122b38.tar.gz llvm-ccb2b011e577e861254f61df9c59494e9e122b38.tar.bz2 |
Enable logf128 constant folding for hosts with 128bit floats (#96287)
Hosts which support a float size of 128 bits can benefit from constant
fp128 folding.
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r-- | llvm/lib/Analysis/ConstantFolding.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp index 084647b..87feb2e 100644 --- a/llvm/lib/Analysis/ConstantFolding.cpp +++ b/llvm/lib/Analysis/ConstantFolding.cpp @@ -1781,7 +1781,7 @@ Constant *ConstantFoldFP(double (*NativeFP)(double), const APFloat &V, return GetConstantFoldFPValue(Result, Ty); } -#if defined(HAS_IEE754_FLOAT128) && defined(HAS_LOGF128) +#if defined(HAS_IEE754_FLOAT128) Constant *ConstantFoldFP128(float128 (*NativeFP)(float128), const APFloat &V, Type *Ty) { llvm_fenv_clearexcept(); @@ -2114,7 +2114,7 @@ static Constant *ConstantFoldScalarCall1(StringRef Name, if (IntrinsicID == Intrinsic::canonicalize) return constantFoldCanonicalize(Ty, Call, U); -#if defined(HAS_IEE754_FLOAT128) && defined(HAS_LOGF128) +#if defined(HAS_IEE754_FLOAT128) if (Ty->isFP128Ty()) { if (IntrinsicID == Intrinsic::log) { float128 Result = logf128(Op->getValueAPF().convertToQuad()); |