Prefer cheap registers for busy live ranges.

On the x86-64 and thumb2 targets, some registers are more expensive to encode
than others in the same register class.

Add a CostPerUse field to the TableGen register description, and make it
available from TRI->getCostPerUse. This represents the cost of a REX prefix or a
32-bit instruction encoding required by choosing a high register.

Teach the greedy register allocator to prefer cheap registers for busy live
ranges (as indicated by spill weight).

llvm-svn: 129864
9 files changed
tree: d962d8b816d631b41da1bb3f6124d029ebda2d02
  1. clang/
  2. compiler-rt/
  3. debuginfo-tests/
  4. libcxx/
  5. lldb/
  6. llvm/