LLVM API Documentation

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
llvm::MipsInstrInfo Class Reference

#include <MipsInstrInfo.h>

Inheritance diagram for llvm::MipsInstrInfo:
Inheritance graph
[legend]
Collaboration diagram for llvm::MipsInstrInfo:
Collaboration graph
[legend]

List of all members.

Public Types

enum  BranchType {
  BT_None, BT_NoBranch, BT_Uncond, BT_Cond,
  BT_CondUncond, BT_Indirect
}

Public Member Functions

 MipsInstrInfo (const MipsSubtarget &STI, unsigned UncondBrOpc)
bool AnalyzeBranch (MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
 Branch Analysis.
unsigned RemoveBranch (MachineBasicBlock &MBB) const override
unsigned InsertBranch (MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, const SmallVectorImpl< MachineOperand > &Cond, DebugLoc DL) const override
bool ReverseBranchCondition (SmallVectorImpl< MachineOperand > &Cond) const override
BranchType AnalyzeBranch (MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify, SmallVectorImpl< MachineInstr * > &BranchInstrs) const
void insertNoop (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override
 Insert nop instruction when hazard condition is found.
virtual const MipsRegisterInfogetRegisterInfo () const =0
virtual unsigned getOppositeBranchOpc (unsigned Opc) const =0
unsigned GetInstSizeInBytes (const MachineInstr *MI) const
 Return the number of bytes of code the specified instruction may be.
void storeRegToStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
void loadRegFromStackSlot (MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const override
virtual void storeRegToStack (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, int64_t Offset) const =0
virtual void loadRegFromStack (MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI, int64_t Offset) const =0
MachineInstrBuilder genInstrWithNewOpc (unsigned NewOpc, MachineBasicBlock::iterator I) const

Static Public Member Functions

static const MipsInstrInfocreate (MipsSubtarget &STI)

Protected Member Functions

bool isZeroImm (const MachineOperand &op) const
MachineMemOperandGetMemOperand (MachineBasicBlock &MBB, int FI, unsigned Flag) const

Protected Attributes

const MipsSubtargetSubtarget
unsigned UncondBrOpc

Detailed Description

Definition at line 33 of file MipsInstrInfo.h.


Member Enumeration Documentation

Enumerator:
BT_None 
BT_NoBranch 
BT_Uncond 
BT_Cond 
BT_CondUncond 
BT_Indirect 

Definition at line 40 of file MipsInstrInfo.h.


Constructor & Destructor Documentation

MipsInstrInfo::MipsInstrInfo ( const MipsSubtarget STI,
unsigned  UncondBrOpc 
) [explicit]

Definition at line 33 of file MipsInstrInfo.cpp.


Member Function Documentation

bool MipsInstrInfo::AnalyzeBranch ( MachineBasicBlock MBB,
MachineBasicBlock *&  TBB,
MachineBasicBlock *&  FBB,
SmallVectorImpl< MachineOperand > &  Cond,
bool  AllowModify 
) const [override]

Branch Analysis.

Definition at line 86 of file MipsInstrInfo.cpp.

References llvm::X86ISD::BT, BT_Indirect, and BT_None.

Create an instruction which has the same operands and memory operands as MI but has a new opcode.

Definition at line 279 of file MipsInstrInfo.cpp.

References llvm::MachineInstrBuilder::addOperand(), llvm::BuildMI(), I, and llvm::MachineInstrBuilder::setMemRefs().

MachineMemOperand * MipsInstrInfo::GetMemOperand ( MachineBasicBlock MBB,
int  FI,
unsigned  Flag 
) const [protected]
virtual unsigned llvm::MipsInstrInfo::getOppositeBranchOpc ( unsigned  Opc) const [pure virtual]
virtual const MipsRegisterInfo& llvm::MipsInstrInfo::getRegisterInfo ( ) const [pure virtual]

getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As such, whenever a client has an instance of instruction info, it should always be able to get register info as well (through this method).

Implemented in llvm::MipsSEInstrInfo, and llvm::Mips16InstrInfo.

void MipsInstrInfo::insertNoop ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI 
) const [override]

Insert nop instruction when hazard condition is found.

insertNoop - If data hazard condition is found insert the target nop instruction.

Definition at line 51 of file MipsInstrInfo.cpp.

References llvm::BuildMI().

bool MipsInstrInfo::isZeroImm ( const MachineOperand op) const [protected]
virtual void llvm::MipsInstrInfo::loadRegFromStack ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
unsigned  DestReg,
int  FrameIndex,
const TargetRegisterClass RC,
const TargetRegisterInfo TRI,
int64_t  Offset 
) const [pure virtual]
void llvm::MipsInstrInfo::loadRegFromStackSlot ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
unsigned  DestReg,
int  FrameIndex,
const TargetRegisterClass RC,
const TargetRegisterInfo TRI 
) const [inline, override]

Definition at line 98 of file MipsInstrInfo.h.

References loadRegFromStack().

ReverseBranchCondition - Return the inverse opcode of the specified Branch instruction.

Definition at line 170 of file MipsInstrInfo.cpp.

References getOppositeBranchOpc(), and llvm::SmallVectorTemplateCommon< T >::size().

virtual void llvm::MipsInstrInfo::storeRegToStack ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MI,
unsigned  SrcReg,
bool  isKill,
int  FrameIndex,
const TargetRegisterClass RC,
const TargetRegisterInfo TRI,
int64_t  Offset 
) const [pure virtual]
void llvm::MipsInstrInfo::storeRegToStackSlot ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  MBBI,
unsigned  SrcReg,
bool  isKill,
int  FrameIndex,
const TargetRegisterClass RC,
const TargetRegisterInfo TRI 
) const [inline, override]

Definition at line 90 of file MipsInstrInfo.h.

References storeRegToStack().


Member Data Documentation

Definition at line 37 of file MipsInstrInfo.h.

Referenced by AnalyzeBranch(), and InsertBranch().


The documentation for this class was generated from the following files: