diff --git a/llvm/lib/Target/AMDGPU/AMDGPUPerfHintAnalysis.cpp b/llvm/lib/Target/AMDGPU/AMDGPUPerfHintAnalysis.cpp --- a/llvm/lib/Target/AMDGPU/AMDGPUPerfHintAnalysis.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUPerfHintAnalysis.cpp @@ -333,6 +333,10 @@ // Do not treat local-addr memory access as large stride. if (isLocalAddr(MO)) return MAI; + // Do not treat constant-addr memory access as large stride because K$ + // behavior is very different from L0$. + if (isConstantAddr(MO)) + return MAI; MAI.V = MO; MAI.Base = GetPointerBaseWithConstantOffset(MO, MAI.Offset, *DL);