Skip to content

Commit 0f1b627

Browse files
committed
Fixup __float128 uses and if defined guard in ConstantFolding
Uses of __float128 in (#94944) should be float128. Although ConstantFoldFP128 is not reliant on HAS_LOGF128, it is only used by conditional code controlled by HAS_LOGF128, and will cause unused errors on buildbots.
1 parent 506b4cd commit 0f1b627

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Analysis/ConstantFolding.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,7 +1744,7 @@ Constant *GetConstantFoldFPValue(double V, Type *Ty) {
17441744
}
17451745

17461746
#if defined(HAS_IEE754_FLOAT128)
1747-
Constant *GetConstantFoldFPValue128(__float128 V, Type *Ty) {
1747+
Constant *GetConstantFoldFPValue128(float128 V, Type *Ty) {
17481748
if (Ty->isFP128Ty())
17491749
return ConstantFP::get(Ty, V);
17501750
llvm_unreachable("Can only constant fold fp128");
@@ -1783,12 +1783,11 @@ Constant *ConstantFoldFP(double (*NativeFP)(double), const APFloat &V,
17831783
return GetConstantFoldFPValue(Result, Ty);
17841784
}
17851785

1786-
#if defined(HAS_IEE754_FLOAT128)
1787-
LLVM_ATTRIBUTE_UNUSED
1786+
#if defined(HAS_IEE754_FLOAT128) && defined(HAS_LOGF128)
17881787
Constant *ConstantFoldFP128(long double (*NativeFP)(long double),
17891788
const APFloat &V, Type *Ty) {
17901789
llvm_fenv_clearexcept();
1791-
__float128 Result = NativeFP(V.convertToQuad());
1790+
float128 Result = NativeFP(V.convertToQuad());
17921791
if (llvm_fenv_testexcept()) {
17931792
llvm_fenv_clearexcept();
17941793
return nullptr;
@@ -2120,7 +2119,7 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
21202119
#if defined(HAS_IEE754_FLOAT128) && defined(HAS_LOGF128)
21212120
if (Ty->isFP128Ty()) {
21222121
if (IntrinsicID == Intrinsic::log) {
2123-
__float128 Result = logf128(Op->getValueAPF().convertToQuad());
2122+
float128 Result = logf128(Op->getValueAPF().convertToQuad());
21242123
return GetConstantFoldFPValue128(Result, Ty);
21252124
}
21262125

0 commit comments

Comments
 (0)