LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
llvm::NVPTXInstrInfo Class Reference

#include <NVPTXInstrInfo.h>

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

Public Member Functions

 NVPTXInstrInfo (NVPTXTargetMachine &TM)
 
virtual const NVPTXRegisterInfogetRegisterInfo () const
 
virtual void copyPhysReg (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, DebugLoc DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const
 
virtual bool isMoveInstr (const MachineInstr &MI, unsigned &SrcReg, unsigned &DestReg) const
 
bool isLoadInstr (const MachineInstr &MI, unsigned &AddrSpace) const
 
bool isStoreInstr (const MachineInstr &MI, unsigned &AddrSpace) const
 
bool isReadSpecialReg (MachineInstr &MI) const
 
virtual bool CanTailMerge (const MachineInstr *MI) const
 
virtual bool AnalyzeBranch (MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const
 
virtual unsigned RemoveBranch (MachineBasicBlock &MBB) const
 
virtual unsigned InsertBranch (MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, const SmallVectorImpl< MachineOperand > &Cond, DebugLoc DL) const
 
unsigned getLdStCodeAddrSpace (const MachineInstr &MI) const
 

Detailed Description

Definition at line 26 of file NVPTXInstrInfo.h.

Constructor & Destructor Documentation

NVPTXInstrInfo::NVPTXInstrInfo ( NVPTXTargetMachine TM)
explicit

Definition at line 31 of file NVPTXInstrInfo.cpp.

Member Function Documentation

bool NVPTXInstrInfo::AnalyzeBranch ( MachineBasicBlock MBB,
MachineBasicBlock *&  TBB,
MachineBasicBlock *&  FBB,
SmallVectorImpl< MachineOperand > &  Cond,
bool  AllowModify 
) const
virtual

AnalyzeBranch - Analyze the branching code at the end of MBB, returning true if it cannot be understood (e.g. it's a switch dispatch or isn't implemented for a target). Upon success, this returns false and returns with the following information in various cases:

  1. If this block ends with no branches (it just falls through to its succ) just return false, leaving TBB/FBB null.
  2. If this block ends with only an unconditional branch, it sets TBB to be the destination block.
  3. If this block ends with an conditional branch and it falls through to an successor block, it sets TBB to be the branch destination block and a list of operands that evaluate the condition. These operands can be passed to other TargetInstrInfo methods to create new branches.
  4. If this block ends with an conditional branch and an unconditional block, it returns the 'true' destination in TBB, the 'false' destination in FBB, and a list of operands that evaluate the condition. These operands can be passed to other TargetInstrInfo methods to create new branches.

Note that RemoveBranch and InsertBranch must be implemented to support cases where this method returns success.

Definition at line 169 of file NVPTXInstrInfo.cpp.

References llvm::MachineBasicBlock::begin(), llvm::MachineBasicBlock::end(), llvm::MachineInstr::eraseFromParent(), llvm::MachineOperand::getMBB(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), I, and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().

bool NVPTXInstrInfo::CanTailMerge ( const MachineInstr MI) const
virtual
void NVPTXInstrInfo::copyPhysReg ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
DebugLoc  DL,
unsigned  DestReg,
unsigned  SrcReg,
bool  KillSrc 
) const
virtual
unsigned llvm::NVPTXInstrInfo::getLdStCodeAddrSpace ( const MachineInstr MI) const
inline

Definition at line 71 of file NVPTXInstrInfo.h.

References llvm::MachineOperand::getImm(), and llvm::MachineInstr::getOperand().

Referenced by isLoadInstr(), and isStoreInstr().

virtual const NVPTXRegisterInfo& llvm::NVPTXInstrInfo::getRegisterInfo ( ) const
inlinevirtual

Definition at line 33 of file NVPTXInstrInfo.h.

Referenced by llvm::NVPTXTargetMachine::getRegisterInfo().

unsigned NVPTXInstrInfo::InsertBranch ( MachineBasicBlock MBB,
MachineBasicBlock TBB,
MachineBasicBlock FBB,
const SmallVectorImpl< MachineOperand > &  Cond,
DebugLoc  DL 
) const
virtual
bool NVPTXInstrInfo::isLoadInstr ( const MachineInstr MI,
unsigned AddrSpace 
) const
bool NVPTXInstrInfo::isMoveInstr ( const MachineInstr MI,
unsigned SrcReg,
unsigned DestReg 
) const
virtual
bool NVPTXInstrInfo::isReadSpecialReg ( MachineInstr MI) const

Definition at line 90 of file NVPTXInstrInfo.cpp.

References llvm::MachineInstr::getOpcode().

bool NVPTXInstrInfo::isStoreInstr ( const MachineInstr MI,
unsigned AddrSpace 
) const
unsigned NVPTXInstrInfo::RemoveBranch ( MachineBasicBlock MBB) const
virtual

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