LLVM  6.0.0svn
Public Member Functions | List of all members
llvm::NVPTXInstrInfo Class Reference

#include "Target/NVPTX/NVPTXInstrInfo.h"

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

Public Member Functions

 NVPTXInstrInfo ()
 
const NVPTXRegisterInfogetRegisterInfo () const
 
void copyPhysReg (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const override
 
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 analyzeBranch (MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const override
 AnalyzeBranch - Analyze the branching code at the end of MBB, returning true if it cannot be understood (e.g. More...
 
unsigned removeBranch (MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
 
unsigned insertBranch (MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
 
unsigned getLdStCodeAddrSpace (const MachineInstr &MI) const
 

Detailed Description

Definition at line 26 of file NVPTXInstrInfo.h.

Constructor & Destructor Documentation

◆ NVPTXInstrInfo()

NVPTXInstrInfo::NVPTXInstrInfo ( )
explicit

Definition at line 31 of file NVPTXInstrInfo.cpp.

Member Function Documentation

◆ analyzeBranch()

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

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 141 of file NVPTXInstrInfo.cpp.

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

Referenced by getRegisterInfo().

◆ copyPhysReg()

void NVPTXInstrInfo::copyPhysReg ( MachineBasicBlock MBB,
MachineBasicBlock::iterator  I,
const DebugLoc DL,
unsigned  DestReg,
unsigned  SrcReg,
bool  KillSrc 
) const
override

◆ getLdStCodeAddrSpace()

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().

◆ getRegisterInfo()

const NVPTXRegisterInfo& llvm::NVPTXInstrInfo::getRegisterInfo ( ) const
inline

◆ insertBranch()

unsigned NVPTXInstrInfo::insertBranch ( MachineBasicBlock MBB,
MachineBasicBlock TBB,
MachineBasicBlock FBB,
ArrayRef< MachineOperand Cond,
const DebugLoc DL,
int *  BytesAdded = nullptr 
) const
override

◆ isLoadInstr()

bool NVPTXInstrInfo::isLoadInstr ( const MachineInstr MI,
unsigned AddrSpace 
) const

◆ isMoveInstr()

bool NVPTXInstrInfo::isMoveInstr ( const MachineInstr MI,
unsigned SrcReg,
unsigned DestReg 
) const
virtual

◆ isStoreInstr()

bool NVPTXInstrInfo::isStoreInstr ( const MachineInstr MI,
unsigned AddrSpace 
) const

◆ removeBranch()

unsigned NVPTXInstrInfo::removeBranch ( MachineBasicBlock MBB,
int *  BytesRemoved = nullptr 
) const
override

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