Compute secondary sub-registers.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 10 May 2012 23:27:10 +0000 (23:27 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 10 May 2012 23:27:10 +0000 (23:27 +0000)
commitfcad79671f22c8994663c6780862b9c38d3609c3
treedce1123afde2279ce6fad0f3a7a852c28db3bf2e
parent9d236f909cec671ef2ff186c8fce6d2e1540a0a9
Compute secondary sub-registers.

The sub-registers explicitly listed in SubRegs in the .td files form a
tree. In a complicated register bank, it is possible to have
sub-register relationships across sub-trees. For example, the ARM NEON
double vector Q0_Q1 is a tree:

  Q0_Q1 = [Q0, Q1],  Q0 = [D0, D1], Q1 = [D2, D3]

But we also define the DPair register D1_D2 = [D1, D2] which is fully
contained in Q0_Q1.

This patch teaches TableGen to find such sub-register relationships, and
assign sub-register indices to them. In the example, TableGen will
create a dsub_1_dsub_2 sub-register index, and add D1_D2 as a
sub-register of Q0_Q1.

This will eventually enable the coalescer to handle copies of skewed
sub-registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156587 91177308-0d34-0410-b5e6-96231b3b80d8
utils/TableGen/CodeGenRegisters.cpp
utils/TableGen/CodeGenRegisters.h