Re-apply [AArch64][RegisterBankInfo] Use the statically computed mappings for COPY
authorQuentin Colombet <qcolombet@apple.com>
Mon, 16 Oct 2017 22:28:40 +0000 (22:28 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Mon, 16 Oct 2017 22:28:40 +0000 (22:28 +0000)
commit0bd282551795c0b63bc08c64b945484f646a0cab
tree6b51270b92720e12050dd30116dd215865e12fb9
parent9f20af613516842fced2ce8a2085f9cd482887cc
Re-apply [AArch64][RegisterBankInfo] Use the statically computed mappings for COPY

This reverts commit r315823, thus re-applying r315781.

Also make sure we don't use G_BITCAST mapping for non-generic registers.
Non-generic registers don't have a type but do have a reg bank.
Something the COPY mapping now how to deal with but the G_BITCAST
mapping don't.

-- Original Commit Message --
We use to resort on the generic implementation to get the mappings for
COPYs. The generic implementation resorts on table lookup and
dynamically allocated objects to get the valid mappings.

Given we already know how to map G_BITCAST and have the static mappings
for them, use that code path for COPY as well. This is much more
efficient.

Improve the compile time of RegBankSelect by up to 20%.

Note: When we eventually generate all the mappings via TableGen, we
wouldn't have to do that dance to shave compile time. The intent of this
change was to make sure that moving to static structure really pays off.

NFC.

llvm-svn: 315947
llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp
llvm/test/CodeGen/AArch64/GlobalISel/arm64-regbankselect.mir