Skip to content
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 remarks: emit remarks when we fail to serialize a function in CMO. #73657

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

zoecarver
Copy link
Collaborator

No description provided.

@@ -274,6 +274,9 @@ def Raccess_note : Separate<["-"], "Raccess-note">,
def Raccess_note_EQ : Joined<["-"], "Raccess-note=">,
Alias<Raccess_note>;

def Rserialization_failed : Flag<["-"], "serialization-failed">,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Missing an R here, and the name could probably be improved anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe:
cross-module-optimization-serialization-failed
Remark if we failed to serialize a function for the purpose of cross module optimization

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good to me.

@nkcsgexi
Copy link
Member

Nitpick: 2-space indentation.

return;

auto &ctx = i->getModule().getASTContext();
auto joined = remark.str() + other.str();
Copy link
Member

Choose a reason for hiding this comment

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

Could you use llvm::Twine for string concatenation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm going to need to turn it into a string anyway to then turn it into a StringRef

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And then I think we need to globally allocate it in the AST context so that it's not deallocated by the time the diagnostic fires

return false;

auto &ctx = f->getModule().getASTContext();
auto joined = remark.str() + other.str();
Copy link
Member

Choose a reason for hiding this comment

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

Same here: could you use llvm::Twine for string concatenation?

Copy link
Member

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

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

Thank you for adding these! Some minor nitpicks.

@zoecarver
Copy link
Collaborator Author

Thanks for the review comments!

@zoecarver
Copy link
Collaborator Author

@swift-ci please smoke test

@zoecarver
Copy link
Collaborator Author

@swift-ci smoke test

@zoecarver
Copy link
Collaborator Author

@swift-ci smoke test

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.

None yet

3 participants