[all-commits] [llvm/llvm-project] 58f02e: [Flang][OpenMP] Properly bind arguments of composi...

Sergio Afonso via All-commits all-commits at lists.llvm.org
Thu Oct 31 07:38:59 PDT 2024


  Branch: refs/heads/users/skatrak/composite-blockargs-03-argsmapping
  Home:   https://github.com/llvm/llvm-project
  Commit: 58f02e5294f2b998e49d2f7f130dc97dc6545c34
      https://github.com/llvm/llvm-project/commit/58f02e5294f2b998e49d2f7f130dc97dc6545c34
  Author: Sergio Afonso <safonsof at amd.com>
  Date:   2024-10-31 (Thu, 31 Oct 2024)

  Changed paths:
    M flang/lib/Lower/OpenMP/OpenMP.cpp
    M mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
    M mlir/test/Target/LLVMIR/openmp-todo.mlir

  Log Message:
  -----------
  [Flang][OpenMP] Properly bind arguments of composite operations

When composite constructs are lowered, clauses for each leaf construct are
lowered before creating the set of loop wrapper operations, using these outside
values to populate their operand lists. Then, when the loop nest associated to
that composite construct is lowered, the binding of Fortran symbols to the
entry block arguments defined by these loop wrappers is performed, resulting in
the creation of `hlfir.declare` operations in the entry block of the
`omp.loop_nest`.

This approach prevents `hlfir.declare` operations related to the binding and
other operations resulting from the evaluation of the clauses from being
inserted between loop wrapper operations, which would be an illegal MLIR
representation. However, this introduces the problem of entry block arguments
defined by a wrapper that then should be used by one of its nested wrappers,
because the corresponding Fortran symbol would still be mapped to an outside
value at the time of gathering the list of operands for the nested wrapper.

This patch adds operand re-mapping logic to update wrappers without changing
when clauses are evaluated or where the `hlfir.declare` creation is performed.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list