LLVM 19.0.0git
Macros | Functions
SIFoldOperands.cpp File Reference
#include "AMDGPU.h"
#include "GCNSubtarget.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
#include "SIMachineFunctionInfo.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineOperand.h"

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 bool isUseMIInFoldList (ArrayRef< FoldCandidate > FoldList, const MachineInstr *MI)
 
static void appendFoldCandidate (SmallVectorImpl< FoldCandidate > &FoldList, MachineInstr *MI, unsigned OpNo, MachineOperand *FoldOp, bool Commuted=false, int ShrinkOp=-1)
 
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 19 of file SIFoldOperands.cpp.

Function Documentation

◆ appendFoldCandidate()

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

◆ evalBinaryInstruction()

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

Definition at line 1105 of file SIFoldOperands.cpp.

References LHS, and RHS.

◆ getMovOpc()

static unsigned getMovOpc ( bool  IsScalar)
static

Definition at line 1171 of file SIFoldOperands.cpp.

◆ getOModValue()

static int getOModValue ( unsigned  Opc,
int64_t  Val 
)
static

◆ getRegOpRC()

static const TargetRegisterClass * getRegOpRC ( const MachineRegisterInfo MRI,
const TargetRegisterInfo TRI,
const MachineOperand MO 
)
static

Definition at line 147 of file SIFoldOperands.cpp.

References MRI, and TRI.

◆ isAGPRCopy()

static 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 1832 of file SIFoldOperands.cpp.

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

◆ isUseMIInFoldList()

static bool isUseMIInFoldList ( ArrayRef< FoldCandidate >  FoldList,
const MachineInstr MI 
)
static

Definition at line 449 of file SIFoldOperands.cpp.

References llvm::any_of(), llvm::CallingConv::C, and MI.

◆ macToMad()

static unsigned macToMad ( unsigned  Opc)
static

Definition at line 158 of file SIFoldOperands.cpp.

◆ mutateCopyOp()

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

Definition at line 1175 of file SIFoldOperands.cpp.

References I, and MI.