Skip to content

[opt-remark] If we have a SIL remark streamer, always emit remarks. #33018

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

gottesmm
Copy link
Contributor

I spoke with Francis and this is the expected behavior.

@gottesmm
Copy link
Contributor Author

(that is, we want to emit everything when we are streaming and let any reader of the data filter as they choose).

@gottesmm
Copy link
Contributor Author

@swift-ci smoke test and merge

@@ -101,8 +101,11 @@ class OptRemarkGenerator : public SILFunctionTransform {
bool isOptRemarksEnabled() {
// TODO: Put this on LangOpts as a helper.
auto &langOpts = getFunction()->getASTContext().LangOpts;

// If we have a remark streamer, emit everything.
return bool(langOpts.OptimizationRemarkMissedPattern) ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@francisvm This whole predicate seems a little odd. Seems like we can clean up a bunch of checks in the emitter itself if it had a direct reference to the module's remark streamer instead of the module itself.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only issue I see is that the remark streamer is only used to serialize remarks, while the emitter is used to emit both diagnostics and serialize remarks.

@swift-ci swift-ci merged commit c120ff8 into swiftlang:master Jul 21, 2020
@gottesmm gottesmm deleted the pr-93832232fe166e23af62cbbf0c4414c6aed910bd branch July 23, 2021 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants