Skip to content

Commit cbff18b

Browse files
perlfudstutt
authored andcommitted
[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 counter. - Move all SGPR hazards on VCC to VA_VCC counter. Change-Id: I229d68d766ae5ba383843cd3958a0586740bee9b
1 parent 27c9777 commit cbff18b

File tree

102 files changed

+2403
-4270
lines changed

Some content is hidden

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

102 files changed

+2403
-4270
lines changed

llvm/lib/Target/AMDGPU/AMDGPU.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,9 @@ void initializeAMDGPUSetWavePriorityPass(PassRegistry &);
464464
void initializeGCNRewritePartialRegUsesPass(llvm::PassRegistry &);
465465
extern char &GCNRewritePartialRegUsesID;
466466

467+
void initializeAMDGPUWaitSGPRHazardsPass(PassRegistry &);
468+
extern char &AMDGPUWaitSGPRHazardsID;
469+
467470
namespace AMDGPU {
468471
enum TargetIndex {
469472
TI_CONSTDATA_START,

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTarget() {
531531
initializeGCNPreRALongBranchRegPass(*PR);
532532
initializeGCNRewritePartialRegUsesPass(*PR);
533533
initializeGCNRegPressurePrinterPass(*PR);
534+
initializeAMDGPUWaitSGPRHazardsPass(*PR);
534535
}
535536

536537
static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
@@ -1625,6 +1626,8 @@ void GCNPassConfig::addPreEmitPass() {
16251626
// cases.
16261627
addPass(&PostRAHazardRecognizerID);
16271628

1629+
addPass(&AMDGPUWaitSGPRHazardsID);
1630+
16281631
if (isPassEnabled(EnableInsertDelayAlu, CodeGenOptLevel::Less))
16291632
addPass(&AMDGPUInsertDelayAluID);
16301633

0 commit comments

Comments
 (0)