LLVM 22.0.0git
llvm::NVPTXInstrInfo Class Reference

#include "Target/NVPTX/NVPTXInstrInfo.h"

Inheritance diagram for llvm::NVPTXInstrInfo:
[legend]

Public Member Functions

 NVPTXInstrInfo (const NVPTXSubtarget &STI)
const NVPTXRegisterInfogetRegisterInfo () const
void copyPhysReg (MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DestReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) 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 26 of file NVPTXInstrInfo.h.

Constructor & Destructor Documentation

◆ NVPTXInstrInfo()

NVPTXInstrInfo::NVPTXInstrInfo ( const NVPTXSubtarget & STI)
explicit

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

References Cond, 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,
Register DestReg,
Register SrcReg,
bool KillSrc,
bool RenamableDest = false,
bool RenamableSrc = false ) const
override

◆ getRegisterInfo()

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

Definition at line 32 of file NVPTXInstrInfo.h.

◆ 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

Definition at line 143 of file NVPTXInstrInfo.cpp.

References assert(), I, and MBB.


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