Skip to content

Commit 85d8767

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 dba0861 commit 85d8767

File tree

87 files changed

+2467
-2071
lines changed

Some content is hidden

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

87 files changed

+2467
-2071
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
@@ -535,6 +535,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUTarget() {
535535
initializeGCNPreRALongBranchRegPass(*PR);
536536
initializeGCNRewritePartialRegUsesPass(*PR);
537537
initializeGCNRegPressurePrinterPass(*PR);
538+
initializeAMDGPUWaitSGPRHazardsPass(*PR);
538539
}
539540

540541
static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
@@ -1629,6 +1630,8 @@ void GCNPassConfig::addPreEmitPass() {
16291630
// cases.
16301631
addPass(&PostRAHazardRecognizerID);
16311632

1633+
addPass(&AMDGPUWaitSGPRHazardsID);
1634+
16321635
if (isPassEnabled(EnableInsertDelayAlu, CodeGenOptLevel::Less))
16331636
addPass(&AMDGPUInsertDelayAluID);
16341637

0 commit comments

Comments
 (0)