-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C++: Make AST GVN a wrapper for IR-based GVN #2765
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
Conversation
| min(Language::Location l | | ||
| l = getAnInstruction().getLocation() | ||
| | | ||
| l | ||
| order by | ||
| l.getFile().getAbsolutePath(), l.getStartLine(), l.getStartColumn(), l.getEndLine(), | ||
| l.getEndColumn() | ||
| ) |
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.
We should exclude UnknownLocation if there are any expressions with known locations in the same GVN. Otherwise implicit this qualifiers on member accesses will cause the value number for the this pointer to have an UnknownLocation.
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.
Good catch. I've excluded UnknownLocations if there are any non-UnknownLocations now.
| final Location getLocation() { | ||
| result = | ||
| rank[1](Location l | | ||
| min(Location l | |
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 same note applies re: UnknownLocation and implicit this qualifiers.
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.
Fixed.
20a20d2 to
c39ca7c
Compare
…taining expressions from a GVN
…ce representation have a GVN
…ocation that's known
c39ca7c to
2017ca8
Compare
8162e87 to
538c2b2
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
The PR in #2724 became quite messy with commits, so here's a fresh PR that should make it easier to follow the structure!