OSDN Git Service

Add a RegisterClassInfo class that lazily caches information about
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 2 Jun 2011 02:19:35 +0000 (02:19 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 2 Jun 2011 02:19:35 +0000 (02:19 +0000)
commit491a13691d3b30b8288dfc6e01ad6a58f69a4ce6
treea9d601a352d9dc7e6bc6f0f8cdc33d582dee0b3d
parent5e06903e66a1f89b29a7cdf89421e3d8d12f6a77
Add a RegisterClassInfo class that lazily caches information about
register classes.

It provides information for each register class that cannot be
determined statically, like:

- The number of allocatable registers in a class after filtering out the
  reserved and invalid registers.

- The preferred allocation order with registers that overlap callee-saved
  registers last.

- The last callee-saved register that overlaps a given physical register.

This information usually doesn't change between functions, so it is
reused for compiling multiple functions when possible.  The many
possible combinations of reserved and callee saves registers makes it
unfeasible to compute this information statically in TableGen.

Use RegisterClassInfo to count available registers in various heuristics
in SimpleRegisterCoalescing, making the pass run 4% faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132450 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CMakeLists.txt
lib/CodeGen/RegisterClassInfo.cpp [new file with mode: 0644]
lib/CodeGen/RegisterClassInfo.h [new file with mode: 0644]
lib/CodeGen/SimpleRegisterCoalescing.cpp
lib/CodeGen/SimpleRegisterCoalescing.h