|
LLVM 23.0.0git
|
#include "GCNHazardRecognizer.h"#include "GCNSubtarget.h"#include "MCTargetDesc/AMDGPUMCTargetDesc.h"#include "SIMachineFunctionInfo.h"#include "llvm/ADT/Statistic.h"#include "llvm/CodeGen/MachineFrameInfo.h"#include "llvm/CodeGen/MachineFunction.h"#include "llvm/CodeGen/MachineInstrBuilder.h"#include "llvm/CodeGen/ScheduleDAG.h"#include "llvm/Support/Debug.h"#include "llvm/TargetParser/TargetParser.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "gcn-hazard-recognizer" |
Enumerations | |
| enum | HazardFnResult { HazardFound , HazardExpired , NoHazardFound } |
Variables | |
| static cl::opt< unsigned, false, MFMAPaddingRatioParser > | MFMAPaddingRatio ("amdgpu-mfma-padding-ratio", cl::init(0), cl::Hidden, cl::desc("Fill a percentage of the latency between " "neighboring MFMA with s_nops.")) |
| static cl::opt< unsigned > | NopPadding ("amdgpu-snop-padding", cl::init(0), cl::Hidden, cl::desc("Insert a s_nop x before every instruction")) |
| static cl::opt< bool > | EnableWMMAVnopHoisting ("amdgpu-wmma-vnop-hoisting", cl::init(true), cl::Hidden, cl::desc("Hoist WMMA hazard V_NOPs from loops to preheaders")) |
| #define DEBUG_TYPE "gcn-hazard-recognizer" |
Definition at line 27 of file GCNHazardRecognizer.cpp.
| enum HazardFnResult |
| Enumerator | |
|---|---|
| HazardFound | |
| HazardExpired | |
| NoHazardFound | |
Definition at line 459 of file GCNHazardRecognizer.cpp.
|
static |
Definition at line 680 of file GCNHazardRecognizer.cpp.
References AbstractManglingParser< Derived, Alloc >::Ops, addRegUnits(), and TRI.
|
static |
Definition at line 674 of file GCNHazardRecognizer.cpp.
References Reg, llvm::BitVector::set(), and TRI.
Referenced by addRegsToSet().
|
static |
Definition at line 693 of file GCNHazardRecognizer.cpp.
References llvm::SIInstrInfo::isSMRD(), and MI.
|
static |
Definition at line 697 of file GCNHazardRecognizer.cpp.
References llvm::SIInstrInfo::isVMEM(), and MI.
|
static |
Checks whether the provided MI "consumes" the operand with a Dest sel fowarding issue Dst .
We may "consume" the Dst via a standard explicit RAW, or through irregular ways (e.g implicit RAW, certain types of WAW)
Definition at line 1023 of file GCNHazardRecognizer.cpp.
References TRI.
|
static |
Definition at line 3637 of file GCNHazardRecognizer.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::MachineBasicBlock::end(), llvm::MachineFunction::front(), and TII.
|
static |
Dest sel forwarding issue occurs if additional logic is needed to swizzle / pack the computed value into correct bit position of the dest register.
This occurs if we have SDWA with dst_sel != DWORD or if we have op_sel with dst_sel that is not aligned to the register. This function analayzes the MI and
Definition at line 977 of file GCNHazardRecognizer.cpp.
References llvm::SISrcMods::DST_OP_SEL, llvm::AMDGPU::SDWA::DWORD, llvm::AMDGPU::FP4, llvm::AMDGPU::FP8, llvm::AMDGPU::getFPDstSelType(), llvm::AMDGPU::hasNamedOperand(), llvm::SIInstrInfo::isSDWA(), llvm::SIInstrInfo::isVALU(), MI, llvm::SISrcMods::OP_SEL_0, and TII.
|
static |
Definition at line 183 of file GCNHazardRecognizer.cpp.
References llvm::AMDGPU::EncodingFields< HwregId, HwregOffset, HwregSize >::decode(), llvm::MachineOperand::getImm(), and TII.
|
static |
Definition at line 568 of file GCNHazardRecognizer.cpp.
References E(), llvm::SIInstrInfo::getNumWaitStates(), getWaitStatesSince(), I, llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), and MBB.
Referenced by getWaitStatesSince(), and getWaitStatesSince().
|
static |
Definition at line 607 of file GCNHazardRecognizer.cpp.
References llvm::SIInstrInfo::getNumWaitStates(), getWaitStatesSince(), and MI.
|
static |
Definition at line 2684 of file GCNHazardRecognizer.cpp.
|
static |
Definition at line 2693 of file GCNHazardRecognizer.cpp.
|
static |
Definition at line 3031 of file GCNHazardRecognizer.cpp.
|
static |
Definition at line 3003 of file GCNHazardRecognizer.cpp.
|
static |
Definition at line 2673 of file GCNHazardRecognizer.cpp.
|
static |
Definition at line 2701 of file GCNHazardRecognizer.cpp.
|
static |
Definition at line 2662 of file GCNHazardRecognizer.cpp.
|
static |
Definition at line 3021 of file GCNHazardRecognizer.cpp.
|
static |
Definition at line 3011 of file GCNHazardRecognizer.cpp.
|
static |
Definition at line 464 of file GCNHazardRecognizer.cpp.
References E(), llvm::SmallVectorImpl< T >::emplace_back(), HazardExpired, HazardFound, I, llvm::InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key, llvm::SetVector< T, Vector, Set, N >::insert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert_as(), isEqual(), LHS, MBB, RHS, llvm::SetVector< T, Vector, Set, N >::size(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
|
static |
Definition at line 270 of file GCNHazardRecognizer.cpp.
References llvm::MachineInstrBuilder::addImm(), llvm::BuildMI(), MI, and TII.
|
static |
Definition at line 2041 of file GCNHazardRecognizer.cpp.
References llvm::SIInstrInfo::isSWMMAC(), llvm::SIInstrInfo::isTRANS(), llvm::SIInstrInfo::isVALU(), llvm::SIInstrInfo::isWMMA(), and MI.
Definition at line 95 of file GCNHazardRecognizer.cpp.
Referenced by llvm::GCNHazardRecognizer::getHazardType(), and llvm::GCNHazardRecognizer::PreEmitNoopsCommon().
|
static |
Definition at line 178 of file GCNHazardRecognizer.cpp.
References llvm::SIInstrInfo::isFLAT(), llvm::SIInstrInfo::isMUBUF(), llvm::SIInstrInfo::isVALU(), and MI.
Referenced by llvm::GCNHazardRecognizer::getHazardType(), and llvm::GCNHazardRecognizer::PreEmitNoopsCommon().
|
static |
Definition at line 160 of file GCNHazardRecognizer.cpp.
References MI.
Referenced by llvm::GCNHazardRecognizer::PreEmitNoopsCommon().
Definition at line 118 of file GCNHazardRecognizer.cpp.
Referenced by llvm::GCNHazardRecognizer::getHazardType(), and llvm::GCNHazardRecognizer::PreEmitNoopsCommon().
Definition at line 114 of file GCNHazardRecognizer.cpp.
Referenced by llvm::GCNHazardRecognizer::getHazardType(), and llvm::GCNHazardRecognizer::PreEmitNoopsCommon().
|
static |
Definition at line 134 of file GCNHazardRecognizer.cpp.
Referenced by llvm::GCNHazardRecognizer::getHazardType(), and llvm::GCNHazardRecognizer::PreEmitNoopsCommon().
Definition at line 99 of file GCNHazardRecognizer.cpp.
Referenced by llvm::GCNHazardRecognizer::getHazardType(), and llvm::GCNHazardRecognizer::PreEmitNoopsCommon().
Definition at line 122 of file GCNHazardRecognizer.cpp.
Referenced by llvm::GCNHazardRecognizer::getHazardType(), and llvm::GCNHazardRecognizer::PreEmitNoopsCommon().
Definition at line 103 of file GCNHazardRecognizer.cpp.
Referenced by llvm::GCNHazardRecognizer::getHazardType(), and llvm::GCNHazardRecognizer::PreEmitNoopsCommon().
|
static |
Definition at line 1553 of file GCNHazardRecognizer.cpp.
References I.
|
static |
Definition at line 1313 of file GCNHazardRecognizer.cpp.
|
static |
Definition at line 2046 of file GCNHazardRecognizer.cpp.
References assert(), llvm::SIInstrInfo::isSWMMAC(), llvm::SIInstrInfo::isWMMA(), llvm::Latency, MI, and TII.
|
static |
Definition at line 1533 of file GCNHazardRecognizer.cpp.
References llvm::SIInstrInfo::isDS(), llvm::SIInstrInfo::isLDSDMA(), llvm::SIInstrInfo::isVMEM(), MBB, and MI.
Referenced by llvm::GCNHazardRecognizer::GCNHazardRecognizer().
| STATISTIC | ( | NumWMMAHoistingBailed | , |
| "Number of WMMA hazards where V_NOP hoisting was not possible" | ) |
| STATISTIC | ( | NumWMMANopsHoisted | , |
| "Number of WMMA hazard V_NOPs hoisted from loops" | ) |
|
static |
Definition at line 3361 of file GCNHazardRecognizer.cpp.
References assert(), llvm::MachineBasicBlock::end(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getParent(), I, and llvm::MachineInstr::isBundled().
|
static |
|
static |
|
static |
Referenced by llvm::GCNHazardRecognizer::PreEmitNoops().