summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-10-02 22:08:36 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-10-02 22:08:36 +0000
commitc8e25d98c00e62ac55f88516f34d504554e68cde (patch)
tree9c67e5141dfb817324a5448eed3d1aaad12c00d9 /llvm/lib/CodeGen
parentf1245ddc785419c8bd3eb035db36401a284518c3 (diff)
downloadbcm5719-llvm-c8e25d98c00e62ac55f88516f34d504554e68cde.tar.gz
bcm5719-llvm-c8e25d98c00e62ac55f88516f34d504554e68cde.zip
Handle reserved registers more accurately in handleMove().
Reserved register live ranges look like a set of dead defs - any uses of reserved registers are ignored. Instead of skipping the updating of reserved register operands entirely, just ignore the use operands and treat the def operands normally. No test case, handleMove() is not commonly used yet. llvm-svn: 165060
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index dca305849e5..141f8edc839 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -1164,18 +1164,17 @@ private:
unsigned Reg = MO.getReg();
- // TODO: Currently we're skipping uses that are reserved or have no
- // interval, but we're not updating their kills. This should be
- // fixed.
- if (TargetRegisterInfo::isPhysicalRegister(Reg) && LIS.isReserved(Reg))
- continue;
+ // Don't track uses of reserved registers - they're not accurate.
+ // Reserved register live ranges look like a set of dead defs.
+ bool Resv =
+ TargetRegisterInfo::isPhysicalRegister(Reg) && LIS.isReserved(Reg);
// Collect ranges for register units. These live ranges are computed on
// demand, so just skip any that haven't been computed yet.
if (TargetRegisterInfo::isPhysicalRegister(Reg)) {
for (MCRegUnitIterator Units(Reg, &TRI); Units.isValid(); ++Units)
if (LiveInterval *LI = LIS.getCachedRegUnit(*Units))
- collectRanges(MO, LI, Entering, Internal, Exiting, OldIdx);
+ collectRanges(MO, LI, Entering, Internal, Exiting, OldIdx, Resv);
} else {
// Collect ranges for individual virtual registers.
collectRanges(MO, &LIS.getInterval(Reg),
@@ -1186,8 +1185,8 @@ private:
void collectRanges(const MachineOperand &MO, LiveInterval *LI,
RangeSet &Entering, RangeSet &Internal, RangeSet &Exiting,
- SlotIndex OldIdx) {
- if (MO.readsReg()) {
+ SlotIndex OldIdx, bool IgnoreReads = false) {
+ if (!IgnoreReads && MO.readsReg()) {
LiveRange* LR = LI->getLiveRangeContaining(OldIdx);
if (LR != 0)
Entering.insert(std::make_pair(LI, LR));
OpenPOWER on IntegriCloud