Jin Huang ce2518f59d
[AA] Improve precision for monotonic atomic load/store operations (#158169)
Refines `getModRefInfo` for `Monotonic` and `Unordered` atomic
operations to perform a full alias evaluation instead of conservatively
returning `ModRef`.

This allows AA to return more precise results (e.g., `NoModRef`),
unblocking optimizations in passes like DSE/PRE when the pointers are
proven not to alias.

LIT testing: 
1. Fixed the `XFAIL` test `@test9` in `DSE/atomic-todo.ll`, where the
improved AA now allows DSE to correctly remove a dead store.
2. Added test `@test9a` to the same file to ensure DSE is still blocked
when pointers may alias.
3. I am also reviewing tests in GVN/PRE to see where this change may be
beneficial. While all existing tests pass, I will update this PR with
any new GVN test cases in a follow-up commit.

---------

Co-authored-by: Jin Huang <jingold@google.com>
2025-12-05 15:59:49 -08:00
..