[llvm] 49fe8cd - [IR] Remove ConstantFP::getZeroValueForNegation.

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 4 09:24:37 PDT 2023


Author: Craig Topper
Date: 2023-04-04T09:24:29-07:00
New Revision: 49fe8cd6daf8994a148ab15d562022797441d11a

URL: https://github.com/llvm/llvm-project/commit/49fe8cd6daf8994a148ab15d562022797441d11a
DIFF: https://github.com/llvm/llvm-project/commit/49fe8cd6daf8994a148ab15d562022797441d11a.diff

LOG: [IR] Remove ConstantFP::getZeroValueForNegation.

This was mostly used for integers which was fixed in D147492.

The only FP usage was removed in D147497.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D147501

Added: 
    

Modified: 
    llvm/include/llvm/IR/Constants.h
    llvm/lib/IR/Constants.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/Constants.h b/llvm/include/llvm/IR/Constants.h
index baa4bac8c8e14..94940c816179e 100644
--- a/llvm/include/llvm/IR/Constants.h
+++ b/llvm/include/llvm/IR/Constants.h
@@ -269,11 +269,6 @@ class ConstantFP final : public ConstantData {
 public:
   ConstantFP(const ConstantFP &) = delete;
 
-  /// Floating point negation must be implemented with f(x) = -0.0 - x. This
-  /// method returns the negative zero constant for floating point or vector
-  /// floating point types; for all other types, it returns the null value.
-  static Constant *getZeroValueForNegation(Type *Ty);
-
   /// This returns a ConstantFP, or a vector containing a splat of a ConstantFP,
   /// for the specified value in the specified type. This should only be used
   /// for simple constant values like 2.0/1.0 etc, that are known-valid both as

diff  --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index 9e26d6c5d9384..398cedabcfdb7 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -1009,13 +1009,6 @@ Constant *ConstantFP::getZero(Type *Ty, bool Negative) {
   return C;
 }
 
-Constant *ConstantFP::getZeroValueForNegation(Type *Ty) {
-  if (Ty->isFPOrFPVectorTy())
-    return getNegativeZero(Ty);
-
-  return Constant::getNullValue(Ty);
-}
-
 
 // ConstantFP accessors.
 ConstantFP* ConstantFP::get(LLVMContext &Context, const APFloat& V) {


        


More information about the llvm-commits mailing list