diff --git a/mlir/lib/Dialect/Transform/IR/TransformOps.cpp b/mlir/lib/Dialect/Transform/IR/TransformOps.cpp --- a/mlir/lib/Dialect/Transform/IR/TransformOps.cpp +++ b/mlir/lib/Dialect/Transform/IR/TransformOps.cpp @@ -2311,10 +2311,8 @@ void transform::PrintOp::build(OpBuilder &builder, OperationState &result, StringRef name) { - if (!name.empty()) { - result.addAttribute(PrintOp::getNameAttrName(result.name), - builder.getStrArrayAttr(name)); - } + if (!name.empty()) + result.getOrAddProperties().name = builder.getStringAttr(name); } void transform::PrintOp::build(OpBuilder &builder, OperationState &result,