-
Notifications
You must be signed in to change notification settings - Fork 735
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
[NFC] Add isSSA to LazyLocalGraph, and use it in OptimizeAddedConstants #6952
Conversation
src/ir/local-graph.h
Outdated
bool isSSA(Index index) const { | ||
auto iter = SSAIndexes.find(index); | ||
if (iter == SSAIndexes.end()) { | ||
computeSSA(index); |
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.
Might as well have computeSSA
return the result so we don't need to do another lookup afterward.
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.
Makes sense, done. It does make it stand out from the others, but in this case the code is simpler and more efficient.
} | ||
} | ||
for (auto* get : flower->getsByIndex[index]) { | ||
for (auto* set : getSets(get)) { |
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.
How can looking at the sets for a get find sets that weren't already found by looking directly at the sets above?
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.
The gets may also be reading from nullptr
(the value at the function entry, for which there is no LocalSet).
This makes the pass 15% faster.