[llvm] [llvm-exegesis] Begin replacing unsigned with MCRegister. NFC (PR #123109)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 15 13:33:25 PST 2025


================
@@ -46,7 +46,7 @@ struct RegisterAliasingTracker {
 
   // Construct a tracker from an MCPhysReg.
   RegisterAliasingTracker(const MCRegisterInfo &RegInfo,
-                          const MCPhysReg Register);
+                          const MCRegister Register);
----------------
topperc wrote:

MCRegister isn't allowed to hold a virtual register. I want to add an assertion for that, but NVPTX and WebAssembly don't compile to traditional assembly and have their own virtual register space in their final output that is encoded outside of the bounds of what MCRegister::isPhysical allows. In the codegen pipeline, they maintain a separate mapping table from LLVM virtual register to their own register numbering. During MachineInstr->MCInst lowering they commit this encoding into MCRegister.

MCPhysReg is a typedef for uint16_t. I believe MCRegister/Register should be preferred except when the uint16_t size savings is important like in global tables in *RegisterInfo.inc.

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


More information about the llvm-commits mailing list