As part of the work to move some parts of target-specific parsing out of Support, there’s a change I’d like to make people aware of that is related:
⚙ D137837 [Support] Move Target/CPU Printing out of CommandLine is the change in question
Right now, if you have configured cmake with LLVM_VERSION_PRINTER_SHOW_HOST_TARGET_INFO=On
(The default), then most tools will print something like this when you invoke them as <tool> --version
:
LLVM (http://llvm.org/):
LLVM version 16.0.0git
DEBUG build with assertions.
Default target: x86_64-unknown-linux-gnu
Host CPU: skylake-avx512
Often, this does not make sense, as the tools don’t actually do anything with the default target info and the host CPU info. For instance, llvm-dis
/llvm-as
/llvm-tblgen
don’t as far as I can tell.
There are also cases where it is useful, because it gives you more information about e.g. the host a bug has been found on (if the report includes the version output!).
If my change is applied, then only tools which currently depend on llvm/Support/Host.h
will print this information, and for other tools, the lines about Default target and Host CPU will not be printed (the preceding lines will be).
This information is easy to re-add after my patch, using the cl::AddExtraVersionPrinter(sys::printDefaultTargetAndDetectedCPU)
code I’ve added to various utilities in that patch (where they were depending on Support/Host, or where the tests needed it to continue passing). This same mechanism is used to print the list of registered targets in llc
and friends.
I’m keen to understand whether people are in favour of this change, or whether they will find it disruptive. There has been some discussion on the patch, so probably best to continue discussion there and for this thread to serve as a pointer to that discussion.