diff --git a/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp b/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp --- a/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp +++ b/llvm/lib/Target/AMDGPU/SIMemoryLegalizer.cpp @@ -898,6 +898,10 @@ const GCNSubtarget &STM = MBB.getParent()->getSubtarget(); + // Graphics environments never added a principled use of volatile vs. + // non-volatile, and the default MTYPE in buffer descriptors (MTYPE value 0) + // is NC_NV (non-coherent, non-volatile) on gfx8 (and maybe on gfx7, but not + // on gfx9), so a non-volatile wbinv is required. const unsigned InvalidateL1 = STM.isAmdPalOS() || STM.isMesa3DOS() ? AMDGPU::BUFFER_WBINVL1 : AMDGPU::BUFFER_WBINVL1_VOL;