mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 12:26:52 +08:00
[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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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"},
|
||||
|
||||
Reference in New Issue
Block a user