Fix PR2783 - coalescer bug. Missing a TargetRegisterInfo::isVirtualRegister check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56112 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2008-09-11 18:40:32 +00:00
parent ffeecd65e3
commit 4086906a0f
2 changed files with 40 additions and 1 deletions

View File

@@ -1319,7 +1319,8 @@ bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) {
// If resulting interval has a preference that no longer fits because of subreg
// coalescing, just clear the preference.
if (ResDstInt->preference && (isExtSubReg || isInsSubReg)) {
if (ResDstInt->preference && (isExtSubReg || isInsSubReg) &&
TargetRegisterInfo::isVirtualRegister(ResDstInt->reg)) {
const TargetRegisterClass *RC = mri_->getRegClass(ResDstInt->reg);
if (!RC->contains(ResDstInt->preference))
ResDstInt->preference = 0;