@@ -132,7 +132,7 @@ enum WaitEventType {
132
132
enum RegisterMapping {
133
133
SQ_MAX_PGM_VGPRS = 512 , // Maximum programmable VGPRs across all targets.
134
134
AGPR_OFFSET = 256 , // Maximum programmable ArchVGPRs across all targets.
135
- SQ_MAX_PGM_SGPRS = 256 , // Maximum programmable SGPRs across all targets.
135
+ SQ_MAX_PGM_SGPRS = 128 , // Maximum programmable SGPRs across all targets.
136
136
NUM_EXTRA_VGPRS = 9 , // Reserved slots for DS.
137
137
// Artificial register slots to track LDS writes into specific LDS locations
138
138
// if a location is known. When slots are exhausted or location is
@@ -757,14 +757,13 @@ RegInterval WaitcntBrackets::getRegInterval(const MachineInstr *MI,
757
757
if (TRI->isAGPR (*MRI, Op.getReg ()))
758
758
Result.first += AGPR_OFFSET;
759
759
assert (Result.first >= 0 && Result.first < SQ_MAX_PGM_VGPRS);
760
- } else if (TRI->isSGPRReg (*MRI, Op.getReg ())) {
761
- assert (Reg < SQ_MAX_PGM_SGPRS);
760
+ } else if (TRI->isSGPRReg (*MRI, Op.getReg ()) && Reg < SQ_MAX_PGM_SGPRS) {
761
+ // SGPRs including VCC, TTMPs and EXEC but excluding read-only scalar
762
+ // sources like SRC_PRIVATE_BASE.
762
763
Result.first = Reg + NUM_ALL_VGPRS;
763
- }
764
- // TODO: Handle TTMP
765
- // else if (TRI->isTTMP(*MRI, Reg.getReg())) ...
766
- else
764
+ } else {
767
765
return {-1 , -1 };
766
+ }
768
767
769
768
const TargetRegisterClass *RC = TRI->getPhysRegBaseClass (Op.getReg ());
770
769
unsigned Size = TRI->getRegSizeInBits (*RC);
0 commit comments