[flang-commits] [flang] [flang] Treat visible Cray pointer associations as aliasing for TBAA (PR #221350)
via flang-commits
flang-commits at lists.llvm.org
Wed Sep 16 08:47:46 PDT 2026
================
@@ -281,13 +281,14 @@ print *, target
end
```
-By default, optimizations assume that Cray pointers do not alias any other
-variables. In the above example, it is assumed that `handle` and `target` do
-not alias, and optimizations will treat them as separate entities.
+By default, optimizations assume that Cray pointers do not alias other
+variables unless the association is visible in the same procedure. In the
+above example, `ptr = loc(target)` causes accesses through `handle` and
+`target` to be treated as potentially aliasing.
----------------
junfengd-nv wrote:
Done. Visible ptr = loc(x) associations are marked TARGET during lowering, before locals are instantiated. The alloca gets fir.target and later FIR passes, not only TBAA
https://github.com/llvm/llvm-project/pull/221350
More information about the flang-commits
mailing list