Skip to content

[IR][ADT] Remove APFloat/Type::isIEEE #130496

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2025
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
1 change: 0 additions & 1 deletion llvm/include/llvm/ADT/APFloat.h
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,6 @@ class APFloat : public APFloatBase {
bool isSmallest() const { APFLOAT_DISPATCH_ON_SEMANTICS(isSmallest()); }
bool isLargest() const { APFLOAT_DISPATCH_ON_SEMANTICS(isLargest()); }
bool isInteger() const { APFLOAT_DISPATCH_ON_SEMANTICS(isInteger()); }
bool isIEEE() const { return usesLayout<IEEEFloat>(getSemantics()); }

bool isSmallestNormalized() const {
APFLOAT_DISPATCH_ON_SEMANTICS(isSmallestNormalized());
Expand Down
8 changes: 2 additions & 6 deletions llvm/include/llvm/IR/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ class Type {
bool isPPC_FP128Ty() const { return getTypeID() == PPC_FP128TyID; }

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

/// Return whether the type is IEEE compatible, as defined by the eponymous
/// method in APFloat.
bool isIEEE() const;

/// If this is a vector type, return the element type, otherwise return
/// 'this'.
inline Type *getScalarType() const {
Expand Down
8 changes: 2 additions & 6 deletions llvm/include/llvm/SandboxIR/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ class Type {
bool isPPC_FP128Ty() const { return LLVMTy->isPPC_FP128Ty(); }

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

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

/// Return whether the type is IEEE compatible, as defined by the eponymous
/// method in APFloat.
bool isIEEE() const { return LLVMTy->isIEEE(); }

/// If this is a vector type, return the element type, otherwise return
/// 'this'.
Type *getScalarType() const;
Expand Down
4 changes: 0 additions & 4 deletions llvm/lib/IR/Type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ const fltSemantics &Type::getFltSemantics() const {
}
}

bool Type::isIEEE() const {
return APFloat::getZero(getFltSemantics()).isIEEE();
}

bool Type::isScalableTargetExtTy() const {
if (auto *TT = dyn_cast<TargetExtType>(this))
return isa<ScalableVectorType>(TT->getLayoutType());
Expand Down
4 changes: 2 additions & 2 deletions llvm/unittests/SandboxIR/TypesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ define void @foo(i32 %v0) {
EXPECT_EQ(VecTy32x2->getScalarSizeInBits(), 32u);
// Check getFPMantissaWidth().
EXPECT_EQ(FloatTy->getFPMantissaWidth(), LLVMFloatTy->getFPMantissaWidth());
// Check isIEEE().
EXPECT_EQ(FloatTy->isIEEE(), LLVMFloatTy->isIEEE());
// Check isIEEELikeFPTy().
EXPECT_EQ(FloatTy->isIEEELikeFPTy(), LLVMFloatTy->isIEEELikeFPTy());
// Check getScalarType().
EXPECT_EQ(
Ctx.getType(llvm::FixedVectorType::get(LLVMInt32Ty, 8u))->getScalarType(),
Expand Down