summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-09-22 01:48:19 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-09-22 01:48:19 +0000
commit0dfed43a5b3a559669b86d5739d507d1f9445f3b (patch)
treef05ce7c5d01b120f13b8ecb26dc48f7f75103194
parent33f6acbbf1f4fdc2a49ba2e239bb62e4edfdc211 (diff)
downloadbcm5719-llvm-0dfed43a5b3a559669b86d5739d507d1f9445f3b.tar.gz
bcm5719-llvm-0dfed43a5b3a559669b86d5739d507d1f9445f3b.zip
Fix a pasto. Also simplify for Bill's benefit.
llvm-svn: 82505
-rw-r--r--llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp6
-rw-r--r--llvm/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll2
-rw-r--r--llvm/test/CodeGen/X86/2008-02-22-ReMatBug.ll2
3 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
index 068dcda93b5..22b62c36037 100644
--- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp
+++ b/llvm/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 =
diff --git a/llvm/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll b/llvm/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll
index 221a168cba8..3291856f18c 100644
--- a/llvm/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll
+++ b/llvm/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=arm-apple-darwin9 -stats |& grep asm-printer | grep 161
+; RUN: llc < %s -mtriple=arm-apple-darwin9 -stats |& grep asm-printer | grep 162
%"struct.Adv5::Ekin<3>" = type <{ i8 }>
%"struct.Adv5::X::Energyflux<3>" = type { double }
diff --git a/llvm/test/CodeGen/X86/2008-02-22-ReMatBug.ll b/llvm/test/CodeGen/X86/2008-02-22-ReMatBug.ll
index a91ac27f98d..8d6bb0df1f6 100644
--- a/llvm/test/CodeGen/X86/2008-02-22-ReMatBug.ll
+++ b/llvm/test/CodeGen/X86/2008-02-22-ReMatBug.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 -stats |& grep {Number of re-materialization} | grep 2
+; RUN: llc < %s -march=x86 -stats |& grep {Number of re-materialization} | grep 3
; rdar://5761454
%struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* }
OpenPOWER on IntegriCloud