LLVM 22.0.0git
SIFoldOperands.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "si-fold-operands"

Functions

static const TargetRegisterClassgetRegOpRC (const MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI, const MachineOperand &MO)
static unsigned macToMad (unsigned Opc)
static void appendFoldCandidate (SmallVectorImpl< FoldCandidate > &FoldList, FoldCandidate &&Entry)
static void appendFoldCandidate (SmallVectorImpl< FoldCandidate > &FoldList, MachineInstr *MI, unsigned OpNo, const FoldableDef &FoldOp, bool Commuted=false, int ShrinkOp=-1)
static MachineOperandlookUpCopyChain (const SIInstrInfo &TII, const MachineRegisterInfo &MRI, Register SrcReg)
static bool evalBinaryInstruction (unsigned Opcode, int32_t &Result, uint32_t LHS, uint32_t RHS)
static unsigned getMovOpc (bool IsScalar)
static void mutateCopyOp (MachineInstr &MI, const MCInstrDesc &NewDesc)
static int getOModValue (unsigned Opc, int64_t Val)
static bool isAGPRCopy (const SIRegisterInfo &TRI, const MachineRegisterInfo &MRI, const MachineInstr &Copy, Register &OutReg, unsigned &OutSubReg)
 Checks whether Copy is a AGPR -> VGPR copy.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "si-fold-operands"

Definition at line 23 of file SIFoldOperands.cpp.

Function Documentation

◆ appendFoldCandidate() [1/2]

void appendFoldCandidate ( SmallVectorImpl< FoldCandidate > & FoldList,
FoldCandidate && Entry )
static

◆ appendFoldCandidate() [2/2]

void appendFoldCandidate ( SmallVectorImpl< FoldCandidate > & FoldList,
MachineInstr * MI,
unsigned OpNo,
const FoldableDef & FoldOp,
bool Commuted = false,
int ShrinkOp = -1 )
static

Definition at line 751 of file SIFoldOperands.cpp.

References appendFoldCandidate(), and MI.

◆ evalBinaryInstruction()

bool evalBinaryInstruction ( unsigned Opcode,
int32_t & Result,
uint32_t LHS,
uint32_t RHS )
static

Definition at line 1475 of file SIFoldOperands.cpp.

References LHS, and RHS.

◆ getMovOpc()

unsigned getMovOpc ( bool IsScalar)
static

Definition at line 1541 of file SIFoldOperands.cpp.

◆ getOModValue()

int getOModValue ( unsigned Opc,
int64_t Val )
static

◆ getRegOpRC()

Definition at line 305 of file SIFoldOperands.cpp.

References const, getRegOpRC(), if(), MRI, and TRI.

Referenced by getRegOpRC().

◆ isAGPRCopy()

bool isAGPRCopy ( const SIRegisterInfo & TRI,
const MachineRegisterInfo & MRI,
const MachineInstr & Copy,
Register & OutReg,
unsigned & OutSubReg )
static

Checks whether Copy is a AGPR -> VGPR copy.

Returns true on success and stores the AGPR register in OutReg and the subreg in OutSubReg

Definition at line 2445 of file SIFoldOperands.cpp.

References assert(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineOperand::getSubReg(), llvm::MachineInstr::isCopy(), llvm::Register::isVirtual(), MRI, and TRI.

◆ lookUpCopyChain()

MachineOperand * lookUpCopyChain ( const SIInstrInfo & TII,
const MachineRegisterInfo & MRI,
Register SrcReg )
static

◆ macToMad()

unsigned macToMad ( unsigned Opc)
static

Definition at line 316 of file SIFoldOperands.cpp.

References Opc.

◆ mutateCopyOp()

void mutateCopyOp ( MachineInstr & MI,
const MCInstrDesc & NewDesc )
static

Definition at line 1545 of file SIFoldOperands.cpp.

References AbstractManglingParser< Derived, Alloc >::NumOps, I, and MI.