aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/AArch64/AArch64RegisterBankInfo.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-02 19:17:04 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-02 19:17:04 +0000
commitb915e9e0fc85ba6f398b3fab0db6a81a8913af94 (patch)
tree98b8f811c7aff2547cab8642daf372d6c59502fb /lib/Target/AArch64/AArch64RegisterBankInfo.h
parent6421cca32f69ac849537a3cff78c352195e99f1b (diff)
Notes
Diffstat (limited to 'lib/Target/AArch64/AArch64RegisterBankInfo.h')
-rw-r--r--lib/Target/AArch64/AArch64RegisterBankInfo.h39
1 files changed, 18 insertions, 21 deletions
diff --git a/lib/Target/AArch64/AArch64RegisterBankInfo.h b/lib/Target/AArch64/AArch64RegisterBankInfo.h
index 907bcfdea161..f763235049d4 100644
--- a/lib/Target/AArch64/AArch64RegisterBankInfo.h
+++ b/lib/Target/AArch64/AArch64RegisterBankInfo.h
@@ -27,43 +27,40 @@ enum {
CCRRegBankID = 2, /// Conditional register: NZCV.
NumRegisterBanks
};
+
+extern RegisterBank GPRRegBank;
+extern RegisterBank FPRRegBank;
+extern RegisterBank CCRRegBank;
} // End AArch64 namespace.
/// This class provides the information for the target register banks.
-class AArch64RegisterBankInfo : public RegisterBankInfo {
+class AArch64RegisterBankInfo final : public RegisterBankInfo {
/// See RegisterBankInfo::applyMapping.
void applyMappingImpl(const OperandsMapper &OpdMapper) const override;
+ /// Get an instruction mapping where all the operands map to
+ /// the same register bank and have similar size.
+ ///
+ /// \pre MI.getNumOperands() <= 3
+ ///
+ /// \return An InstructionMappings with a statically allocated
+ /// OperandsMapping.
+ static InstructionMapping
+ getSameKindOfOperandsMapping(const MachineInstr &MI);
+
public:
AArch64RegisterBankInfo(const TargetRegisterInfo &TRI);
- /// Get the cost of a copy from \p B to \p A, or put differently,
- /// get the cost of A = COPY B. Since register banks may cover
- /// different size, \p Size specifies what will be the size in bits
- /// that will be copied around.
- ///
- /// \note Since this is a copy, both registers have the same size.
+
unsigned copyCost(const RegisterBank &A, const RegisterBank &B,
unsigned Size) const override;
- /// 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.
const RegisterBank &
getRegBankFromRegClass(const TargetRegisterClass &RC) const override;
- /// Get the alternative mappings for \p MI.
- /// Alternative in the sense different from getInstrMapping.
InstructionMappings
getInstrAlternativeMappings(const MachineInstr &MI) const override;
+
+ InstructionMapping getInstrMapping(const MachineInstr &MI) const override;
};
} // End llvm namespace.
#endif