[llvm-commits] [llvm] r82505 - in /llvm/trunk: lib/CodeGen/SimpleRegisterCoalescing.cpp test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll test/CodeGen/X86/2008-02-22-ReMatBug.ll

Evan Cheng evan.cheng at apple.com
Mon Sep 21 18:48:19 PDT 2009


Author: evancheng
Date: Mon Sep 21 20:48:19 2009
New Revision: 82505

URL: http://llvm.org/viewvc/llvm-project?rev=82505&view=rev
Log:
Fix a pasto. Also simplify for Bill's benefit.

Modified:
    llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
    llvm/trunk/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll
    llvm/trunk/test/CodeGen/X86/2008-02-22-ReMatBug.ll

Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=82505&r1=82504&r2=82505&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Mon Sep 21 20:48:19 2009
@@ -2571,17 +2571,19 @@
           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 =

Modified: llvm/trunk/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll?rev=82505&r1=82504&r2=82505&view=diff

==============================================================================
--- llvm/trunk/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/2008-11-19-ScavengerAssert.ll Mon Sep 21 20:48:19 2009
@@ -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 }

Modified: llvm/trunk/test/CodeGen/X86/2008-02-22-ReMatBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-02-22-ReMatBug.ll?rev=82505&r1=82504&r2=82505&view=diff

==============================================================================
--- llvm/trunk/test/CodeGen/X86/2008-02-22-ReMatBug.ll (original)
+++ llvm/trunk/test/CodeGen/X86/2008-02-22-ReMatBug.ll Mon Sep 21 20:48:19 2009
@@ -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* }





More information about the llvm-commits mailing list