Skip to content

Commit 0c92102

Browse files
committed
[AMDGPU] Rewrite GFX12 SGPR hazard handling to dedicated pass
- Algorithm operates over whole IR to attempt to minimize waits. - Add support for VALU->VALU SGPR hazards via VA_SDST/VA_VCC.
1 parent f3590c1 commit 0c92102

File tree

91 files changed

+2522
-2080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+2522
-2080
lines changed

llvm/lib/Target/AMDGPU/AMDGPU.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,9 @@ void initializeAMDGPUSetWavePriorityPass(PassRegistry &);
459459
void initializeGCNRewritePartialRegUsesPass(llvm::PassRegistry &);
460460
extern char &GCNRewritePartialRegUsesID;
461461

462+
void initializeAMDGPUWaitSGPRHazardsPass(PassRegistry &);
463+
extern char &AMDGPUWaitSGPRHazardsID;
464+
462465
namespace AMDGPU {
463466
enum TargetIndex {
464467
TI_CONSTDATA_START,

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTarget() {
540540
initializeGCNPreRALongBranchRegPass(*PR);
541541
initializeGCNRewritePartialRegUsesPass(*PR);
542542
initializeGCNRegPressurePrinterPass(*PR);
543+
initializeAMDGPUWaitSGPRHazardsPass(*PR);
543544
}
544545

545546
static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
@@ -1665,6 +1666,8 @@ void GCNPassConfig::addPreEmitPass() {
16651666
// cases.
16661667
addPass(&PostRAHazardRecognizerID);
16671668

1669+
addPass(&AMDGPUWaitSGPRHazardsID);
1670+
16681671
if (isPassEnabled(EnableInsertDelayAlu, CodeGenOptLevel::Less))
16691672
addPass(&AMDGPUInsertDelayAluID);
16701673

0 commit comments

Comments
 (0)