[llvm] [ConstantFPRange] Remove `ConstantFPRange::toKnownFPClass` (PR #109960)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 25 03:57:40 PDT 2024
https://github.com/dtcxzyw updated https://github.com/llvm/llvm-project/pull/109960
>From 8df5eac7baf3476f123a7319d2ec3a374f29b0e0 Mon Sep 17 00:00:00 2001
From: Yingwei Zheng <dtcxzyw2333 at gmail.com>
Date: Wed, 25 Sep 2024 18:52:59 +0800
Subject: [PATCH 1/3] [ConstantFPRange] Remove
`ConstantFPRange::toKnownFPClass`
---
llvm/include/llvm/IR/ConstantFPRange.h | 3 ---
llvm/lib/IR/ConstantFPRange.cpp | 7 -------
llvm/unittests/IR/ConstantFPRangeTest.cpp | 3 ---
3 files changed, 13 deletions(-)
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) {
>From ff7e03f032b0c32b2381c145923c92248bd24fd2 Mon Sep 17 00:00:00 2001
From: Yingwei Zheng <dtcxzyw2333 at gmail.com>
Date: Wed, 25 Sep 2024 18:55:25 +0800
Subject: [PATCH 2/3] [ConstantFPRange] Remove unused includes. NFC.
---
llvm/lib/IR/ConstantFPRange.cpp | 1 -
llvm/unittests/IR/ConstantFPRangeTest.cpp | 1 -
2 files changed, 2 deletions(-)
diff --git a/llvm/lib/IR/ConstantFPRange.cpp b/llvm/lib/IR/ConstantFPRange.cpp
index 6b3610f5cdfe8c..957701891c8f37 100644
--- a/llvm/lib/IR/ConstantFPRange.cpp
+++ b/llvm/lib/IR/ConstantFPRange.cpp
@@ -8,7 +8,6 @@
#include "llvm/IR/ConstantFPRange.h"
#include "llvm/ADT/APFloat.h"
-#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
diff --git a/llvm/unittests/IR/ConstantFPRangeTest.cpp b/llvm/unittests/IR/ConstantFPRangeTest.cpp
index 5a00c6b11d12b5..e57cf04501a9ae 100644
--- a/llvm/unittests/IR/ConstantFPRangeTest.cpp
+++ b/llvm/unittests/IR/ConstantFPRangeTest.cpp
@@ -10,7 +10,6 @@
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/SmallBitVector.h"
-#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Operator.h"
#include "llvm/Support/KnownBits.h"
>From e4f4ab29bea4f5375b615ef97f1ad547bc77c8bc Mon Sep 17 00:00:00 2001
From: Yingwei Zheng <dtcxzyw2333 at gmail.com>
Date: Wed, 25 Sep 2024 18:57:18 +0800
Subject: [PATCH 3/3] [ConstantFPRange] Remove unused includes. NFC.
---
llvm/unittests/IR/ConstantFPRangeTest.cpp | 4 ----
1 file changed, 4 deletions(-)
diff --git a/llvm/unittests/IR/ConstantFPRangeTest.cpp b/llvm/unittests/IR/ConstantFPRangeTest.cpp
index e57cf04501a9ae..722e6566730da5 100644
--- a/llvm/unittests/IR/ConstantFPRangeTest.cpp
+++ b/llvm/unittests/IR/ConstantFPRangeTest.cpp
@@ -7,12 +7,8 @@
//===----------------------------------------------------------------------===//
#include "llvm/IR/ConstantFPRange.h"
-#include "llvm/ADT/BitVector.h"
-#include "llvm/ADT/Sequence.h"
-#include "llvm/ADT/SmallBitVector.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Operator.h"
-#include "llvm/Support/KnownBits.h"
#include "gtest/gtest.h"
using namespace llvm;
More information about the llvm-commits
mailing list