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
This commit is contained in:
Evan Cheng
2009-09-22 01:48:19 +00:00
parent 1c17c1bc54
commit 014d624a28
3 changed files with 6 additions and 4 deletions

View File

@ -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 =