Consider ad hoc aliasing when building RegUnits.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 14 May 2012 15:20:39 +0000 (15:20 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Mon, 14 May 2012 15:20:39 +0000 (15:20 +0000)
commit066fba1a822e881fbe7c6e01988fcba7936f283f
tree78e485206e04777c28ed1e3ed2c61a2df205fb19
parent534848b1c79088f23f034027e763cc3b3fb9eb7e
Consider ad hoc aliasing when building RegUnits.

Register units can be used to compute if two registers overlap:

  A overlaps B iff units(A) intersects units(B).

With this change, the above holds true even on targets that use ad hoc
aliasing (currently only ARM). This means that register units can be
used to implement regsOverlap() more efficiently, and the register
allocator can use the concept to model interference.

When there is no ad hoc aliasing, the register units correspond to the
maximal cliques in the register overlap graph. This is optimal, no other
register unit assignment can have fewer units.

With ad hoc aliasing, weird things are possible, and we don't try too
hard to compute the maximal cliques. The current approach is always
correct, and it works very well (probably optimally) as long as the ad
hoc aliasing doesn't have cliques larger than pairs. It seems unlikely
that any target would need more.

llvm-svn: 156763
llvm/utils/TableGen/CodeGenRegisters.cpp