LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PPCRegisterInfo.h
Go to the documentation of this file.
1 //===-- PPCRegisterInfo.h - PowerPC Register Information Impl ---*- 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 //
10 // This file contains the PowerPC implementation of the TargetRegisterInfo
11 // class.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef POWERPC32_REGISTERINFO_H
16 #define POWERPC32_REGISTERINFO_H
17 
18 #include "llvm/ADT/DenseMap.h"
19 #include "PPC.h"
20 
21 #define GET_REGINFO_HEADER
22 #include "PPCGenRegisterInfo.inc"
23 
24 namespace llvm {
25 class PPCSubtarget;
26 class TargetInstrInfo;
27 class Type;
28 
30  DenseMap<unsigned, unsigned> ImmToIdxMap;
31  const PPCSubtarget &Subtarget;
32 public:
34 
35  /// getPointerRegClass - Return the register class to use to hold pointers.
36  /// This is used for addressing modes.
37  virtual const TargetRegisterClass *
38  getPointerRegClass(const MachineFunction &MF, unsigned Kind=0) const;
39 
40  unsigned getRegPressureLimit(const TargetRegisterClass *RC,
41  MachineFunction &MF) const;
42 
43  /// Code Generation virtual methods...
44  const uint16_t *getCalleeSavedRegs(const MachineFunction* MF = 0) const;
45  const uint32_t *getCallPreservedMask(CallingConv::ID CC) const;
46  const uint32_t *getNoPreservedMask() const;
47 
48  BitVector getReservedRegs(const MachineFunction &MF) const;
49 
50  /// We require the register scavenger.
52  return true;
53  }
54 
56  return true;
57  }
58 
60  return true;
61  }
62 
63  virtual bool requiresVirtualBaseRegisters(const MachineFunction &MF) const {
64  return true;
65  }
66 
69  unsigned FrameIndex) const;
71  unsigned FrameIndex) const;
73  unsigned FrameIndex) const;
75  unsigned FrameIndex) const;
76 
77  bool hasReservedSpillSlot(const MachineFunction &MF, unsigned Reg,
78  int &FrameIdx) const;
80  int SPAdj, unsigned FIOperandNum,
81  RegScavenger *RS = NULL) const;
82 
83  // Support for virtual base registers.
84  bool needsFrameBaseReg(MachineInstr *MI, int64_t Offset) const;
86  unsigned BaseReg, int FrameIdx,
87  int64_t Offset) const;
89  unsigned BaseReg, int64_t Offset) const;
90  bool isFrameOffsetLegal(const MachineInstr *MI, int64_t Offset) const;
91 
92  // Debug information queries.
93  unsigned getFrameRegister(const MachineFunction &MF) const;
94 
95  // Base pointer (stack realignment) support.
96  unsigned getBaseRegister(const MachineFunction &MF) const;
97  bool hasBasePointer(const MachineFunction &MF) const;
98  bool canRealignStack(const MachineFunction &MF) const;
99  bool needsStackRealignment(const MachineFunction &MF) const;
100 };
101 
102 } // end namespace llvm
103 
104 #endif
COFF::RelocationTypeX86 Type
Definition: COFFYAML.cpp:227
void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=NULL) const
void materializeFrameBaseRegister(MachineBasicBlock *MBB, unsigned BaseReg, int FrameIdx, int64_t Offset) const
const uint32_t * getCallPreservedMask(CallingConv::ID CC) const
void lowerVRSAVERestore(MachineBasicBlock::iterator II, unsigned FrameIndex) const
bool needsStackRealignment(const MachineFunction &MF) const
bool hasReservedSpillSlot(const MachineFunction &MF, unsigned Reg, int &FrameIdx) const
unsigned getFrameRegister(const MachineFunction &MF) const
BitVector getReservedRegs(const MachineFunction &MF) const
ID
LLVM Calling Convention Representation.
Definition: CallingConv.h:26
bool needsFrameBaseReg(MachineInstr *MI, int64_t Offset) const
void lowerVRSAVESpilling(MachineBasicBlock::iterator II, unsigned FrameIndex) const
void lowerCRRestore(MachineBasicBlock::iterator II, unsigned FrameIndex) const
bool requiresFrameIndexScavenging(const MachineFunction &MF) const
unsigned getBaseRegister(const MachineFunction &MF) const
virtual const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind=0) const
void resolveFrameIndex(MachineBasicBlock::iterator I, unsigned BaseReg, int64_t Offset) const
void lowerDynamicAlloc(MachineBasicBlock::iterator II) const
bool isFrameOffsetLegal(const MachineInstr *MI, int64_t Offset) const
const uint32_t * getNoPreservedMask() const
unsigned getRegPressureLimit(const TargetRegisterClass *RC, MachineFunction &MF) const
bool trackLivenessAfterRegAlloc(const MachineFunction &MF) const
PPCRegisterInfo(const PPCSubtarget &SubTarget)
virtual bool requiresVirtualBaseRegisters(const MachineFunction &MF) const
#define I(x, y, z)
Definition: MD5.cpp:54
bool canRealignStack(const MachineFunction &MF) const
void lowerCRSpilling(MachineBasicBlock::iterator II, unsigned FrameIndex) const
bool requiresRegisterScavenging(const MachineFunction &MF) const
We require the register scavenger.
const uint16_t * getCalleeSavedRegs(const MachineFunction *MF=0) const
Code Generation virtual methods...
bool hasBasePointer(const MachineFunction &MF) const