Skip to content

Commit df0ab0a

Browse files
rampitecstepthomas
andcommitted
[AMDGPU] Update GCNHazardRecognizer's understanding of gfx12 waitcount instructions
This simply updates the pass's cognizance of these instructions, and for the most part the hazards where they might be encountered do not exist for gfx12. Nonetheless, encountering them has to be checked for as doing so would indicate a compiler error. Co-authored-by: Stephen Thomas <[email protected]>
1 parent d9f7d86 commit df0ab0a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,16 @@ bool GCNHazardRecognizer::fixSMEMtoVectorWriteHazards(MachineInstr *MI) {
13571357
// DsCnt corresponds to LGKMCnt here.
13581358
return (Decoded.DsCnt == 0);
13591359
}
1360+
case AMDGPU::S_WAIT_STORECNT:
1361+
case AMDGPU::S_WAIT_STORECNT_DSCNT:
1362+
case AMDGPU::S_WAIT_LOADCNT:
1363+
case AMDGPU::S_WAIT_LOADCNT_DSCNT:
1364+
case AMDGPU::S_WAIT_SAMPLECNT:
1365+
case AMDGPU::S_WAIT_BVHCNT:
1366+
case AMDGPU::S_WAIT_DSCNT:
1367+
case AMDGPU::S_WAIT_EXPCNT:
1368+
case AMDGPU::S_WAIT_KMCNT:
1369+
llvm_unreachable("unexpected wait count instruction");
13601370
default:
13611371
// SOPP instructions cannot mitigate the hazard.
13621372
if (TII->isSOPP(MI))
@@ -2254,6 +2264,15 @@ int GCNHazardRecognizer::checkFPAtomicToDenormModeHazard(MachineInstr *MI) {
22542264
case AMDGPU::S_WAITCNT_EXPCNT:
22552265
case AMDGPU::S_WAITCNT_LGKMCNT:
22562266
case AMDGPU::S_WAIT_IDLE:
2267+
case AMDGPU::S_WAIT_LOADCNT:
2268+
case AMDGPU::S_WAIT_LOADCNT_DSCNT:
2269+
case AMDGPU::S_WAIT_SAMPLECNT:
2270+
case AMDGPU::S_WAIT_BVHCNT:
2271+
case AMDGPU::S_WAIT_STORECNT:
2272+
case AMDGPU::S_WAIT_STORECNT_DSCNT:
2273+
case AMDGPU::S_WAIT_EXPCNT:
2274+
case AMDGPU::S_WAIT_DSCNT:
2275+
case AMDGPU::S_WAIT_KMCNT:
22572276
return true;
22582277
default:
22592278
break;

0 commit comments

Comments
 (0)