[PATCH] D137837: [Support] Move Target/CPU Printing out of CommandLine

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 13:42:21 PST 2022


lenary added a comment.

In D137837#3984848 <https://reviews.llvm.org/D137837#3984848>, @lebedev.ri wrote:

> In D137837#3984832 <https://reviews.llvm.org/D137837#3984832>, @fpetrogalli wrote:
>
>> In D137837#3976344 <https://reviews.llvm.org/D137837#3976344>, @MaskRay wrote:
>>
>>> I think this patch can drop `cl::AddExtraVersionPrinter(sys::printDefaultTargetAndDetectedCPU);` from most tools. Only add them case by case when there is consensus there is a significant value.
>>
>> @MaskRay / @lenary can we consider this clean up operation a separate piece of work and move on with the patch-set submission needed to get D137838 <https://reviews.llvm.org/D137838> in?
>>
>> We all agreed that the work leading at D137838 <https://reviews.llvm.org/D137838> is a better solution than D137516 <https://reviews.llvm.org/D137516> because it is breaking the `tblgen` / `libSupport` dependency for all targets. I am really thankful that @lenary offered their time to work on this. 
>> The fact that we are getting so little attention from other members is maybe is a sign that we can just move on and merge it without waiting for more consensus? If anything turn out to be wrong, we can always fix up/revert?
>>
>> Thank you!
>>
>> Francesco
>
> FWIW, llvm-mca / llvm-exegesis / llc / opt need to continue printing the supported CPU's in `--version`.
> Others not sure, any such cleanup should be on case-by-case basis with separate patches for each.

None of these tools print a list of CPUs in the output of `--version` on main, as far as I can see.

All of them except `opt` print a list of registered targets, and this functionality is done separately, e.g. https://github.com/llvm/llvm-project/blob/ecabba04a35432ad94447d199cf6127d57415456/llvm/tools/llvm-mca/llvm-mca.cpp#L326 which I am not proposing to change in any of the named tools.

To be clear once again, with this change, if a tool does not use `cl::AddExtraVersionPrinter(sys::printDefaultTargetAndDetectedCPU);`, then the only two lines it will not output are the `Default target: <triple>` and `Host CPU: <cpu>` lines from `--version`. All other output is unaffected, including lists of Registered Targets, and the actual LLVM version.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137837/new/

https://reviews.llvm.org/D137837



More information about the llvm-commits mailing list