-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[llc] Add -M for InstPrinter options #121078
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
[llc] Add -M for InstPrinter options #121078
Conversation
Created using spr 1.3.5-bogner
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.
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
MCOptions.AsmVerbose = true; |
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 You are right that Clang cc1as sets |
I'm not against the current approach, it is just I'm not sure that this option would be as useful for |
For some reasons some RISC-V tests use a cl::opt option |
Just realized that I haven't made the simplifications you requested :) Done. I think this is still useful, even just to remove |
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.
LGTM
For many targets, llvm-objdump and llvm-mc (https://reviews.llvm.org/D103004) support -M no-aliases (e.g. `RISCVInstPrinter::applyTargetSpecificCLOption`). This patch implements -M for llc. While here, rename "DisassemblerOptions" in llvm-mc to the more appropriate "InstPrinterOptions". For llvm-mc --assemble, there is no disassembler involved. Pull Request: llvm/llvm-project#121078
Greetings from the borg! The HWASan buildbot is failing on the newly added llvm/test/tools/llc/instprinter-options.ll: https://lab.llvm.org/buildbot/#/builders/55/builds/9607
|
... to clarify ownership, aligning with other parameters. Using `std::unique_ptr` encourages users to manage `createMCInstPrinter` with a unique_ptr instead of a raw pointer, reducing the risk of memory leaks. * llvm-mc: fix a leak and update llvm/test/tools/llvm-mc/disassembler-options.test * #121078 copied the llvm-mc code to CodeGenTargetMachineImpl and made the same mistake. Fixed by 2b8cc65 Using unique_ptr requires #include MCInstPrinter.h in a few translation units. * Delete a createAsmStreamer overload I deprecated in 2024 * SystemZMCTargetDesc.cpp: rename to `createSystemZAsmStreamer` to fix an overload conflict. Pull Request: #135128
For many targets, llvm-objdump and llvm-mc (https://reviews.llvm.org/D103004) support -M no-aliases (e.g. `RISCVInstPrinter::applyTargetSpecificCLOption`). This patch implements -M for llc. While here, rename "DisassemblerOptions" in llvm-mc to the more appropriate "InstPrinterOptions". For llvm-mc --assemble, there is no disassembler involved. Pull Request: llvm#121078
now that llc supports `-M no-aliases` (along with llvm-mc and llvm-objdump) (llvm#121078). Pull Request: llvm#134879
... to clarify ownership, aligning with other parameters. Using `std::unique_ptr` encourages users to manage `createMCInstPrinter` with a unique_ptr instead of a raw pointer, reducing the risk of memory leaks. * llvm-mc: fix a leak and update llvm/test/tools/llvm-mc/disassembler-options.test * llvm#121078 copied the llvm-mc code to CodeGenTargetMachineImpl and made the same mistake. Fixed by 2b8cc65 Using unique_ptr requires #include MCInstPrinter.h in a few translation units. * Delete a createAsmStreamer overload I deprecated in 2024 * SystemZMCTargetDesc.cpp: rename to `createSystemZAsmStreamer` to fix an overload conflict. Pull Request: llvm#135128
For many targets, llvm-objdump and llvm-mc
(https://reviews.llvm.org/D103004) support -M no-aliases (e.g.
RISCVInstPrinter::applyTargetSpecificCLOption
).This patch implements -M for llc.
While here, rename "DisassemblerOptions" in llvm-mc to the more
appropriate "InstPrinterOptions". For llvm-mc --assemble, there is no
disassembler involved.