Fix PR2664 - spiller GetRegForReload wasn't respecting sub-register indices on machine operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56065 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2008-09-10 20:08:45 +00:00
parent b188dd9c5b
commit 014264b70f

View File

@ -832,8 +832,10 @@ namespace {
}
Spills.ClobberPhysReg(NewPhysReg);
Spills.ClobberPhysReg(NewOp.PhysRegReused);
MI->getOperand(NewOp.Operand).setReg(NewPhysReg);
unsigned SubIdx = MI->getOperand(NewOp.Operand).getSubReg();
unsigned RReg = SubIdx ? TRI->getSubReg(NewPhysReg, SubIdx) : NewPhysReg;
MI->getOperand(NewOp.Operand).setReg(RReg);
Spills.addAvailable(NewOp.StackSlotOrReMat, MI, NewPhysReg);
--MII;