llvm-project
322af988 - [NFC][Attributor] Reach fixpoint in call site AACallEdges for direct calls (#237632)

Commit
8 days ago
[NFC][Attributor] Reach fixpoint in call site AACallEdges for direct calls (#237632) A direct call whose callee has no callback metadata only calls its callee, so its call site `AACallEdges` cannot change after initialization. Add the edge in initialize and reach a fixpoint there, instead of updating the attribute twice to find out. `AACallEdgesFunction` already skips the call site attribute for such calls since #232616; both now share `getOnlyCallee()`. Other attributes still create call site AACallEdges for direct calls, e.g., `AAInterFnReachability` and the AMDGPU attributor. On a generated module with 2,001 functions and 15,986 calls, this removes all updates of call site `AACallEdges`. The total number of updates goes from 304,263 to 272,291 with `-passes=attributor`, from 207,815 to 175,843 with `-passes=attributor-light`, and from 35,977 to 16,005 with `-passes=amdgpu-attributor`. The wall time does not change measurably on that module, because these updates are cheap. This PR was assisted by AI but I reviewed all the changes.
Author
Parents
Loading