[flang-commits] [flang] [flang] Restructured TBAA trees in AddAliasTags pass. (PR #136725)
Slava Zakharin via flang-commits
flang-commits at lists.llvm.org
Mon Apr 28 09:34:29 PDT 2025
vzakhari wrote:
> Thanks for this reorganization Slava. I'm worried about the "'Target' hole for dummy arguments" section of the [aliasing documentation](https://flang.llvm.org/docs/Aliasing.html#the-target-hole-for-dummy-arguments). If I understand correctly, a dummy argument which does not have the TARGET attribute could still be associated with an actual argument which does, and so it might alias with any variable with the POINTER attribute. So I think POINTER variables still need to be added as "any data".
Thank you for the review, Tom.
When a dummy argument does not have TARGET attribute and the underlying (sub)object is modified then it can be done only through referencing this dummy argument. If such a dummy argument is passed as an actual argument for associating it with the callee's dummy TARGET argument, then all the accesses to the callee's dummy argument will be attributed with TBAA having a different TBAA root (for the callee function), so the accesses within the callee and withing the caller will have disjoint TBAA that means MayAlias. So even if LLVM inlines the callee, I believe, the TBAA will be conservatively correct for such case.
https://github.com/llvm/llvm-project/pull/136725
More information about the flang-commits
mailing list