[PATCH] D73339: [RISCV] Compress instructions based on function features

Simon Cook via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 28 02:09:00 PST 2020


simoncook marked 2 inline comments as done.
simoncook added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp:160
 
+void RISCVAsmPrinter::SetupMachineFunction(MachineFunction &MF) {
+  // Set the current MCSubtargetInfo to a copy which has the correct
----------------
lenary wrote:
> Most backends seem to override `AsmPrinter::runOnFunction` entirely (the default implementation calls `SetupMachineFunction`), and avoid overriding `SetupMachineFunction`. Is there a particular reason you've chosen one vs the other? I note things like the ARM backend are pulling a `SubtargetInfo` out of the MachineFunction in their `runOnFunction` implementations, but I realise we end up needing a `MCSubtargetInfo` here - I presume that's the main reason?
No there isn't (or at least I can't remember there being a good reason), but thanks for pointing out this looks odd, going down the route of overriding runOnFunction as other backends do works as well, so I'm updating this to make this change in runOnFunction to match.


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

https://reviews.llvm.org/D73339





More information about the llvm-commits mailing list