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

Sam Elliott via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 11 11:50:59 PST 2022


lenary added a comment.

In D137837#3922026 <https://reviews.llvm.org/D137837#3922026>, @MaskRay wrote:

> I am in favor of the spirit of the change and the direction moving target-specific stuff outside LLVMSupport.
>
> There are tools which have default target specific behavior (llc, llvm-ar, etc) and more which don't.
>
> At least for those which don't have default target specific behavior, the default target and host cpu information from many tools' `--version` is not really useful.
>
> Tools which don't have `#include "llvm/Support/Host.h"` should not have the new dependency.
>
>   % llvm-dwarfdump --version
>   LLVM (http://llvm.org/):
>     LLVM version 16.0.0git
>     Optimized build with assertions.
>     Default target: x86_64-unknown-linux-gnu
>     Host CPU: skylake-avx512

Broadly, the way I went about choosing whether we should do this was based on two things:

- If the utility initialized all configured targets, or
- If the utility had a `-march`/`-mcpu` command-line flag.

I realise this ends up as an approximation, but I think this broadly follows what you're saying.

e.g., I haven't added this to `llvm-as` and `llvm-dis`, because they didn't, and the same applies to tablegen.


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