@@ -151,14 +151,14 @@ enum RegisterMapping {
151
151
SQ_MAX_PGM_VGPRS = 1024 , // Maximum programmable VGPRs across all targets.
152
152
AGPR_OFFSET = 512 , // Maximum programmable ArchVGPRs across all targets.
153
153
SQ_MAX_PGM_SGPRS = 128 , // Maximum programmable SGPRs across all targets.
154
- NUM_EXTRA_VGPRS = 9 , // Reserved slots for DS.
155
154
// Artificial register slots to track LDS writes into specific LDS locations
156
155
// if a location is known. When slots are exhausted or location is
157
156
// unknown use the first slot. The first slot is also always updated in
158
157
// addition to known location's slot to properly generate waits if dependent
159
158
// instruction's location is unknown.
160
- EXTRA_VGPR_LDS = 0 ,
161
- NUM_ALL_VGPRS = SQ_MAX_PGM_VGPRS + NUM_EXTRA_VGPRS, // Where SGPR starts.
159
+ FIRST_LDS_VGPR = SQ_MAX_PGM_VGPRS, // Extra slots for LDS stores.
160
+ NUM_LDS_VGPRS = 9 , // One more than the stores we track.
161
+ NUM_ALL_VGPRS = SQ_MAX_PGM_VGPRS + NUM_LDS_VGPRS, // Where SGPRs start.
162
162
};
163
163
164
164
// Enumerate different types of result-returning VMEM operations. Although
@@ -488,7 +488,7 @@ class WaitcntBrackets {
488
488
unsigned char VgprVmemTypes[NUM_ALL_VGPRS] = {0 };
489
489
// Store representative LDS DMA operations. The only useful info here is
490
490
// alias info. One store is kept per unique AAInfo.
491
- SmallVector<const MachineInstr *, NUM_EXTRA_VGPRS - 1 > LDSDMAStores;
491
+ SmallVector<const MachineInstr *, NUM_LDS_VGPRS - 1 > LDSDMAStores;
492
492
};
493
493
494
494
// This abstracts the logic for generating and updating S_WAIT* instructions
@@ -1062,15 +1062,15 @@ void WaitcntBrackets::updateByEvent(const SIInstrInfo *TII,
1062
1062
}
1063
1063
}
1064
1064
}
1065
- if (Slot || LDSDMAStores.size () == NUM_EXTRA_VGPRS - 1 )
1065
+ if (Slot || LDSDMAStores.size () == NUM_LDS_VGPRS - 1 )
1066
1066
break ;
1067
1067
LDSDMAStores.push_back (&Inst);
1068
1068
Slot = LDSDMAStores.size ();
1069
1069
break ;
1070
1070
}
1071
- setRegScore (SQ_MAX_PGM_VGPRS + EXTRA_VGPR_LDS + Slot, T, CurrScore);
1071
+ setRegScore (FIRST_LDS_VGPR + Slot, T, CurrScore);
1072
1072
if (Slot)
1073
- setRegScore (SQ_MAX_PGM_VGPRS + EXTRA_VGPR_LDS , T, CurrScore);
1073
+ setRegScore (FIRST_LDS_VGPR , T, CurrScore);
1074
1074
}
1075
1075
}
1076
1076
}
@@ -1122,7 +1122,7 @@ void WaitcntBrackets::print(raw_ostream &OS) const {
1122
1122
if (RegScore <= LB)
1123
1123
continue ;
1124
1124
unsigned RelScore = RegScore - LB - 1 ;
1125
- if (J < SQ_MAX_PGM_VGPRS + EXTRA_VGPR_LDS ) {
1125
+ if (J < FIRST_LDS_VGPR ) {
1126
1126
OS << RelScore << " :v" << J << " " ;
1127
1127
} else {
1128
1128
OS << RelScore << " :ds " ;
@@ -1914,7 +1914,7 @@ bool SIInsertWaitcnts::generateWaitcntInstBefore(MachineInstr &MI,
1914
1914
continue ;
1915
1915
1916
1916
// LOAD_CNT is only relevant to vgpr or LDS.
1917
- unsigned RegNo = SQ_MAX_PGM_VGPRS + EXTRA_VGPR_LDS ;
1917
+ unsigned RegNo = FIRST_LDS_VGPR ;
1918
1918
// Only objects with alias scope info were added to LDSDMAScopes array.
1919
1919
// In the absense of the scope info we will not be able to disambiguate
1920
1920
// aliasing here. There is no need to try searching for a corresponding
0 commit comments