[clang] [llvm] [mlir] [polly] [RFC][IR] Remove `Constant::isZeroValue` (PR #181521)

Shilei Tian via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 15 07:12:13 PST 2026


================
@@ -71,22 +71,6 @@ bool Constant::isNegativeZeroValue() const {
   return isNullValue();
 }
 
-// Return true iff this constant is positive zero (floating point), negative
-// zero (floating point), or a null value.
-bool Constant::isZeroValue() const {
-  // Floating point values have an explicit -0.0 value.
-  if (const ConstantFP *CFP = dyn_cast<ConstantFP>(this))
-    return CFP->isZero();
-
-  // Check for constant splat vectors of 1 values.
-  if (getType()->isVectorTy())
----------------
shiltian wrote:

IMHO, it's also not functionally consistent because it only checks splat vectors for FP values. What about arrays or non-splat vectors?

https://github.com/llvm/llvm-project/pull/181521


More information about the cfe-commits mailing list