diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-09-22 01:48:19 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-09-22 01:48:19 +0000 |
commit | 014d624a2864605b10d3b14fd9cda3163c41f6bf (patch) | |
tree | f1d5d50340bb470afe37be9c99f0ae7e23d9744d /lib/CodeGen/SimpleRegisterCoalescing.cpp | |
parent | 1c17c1bc54335564e86bdb7c5e87383feddbc729 (diff) |
Fix a pasto. Also simplify for Bill's benefit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82505 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r-- | lib/CodeGen/SimpleRegisterCoalescing.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index 068dcda93b..22b62c3603 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -2571,17 +2571,19 @@ void SimpleRegisterCoalescing::CalculateSpillWeights() { continue; bool HasDef = mopi.isDef(); - bool HasUse = mopi.isUse(); + bool HasUse = !HasDef; for (unsigned j = i+1; j != e; ++j) { const MachineOperand &mopj = MI->getOperand(j); if (!mopj.isReg() || mopj.getReg() != Reg) continue; HasDef |= mopj.isDef(); HasUse |= mopj.isUse(); + if (HasDef && HasUse) + break; } LiveInterval &RegInt = li_->getInterval(Reg); - float Weight = li_->getSpillWeight(HasDef, HasUse, loopDepth+1); + float Weight = li_->getSpillWeight(HasDef, HasUse, loopDepth); if (HasDef && isExit) { // Looks like this is a loop count variable update. MachineInstrIndex DefIdx = |