aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorSlava Zakharin <szakharin@nvidia.com>2025-04-29 10:17:11 -0700
committerGitHub <noreply@github.com>2025-04-29 10:17:11 -0700
commit82c036e2de4eba0e286a94c9b3240e4b14d8aee4 (patch)
treeda7ce11c8fad9d646243dda44fa57a6f9a8d4366 /clang/lib/Frontend/CompilerInstance.cpp
parent5cec6f6f2d0a9abb53af9d663a60fe56736fc2ac (diff)
downloadllvm-82c036e2de4eba0e286a94c9b3240e4b14d8aee4.zip
llvm-82c036e2de4eba0e286a94c9b3240e4b14d8aee4.tar.gz
llvm-82c036e2de4eba0e286a94c9b3240e4b14d8aee4.tar.bz2
[flang] Restructured TBAA trees in AddAliasTags pass. (#136725)
This patch produces the following TBAA tree for a function: ``` Function root | "any access" | |- "descriptor member" |- "any data access" | |- "dummy arg data" |- "target data" | |- "allocated data" |- "direct data" |- "global data" ``` The TBAA tags are assigned using the following logic: * All POINTER variables point to the root of "target data". * Dummy arguments without POINTER/TARGET point to their leafs under "dummy arg data". * Dummy arguments with TARGET point to the root of "target data". * Global variables without descriptors point to their leafs under "global data" (including the ones with TARGET). * Global variables with descriptors point to their leafs under "direct data" (including the ones with TARGET). * Locally allocated variables point to their leafs under "allocated data" (including the ones with TARGET). This change makes it possible to disambiguate globals like: ``` module data real, allocatable :: a(:) real, allocatable, target :: b(:) end ``` Indeed, two direct references to global vars cannot alias even if any/both of them have TARGET attribute. In addition, the dummy arguments without POINTER/TARGET cannot alias any other variable even with POINTER/TARGET. This was not expressed in TBAA before this change. As before, any "unknown" memory references (such as with Indirect source, as classified by FIR alias analysis) may alias with anything, as long as they point to the root of "any access". Please think of the counterexamples for which this structure may not work.
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
0 files changed, 0 insertions, 0 deletions