LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AArch64InstrInfo.h
Go to the documentation of this file.
1 //===- AArch64InstrInfo.h - AArch64 Instruction Information -----*- 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 AArch64 implementation of the TargetInstrInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_TARGET_AARCH64INSTRINFO_H
15 #define LLVM_TARGET_AARCH64INSTRINFO_H
16 
18 #include "AArch64RegisterInfo.h"
19 
20 #define GET_INSTRINFO_HEADER
21 #include "AArch64GenInstrInfo.inc"
22 
23 namespace llvm {
24 
25 class AArch64Subtarget;
26 
28  const AArch64RegisterInfo RI;
29  const AArch64Subtarget &Subtarget;
30 public:
31  explicit AArch64InstrInfo(const AArch64Subtarget &TM);
32 
33  /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
34  /// such, whenever a client has an instance of instruction info, it should
35  /// always be able to get register info as well (through this method).
36  ///
37  const TargetRegisterInfo &getRegisterInfo() const { return RI; }
38 
39  const AArch64Subtarget &getSubTarget() const { return Subtarget; }
40 
43  unsigned DestReg, unsigned SrcReg,
44  bool KillSrc) const;
45 
48  unsigned SrcReg, bool isKill, int FrameIndex,
49  const TargetRegisterClass *RC,
50  const TargetRegisterInfo *TRI) const;
53  unsigned DestReg, int FrameIdx,
54  const TargetRegisterClass *RC,
55  const TargetRegisterInfo *TRI) const;
56 
58  MachineBasicBlock *&FBB,
60  bool AllowModify = false) const;
62  MachineBasicBlock *FBB,
64  DebugLoc DL) const;
65  unsigned RemoveBranch(MachineBasicBlock &MBB) const;
67 
69 
70  /// Look through the instructions in this function and work out the largest
71  /// the stack frame can be while maintaining the ability to address local
72  /// slots with no complexities.
73  unsigned estimateRSStackLimit(MachineFunction &MF) const;
74 
75  /// getAddressConstraints - For loads and stores (and PRFMs) taking an
76  /// immediate offset, this function determines the constraints required for
77  /// the immediate. It must satisfy:
78  /// + MinOffset <= imm <= MaxOffset
79  /// + imm % OffsetScale == 0
80  void getAddressConstraints(const MachineInstr &MI, int &AccessScale,
81  int &MinOffset, int &MaxOffset) const;
82 
83 
84  unsigned getInstSizeInBytes(const MachineInstr &MI) const;
85 
86  unsigned getInstBundleLength(const MachineInstr &MI) const;
87 
88 };
89 
90 bool rewriteA64FrameIndex(MachineInstr &MI, unsigned FrameRegIdx,
91  unsigned FrameReg, int &Offset,
92  const AArch64InstrInfo &TII);
93 
94 
95 void emitRegUpdate(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
96  DebugLoc dl, const TargetInstrInfo &TII,
97  unsigned DstReg, unsigned SrcReg, unsigned ScratchReg,
98  int64_t NumBytes,
100 
101 void emitSPUpdate(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
102  DebugLoc dl, const TargetInstrInfo &TII,
103  unsigned ScratchReg, int64_t NumBytes,
105 
106 }
107 
108 #endif
bool ReverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const
unsigned MaxOffset
bool expandPostRAPseudo(MachineBasicBlock::iterator MI) const
const HexagonInstrInfo * TII
unsigned estimateRSStackLimit(MachineFunction &MF) const
void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, DebugLoc DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const
bool rewriteA64FrameIndex(MachineInstr &MI, unsigned FrameRegIdx, unsigned FrameReg, int &Offset, const AArch64InstrInfo &TII)
const TargetRegisterInfo & getRegisterInfo() const
unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, const SmallVectorImpl< MachineOperand > &Cond, DebugLoc DL) const
bundle_iterator< MachineInstr, instr_iterator > iterator
void emitSPUpdate(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, DebugLoc dl, const TargetInstrInfo &TII, unsigned ScratchReg, int64_t NumBytes, MachineInstr::MIFlag MIFlags=MachineInstr::NoFlags)
unsigned getInstSizeInBytes(const MachineInstr &MI) const
unsigned RemoveBranch(MachineBasicBlock &MBB) const
bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify=false) const
AArch64InstrInfo(const AArch64Subtarget &TM)
void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned DestReg, int FrameIdx, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const
const AArch64Subtarget & getSubTarget() const
#define I(x, y, z)
Definition: MD5.cpp:54
void getAddressConstraints(const MachineInstr &MI, int &AccessScale, int &MinOffset, int &MaxOffset) const
void emitRegUpdate(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, DebugLoc dl, const TargetInstrInfo &TII, unsigned DstReg, unsigned SrcReg, unsigned ScratchReg, int64_t NumBytes, MachineInstr::MIFlag MIFlags=MachineInstr::NoFlags)
unsigned getInstBundleLength(const MachineInstr &MI) const