[Mlir-commits] [mlir] [mlir][vector] Avoid setting padding by default to `0` in `vector.transfer_read` prefer `ub.poison` (PR #146088)
Jakub Kuderski
llvmlistbot at llvm.org
Mon Jun 30 10:56:28 PDT 2025
================
@@ -154,6 +154,9 @@ Value getReductionOp(AtomicRMWKind op, OpBuilder &builder, Location loc,
Value lhs, Value rhs);
arith::CmpIPredicate invertPredicate(arith::CmpIPredicate pred);
+
+/// Creates an `arith.constant` operation with a zero value of type `type`.
+Value getZeroConstant(OpBuilder &builder, Location loc, Type type);
----------------
kuhar wrote:
It should be the job `getZeroConstant` or `getZeroAttr` to assert that a zero value can be created IMO. I agree that we shouldn't try to fix the world, but I think that an assert won't hurt here if we can avoid surprising bugs in the future. If you don't think this is the best place for an assertion, we should at least document the failure in the header.
https://github.com/llvm/llvm-project/pull/146088
More information about the Mlir-commits
mailing list