-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Deprecate order file instrumentation #121514
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This seems unfortunate that the replacement for a clang
-f
option is a-mllvm
flag. The-mllvm
flags don't get documented in the help or manpage.Should this instead be surfaced as a new flag?
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.
These flags are extensively documented in this RFC and this EuroLLVM talk. And LLVM options do have descriptions like clang frontend flags. I think it might be overkill to turn this into a frontend flag.
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.
RFCs and developer meeting talks are not user documentation. The
-mllvm
flags are not documented in Clang’s-help
, or manual (https://clang.llvm.org/docs/UsersManual.html).As someone who was looking for this flag last week, I don’t believe we should be deprecating a documented publicly facing option with the replacement being undocumented.
cc: @AaronBallman & @MaskRay
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.
I believe this shows the importance of deprecating this flag as using IRPGO has better support and will give better performance gains. I wasn't sure how many people are using this flag, so I'm glad you reached out.
I can add a section to describe how to use this flag in the user manual (https://clang.llvm.org/docs/UsersManual.html#profiling-with-instrumentation). Would that be sufficient?
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.
I think this needs to be a
-f
flag so that it gets documented in-help
, the manpage and the UsersManual web page.Uh oh!
There was an error while loading. Please reload this page.
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.
While it looks kinda unusual, I think it's fine in this case.
I believe
-forder-file-instrumentation
, proposed by Meta (Facebook), was only used by Meta. Now there is a replacement and -forder-file-instrumentation is no longer needed. This deprecation message is more for courtesy, but I dough anyone will notice it. Temporal profiler authors probably don't want to expose-mllvm xxx
as a driver option yet.I think that a lot of instrumentation options where the authors don't want to promise too much stability for certain niche optional features. For this option Ellis has done more than absolutely required.
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.
-forder-file-instrumentation
was not only used by Meta. At a minimum I’ve been using it, and my former team at Apple was too. The instrumentation-based approaches to order file generation are significantly more robust than the dtrace-based solution (https://github.com/llvm/llvm-project/blob/main/clang/utils/perf-training/perf-helper.py#L128), that I upstreamed from Apple’s internal tooling in 2016 (d8b5bde).I don’t know if Apple ever updated their Clang builds to use the instrumentation-based approach, but it is vastly superior. Notably dtrace is not deterministic, so using it to drive part of a build process is not ideal.
I worry about having a deprecation policy allowing deprecating a publicly documented option for a non-public option. If the new feature isn’t stable, and the old feature still works, why are we deprecating it?
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.
A new clang option with good documentation can be useful. How about something like -ffunction-timing-profile?
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.
-pgo-temporal-instrumentation
is stable and a significant improvement over-forder-file-instrumentation
. I'm happy to help answer any questions about migrating to IRPGO, and I don't mind delaying the removal if necessary.I suppose I could add a frontend flag similar to how #109837 added
-fprofile-generate-cold-function-coverage
. I'll think about the naming.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.
Added the flag in #122385