aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-04-21 22:46:52 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-04-21 22:46:52 +0000
commit047e9d1fa34f28a3db20f841eec1d194abf2a1da (patch)
tree4f04dd784d95779528ce075c994f65335631067c /lib/CodeGen/LiveIntervalAnalysis.cpp
parent101a267d8a32e6aef0bbe6fe1b5ff540828a00a4 (diff)
downloadexternal_llvm-047e9d1fa34f28a3db20f841eec1d194abf2a1da.zip
external_llvm-047e9d1fa34f28a3db20f841eec1d194abf2a1da.tar.gz
external_llvm-047e9d1fa34f28a3db20f841eec1d194abf2a1da.tar.bz2
It has finally happened. Spiller is now using live interval info.
This fixes a very subtle bug. vr defined by an implicit_def is allowed overlap with any register since it doesn't actually modify anything. However, if it's used as a two-address use, its live range can be extended and it can be spilled. The spiller must take care not to emit a reload for the vn number that's defined by the implicit_def. This is both a correctness and performance issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69743 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index f6a1c48..6691c2e 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -1304,7 +1304,7 @@ rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI,
// Update stack slot spill weight if we are splitting.
float Weight = getSpillWeight(HasDef, HasUse, loopDepth);
- if (!TrySplit)
+ if (!TrySplit)
SSWeight += Weight;
// Create a new virtual register for the spill interval.
@@ -1338,7 +1338,7 @@ rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI,
HasUse = false;
HasDef = false;
CanFold = false;
- if (isRemoved(MI)) {
+ if (isNotInMIMap(MI)) {
SSWeight -= Weight;
break;
}
@@ -1393,7 +1393,7 @@ rewriteInstructionForSpills(const LiveInterval &li, const VNInfo *VNI,
if (DefIsReMat && ImpUse)
MI->addOperand(MachineOperand::CreateReg(ImpUse, false, true));
- // create a new register interval for this spill / remat.
+ // Create a new register interval for this spill / remat.
LiveInterval &nI = getOrCreateInterval(NewVReg);
if (CreatedNewVReg) {
NewLIs.push_back(&nI);