[all-commits] [llvm/llvm-project] e52a6d: [flang][hlfir] avoid useless LHS temporaries insid...

jeanPerier via All-commits all-commits at lists.llvm.org
Wed Jul 5 05:27:30 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e52a6d7784adbcb98b17af7943c69c854aa7b10f
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2023-07-05 (Wed, 05 Jul 2023)

  Changed paths:
    M flang/lib/Optimizer/HLFIR/Transforms/ScheduleOrderedAssignments.cpp
    M flang/test/HLFIR/order_assignments/where-scheduling.f90

  Log Message:
  [flang][hlfir] avoid useless LHS temporaries inside WHERE

The need to save LHS addresses on a stack before doing an assignment
is very limited: it is only really needed for forall and vectore
subscripted LHS where the LHS cannot be computed as a descriptor.

The previous current WHERE codegen was creating address stacks for
LHS element addresses when the LHS evaluation conflicts with the
assignment (may depend on the LHS value). This is not needed
since the computed array designator for the LHS is already "saved"
before the assignment from an SSA point of view.

This patch prevents LHS temporary stack from being created outside
of forall and vector subscripted assignments.

Differential Revision: https://reviews.llvm.org/D154418

More information about the All-commits mailing list