Reapply coalescer fix for better cross-class coalescing.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 11 Feb 2010 23:55:29 +0000 (23:55 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 11 Feb 2010 23:55:29 +0000 (23:55 +0000)
This time with fixed test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95938 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SimpleRegisterCoalescing.cpp
test/CodeGen/Thumb2/cross-rc-coalescing-2.ll
test/CodeGen/X86/2008-07-11-SpillerBug.ll
test/CodeGen/X86/pr1505b.ll
test/CodeGen/X86/pr3495.ll
test/CodeGen/X86/stack-color-with-reg.ll
test/CodeGen/X86/twoaddr-coalesce.ll

index df5c0ef3751f04a3557a5b60d1919402e8ef8fe6..ac19f48e6512f7b544ff37d39ce97a9a59ad551f 100644 (file)
@@ -1148,7 +1148,7 @@ SimpleRegisterCoalescing::isWinToJoinCrossClass(unsigned LargeReg,
   LiveInterval &SmallInt = li_->getInterval(SmallReg);
   unsigned LargeSize = li_->getApproximateInstructionCount(LargeInt);
   unsigned SmallSize = li_->getApproximateInstructionCount(SmallInt);
-  if (SmallSize > Threshold || LargeSize > Threshold) {
+  if (LargeSize > Threshold) {
     unsigned SmallUses = std::distance(mri_->use_nodbg_begin(SmallReg),
                                        mri_->use_nodbg_end());
     unsigned LargeUses = std::distance(mri_->use_nodbg_begin(LargeReg),
index 8f6449e8ffd5fe02e5735c527720bf33360f87e1..2b209319792d066f7a6e3f4610675a6ae5adb2c3 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mtriple=thumbv7-apple-darwin9 -mcpu=cortex-a8 | grep vmov.f32 | count 7
+; RUN: llc < %s -mtriple=thumbv7-apple-darwin9 -mcpu=cortex-a8 | grep vmov.f32 | count 3
 
 define arm_apcscc void @fht(float* nocapture %fz, i16 signext %n) nounwind {
 entry:
index cd99c0e53c0ba42f2645910852a1226092ba736c..548b44db6d2728824935e57018e96988be6f0721 100644 (file)
@@ -1,9 +1,7 @@
 ; RUN: llc < %s -march=x86 -relocation-model=static -disable-fp-elim -post-RA-scheduler=false -asm-verbose=0 | FileCheck %s
 ; PR2536
 
-
-; CHECK: movw %cx
-; CHECK-NEXT: andl    $65534, %
+; CHECK: andl    $65534, %
 ; CHECK-NEXT: movl %
 ; CHECK-NEXT: movl $17
 
index 12736cda4cd28589f13964b0f3538a511a1687aa..6a08dae51f8ae8d99acfaf33fea1486949208e4a 100644 (file)
@@ -1,5 +1,5 @@
-; RUN: llc < %s -mcpu=i486 | grep fstpl | count 4
-; RUN: llc < %s -mcpu=i486 | grep fstps | count 3
+; RUN: llc < %s -mcpu=i486 | grep fstpl | count 5
+; RUN: llc < %s -mcpu=i486 | grep fstps | count 2
 ; PR1505
 
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
index 1795970d353ee3c7e8d05fcaae7a73077a457890..14f2a544867c46755d4541e50636b6303f4324b9 100644 (file)
@@ -1,6 +1,6 @@
 ; RUN: llc < %s -march=x86 -stats |& grep {Number of loads added} | grep 2
 ; RUN: llc < %s -march=x86 -stats |& grep {Number of register spills} | grep 1
-; RUN: llc < %s -march=x86 -stats |& grep {Number of machine instrs printed} | grep 38
+; RUN: llc < %s -march=x86 -stats |& grep {Number of machine instrs printed} | grep 37
 ; PR3495
 ; The loop reversal kicks in once here, resulting in one fewer instruction.
 
index 7d85818d46b95a324aa78fb33663f071a0eacdfe..42e7a394d8bc0471e33ed02bf80aa644c173db61 100644 (file)
@@ -1,5 +1,5 @@
 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -relocation-model=pic -disable-fp-elim -color-ss-with-regs -stats -info-output-file - > %t
-; RUN:   grep stackcoloring %t | grep "stack slot refs replaced with reg refs"  | grep 14
+; RUN:   grep stackcoloring %t | grep "stack slot refs replaced with reg refs"  | grep 8
 
        type { [62 x %struct.Bitvec*] }         ; type %0
        type { i8* }            ; type %1
index d0e13f61f2d05c78e7d894c89708b68ba2ef2a9e..4c37225ce027bdc30cad36e7e3411c157b79b3d3 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: llc < %s -march=x86 | grep mov | count 5
+; RUN: llc < %s -march=x86 | grep mov | count 4
 ; rdar://6523745
 
 @"\01LC" = internal constant [4 x i8] c"%d\0A\00"              ; <[4 x i8]*> [#uses=1]