From 5cebc4877dcb757514e82f85460cc09cd8e6666a Mon Sep 17 00:00:00 2001 From: colawithsauce <51731521+colawithsauce@users.noreply.github.com> Date: Sat, 15 Nov 2025 02:24:22 +0800 Subject: [PATCH] [mlir] NamedSequence builder honor arg_attrs when building Previously the builder did not attach argument attributes when calling NamedSequenceOp::build with `arg_attrs`, which makes we can not create a legal named_sequence operation by this builder. This patch ensures `arg_attrs` are stored in the op state so verification and printing show them. --- mlir/lib/Dialect/Transform/IR/TransformOps.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mlir/lib/Dialect/Transform/IR/TransformOps.cpp b/mlir/lib/Dialect/Transform/IR/TransformOps.cpp index 062606e7e10b6..415e2af491c07 100644 --- a/mlir/lib/Dialect/Transform/IR/TransformOps.cpp +++ b/mlir/lib/Dialect/Transform/IR/TransformOps.cpp @@ -2571,6 +2571,11 @@ void transform::NamedSequenceOp::build(OpBuilder &builder, TypeAttr::get(FunctionType::get(builder.getContext(), rootType, resultTypes))); state.attributes.append(attrs.begin(), attrs.end()); + if (!argAttrs.empty()) { + SmallVector argAttrsVec(argAttrs.begin(), argAttrs.end()); + state.getOrAddProperties().arg_attrs = + ArrayAttr::get(builder.getContext(), argAttrsVec); + } state.addRegion(); buildSequenceBody(builder, state, rootType,