radeon/llvm: fix calculation of max register number

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
This commit is contained in:
Christian König 2012-07-31 18:30:45 +02:00
parent a488fdd3d9
commit 6574fe3c4a

View file

@ -154,7 +154,7 @@ void SICodeEmitter::InitProgramInfo(MachineFunction &MF) {
assert("!Unknown register class");
}
hwReg = RI->getHWRegNum(reg);
maxUsed = ((hwReg + 1) * width) - 1;
maxUsed = hwReg + width - 1;
if (isSGPR) {
MaxSGPR = maxUsed > MaxSGPR ? maxUsed : MaxSGPR;
} else {