-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 1: add pass base, pass manager, adaptor pass, ut #54023
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
❌ The PR is not created using PR's template. You can refer to this Demo. |
39e93a3
to
ff6b3b6
Compare
75c363c
to
c50db71
Compare
|
||
ir::IrContext *GetContext() const { return context_; } | ||
|
||
bool Run(ir::Operation *op); |
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.
这里要讨论下是不是要加个Program的重载
adaptor_pass_ = std::make_unique<detail::AdaptorPass>(this); | ||
} | ||
|
||
bool PassManager::Run(ir::Operation* op) { |
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.
这里加一个Pass依赖检查吧,之前忘加了
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.
后面PR加
// (4) Test pass manager for op. | ||
ir::pass::PassManager pm(ctx); | ||
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.
PassManager应该run在顶层Program上(或者有block的op上),可以看下有没有Program的单测可以参考
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.
后面PR做修改
b067197
to
ae8cd4b
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
PR types
Others
PR changes
Others
Description
新IR下的新PASS体系,新PASS体系适配新IR。该系列PR主要包括如下几个部分:
主要包括四个部分:(1) Pass base & PassManager & PassAdaptor; #54023 (2) AnalysisManager & Pass Instrumentation (PassTiming, IRPrinting..); (3) Pattern Rewrite ... (4) 其他。
本PR完成第一部分,新增Pass基类,PassManager类以及PassAdaptor类。