[all-commits] [llvm/llvm-project] 0446bf: [flang][hlfir] Codegen of hlfir.region_assign wher...
jeanPerier via All-commits
all-commits at lists.llvm.org
Fri Jun 30 00:21:44 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 0446bfcc5ca206701b511796ed1c8316daa2d169
https://github.com/llvm/llvm-project/commit/0446bfcc5ca206701b511796ed1c8316daa2d169
Author: Jean Perier <jperier at nvidia.com>
Date: 2023-06-30 (Fri, 30 Jun 2023)
Changed paths:
M flang/include/flang/Optimizer/Builder/Runtime/TemporaryStack.h
M flang/include/flang/Optimizer/Builder/TemporaryStorage.h
M flang/lib/Optimizer/Builder/Runtime/TemporaryStack.cpp
M flang/lib/Optimizer/Builder/TemporaryStorage.cpp
M flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIROrderedAssignments.cpp
A flang/test/HLFIR/order_assignments/lhs-conflicts-codegen.fir
Log Message:
-----------
[flang][hlfir] Codegen of hlfir.region_assign where LHS conflicts
When the analysis of hlfir.region_assign determined that the LHS region
evaluation may be impacted by the assignment effects, all LHS must be
fully evaluated and saved before any assignment is done.
This patch adds TemporaryStorage variants to save address, including
vector subscripted entities addresses whose shape must be saved.
It uses the DescriptorStack runtime to deal with complex cases inside
forall. For the sake of simplicity, this is also used for vector
subscripted LHS outside of foralls (each element address is saved as
a descriptor on this stack. This is a bit suboptimal, but it is a safe
start that will work with all kinds of type (polymorphic, PDTs...)
without further work). Another approach would be to saved only the
values that are conflicting in the LHS computation, but this would
require a much more complex analysis of the LHS region DAG.
Differential Revision: https://reviews.llvm.org/D154057
More information about the All-commits
mailing list