|
LLVM 24.0.0git
|
#include "SIPeepholeSDWA.h"#include "AMDGPU.h"#include "GCNSubtarget.h"#include "llvm/ADT/Statistic.h"#include "llvm/CodeGen/MachineFunctionPass.h"#include <optional>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "si-peephole-sdwa" |
Functions | |
| STATISTIC (NumSDWAPatternsFound, "Number of SDWA patterns found.") | |
| STATISTIC (NumSDWAInstructionsPeepholed, "Number of instruction converted to SDWA.") | |
| static raw_ostream & | operator<< (raw_ostream &OS, SdwaSel Sel) |
| static raw_ostream & | operator<< (raw_ostream &OS, const DstUnused &Un) |
| static void | copyRegOperand (MachineOperand &To, const MachineOperand &From) |
| static bool | isSameReg (const MachineOperand &LHS, const MachineOperand &RHS) |
| static MachineOperand * | findSingleRegUse (const MachineOperand *Reg, const MachineRegisterInfo *MRI) |
| static MachineOperand * | findSingleRegDef (const MachineOperand *Reg, const MachineRegisterInfo *MRI) |
| static std::optional< SdwaSel > | combineSdwaSrcSel (SdwaSel Sel, SdwaSel OperandSel) |
Combine an SDWA source instruction's existing source selection Sel with the SDWA selection OperandSel of its operand. | |
| static bool | canCombineOpSel (const MachineInstr &MI, const SIInstrInfo *TII, AMDGPU::OpName SrcOpName, AMDGPU::OpName SrcSelOpName, MachineOperand *Op, SdwaSel OpSel) |
Verify that Op is the same register as the operand of the SDWA instruction MI named by SrcOpName and that the SDWA selection SrcSelOpName can be combined with the OpSel. | |
| static raw_ostream & | operator<< (raw_ostream &OS, const SDWAOperand &Operand) |
| #define DEBUG_TYPE "si-peephole-sdwa" |
Definition at line 31 of file SIPeepholeSDWA.cpp.
|
static |
Verify that Op is the same register as the operand of the SDWA instruction MI named by SrcOpName and that the SDWA selection SrcSelOpName can be combined with the OpSel.
Definition at line 512 of file SIPeepholeSDWA.cpp.
References assert(), combineSdwaSrcSel(), isSameReg(), MI, and TII.
Combine an SDWA source instruction's existing source selection Sel with the SDWA selection OperandSel of its operand.
If the selections are compatible, return the combined selection, otherwise return a nullopt. This applies to src_sel only. Extracting from an already extracted field is again a single field, but dst_sel writes a field and leaves the rest to dst_unused, so two of them do not fold into one. See SDWADstOperand::canCombineSelections. For example, if we have Sel = BYTE_0 Sel and OperandSel = WORD_1: BYTE_0 Sel (WORD_1 Sel (X)) -> BYTE_2 Sel (X)
Definition at line 317 of file SIPeepholeSDWA.cpp.
Referenced by canCombineOpSel().
|
static |
Definition at line 272 of file SIPeepholeSDWA.cpp.
References assert(), llvm::MachineOperand::getReg(), llvm::MachineOperand::getSubReg(), llvm::MachineOperand::isDead(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isUndef(), llvm::MachineOperand::isUse(), llvm::MachineOperand::setIsDead(), llvm::MachineOperand::setIsKill(), llvm::MachineOperand::setIsUndef(), llvm::MachineOperand::setReg(), and llvm::MachineOperand::setSubReg().
|
static |
Definition at line 299 of file SIPeepholeSDWA.cpp.
References llvm::MachineRegisterInfo::getOneDef(), and Reg.
|
static |
Definition at line 291 of file SIPeepholeSDWA.cpp.
References llvm::MachineRegisterInfo::getOneNonDBGUse(), and Reg.
|
static |
Definition at line 284 of file SIPeepholeSDWA.cpp.
Referenced by canCombineOpSel().
|
static |
Definition at line 239 of file SIPeepholeSDWA.cpp.
References llvm::AMDGPU::SDWA::UNUSED_PAD, llvm::AMDGPU::SDWA::UNUSED_PRESERVE, and llvm::AMDGPU::SDWA::UNUSED_SEXT.
|
static |
Definition at line 983 of file SIPeepholeSDWA.cpp.
|
static |
Definition at line 226 of file SIPeepholeSDWA.cpp.
References llvm::AMDGPU::SDWA::BYTE_0, llvm::AMDGPU::SDWA::BYTE_1, llvm::AMDGPU::SDWA::BYTE_2, llvm::AMDGPU::SDWA::BYTE_3, llvm::AMDGPU::SDWA::DWORD, llvm::AMDGPU::SDWA::WORD_0, and llvm::AMDGPU::SDWA::WORD_1.
| STATISTIC | ( | NumSDWAInstructionsPeepholed | , |
| "Number of instruction converted to SDWA." | ) |
| STATISTIC | ( | NumSDWAPatternsFound | , |
| "Number of SDWA patterns found." | ) |