Previously any load (global, local or constant) feeding into a
global load or store would be counted as an indirect access. This
patch only counts global loads feeding into a global load or store.
The rationale is that the latency for global loads is generally
much larger than the other kinds.
As a side effect this makes it easier to write small kernels test
cases that are not counted as having indirect accesses, despite
the fact that arguments to the kernel are accessed with an SMEM
load.
Differential Revision: https://reviews.llvm.org/D122804
if (auto LD = dyn_cast<LoadInst>(V)) {
auto M = LD->getPointerOperand();
- if (isGlobalAddr(M) || isLocalAddr(M) || isConstantAddr(M)) {
+ if (isGlobalAddr(M)) {
LLVM_DEBUG(dbgs() << " is IA\n");
return true;
}
ret void
}
-; FIXME: This test was intended to be WaveLimiterHint : 0
; GCN-LABEL: {{^}}test_indirect_through_phi:
; GCN: MemoryBound: 0
-; GCN: WaveLimiterHint : 1
+; GCN: WaveLimiterHint : 0
define amdgpu_kernel void @test_indirect_through_phi(float addrspace(1)* %arg) {
bb:
%load = load float, float addrspace(1)* %arg, align 8
; SI-MINREG: NumSgprs: {{[1-9]$}}
; SI-MINREG: NumVgprs: {{[1-9]$}}
-; SI-MAXOCC: NumSgprs: {{[0-4][0-9]$}}
-; SI-MAXOCC: NumVgprs: {{[0-4][0-9]$}}
+; SI-MAXOCC: NumSgprs: {{[1-4]?[0-9]$}}
+; SI-MAXOCC: NumVgprs: {{[1-4]?[0-9]$}}
; stores may alias loads
; VI: NumSgprs: {{[0-9]$}}