Index: lib/Target/AMDGPU/SIRegisterInfo.cpp =================================================================== --- lib/Target/AMDGPU/SIRegisterInfo.cpp +++ lib/Target/AMDGPU/SIRegisterInfo.cpp @@ -1122,7 +1122,7 @@ unsigned SIRegisterInfo::getNumReservedSGPRs(const SISubtarget &ST) const { if (ST.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS) return 6; // VCC, FLAT_SCRATCH, XNACK. - return 2; // VCC. + return 4; // VCC, FLAT_SCRATCH. } unsigned SIRegisterInfo::getMinNumSGPRs(const SISubtarget &ST,