[llvm] [ConstantFPRange] Remove `ConstantFPRange::toKnownFPClass` (PR #109960)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 25 03:55:04 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: Yingwei Zheng (dtcxzyw)
<details>
<summary>Changes</summary>
Addresses comment https://github.com/llvm/llvm-project/pull/86483#pullrequestreview-2327710679.
---
Full diff: https://github.com/llvm/llvm-project/pull/109960.diff
3 Files Affected:
- (modified) llvm/include/llvm/IR/ConstantFPRange.h (-3)
- (modified) llvm/lib/IR/ConstantFPRange.cpp (-7)
- (modified) llvm/unittests/IR/ConstantFPRangeTest.cpp (-3)
``````````diff
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) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/109960
More information about the llvm-commits
mailing list