diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-20 18:00:57 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-06-20 18:00:57 +0000 |
commit | 7824152557cfe3a366963f504b2b956f853ebc3a (patch) | |
tree | 0fadd2f553285f1dececdda3a7c47bc3ddfd8aff /lib/CodeGen | |
parent | b47f3ea22461b2d877d4a3246d54bdeab4fcfaa3 (diff) | |
download | external_llvm-7824152557cfe3a366963f504b2b956f853ebc3a.zip external_llvm-7824152557cfe3a366963f504b2b956f853ebc3a.tar.gz external_llvm-7824152557cfe3a366963f504b2b956f853ebc3a.tar.bz2 |
Only update regunit live ranges that have been precomputed.
Regunit live ranges are computed on demand, so when mi-sched calls
handleMove, some regunits may not have live ranges yet.
That makes updating them easier: Just skip the non-existing ranges. They
will be computed correctly from the rescheduled machine code when they
are needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158831 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 6b8cc88..153d1c3 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -1196,11 +1196,15 @@ private: if (TargetRegisterInfo::isPhysicalRegister(Reg) && LIS.isReserved(Reg)) continue; + // 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) && LIS.trackingRegUnits()) - for (MCRegUnitIterator Units(Reg, &TRI); Units.isValid(); ++Units) - collectRanges(MO, &LIS.getRegUnit(*Units), - Entering, Internal, Exiting, OldIdx); - else if (LIS.hasInterval(Reg)) + for (MCRegUnitIterator Units(Reg, &TRI); Units.isValid(); ++Units) + if (LiveInterval *LI = LIS.getCachedRegUnit(*Units)) + collectRanges(MO, LI, Entering, Internal, Exiting, OldIdx); + + // Collect ranges for individual registers. + if (LIS.hasInterval(Reg)) collectRanges(MO, &LIS.getInterval(Reg), Entering, Internal, Exiting, OldIdx); } |