Skip to content

Commit 3343485

Browse files
arsenmPravin Jagtap
authored andcommitted
AMDGPU: Handle gfx950 XDL-write-overlapped-smfma-src-c wait state change (llvm#117263)
These have an additional wait state compared to gfx940.
1 parent 75a39f8 commit 3343485

File tree

3 files changed

+107
-60
lines changed

3 files changed

+107
-60
lines changed

llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,12 +2228,14 @@ int GCNHazardRecognizer::checkMAIHazards908(MachineInstr *MI) {
22282228
}
22292229

22302230
static int
2231-
GFX940_XDL_N_PassWritesVGPROverlappedSMFMASrcCWaitStates(int NumPasses) {
2232-
// 2 pass -> 3
2233-
// 4 pass -> 5
2234-
// 8 pass -> 9
2235-
// 16 pass -> 17
2236-
return NumPasses + 1;
2231+
GFX940_XDL_N_PassWritesVGPROverlappedSMFMASrcCWaitStates(int NumPasses,
2232+
bool IsGFX950) {
2233+
// xdl def cycles | gfx940 | gfx950
2234+
// 2 pass | 3 4
2235+
// 4 pass | 5 6
2236+
// 8 pass | 9 10
2237+
// 16 pass | 17 18
2238+
return NumPasses + 1 + IsGFX950;
22372239
}
22382240

22392241
static int
@@ -2369,7 +2371,7 @@ int GCNHazardRecognizer::checkMAIHazards90A(MachineInstr *MI) {
23692371
NeedWaitStates =
23702372
isXDL(ST, *MI1)
23712373
? GFX940_XDL_N_PassWritesVGPROverlappedSMFMASrcCWaitStates(
2372-
NumPasses)
2374+
NumPasses, ST.hasGFX950Insts())
23732375
: GFX940_SMFMA_N_PassWritesVGPROverlappedSMFMASrcCWaitStates(
23742376
NumPasses);
23752377
break;

0 commit comments

Comments
 (0)