-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[BOLT] Fix unrecognized option values for print-sorted-by-order #155613
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
@llvm/pr-subscribers-bolt Author: Haibo Jiang (Jianghibo) ChangesFull diff: https://github.com/llvm/llvm-project/pull/155613.diff 1 Files Affected:
diff --git a/bolt/lib/Passes/BinaryPasses.cpp b/bolt/lib/Passes/BinaryPasses.cpp
index d7f02b9470030..176d23d275b26 100644
--- a/bolt/lib/Passes/BinaryPasses.cpp
+++ b/bolt/lib/Passes/BinaryPasses.cpp
@@ -60,7 +60,10 @@ static cl::opt<DynoStatsSortOrder> DynoStatsSortOrderOpt(
"print-sorted-by-order",
cl::desc("use ascending or descending order when printing functions "
"ordered by dyno stats"),
- cl::init(DynoStatsSortOrder::Descending), cl::cat(BoltOptCategory));
+ cl::init(DynoStatsSortOrder::Descending),
+ cl::values(clEnumValN(DynoStatsSortOrder::Ascending, "ascending", "Ascending order"),
+ clEnumValN(DynoStatsSortOrder::Descending, "descending", "Descending order")),
+ cl::cat(BoltOptCategory));
cl::list<std::string>
HotTextMoveSections("hot-text-move-sections",
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
76fff98
to
1f22678
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.
Indeed it appears that descending was default with no way to set it?
llvm-bolt --dyno-stats --print-sorted-by-order=ascending ..
llvm-bolt: for the --print-sorted-by-order option: Cannot find option named 'ascending'!
llvm-bolt --dyno-stats --print-sorted-by-order=descending ..
llvm-bolt: for the --print-sorted-by-order option: Cannot find option named 'descending'!
Not sure if it's easy to add a small lit test or some text example on the PR.
1f22678
to
3da659b
Compare
Thanks for your review, added the test case. |
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.
Great, thanks for adding a test!
Could you replace the print-sorted-by-order.fdata
file with a link_fdata
RUN line along with an FDATA
directive? There are some examples in tests.
3da659b
to
1a3fac6
Compare
1a3fac6
to
c6ca7ea
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.
Hey Haibo,
Thanks for improving BOLT. The latest patch looks good (c6ca7ea)!
Please allow a day before merging in case there are any further reviews.
Hi, I do not have permission to merge PR. Can you help me merge this PR? Thanks |
Currently llvm-bolt does not recognize the input value for ’-print-sorted-by-order‘.