LLVM  8.0.1
X86RegisterBankInfo.h
Go to the documentation of this file.
1 //===- X86RegisterBankInfo ---------------------------------------*- 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 X86.
11 /// \todo This should be generated by TableGen.
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_X86_X86REGISTERBANKINFO_H
15 #define LLVM_LIB_TARGET_X86_X86REGISTERBANKINFO_H
16 
18 
19 #define GET_REGBANK_DECLARATIONS
20 #include "X86GenRegisterBank.inc"
21 
22 namespace llvm {
23 
24 class LLT;
25 
27 protected:
28 #define GET_TARGET_REGBANK_CLASS
29 #include "X86GenRegisterBank.inc"
30 #define GET_TARGET_REGBANK_INFO_CLASS
31 #include "X86GenRegisterBankInfo.def"
32 
35 
36  static PartialMappingIdx getPartialMappingIdx(const LLT &Ty, bool isFP);
38  getValueMapping(PartialMappingIdx Idx, unsigned NumOperands);
39 };
40 
42 
43 /// This class provides the information for the target register banks.
45 private:
46  /// Get an instruction mapping.
47  /// \return An InstructionMappings with a statically allocated
48  /// OperandsMapping.
49  const InstructionMapping &getSameOperandsMapping(const MachineInstr &MI,
50  bool isFP) const;
51 
52  /// Track the bank of each instruction operand(register)
53  static void
54  getInstrPartialMappingIdxs(const MachineInstr &MI,
55  const MachineRegisterInfo &MRI, const bool isFP,
57 
58  /// Construct the instruction ValueMapping from PartialMappingIdxs
59  /// \return true if mapping succeeded.
60  static bool
61  getInstrValueMapping(const MachineInstr &MI,
62  const SmallVectorImpl<PartialMappingIdx> &OpRegBankIdx,
64 
65 public:
67 
68  const RegisterBank &
69  getRegBankFromRegClass(const TargetRegisterClass &RC) const override;
70 
72  getInstrAlternativeMappings(const MachineInstr &MI) const override;
73 
74  /// See RegisterBankInfo::applyMapping.
75  void applyMappingImpl(const OperandsMapper &OpdMapper) const override;
76 
78  getInstrMapping(const MachineInstr &MI) const override;
79 };
80 
81 } // namespace llvm
82 #endif
static RegisterBankInfo::ValueMapping ValMappings[]
This class represents lattice values for constants.
Definition: AllocatorList.h:24
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 const TargetRegisterInfo * TRI
Holds all the information related to register banks.
This class provides the information for the target register banks.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
static PartialMappingIdx getPartialMappingIdx(const LLT &Ty, bool isFP)
static const RegisterBankInfo::ValueMapping * getValueMapping(PartialMappingIdx Idx, unsigned NumOperands)
unsigned const MachineRegisterInfo * MRI
virtual const InstructionMapping & getInstrMapping(const MachineInstr &MI) const
Get the mapping of the different operands of MI on the register bank.
Helper struct that represents how a value is partially mapped into a register.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
This is a &#39;vector&#39; (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:847
static RegisterBankInfo::PartialMapping PartMappings[]
This class implements the register bank concept.
Definition: RegisterBank.h:29
Helper struct that represents how a value is mapped through different register banks.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Representation of each machine instruction.
Definition: MachineInstr.h:64
virtual void applyMappingImpl(const OperandsMapper &OpdMapper) const
See applyMapping.
virtual InstructionMappings getInstrAlternativeMappings(const MachineInstr &MI) const
Get the alternative mappings for MI.
IRTranslator LLVM IR MI
virtual const RegisterBank & getRegBankFromRegClass(const TargetRegisterClass &RC) const
Get a register bank that covers RC.