Skip to content

Commit dffef04

Browse files
authored
[IR][ADT] Remove APFloat/Type::isIEEE (#130496)
Address comment #130477 (comment).
1 parent 29555ad commit dffef04

File tree

5 files changed

+6
-19
lines changed

5 files changed

+6
-19
lines changed

llvm/include/llvm/ADT/APFloat.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,6 @@ class APFloat : public APFloatBase {
14651465
bool isSmallest() const { APFLOAT_DISPATCH_ON_SEMANTICS(isSmallest()); }
14661466
bool isLargest() const { APFLOAT_DISPATCH_ON_SEMANTICS(isLargest()); }
14671467
bool isInteger() const { APFLOAT_DISPATCH_ON_SEMANTICS(isInteger()); }
1468-
bool isIEEE() const { return usesLayout<IEEEFloat>(getSemantics()); }
14691468

14701469
bool isSmallestNormalized() const {
14711470
APFLOAT_DISPATCH_ON_SEMANTICS(isSmallestNormalized());

llvm/include/llvm/IR/Type.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ class Type {
165165
bool isPPC_FP128Ty() const { return getTypeID() == PPC_FP128TyID; }
166166

167167
/// Return true if this is a well-behaved IEEE-like type, which has a IEEE
168-
/// compatible layout as defined by APFloat::isIEEE(), and does not have
169-
/// non-IEEE values, such as x86_fp80's unnormal values.
168+
/// compatible layout, and does not have non-IEEE values, such as x86_fp80's
169+
/// unnormal values.
170170
bool isIEEELikeFPTy() const {
171171
switch (getTypeID()) {
172172
case DoubleTyID:
@@ -346,10 +346,6 @@ class Type {
346346
/// ppc long double), this method returns -1.
347347
int getFPMantissaWidth() const;
348348

349-
/// Return whether the type is IEEE compatible, as defined by the eponymous
350-
/// method in APFloat.
351-
bool isIEEE() const;
352-
353349
/// If this is a vector type, return the element type, otherwise return
354350
/// 'this'.
355351
inline Type *getScalarType() const {

llvm/include/llvm/SandboxIR/Type.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ class Type {
120120
bool isPPC_FP128Ty() const { return LLVMTy->isPPC_FP128Ty(); }
121121

122122
/// Return true if this is a well-behaved IEEE-like type, which has a IEEE
123-
/// compatible layout as defined by APFloat::isIEEE(), and does not have
124-
/// non-IEEE values, such as x86_fp80's unnormal values.
123+
/// compatible layout, and does not have non-IEEE values, such as x86_fp80's
124+
/// unnormal values.
125125
bool isIEEELikeFPTy() const { return LLVMTy->isIEEELikeFPTy(); }
126126

127127
/// Return true if this is one of the floating-point types
@@ -262,10 +262,6 @@ class Type {
262262
/// ppc long double), this method returns -1.
263263
int getFPMantissaWidth() const { return LLVMTy->getFPMantissaWidth(); }
264264

265-
/// Return whether the type is IEEE compatible, as defined by the eponymous
266-
/// method in APFloat.
267-
bool isIEEE() const { return LLVMTy->isIEEE(); }
268-
269265
/// If this is a vector type, return the element type, otherwise return
270266
/// 'this'.
271267
Type *getScalarType() const;

llvm/lib/IR/Type.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,6 @@ const fltSemantics &Type::getFltSemantics() const {
117117
}
118118
}
119119

120-
bool Type::isIEEE() const {
121-
return APFloat::getZero(getFltSemantics()).isIEEE();
122-
}
123-
124120
bool Type::isScalableTargetExtTy() const {
125121
if (auto *TT = dyn_cast<TargetExtType>(this))
126122
return isa<ScalableVectorType>(TT->getLayoutType());

llvm/unittests/SandboxIR/TypesTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ define void @foo(i32 %v0) {
180180
EXPECT_EQ(VecTy32x2->getScalarSizeInBits(), 32u);
181181
// Check getFPMantissaWidth().
182182
EXPECT_EQ(FloatTy->getFPMantissaWidth(), LLVMFloatTy->getFPMantissaWidth());
183-
// Check isIEEE().
184-
EXPECT_EQ(FloatTy->isIEEE(), LLVMFloatTy->isIEEE());
183+
// Check isIEEELikeFPTy().
184+
EXPECT_EQ(FloatTy->isIEEELikeFPTy(), LLVMFloatTy->isIEEELikeFPTy());
185185
// Check getScalarType().
186186
EXPECT_EQ(
187187
Ctx.getType(llvm::FixedVectorType::get(LLVMInt32Ty, 8u))->getScalarType(),

0 commit comments

Comments
 (0)