mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 11:02:59 +02:00
Try trivial remat before the coalescer gives up on a vr / physreg coalescing for fear of tying up a physical register.
llvm-svn: 99575
This commit is contained in:
parent
f5c1282ba6
commit
0b7dd682dd
@ -1664,7 +1664,8 @@ bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) {
|
|||||||
if (JoinPInt.ranges.size() > 1000) {
|
if (JoinPInt.ranges.size() > 1000) {
|
||||||
mri_->setRegAllocationHint(JoinVInt.reg, 0, JoinPReg);
|
mri_->setRegAllocationHint(JoinVInt.reg, 0, JoinPReg);
|
||||||
++numAborts;
|
++numAborts;
|
||||||
DEBUG(dbgs() << "\tPhysical register too complicated, abort!\n");
|
DEBUG(dbgs()
|
||||||
|
<< "\tPhysical register live interval too complicated, abort!\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1675,6 +1676,11 @@ bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) {
|
|||||||
if (Length > Threshold &&
|
if (Length > Threshold &&
|
||||||
(((float)std::distance(mri_->use_nodbg_begin(JoinVReg),
|
(((float)std::distance(mri_->use_nodbg_begin(JoinVReg),
|
||||||
mri_->use_nodbg_end()) / Length) < Ratio)) {
|
mri_->use_nodbg_end()) / Length) < Ratio)) {
|
||||||
|
// Before giving up coalescing, if definition of source is defined by
|
||||||
|
// trivial computation, try rematerializing it.
|
||||||
|
if (ReMaterializeTrivialDef(SrcInt, DstReg, DstSubIdx, CopyMI))
|
||||||
|
return true;
|
||||||
|
|
||||||
mri_->setRegAllocationHint(JoinVInt.reg, 0, JoinPReg);
|
mri_->setRegAllocationHint(JoinVInt.reg, 0, JoinPReg);
|
||||||
++numAborts;
|
++numAborts;
|
||||||
DEBUG(dbgs() << "\tMay tie down a physical register, abort!\n");
|
DEBUG(dbgs() << "\tMay tie down a physical register, abort!\n");
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
; RUN: llc < %s -march=x86-64 -mattr=+sse3 -stats |& grep {2 machine-licm}
|
; RUN: llc < %s -march=x86-64 -mattr=+sse3 -stats |& grep {2 machine-licm}
|
||||||
|
; RUN: llc < %s -march=x86-64 -mattr=+sse3 | FileCheck %s
|
||||||
; rdar://6627786
|
; rdar://6627786
|
||||||
|
; rdar://7792037
|
||||||
|
|
||||||
target triple = "x86_64-apple-darwin10.0"
|
target triple = "x86_64-apple-darwin10.0"
|
||||||
%struct.Key = type { i64 }
|
%struct.Key = type { i64 }
|
||||||
@ -11,6 +13,13 @@ entry:
|
|||||||
br label %bb4
|
br label %bb4
|
||||||
|
|
||||||
bb4: ; preds = %bb.i, %bb26, %bb4, %entry
|
bb4: ; preds = %bb.i, %bb26, %bb4, %entry
|
||||||
|
; CHECK: %bb4
|
||||||
|
; CHECK: xorb
|
||||||
|
; CHECK: callq
|
||||||
|
; CHECK: movq
|
||||||
|
; CHECK: xorl
|
||||||
|
; CHECK: xorb
|
||||||
|
|
||||||
%0 = call i32 (...)* @xxGetOffsetForCode(i32 undef) nounwind ; <i32> [#uses=0]
|
%0 = call i32 (...)* @xxGetOffsetForCode(i32 undef) nounwind ; <i32> [#uses=0]
|
||||||
%ins = or i64 %p, 2097152 ; <i64> [#uses=1]
|
%ins = or i64 %p, 2097152 ; <i64> [#uses=1]
|
||||||
%1 = call i32 (...)* @xxCalculateMidType(%struct.Key* %desc, i32 0) nounwind ; <i32> [#uses=1]
|
%1 = call i32 (...)* @xxCalculateMidType(%struct.Key* %desc, i32 0) nounwind ; <i32> [#uses=1]
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
; RUN: llc < %s -march=x86 | grep mov | count 6
|
; RUN: llc < %s -march=x86 | grep mov | count 5
|
||||||
; PR2659
|
; PR2659
|
||||||
|
|
||||||
define i32 @binomial(i32 %n, i32 %k) nounwind {
|
define i32 @binomial(i32 %n, i32 %k) nounwind {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin9.4.0 | grep movl | count 6
|
; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin9.4.0 | grep movl | count 5
|
||||||
|
; RUN: llc < %s -march=x86 -mtriple=i686-apple-darwin9.4.0 | FileCheck %s
|
||||||
; PR2659
|
; PR2659
|
||||||
|
|
||||||
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-f80:128:128"
|
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-f80:128:128"
|
||||||
@ -13,6 +14,11 @@ forcond.preheader: ; preds = %entry
|
|||||||
%cmp44 = icmp eq i32 %k, 0 ; <i1> [#uses=1]
|
%cmp44 = icmp eq i32 %k, 0 ; <i1> [#uses=1]
|
||||||
br i1 %cmp44, label %afterfor, label %forbody
|
br i1 %cmp44, label %afterfor, label %forbody
|
||||||
|
|
||||||
|
; CHECK: %forcond.preheader.forbody_crit_edge
|
||||||
|
; CHECK: movl $1
|
||||||
|
; CHECK-NOT: xorl
|
||||||
|
; CHECK-NEXT: movl $1
|
||||||
|
|
||||||
ifthen: ; preds = %entry
|
ifthen: ; preds = %entry
|
||||||
ret i32 0
|
ret i32 0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user