-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[Opt] [refactor] Move unreachable code elimination to a separate pass #1315
Conversation
BTW Shall we add optimizations for |
Codecov Report
@@ Coverage Diff @@
## master #1315 +/- ##
=======================================
Coverage 86.14% 86.14%
=======================================
Files 18 18
Lines 3313 3313
Branches 622 622
=======================================
Hits 2854 2854
Misses 333 333
Partials 126 126 Continue to review full report at Codecov.
|
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. Thanks!
BTW Shall we add optimizations for if (0) and if (1)?
Sounds good!
Co-authored-by: Yuanming Hu <yuanming-hu@users.noreply.github.com>
So I think I should add the optimization into this pass, and rename the 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.
LGTM. Thanks!
…taichi-dev#1315) * [Opt] [refactor] Move unreachable code elimination to a separate pass * improve * minor * [skip ci] minor * Update taichi/transforms/continue_stmt_optimization.cpp Co-authored-by: Yuanming Hu <yuanming-hu@users.noreply.github.com> * add optimizations for if (0) and if (1) Co-authored-by: Yuanming Hu <yuanming-hu@users.noreply.github.com>
Related issue = #656
Related PR = #1299
I did this refactoring because the optimization about
ContinueStmt
insimplify
I added in #1299 probably made removing the exceptions (#1059) in that pass more difficult.Although the function of this pass is similar to the
DIE
pass, the logic is completely different. So I put it in a separate pass. We can eliminateContinueStmt
s like the following in this PR:I'm not sure about how this pass should be named, so feel free to propose better names.
[Click here for the format server]