-
Notifications
You must be signed in to change notification settings - Fork 444
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
Remove reference map from another set of midend passes #4939
Conversation
Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
…ce map Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
…uses relies on fresh refmap Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
Two issues were uncovered so far:
Overall I think eventually we'd need passes to maintain their own copy of reference map if they really need it; we should not have global refmap object passed everywhere as maintaining its freshness is non-trivial and error-prone. |
explicit DoConstantFolding(const TypeMap *typeMap, bool warnings = true, | ||
ConstantFoldingPolicy *policy = nullptr) | ||
: DoConstantFolding(this, typeMap, warnings, policy) {} | ||
|
||
DoConstantFolding() : DoConstantFolding(nullptr, nullptr) {} |
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.
Shouldn't this be DoConstantFolding() : DoConstantFolding(this, nullptr) {}
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.
There is one very subtle but important difference. We do use refmap in absence of typemap during constfolding of path expressions. However, this requires more or less complete IR. This is not the case for P14-to-16 conversion, where constfolding is done in the middle of conversion and therefore we just crash not being able to resolve anything.
On the other hand, it seems we're missing some constfolding opportunities if we'd require known types along with resolution contex.
Things are a bit messy, yes, I am planning to untangle this eventually.
This includes less obvious cases. Plus some additional cleanup.