aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/ProgramTest.cpp
diff options
context:
space:
mode:
authorjeanPerier <jperier@nvidia.com>2025-03-05 11:24:04 +0100
committerGitHub <noreply@github.com>2025-03-05 11:24:04 +0100
commit7302e1b94edb2de459a72b3e452d4f3be2d795eb (patch)
tree32bcd93ea7a3444c757bbaa09190ace632b5e979 /llvm/unittests/Support/ProgramTest.cpp
parent59169036ca0e064612886713d609873f776e85db (diff)
downloadllvm-7302e1b94edb2de459a72b3e452d4f3be2d795eb.zip
llvm-7302e1b94edb2de459a72b3e452d4f3be2d795eb.tar.gz
llvm-7302e1b94edb2de459a72b3e452d4f3be2d795eb.tar.bz2
[flang] implement simple pointer assignments inside FORALL (#129522)
The semantic of pointer assignments inside FORALL requires evaluating the targets (RHS) and pointer variables (LHS) of all iterations before evaluating the assignments. In practice, if the compiler can prove that the RHS and LHS evaluations are not impacted by the assignments, the evaluation of the FORALL assignment statement can be done in a single loop. However, if the compiler cannot prove this, it needs to "save" the addresses of the targets and/or the pointer descriptors of each iterations before doing the assignments. This patch implements the most common cases where there is no lower bound spec, no bounds remapping, the LHS is not polymorphic, and the RHS is not NULL. The HLFIR operation used to represent assignments inside FORALL can be used for pointer assignments to (the only difference being that the LHS is a descriptor address). The analysis for intrinsic assignment can be reused, with the distinction that the RHS data is not read during the assignment. The logic that is used to save LHS in intrinsic assignments inside FORALL is extracted to be used for the RHS of pointer assignments when needed (saving a descriptor value). Pointer assignment LHS are just descriptor addresses and are saved as int_ptr values.
Diffstat (limited to 'llvm/unittests/Support/ProgramTest.cpp')
0 files changed, 0 insertions, 0 deletions