Skip to content

Commit 5cebc48

Browse files
[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.
1 parent 739a5a4 commit 5cebc48

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mlir/lib/Dialect/Transform/IR/TransformOps.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,6 +2571,11 @@ void transform::NamedSequenceOp::build(OpBuilder &builder,
25712571
TypeAttr::get(FunctionType::get(builder.getContext(),
25722572
rootType, resultTypes)));
25732573
state.attributes.append(attrs.begin(), attrs.end());
2574+
if (!argAttrs.empty()) {
2575+
SmallVector<Attribute> argAttrsVec(argAttrs.begin(), argAttrs.end());
2576+
state.getOrAddProperties<Properties>().arg_attrs =
2577+
ArrayAttr::get(builder.getContext(), argAttrsVec);
2578+
}
25742579
state.addRegion();
25752580

25762581
buildSequenceBody(builder, state, rootType,

0 commit comments

Comments
 (0)