[Mlir-commits] [mlir] [mlir][Vector] Teach how to materialize UB constant to Vector (PR #125596)

Jakub Kuderski llvmlistbot at llvm.org
Mon Feb 3 15:56:55 PST 2025


================
@@ -437,6 +437,9 @@ void VectorDialect::initialize() {
 Operation *VectorDialect::materializeConstant(OpBuilder &builder,
                                               Attribute value, Type type,
                                               Location loc) {
+  if (auto poisonAttr = dyn_cast<ub::PoisonAttrInterface>(value))
+    return builder.create<ub::PoisonOp>(loc, type, poisonAttr);
+
   return arith::ConstantOp::materialize(builder, value, type, loc);
----------------
kuhar wrote:

Ah, I misread the code, I thought this delegates to the arith dialect, not an op. Nevermind.

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


More information about the Mlir-commits mailing list