[PATCH] D54433: [PowerPC][NFC] Macro for register set defs for the Asm Parser

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 14 12:35:41 PST 2018


nemanjai added inline comments.


================
Comment at: lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h:136
+
+static const MCPhysReg RRegs[32] = PPC_REGS0_31(llvm::PPC::R);
+static const MCPhysReg XRegs[32] = PPC_REGS0_31(llvm::PPC::X);
----------------
jsji wrote:
> PPCMCTargetDesc.h is included in several files, eg: `llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp`, `llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp`, `llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp`.. 
> 
> Declaring static in this header will introduce unnecessary and useless copies o those modules. Maybe we should put these in a new file that included only in necessary modules?
We can certainly do that. However, these are `static` so they will be optimized out of any CU's that don't have any uses of them. So I'm not sure what you mean by copies. Are you concerned about increasing compile time when compiling those CU's (in order to determine these arrays aren't needed)?


Repository:
  rL LLVM

https://reviews.llvm.org/D54433





More information about the llvm-commits mailing list