@@ -81,7 +81,7 @@ class TargetRegisterClass {
81
81
}
82
82
83
83
// / Return the specified register in the class.
84
- unsigned getRegister (unsigned i) const {
84
+ MCRegister getRegister (unsigned i) const {
85
85
return MC->getRegister (i);
86
86
}
87
87
@@ -315,8 +315,8 @@ class TargetRegisterInfo : public MCRegisterInfo {
315
315
// / Returns the Register Class of a physical register of the given type,
316
316
// / picking the most sub register class of the right type that contains this
317
317
// / physreg.
318
- const TargetRegisterClass *
319
- getMinimalPhysRegClass ( unsigned Reg, MVT VT = MVT::Other) const ;
318
+ const TargetRegisterClass *getMinimalPhysRegClass (MCRegister Reg,
319
+ MVT VT = MVT::Other) const ;
320
320
321
321
// / Return the maximal subclass of the given register class that is
322
322
// / allocatable or NULL.
@@ -331,12 +331,12 @@ class TargetRegisterInfo : public MCRegisterInfo {
331
331
332
332
// / Return the additional cost of using this register instead
333
333
// / of other registers in its class.
334
- unsigned getCostPerUse (unsigned RegNo) const {
334
+ unsigned getCostPerUse (MCRegister RegNo) const {
335
335
return InfoDesc[RegNo].CostPerUse ;
336
336
}
337
337
338
338
// / Return true if the register is in the allocation of any register class.
339
- bool isInAllocatableClass (unsigned RegNo) const {
339
+ bool isInAllocatableClass (MCRegister RegNo) const {
340
340
return InfoDesc[RegNo].inAllocatableClass ;
341
341
}
342
342
@@ -520,8 +520,8 @@ class TargetRegisterInfo : public MCRegisterInfo {
520
520
521
521
// / Return a super-register of the specified register
522
522
// / Reg so its sub-register of index SubIdx is Reg.
523
- unsigned getMatchingSuperReg (MCRegister Reg, unsigned SubIdx,
524
- const TargetRegisterClass *RC) const {
523
+ MCRegister getMatchingSuperReg (MCRegister Reg, unsigned SubIdx,
524
+ const TargetRegisterClass *RC) const {
525
525
return MCRegisterInfo::getMatchingSuperReg (Reg, SubIdx, RC->MC );
526
526
}
527
527
@@ -605,8 +605,8 @@ class TargetRegisterInfo : public MCRegisterInfo {
605
605
}
606
606
607
607
// / Debugging helper: dump register in human readable form to dbgs() stream.
608
- static void dumpReg (unsigned Reg, unsigned SubRegIndex = 0 ,
609
- const TargetRegisterInfo* TRI = nullptr );
608
+ static void dumpReg (Register Reg, unsigned SubRegIndex = 0 ,
609
+ const TargetRegisterInfo * TRI = nullptr );
610
610
611
611
protected:
612
612
// / Overridden by TableGen in targets that have sub-registers.
@@ -745,7 +745,7 @@ class TargetRegisterInfo : public MCRegisterInfo {
745
745
const TargetRegisterClass *RC) const = 0;
746
746
747
747
// / Returns size in bits of a phys/virtual/generic register.
748
- unsigned getRegSizeInBits (unsigned Reg, const MachineRegisterInfo &MRI) const ;
748
+ unsigned getRegSizeInBits (Register Reg, const MachineRegisterInfo &MRI) const ;
749
749
750
750
// / Get the weight in units of pressure for this register unit.
751
751
virtual unsigned getRegUnitWeight (unsigned RegUnit) const = 0;
@@ -784,20 +784,19 @@ class TargetRegisterInfo : public MCRegisterInfo {
784
784
// / independent register allocation hints. Targets that override this
785
785
// / function should typically call this default implementation as well and
786
786
// / expect to see generic copy hints added.
787
- virtual bool getRegAllocationHints (unsigned VirtReg,
788
- ArrayRef<MCPhysReg> Order,
789
- SmallVectorImpl<MCPhysReg> &Hints,
790
- const MachineFunction &MF,
791
- const VirtRegMap *VRM = nullptr ,
792
- const LiveRegMatrix *Matrix = nullptr )
793
- const ;
787
+ virtual bool
788
+ getRegAllocationHints (Register VirtReg, ArrayRef<MCPhysReg> Order,
789
+ SmallVectorImpl<MCPhysReg> &Hints,
790
+ const MachineFunction &MF,
791
+ const VirtRegMap *VRM = nullptr ,
792
+ const LiveRegMatrix *Matrix = nullptr ) const ;
794
793
795
794
// / A callback to allow target a chance to update register allocation hints
796
795
// / when a register is "changed" (e.g. coalesced) to another register.
797
796
// / e.g. On ARM, some virtual registers should target register pairs,
798
797
// / if one of pair is coalesced to another register, the allocation hint of
799
798
// / the other half of the pair should be changed to point to the new register.
800
- virtual void updateRegAllocHint (unsigned Reg, unsigned NewReg,
799
+ virtual void updateRegAllocHint (Register Reg, Register NewReg,
801
800
MachineFunction &MF) const {
802
801
// Do nothing.
803
802
}
@@ -855,7 +854,7 @@ class TargetRegisterInfo : public MCRegisterInfo {
855
854
// / spill slot. This tells PEI not to create a new stack frame
856
855
// / object for the given register. It should be called only after
857
856
// / determineCalleeSaves().
858
- virtual bool hasReservedSpillSlot (const MachineFunction &MF, unsigned Reg,
857
+ virtual bool hasReservedSpillSlot (const MachineFunction &MF, Register Reg,
859
858
int &FrameIdx) const {
860
859
return false ;
861
860
}
@@ -892,22 +891,22 @@ class TargetRegisterInfo : public MCRegisterInfo {
892
891
// / Insert defining instruction(s) for BaseReg to be a pointer to FrameIdx
893
892
// / before insertion point I.
894
893
virtual void materializeFrameBaseRegister (MachineBasicBlock *MBB,
895
- unsigned BaseReg, int FrameIdx,
894
+ Register BaseReg, int FrameIdx,
896
895
int64_t Offset) const {
897
896
llvm_unreachable (" materializeFrameBaseRegister does not exist on this "
898
897
" target" );
899
898
}
900
899
901
900
// / Resolve a frame index operand of an instruction
902
901
// / to reference the indicated base register plus offset instead.
903
- virtual void resolveFrameIndex (MachineInstr &MI, unsigned BaseReg,
902
+ virtual void resolveFrameIndex (MachineInstr &MI, Register BaseReg,
904
903
int64_t Offset) const {
905
904
llvm_unreachable (" resolveFrameIndex does not exist on this target" );
906
905
}
907
906
908
907
// / Determine whether a given base register plus offset immediate is
909
908
// / encodable to resolve a frame index.
910
- virtual bool isFrameOffsetLegal (const MachineInstr *MI, unsigned BaseReg,
909
+ virtual bool isFrameOffsetLegal (const MachineInstr *MI, Register BaseReg,
911
910
int64_t Offset) const {
912
911
llvm_unreachable (" isFrameOffsetLegal does not exist on this target" );
913
912
}
@@ -920,7 +919,7 @@ class TargetRegisterInfo : public MCRegisterInfo {
920
919
MachineBasicBlock::iterator I,
921
920
MachineBasicBlock::iterator &UseMI,
922
921
const TargetRegisterClass *RC,
923
- unsigned Reg) const {
922
+ Register Reg) const {
924
923
return false ;
925
924
}
926
925
@@ -936,7 +935,7 @@ class TargetRegisterInfo : public MCRegisterInfo {
936
935
RegScavenger *RS = nullptr ) const = 0;
937
936
938
937
// / Return the assembly name for \p Reg.
939
- virtual StringRef getRegAsmName (unsigned Reg) const {
938
+ virtual StringRef getRegAsmName (MCRegister Reg) const {
940
939
// FIXME: We are assuming that the assembly name is equal to the TableGen
941
940
// name converted to lower case
942
941
//
@@ -973,7 +972,7 @@ class TargetRegisterInfo : public MCRegisterInfo {
973
972
virtual Register getFrameRegister (const MachineFunction &MF) const = 0;
974
973
975
974
// / Mark a register and all its aliases as reserved in the given set.
976
- void markSuperRegs (BitVector &RegisterSet, unsigned Reg) const ;
975
+ void markSuperRegs (BitVector &RegisterSet, MCRegister Reg) const ;
977
976
978
977
// / Returns true if for every register in the set all super registers are part
979
978
// / of the set as well.
@@ -1177,7 +1176,7 @@ Printable printVRegOrUnit(unsigned VRegOrUnit, const TargetRegisterInfo *TRI);
1177
1176
1178
1177
// / Create Printable object to print register classes or register banks
1179
1178
// / on a \ref raw_ostream.
1180
- Printable printRegClassOrBank (unsigned Reg, const MachineRegisterInfo &RegInfo,
1179
+ Printable printRegClassOrBank (Register Reg, const MachineRegisterInfo &RegInfo,
1181
1180
const TargetRegisterInfo *TRI);
1182
1181
1183
1182
} // end namespace llvm
0 commit comments