diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-11-14 07:59:08 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-11-14 07:59:08 +0000 |
| commit | c498b0281fa81bc213ad1a1228664d480936c0e6 (patch) | |
| tree | 9f5398569fe93f7e9c1f427daff5b051ecbcb14c /lib/CodeGen/LiveIntervalAnalysis.cpp | |
| parent | f9572a4c2bcdec54ea70c7b14f4ac6b38cfdd70c (diff) | |
Clean up sub-register implementation by moving subReg information back to
MachineOperand auxInfo. Previous clunky implementation uses an external map
to track sub-register uses. That works because register allocator uses
a new virtual register for each spilled use. With interval splitting (coming
soon), we may have multiple uses of the same register some of which are
of using different sub-registers from others. It's too fragile to constantly
update the information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44104 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
| -rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index ac5fc8ca02..833868a458 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -670,12 +670,8 @@ rewriteInstructionForSpills(const LiveInterval &li, unsigned RegI = Reg; if (Reg == 0 || MRegisterInfo::isPhysicalRegister(Reg)) continue; - bool isSubReg = RegMap->isSubRegister(Reg); - unsigned SubIdx = 0; - if (isSubReg) { - SubIdx = RegMap->getSubRegisterIndex(Reg); - Reg = RegMap->getSuperRegister(Reg); - } + unsigned SubIdx = mop.getSubReg(); + bool isSubReg = SubIdx != 0; if (Reg != li.reg) continue; @@ -710,8 +706,6 @@ rewriteInstructionForSpills(const LiveInterval &li, // Create a new virtual register for the spill interval. unsigned NewVReg = RegMap->createVirtualRegister(rc); vrm.grow(); - if (isSubReg) - RegMap->setIsSubRegister(NewVReg, NewVReg, SubIdx); // Scan all of the operands of this instruction rewriting operands // to use NewVReg instead of li.reg as appropriate. We do this for |
