Be more aggressive about following hints.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 8 Jul 2011 20:46:18 +0000 (20:46 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 8 Jul 2011 20:46:18 +0000 (20:46 +0000)
commit51458ed09e6db0e424cd528e10b879f59915abe4
tree56a25a53a83111d5cbeb0b0b9a55510310d35052
parent0b44aea7b564c5c28ac0acaaba8805ce7c625fd3
Be more aggressive about following hints.

RAGreedy::tryAssign will now evict interference from the preferred
register even when another register is free.

To support this, add the EvictionCost struct that counts how many hints
are broken by an eviction. We don't want to break one hint just to
satisfy another.

Rename canEvict to shouldEvict, and add the first bit of eviction policy
that doesn't depend on spill weights: Always make room in the preferred
register as long as the evictees can be split and aren't already
assigned to their preferred register.

Also make the CSR avoidance more accurate. When looking for a cheaper
register it is OK to use a new volatile register. Only CSR aliases that
have never been used before should be avoided.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134735 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineRegisterInfo.h
lib/CodeGen/LiveIntervalUnion.cpp
lib/CodeGen/LiveIntervalUnion.h
lib/CodeGen/RegAllocGreedy.cpp
lib/CodeGen/VirtRegMap.h
test/CodeGen/ARM/lsr-unfolded-offset.ll
test/CodeGen/X86/2009-12-01-EarlyClobberBug.ll
test/CodeGen/X86/divide-by-constant.ll
test/CodeGen/X86/lsr-reuse-trunc.ll
test/CodeGen/X86/peep-test-3.ll
test/CodeGen/X86/sse3.ll