[llvm-commits] [llvm] r56065 - /llvm/trunk/lib/CodeGen/VirtRegMap.cpp
Evan Cheng
evan.cheng at apple.com
Wed Sep 10 13:08:46 PDT 2008
Author: evancheng
Date: Wed Sep 10 15:08:45 2008
New Revision: 56065
URL: http://llvm.org/viewvc/llvm-project?rev=56065&view=rev
Log:
Fix PR2664 - spiller GetRegForReload wasn't respecting sub-register indices on machine operands.
Modified:
llvm/trunk/lib/CodeGen/VirtRegMap.cpp
Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=56065&r1=56064&r2=56065&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original)
+++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Wed Sep 10 15:08:45 2008
@@ -832,8 +832,10 @@
}
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;
More information about the llvm-commits
mailing list