diff options
author | Owen Anderson <resistor@mac.com> | 2008-08-19 01:05:33 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-08-19 01:05:33 +0000 |
commit | 724651ab6e5efc6b4a321c6c9f58a3a716072d50 (patch) | |
tree | 525061d8614f733e02019cd1cc3f1a1040f99718 /lib | |
parent | fa7e17d3794948b251c85e5549de9cba1aebf55a (diff) | |
download | external_llvm-724651ab6e5efc6b4a321c6c9f58a3a716072d50.zip external_llvm-724651ab6e5efc6b4a321c6c9f58a3a716072d50.tar.gz external_llvm-724651ab6e5efc6b4a321c6c9f58a3a716072d50.tar.bz2 |
Make SimpleSpiller respect subregister indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54968 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/VirtRegMap.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp index c06ff71..890ecf9 100644 --- a/lib/CodeGen/VirtRegMap.cpp +++ b/lib/CodeGen/VirtRegMap.cpp @@ -241,6 +241,7 @@ bool SimpleSpiller::runOnMachineFunction(MachineFunction &MF, VirtRegMap &VRM) { DOUT << "********** Function: " << MF.getFunction()->getName() << '\n'; const TargetMachine &TM = MF.getTarget(); const TargetInstrInfo &TII = *TM.getInstrInfo(); + const TargetRegisterInfo &TRI = *TM.getRegisterInfo(); // LoadedRegs - Keep track of which vregs are loaded, so that we only load @@ -261,7 +262,9 @@ bool SimpleSpiller::runOnMachineFunction(MachineFunction &MF, VirtRegMap &VRM) { if (MO.isRegister() && MO.getReg()) { if (TargetRegisterInfo::isVirtualRegister(MO.getReg())) { unsigned VirtReg = MO.getReg(); + unsigned SubIdx = MO.getSubReg(); unsigned PhysReg = VRM.getPhys(VirtReg); + unsigned RReg = SubIdx ? TRI.getSubReg(PhysReg, SubIdx) : PhysReg; if (!VRM.isAssignedReg(VirtReg)) { int StackSlot = VRM.getStackSlot(VirtReg); const TargetRegisterClass* RC = @@ -286,8 +289,8 @@ bool SimpleSpiller::runOnMachineFunction(MachineFunction &MF, VirtRegMap &VRM) { ++NumStores; } } - MF.getRegInfo().setPhysRegUsed(PhysReg); - MI.getOperand(i).setReg(PhysReg); + MF.getRegInfo().setPhysRegUsed(RReg); + MI.getOperand(i).setReg(RReg); } else { MF.getRegInfo().setPhysRegUsed(MO.getReg()); } |