mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-20 02:28:23 +00:00
Make linear scan's trivial coalescer slightly more aggressive.
llvm-svn: 62547
This commit is contained in:
parent
5281f4fb64
commit
5ee5ba12be
@ -249,7 +249,7 @@ unsigned RALinScan::attemptTrivialCoalescing(LiveInterval &cur, unsigned Reg) {
|
|||||||
if ((cur.preference && cur.preference == Reg) || !cur.containsOneValue())
|
if ((cur.preference && cur.preference == Reg) || !cur.containsOneValue())
|
||||||
return Reg;
|
return Reg;
|
||||||
|
|
||||||
VNInfo *vni = cur.getValNumInfo(0);
|
VNInfo *vni = cur.begin()->valno;
|
||||||
if (!vni->def || vni->def == ~1U || vni->def == ~0U)
|
if (!vni->def || vni->def == ~1U || vni->def == ~0U)
|
||||||
return Reg;
|
return Reg;
|
||||||
MachineInstr *CopyMI = li_->getInstructionFromIndex(vni->def);
|
MachineInstr *CopyMI = li_->getInstructionFromIndex(vni->def);
|
||||||
@ -686,13 +686,13 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur)
|
|||||||
unsigned StartPosition = cur->beginNumber();
|
unsigned StartPosition = cur->beginNumber();
|
||||||
const TargetRegisterClass *RCLeader = RelatedRegClasses.getLeaderValue(RC);
|
const TargetRegisterClass *RCLeader = RelatedRegClasses.getLeaderValue(RC);
|
||||||
|
|
||||||
// If this live interval is defined by a move instruction and its source is
|
// If start of this live interval is defined by a move instruction and its
|
||||||
// assigned a physical register that is compatible with the target register
|
// source is assigned a physical register that is compatible with the target
|
||||||
// class, then we should try to assign it the same register.
|
// register class, then we should try to assign it the same register.
|
||||||
// This can happen when the move is from a larger register class to a smaller
|
// This can happen when the move is from a larger register class to a smaller
|
||||||
// one, e.g. X86::mov32to32_. These move instructions are not coalescable.
|
// one, e.g. X86::mov32to32_. These move instructions are not coalescable.
|
||||||
if (!cur->preference && cur->containsOneValue()) {
|
if (!cur->preference && cur->hasAtLeastOneValue()) {
|
||||||
VNInfo *vni = cur->getValNumInfo(0);
|
VNInfo *vni = cur->begin()->valno;
|
||||||
if (vni->def && vni->def != ~1U && vni->def != ~0U) {
|
if (vni->def && vni->def != ~1U && vni->def != ~0U) {
|
||||||
MachineInstr *CopyMI = li_->getInstructionFromIndex(vni->def);
|
MachineInstr *CopyMI = li_->getInstructionFromIndex(vni->def);
|
||||||
unsigned SrcReg, DstReg;
|
unsigned SrcReg, DstReg;
|
||||||
|
8
test/CodeGen/X86/uint_to_fp-2.ll
Normal file
8
test/CodeGen/X86/uint_to_fp-2.ll
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2 | grep movsd | count 1
|
||||||
|
; rdar://6504833
|
||||||
|
|
||||||
|
define float @f(i32 %x) nounwind readnone {
|
||||||
|
entry:
|
||||||
|
%0 = uitofp i32 %x to float
|
||||||
|
ret float %0
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user