LLVM  5.0.0
AMDGPURegisterBankInfo.h
Go to the documentation of this file.
1 //===- AMDGPURegisterBankInfo -----------------------------------*- C++ -*-==//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 /// \file
10 /// This file declares the targeting of the RegisterBankInfo class for AMDGPU.
11 /// \todo This should be generated by TableGen.
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUREGISTERBANKINFO_H
15 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUREGISTERBANKINFO_H
16 
18 
19 namespace llvm {
20 
21 class SIRegisterInfo;
22 class TargetRegisterInfo;
23 
24 namespace AMDGPU {
25 enum {
29 };
30 } // End AMDGPU namespace.
31 
32 /// This class provides the information for the target register banks.
34 
35 protected:
36 
37 #define GET_TARGET_REGBANK_CLASS
38 #include "AMDGPUGenRegisterBank.inc"
39 };
41  const SIRegisterInfo *TRI;
42 
43  /// See RegisterBankInfo::applyMapping.
44  void applyMappingImpl(const OperandsMapper &OpdMapper) const override;
45 
47  getInstrMappingForLoad(const MachineInstr &MI) const;
48 
49 public:
51 
52  unsigned copyCost(const RegisterBank &A, const RegisterBank &B,
53  unsigned Size) const override;
54 
55  const RegisterBank &
56  getRegBankFromRegClass(const TargetRegisterClass &RC) const override;
57 
59  getInstrAlternativeMappings(const MachineInstr &MI) const override;
60 
61  const InstructionMapping &
62  getInstrMapping(const MachineInstr &MI) const override;
63 };
64 } // End llvm namespace.
65 #endif
const InstructionMapping & getInstrMapping(const MachineInstr &MI) const override
Get the mapping of the different operands of MI on the register bank.
Helper class that represents how the value of an instruction may be mapped and what is the related co...
Helper class used to get/create the virtual registers that will be used to replace the MachineOperand...
unsigned copyCost(const RegisterBank &A, const RegisterBank &B, unsigned Size) const override
Get the cost of a copy from B to A, or put differently, get the cost of A = COPY B.
Holds all the information related to register banks.
#define A
Definition: LargeTest.cpp:12
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
#define B
Definition: LargeTest.cpp:24
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:861
This class implements the register bank concept.
Definition: RegisterBank.h:29
AMDGPURegisterBankInfo(const TargetRegisterInfo &TRI)
InstructionMappings getInstrAlternativeMappings(const MachineInstr &MI) const override
Get the alternative mappings for MI.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
Representation of each machine instruction.
Definition: MachineInstr.h:59
const RegisterBank & getRegBankFromRegClass(const TargetRegisterClass &RC) const override
Get a register bank that covers RC.
This class provides the information for the target register banks.
IRTranslator LLVM IR MI