[llvm] [llc] Add -M for InstPrinter options (PR #121078)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 24 21:15:57 PST 2024


MaskRay wrote:

> The way it is currently implemented it only works when invoking llc directly. It would be great if the option could be set by the compiler driver, which passes options in memory. See
> 
> https://github.com/llvm/llvm-project/blob/eb549da9e5c1e626edb14ba9ce43e46ad3d088af/clang/tools/driver/cc1as_main.cpp#L538
> 
> for a few examples.
> Some targets prefer to _not_ print aliases by default; there should be a way of enabling this behavior.

Thanks for the quick response. This patch intends to port `applyTargetSpecificCLOption` to llc to be on par with llvm-mc and llvm-objdump.

You are right that Clang cc1as sets `MCTargetOptions` in a different place. If we want to add a `clang -cc1` and `-cc1as` option, the clang file needs to be modified. That isn't my motivation, though. (Skimming through GCC's manpage I don't find a similar option. If we add an option, we have some freedom on the naming.)

https://github.com/llvm/llvm-project/pull/121078


More information about the llvm-commits mailing list