NuPlusRegisterInfo.cpp

From NaplesPU Documentation
Revision as of 18:23, 18 June 2018 by Edo (talk | contribs)
Jump to: navigation, search

These files contain the NuPlus implementation of the TargetRegisterInfo class and include the NuPlusGenRegisterInfo.inc file that is generated by TableGen from NuPlusRegisterInfo.td. This file describes the class used to get information about a target machines register file, used for a variety of purposed, especially register allocation.

In particular:

  • The getCalleeSavedRegs returns the nu+ callee-saved registers, i.e. S50, S51, S52, S53, S54, S55, S56, S57, MR_REG, FP_REG, RA_REG, V56, V57, V58, V59, V60, V61, V62 and V63. The NuPlusCSR_SaveList list is defined inside the NuPlusGenRegisterInfo.inc file.
  • The getCallPreservedMask returns a mask of call-preserved registers.
  • The getReservedRegs returns the nu+ special-purpose registers, i.e. TR_REG, MR_REG, FP_REG, RA_REG, SP_REG, RA_REG, PC_REG.
  • The getPointerRegClass returns the register class used to store pointers, i.e. GPR32.
  • The eliminateFrameIndex replaces the Frame Index with a stack/frame pointer.
  • The getFrameRegister returns the frame pointer, if used, otherwise returns the stack pointer.
  • The requiresRegisterScavenging method enables the machine register scavenger which provides a mechanism to make registers available by evicting them to spill stack slots.
  • The trackLivenessAfterRegAlloc method enables tracking liveness after register allocation. This could potentially be used to determine which registers can be live across a call.
  • The requiresFrameIndexScavenging method enables the register scavenger after the PEI (Prolog Epilog Inserter) phase for materializing frame index constants.