[PATCH] D147501: [IR] Remove ConstantFP::getZeroValueForNegation.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 22:08:50 PDT 2023


craig.topper created this revision.
craig.topper added reviewers: nikic, efriedma, reames.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added a project: LLVM.

This was mostly used for integers which was fixed in D147492 <https://reviews.llvm.org/D147492>.

The only FP usage was removed in D147497 <https://reviews.llvm.org/D147497>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147501

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


Index: llvm/lib/IR/Constants.cpp
===================================================================
--- llvm/lib/IR/Constants.cpp
+++ llvm/lib/IR/Constants.cpp
@@ -1009,13 +1009,6 @@
   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) {
Index: llvm/include/llvm/IR/Constants.h
===================================================================
--- llvm/include/llvm/IR/Constants.h
+++ llvm/include/llvm/IR/Constants.h
@@ -269,11 +269,6 @@
 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147501.510689.patch
Type: text/x-patch
Size: 1259 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230404/7857418a/attachment.bin>


More information about the llvm-commits mailing list