-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[ConstantFPRange] Remove ConstantFPRange::toKnownFPClass
#109960
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
Conversation
@llvm/pr-subscribers-llvm-ir Author: Yingwei Zheng (dtcxzyw) ChangesAddresses comment #86483 (review). Full diff: https://github.com/llvm/llvm-project/pull/109960.diff 3 Files Affected:
diff --git a/llvm/include/llvm/IR/ConstantFPRange.h b/llvm/include/llvm/IR/ConstantFPRange.h
index 23f0e8b8e0d134..67f9f945d748ba 100644
--- a/llvm/include/llvm/IR/ConstantFPRange.h
+++ b/llvm/include/llvm/IR/ConstantFPRange.h
@@ -175,9 +175,6 @@ class [[nodiscard]] ConstantFPRange {
/// Return the FPClassTest which will return true for the value.
FPClassTest classify() const;
- /// Return known floating-point classes for values in this range.
- KnownFPClass toKnownFPClass() const;
-
/// Print out the bounds to a stream.
void print(raw_ostream &OS) const;
diff --git a/llvm/lib/IR/ConstantFPRange.cpp b/llvm/lib/IR/ConstantFPRange.cpp
index 58aab353b43939..6b3610f5cdfe8c 100644
--- a/llvm/lib/IR/ConstantFPRange.cpp
+++ b/llvm/lib/IR/ConstantFPRange.cpp
@@ -196,13 +196,6 @@ FPClassTest ConstantFPRange::classify() const {
return static_cast<FPClassTest>(Mask);
}
-KnownFPClass ConstantFPRange::toKnownFPClass() const {
- KnownFPClass Result;
- Result.KnownFPClasses = classify();
- Result.SignBit = getSignBit();
- return Result;
-}
-
void ConstantFPRange::print(raw_ostream &OS) const {
if (isFullSet())
OS << "full-set";
diff --git a/llvm/unittests/IR/ConstantFPRangeTest.cpp b/llvm/unittests/IR/ConstantFPRangeTest.cpp
index bf6ea95c00e22e..5a00c6b11d12b5 100644
--- a/llvm/unittests/IR/ConstantFPRangeTest.cpp
+++ b/llvm/unittests/IR/ConstantFPRangeTest.cpp
@@ -363,14 +363,11 @@ TEST_F(ConstantFPRangeTest, FPClassify) {
EXPECT_EQ(SomeNeg.classify(), fcNegFinite);
EXPECT_EQ(PosInf.classify(), fcPosInf);
EXPECT_EQ(NegInf.classify(), fcNegInf);
- EXPECT_TRUE(SomePos.toKnownFPClass().cannotBeOrderedLessThanZero());
EXPECT_EQ(Finite.getSignBit(), std::nullopt);
EXPECT_EQ(PosZero.getSignBit(), false);
EXPECT_EQ(NegZero.getSignBit(), true);
EXPECT_EQ(SomePos.getSignBit(), false);
EXPECT_EQ(SomeNeg.getSignBit(), true);
- EXPECT_EQ(SomePos.toKnownFPClass().SignBit, false);
- EXPECT_EQ(SomeNeg.toKnownFPClass().SignBit, true);
EnumerateConstantFPRanges(
[](const ConstantFPRange &CR) {
|
@@ -196,13 +196,6 @@ FPClassTest ConstantFPRange::classify() const { | |||
return static_cast<FPClassTest>(Mask); | |||
} | |||
|
|||
KnownFPClass ConstantFPRange::toKnownFPClass() const { | |||
KnownFPClass Result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably move KnownFPClass into ADT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which reminds me, we for some reason have llvm/ADT/FloatingPointMode.h, and llvm/IR/FPEnv.h. I can't tell if there's some intentional split here
Addresses comment #86483 (review).