1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00

[RegisterBankInfo] Add a method to get the mapping RegClass -> RegBank.

This should be TableGen'ed at some point.

llvm-svn: 265574
This commit is contained in:
Quentin Colombet 2016-04-06 17:51:41 +00:00
parent d960c5411f
commit 3acc199dde

View File

@ -195,6 +195,23 @@ public:
/// Get the total number of register banks.
unsigned getNumRegBanks() const { return NumRegBanks; }
/// Get a register bank that covers \p RC.
///
/// \pre \p RC is a user-defined register class (as opposed as one
/// generated by TableGen).
///
/// \note The mapping RC -> RegBank could be built while adding the
/// coverage for the register banks. However, we do not do it, because,
/// at least for now, we only need this information for register classes
/// that are used in the description of instruction. In other words,
/// there are just a handful of them and we do not want to waste space.
///
/// \todo This should be TableGen'ed.
virtual const RegisterBank &
getRegBankFromRegClass(const TargetRegisterClass &RC) const {
llvm_unreachable("The target must override this method");
}
/// Get the cost of a copy from \p B to \p A, or put differently,
/// get the cost of A = COPY B.
virtual unsigned copyCost(const RegisterBank &A,