Skip to content

[Attributor] - Cap accesses in AAPointerInfo #1807

Open
bhandarkar-pranav wants to merge 2 commits intoamd-stagingfrom
amd/dev/bhandarkar-pranav/cap_accesses_in_AAPointerInfo
Open

[Attributor] - Cap accesses in AAPointerInfo #1807
bhandarkar-pranav wants to merge 2 commits intoamd-stagingfrom
amd/dev/bhandarkar-pranav/cap_accesses_in_AAPointerInfo

Conversation

@bhandarkar-pranav
Copy link

No description provided.

Add cl::opt -attributor-max-pi-accesses=<N> (default 0 = unlimited) that
caps the number of accesses in a single AAPointerInfo instance. When
AccessList.size() reaches the threshold in addAccess(), the instance is
set to pessimistic fixpoint.

This prevents O(N²) scaling in LTO builds with many GPU kernels sharing
runtime globals. Global-level AAPointerInfoFloating instances (e.g.,
@TeamState) accumulate direct accesses from all kernels in a partition,
and every query iterates the full list. With N kernels, this creates
O(N) accesses × O(N) queries = O(N²) cost.

On a VASP reproducer (11 patterns, ~160 kernels):
  - No cap:   259s link time, 142s in forallInterferingAccesses
  - cap=512:   65s link time,   3.4s in forallInterferingAccesses
  - cap=128:   54s link time

No behavioral change when the flag is not set (default 0).
Tested: check-llvm (0 failures), check-flang (0 failures),
        GPU Fortran correctness suite (0 regressions).

Made-with: Cursor
@z1-cciauto
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants