|
LLVM 24.0.0git
|
#include "GCNVOPDUtils.h"#include "AMDGPUSubtarget.h"#include "GCNSubtarget.h"#include "SIInstrInfo.h"#include "Utils/AMDGPUBaseInfo.h"#include "llvm/ADT/SmallVector.h"#include "llvm/CodeGen/MachineBasicBlock.h"#include "llvm/CodeGen/MachineInstr.h"#include "llvm/CodeGen/MachineOperand.h"#include "llvm/CodeGen/MachineRegisterInfo.h"#include "llvm/CodeGen/MacroFusion.h"#include "llvm/CodeGen/ScheduleDAG.h"#include "llvm/CodeGen/ScheduleDAGMutation.h"#include "llvm/CodeGen/TargetInstrInfo.h"#include "llvm/MC/MCInst.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "gcn-vopd-utils" |
Functions | |
| static bool | isValidVOPDSrc (const SIInstrInfo &TII, int VOPDOpc, unsigned CompIdx, unsigned SrcIdx, Register PhysSrcReg) |
| static const MachineOperand & | getNamedOp (const MachineInstr &MI, AMDGPU::OpName Name) |
| static bool | canMapVOP3PToVOPD (const MachineInstr &MI) |
| static std::optional< VOPDMatchInfo > | tryMatchVOPDPairVariant (const SIInstrInfo &TII, unsigned EncodingFamily, MachineInstr &FirstMI, MachineInstr &SecondMI, bool IsVOPD3) |
| Core pair-eligibility check for a single VOPD encoding variant (VOPD or VOPD3). | |
| static bool | shouldScheduleVOPDAdjacent (const TargetInstrInfo &TII, const TargetSubtargetInfo &TSI, const MachineInstr *FirstMI, const MachineInstr &SecondMI, const SDep *) |
| Check if the instr pair, FirstMI and SecondMI, should be scheduled together. | |
| static void | collectLoads (SmallPtrSet< SUnit *, 8 > &Loads, BitVector &Visited, SUnit &Head, bool Forward, bool StopAtLoads) |
Collect all load (dependents if Forward else dependencies) that connect to the Head SU. | |
| static bool | loadsMayOverlap (SUnit &I, const SmallPtrSet< SUnit *, 8 > &ILoadSuccs, SUnit &J, BitVector &LoadPredsComputed, SmallVector< SmallPtrSet< SUnit *, 8 > > &LoadPredsCache, BitVector &Scratch) |
Checks whether fusing SU I with SU J would force the loads preceding J to complete before loads depending on I. | |
| #define DEBUG_TYPE "gcn-vopd-utils" |
Definition at line 33 of file GCNVOPDUtils.cpp.
|
static |
Definition at line 72 of file GCNVOPDUtils.cpp.
References llvm::getImm(), getNamedOp(), llvm::MachineOperand::getReg(), isReg(), MI, llvm::SISrcMods::OP_SEL_1, and Opc.
Referenced by llvm::checkVOPDRegConstraints().
|
static |
Collect all load (dependents if Forward else dependencies) that connect to the Head SU.
Visited should allocate enough bits for the number of SUnits, but its value can otherwise be uninitialized.
Definition at line 336 of file GCNVOPDUtils.cpp.
References llvm::SDep::Data, llvm::SUnit::getInstr(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::SUnit::isBoundaryNode(), llvm::SUnit::isInstr(), llvm::MachineInstr::mayLoad(), llvm::SUnit::NodeNum, llvm::SUnit::Preds, llvm::BitVector::reset(), llvm::BitVector::set(), llvm::SUnit::Succs, and llvm::BitVector::test().
Referenced by loadsMayOverlap().
|
static |
|
static |
Definition at line 38 of file GCNVOPDUtils.cpp.
References assert(), llvm_unreachable, and TII.
Referenced by llvm::checkVOPDRegConstraints().
|
static |
Checks whether fusing SU I with SU J would force the loads preceding J to complete before loads depending on I.
ILoadSuccs should hold all first load successors of I (via collectLoads with StopAtLoads=true). For set bits in LoadPredsComputed, the corresponding set in LoadPredsCache should hold all transitive load dependencies (via collectLoads with StopAtLoads=false). The Scratch bitvector should allocate enough bits for the number of SUnits.
Definition at line 374 of file GCNVOPDUtils.cpp.
References collectLoads(), llvm::SmallPtrSetImpl< PtrType >::contains(), llvm::dbgs(), llvm::SmallPtrSetImplBase::empty(), I, LLVM_DEBUG, llvm::SUnit::NodeNum, llvm::BitVector::set(), and llvm::BitVector::test().
|
static |
Check if the instr pair, FirstMI and SecondMI, should be scheduled together.
Given SecondMI, when FirstMI is unspecified, then check if SecondMI may be part of a fused pair at all.
Definition at line 296 of file GCNVOPDUtils.cpp.
References assert(), llvm::AMDGPU::getCanBeVOPD(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getParent(), llvm::SIInstrInfo::getSubtarget(), llvm::AMDGPU::getVOPDEncodingFamily(), TII, llvm::tryMatchVOPDPair(), llvm::AMDGPU::CanBeVOPD::X, and llvm::AMDGPU::CanBeVOPD::Y.
Referenced by llvm::createVOPDPairingMutation().
|
static |
Core pair-eligibility check for a single VOPD encoding variant (VOPD or VOPD3).
Returns the X/Y assignment on success, or std::nullopt otherwise.
Definition at line 239 of file GCNVOPDUtils.cpp.
References llvm::checkVOPDRegConstraints(), llvm::AMDGPU::getCanBeVOPD(), llvm::MachineInstr::getOpcode(), Opc, TII, llvm::AMDGPU::CanBeVOPD::X, and llvm::AMDGPU::CanBeVOPD::Y.
Referenced by llvm::tryMatchVOPDPair().