@@ -110,17 +110,17 @@ class SIRegisterClass <string n, list<ValueType> rTypes, int Align, dag rList>
110110 let TSFlags{3} = HasAGPR;
111111 let TSFlags{4} = HasSGPR;
112112
113- // RA will use RegisterClass AllocationPriority amongst other info (e.g. ordering in the basic block)
113+ // RA will use RegisterClass AllocationPriority amongst other info (e.g. ordering in the basic block)
114114 // to decide which registers to try to assign first. Usually, this RegisterClass priority is given
115115 // very high priority, if not the highest priority, when considering which VirtReg to allocate next.
116116 //
117- // We have 5 bits to assign AllocationPriorities to RegisterClasses. Generally, it is beneficial to
118- // assign more constrained RegisterClasses first. As a result, we prioritize register classes with
119- // more 32 bit tuples (e.g. VReg_512) over registers with fewer tuples (e.g. VGPR_32).
120- //
117+ // We have 5 bits to assign AllocationPriorities to RegisterClasses. Generally, it is beneficial to
118+ // assign more constrained RegisterClasses first. As a result, we prioritize register classes with
119+ // more 32 bit tuples (e.g. VReg_512) over registers with fewer tuples (e.g. VGPR_32).
120+ //
121121 // The interesting case is the vector register case on architectures which have ARegs, VRegs, AVRegs.
122122 // In this case, we would like to assign ARegs and VRegs before AVRegs, as AVRegs are less constrained
123- // and can be assigned to both AGPRs and VGPRs. We use the 5th bit to encode this into the
123+ // and can be assigned to both AGPRs and VGPRs. We use the 5th bit to encode this into the
124124 // RegisterClass AllocationPriority. BaseClassPriority is used to turn the bit on, and BaseClassScaleFactor
125125 // is used for scaling of the bit (i.e. 1 << 4).
126126 field int BaseClassPriority = 1;
@@ -976,14 +976,14 @@ class VRegClassBase<int numRegs, list<ValueType> regTypes, dag regList> :
976976 // Requires n v_mov_b32 to copy
977977 let CopyCost = numRegs;
978978
979- // Since we only have 5 bits for the RegisterClass Allocation Priorty, and since we use the
980- // 5th bit for BaseClassPriority, we need to encode the SizePriority into 4 bits. As a result
981- // of this encoding, for registers with numRegs 15 or 16, we give SizePriority of 14, and for
982- // regsters with numRegs 17+ we give SizePriority of 15. In practice, there is only one
983- // RegClass per Vector Register type in each of these groups (i.e. numRegs = 15,16 : {VReg_512},
984- // and numRegs = 17+ : {VReg_1024}). Therefore, we have not lost any info by compressing.
979+ // Since we only have 5 bits for the RegisterClass Allocation Priorty, and since we use the
980+ // 5th bit for BaseClassPriority, we need to encode the SizePriority into 4 bits. As a result
981+ // of this encoding, for registers with numRegs 15 or 16, we give SizePriority of 14, and for
982+ // regsters with numRegs 17+ we give SizePriority of 15. In practice, there is only one
983+ // RegClass per Vector Register type in each of these groups (i.e. numRegs = 15,16 : {VReg_512},
984+ // and numRegs = 17+ : {VReg_1024}). Therefore, we have not lost any info by compressing.
985985 defvar SizePrioriity = !if(!le(numRegs, 14), !sub(numRegs, 1), !if(!le(numRegs, 16), 14, 15));
986-
986+
987987 let AllocationPriority = !add(SizePrioriity, !mul(BaseClassPriority, BaseClassScaleFactor));
988988 let Weight = numRegs;
989989}
0 commit comments