-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IR&PASS] part 2-1: add analysis_manager, pass_instrumentation #54170
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
dab2139
to
6c55763
Compare
3a794d0
to
83ced29
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
单测重命名
…h pass/utils.h and adjust pass dir
3869883
to
21b7883
Compare
|
||
/// Invalidate any cached analyses based upon the given set of preserved | ||
void Invalidate(const PreservedAnalyses& pa) { | ||
PreservedAnalyses pa_copy(pa); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO:@jiweibo.
这里的pa_copy我忘了为啥这样了,先合入,后续在修改这里吧。
|
||
bool Run(ir::Operation *op); | ||
// bool Run(ir::Program *program) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: 等Program支持ModuleOp后 uncomment.
pm.AddPass(std::make_unique<TestPass>()); | ||
|
||
CHECK_EQ(pm.Run(op), true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ModuleOp合入后,这里改为Run(Program)的单测+Run(Operation with block)的单测
|
||
bool Initialize(ir::IrContext *context); | ||
private: | ||
bool Initialize(ir::IrContext *context) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialize是为了调用Pass的Initialize,大概率会修改成员变量,const感觉应该去掉。
后面记得修改。@jiweibo @yuanlehome
} | ||
|
||
bool CanScheduleOn(ir::Operation *op) const override { | ||
return std::strcmp(op->op_info().name(), "TestDialect.TestOp") == 0; | ||
} | ||
}; | ||
|
||
TEST(pass_manager_test, pass_manager_test) { | ||
TEST(pass_manager_test, pass_manager) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: @jiweibo @yuanlehome IR合入Region, Block后,补充多Block单测,通过Coverage覆盖率。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Others
PR changes
Others
Description
新IR下的新PASS体系,新PASS体系适配新IR。该系列PR主要包括如下几个部分:
主要包括四个部分:(1) Pass base & PassManager & PassAdaptor; #54023 (2) AnalysisManager & Pass Instrumentation (PassTiming, IRPrinting..); #54170 (3) Pattern Rewrite ... (4) 其他。
本PR工作:
TODO: add ut.