diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-09-11 01:02:12 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-09-11 01:02:12 +0000 |
commit | d9c553f2622f751f9c474aa348e2f8b595d7d9ca (patch) | |
tree | 8c9f618696aec433f56ffb0f64f47fa09e4c0313 /lib/CodeGen/VirtRegMap.cpp | |
parent | 7f85fbd9de5a4bb1474075b46eb3a8246ea5220d (diff) |
Propagate subreg index when promoting a load to a copy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56085 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/VirtRegMap.cpp')
-rw-r--r-- | lib/CodeGen/VirtRegMap.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp index e783e04a61..3e27fe2793 100644 --- a/lib/CodeGen/VirtRegMap.cpp +++ b/lib/CodeGen/VirtRegMap.cpp @@ -1588,11 +1588,18 @@ void LocalSpiller::RewriteMBB(MachineBasicBlock &MBB, VirtRegMap &VRM) { if (DestReg != InReg) { const TargetRegisterClass *RC = RegInfo->getRegClass(VirtReg); TII->copyRegToReg(MBB, &MI, DestReg, InReg, RC, RC); + MachineOperand *DefMO = MI.findRegisterDefOperand(DestReg); + unsigned SubIdx = DefMO->getSubReg(); // Revisit the copy so we make sure to notice the effects of the // operation on the destreg (either needing to RA it if it's // virtual or needing to clobber any values if it's physical). NextMII = &MI; --NextMII; // backtrack to the copy. + // Propagate the sub-register index over. + if (SubIdx) { + DefMO = NextMII->findRegisterDefOperand(DestReg); + DefMO->setSubReg(SubIdx); + } BackTracked = true; } else { DOUT << "Removing now-noop copy: " << MI; |