LLVM 19.0.0git
Public Member Functions | List of all members
llvm::NVPTXInstrInfo Class Reference

#include "Target/NVPTX/NVPTXInstrInfo.h"

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

Public Member Functions

 NVPTXInstrInfo ()
 
const NVPTXRegisterInfogetRegisterInfo () const
 
void copyPhysReg (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg, bool KillSrc) const override
 
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.
 
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
 

Detailed Description

Definition at line 25 of file NVPTXInstrInfo.h.

Constructor & Destructor Documentation

◆ NVPTXInstrInfo()

NVPTXInstrInfo::NVPTXInstrInfo ( )
explicit

Definition at line 30 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 90 of file NVPTXInstrInfo.cpp.

References llvm::MachineBasicBlock::begin(), Cond, llvm::MachineBasicBlock::end(), llvm::MachineOperand::getMBB(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), I, MBB, and TBB.

◆ copyPhysReg()

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

◆ getRegisterInfo()

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

Definition at line 31 of file NVPTXInstrInfo.h.

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

◆ insertBranch()

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

◆ removeBranch()

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

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