[Mlir-commits] [clang] [llvm] [mlir] [LLVM][Constants] Store "splat (float 0.0)" as ConstantFP rather than ConstantAggregateZero. (PR #195284)
Paul Walker
llvmlistbot at llvm.org
Tue May 5 03:09:08 PDT 2026
================
@@ -1672,6 +1672,11 @@ static void writeConstantInternal(raw_ostream &Out, const Constant *CV,
Type *Ty = CFP->getType();
if (Ty->isVectorTy()) {
+ if (CFP->isExactlyValue(+0.0)) {
----------------
paulwalker-arm wrote:
What about adding an implementation of isNullValue() to ConstantFP/ConstantInt? That removes the need to know the exact type (i.e. the benefit of Constant*) and would improve any existing instances.
https://github.com/llvm/llvm-project/pull/195284
More information about the Mlir-commits
mailing list