-
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] Make irpass::replace_all_usages_with bottom-up #1789
Conversation
|
Without
With
|
What about |
Nice catch! With |
Codecov Report
@@ Coverage Diff @@
## master #1789 +/- ##
=======================================
Coverage 43.51% 43.51%
=======================================
Files 44 44
Lines 6023 6023
Branches 1078 1078
=======================================
Hits 2621 2621
Misses 3248 3248
Partials 154 154 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.
Thanks! LGTM.
Related issue = close #1785
Stmt::parent
is sometimes unreliable, especially in theoffload
pass.lower_ast
also causes the IR printer to crash sometimes, which makes it harder to debug...In the async engine, there are some usages of
replace_all_usages_with
which require traversing theroot
instead ofold_stmt->parent
. I setroot
to benullptr
inStmt::replace_with
and makereplace_all_usages_with
bottom-up only whenroot == nullptr
.[Click here for the format server]