[Mlir-commits] [mlir] [mlir][Vector] Teach how to materialize UB constant to Vector (PR #125596)
Diego Caballero
llvmlistbot at llvm.org
Mon Feb 3 15:59:39 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);
----------------
dcaballe wrote:
yes, it happened to me as well. Actually, my first implementation was something like `getContext()->getDialect<ub::UBDialect>()->materializeConstant(...)`. Honestly, it's not clear to me how these dialect/op materialize methods should be used...
https://github.com/llvm/llvm-project/pull/125596
More information about the Mlir-commits
mailing list