diff options
author | jeanPerier <jperier@nvidia.com> | 2024-10-23 12:34:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-23 12:34:13 +0200 |
commit | a59f7124349fc42e6aa8031796f310bb883d95de (patch) | |
tree | f2a0d68ca43a2fe05fb6ddca95d205606697856e /llvm/lib/CodeGen/CodeGen.cpp | |
parent | 03cef62fe53d9927865f2acbde438fc35377f16e (diff) | |
download | llvm-a59f7124349fc42e6aa8031796f310bb883d95de.zip llvm-a59f7124349fc42e6aa8031796f310bb883d95de.tar.gz llvm-a59f7124349fc42e6aa8031796f310bb883d95de.tar.bz2 |
[flang][hlfir] do not consider local temps as conflicting in assignment (#113330)
Last patch required to avoid creating a temporary for the LHS when
dealing with `x([a,b]) = y`.
The code dealing with "ordered assignments" (where, forall, user and
vector subscripted assignments) is saving the evaluated RHS/LHS and
masks if they have write effects because this write effects should not
be evaluated when they affect entities that may be written to in other
contexts after the evaluation and before the re-evaluation.
But when dealing with write to storage allocated in the region for the
expression being evluated, there is no problem to re-evaluate the write:
it has no effect outside of the expression evaluation that owns the
allocation.
In the case of `x([a,b]) = y`, the temporary is created for the vector
subscript. Raising the HLFIR abstraction for simple array constructors
may be a good idea, but local temps are created in other contexts, so
this fix is more generic.
Diffstat (limited to 'llvm/lib/CodeGen/CodeGen.cpp')
0 files changed, 0 insertions, 0 deletions