Handle NewReg==OldReg in renameRegister().

This can happen when widening a virtual register to a super-register
class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156867 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2012-05-15 22:20:27 +00:00
parent 141aea9cff
commit 70724aaf73

View File

@ -721,7 +721,8 @@ renameRegister(unsigned OldReg, unsigned NewReg, unsigned SubIdx) {
if (TargetRegisterInfo::isVirtualRegister(NewReg))
mapVirtReg(NewReg, UV);
virtRegToEqClass.erase(OldReg);
if (OldReg != NewReg)
virtRegToEqClass.erase(OldReg);
do {
UV->renameRegister(OldReg, NewReg, SubIdx, TRI);