[mlir][EmitC]Remove the Unused Option in the wrap-emitc-func-in-class Pass (#150577)

This patch removes the option `namedAttribute` which is not used in this
pass.
This commit is contained in:
Jaden Angella
2025-07-25 09:30:55 -07:00
committed by GitHub
parent 81eb63ad7f
commit af1ca08ddb
4 changed files with 7 additions and 17 deletions

View File

@@ -51,11 +51,6 @@ def WrapFuncInClassPass : Pass<"wrap-emitc-func-in-class"> {
```
}];
let dependentDialects = ["emitc::EmitCDialect"];
let options = [Option<
"namedAttribute", "named-attribute", "std::string",
/*default=*/"",
"Attribute key used to extract field names from function argument's "
"dictionary attributes">];
}
#endif // MLIR_DIALECT_EMITC_TRANSFORMS_PASSES

View File

@@ -29,8 +29,7 @@ ExpressionOp createExpression(Operation *op, OpBuilder &builder);
void populateExpressionPatterns(RewritePatternSet &patterns);
/// Populates 'patterns' with func-related patterns.
void populateFuncPatterns(RewritePatternSet &patterns,
StringRef namedAttribute);
void populateFuncPatterns(RewritePatternSet &patterns);
} // namespace emitc
} // namespace mlir

View File

@@ -31,7 +31,7 @@ struct WrapFuncInClassPass
Operation *rootOp = getOperation();
RewritePatternSet patterns(&getContext());
populateFuncPatterns(patterns, namedAttribute);
populateFuncPatterns(patterns);
walkAndApplyPatterns(rootOp, std::move(patterns));
}
@@ -43,8 +43,8 @@ struct WrapFuncInClassPass
class WrapFuncInClass : public OpRewritePattern<emitc::FuncOp> {
public:
WrapFuncInClass(MLIRContext *context, StringRef attrName)
: OpRewritePattern<emitc::FuncOp>(context), attributeName(attrName) {}
WrapFuncInClass(MLIRContext *context)
: OpRewritePattern<emitc::FuncOp>(context) {}
LogicalResult matchAndRewrite(emitc::FuncOp funcOp,
PatternRewriter &rewriter) const override {
@@ -101,12 +101,8 @@ public:
rewriter.replaceOp(funcOp, newClassOp);
return success();
}
private:
StringRef attributeName;
};
void mlir::emitc::populateFuncPatterns(RewritePatternSet &patterns,
StringRef namedAttribute) {
patterns.add<WrapFuncInClass>(patterns.getContext(), namedAttribute);
void mlir::emitc::populateFuncPatterns(RewritePatternSet &patterns) {
patterns.add<WrapFuncInClass>(patterns.getContext());
}

View File

@@ -1,4 +1,4 @@
// RUN: mlir-opt --wrap-emitc-func-in-class='named-attribute=emitc.name_hint' %s | FileCheck %s
// RUN: mlir-opt --wrap-emitc-func-in-class %s | FileCheck %s
module attributes { } {
emitc.func @model(%arg0: !emitc.array<1xf32> {emitc.name_hint = "another_feature"},