[all-commits] [llvm/llvm-project] 1710c8: [flang] Lowering changes for assigning dummy_scope...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Wed May 8 16:48:36 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1710c8cf0f8def4984893e9dd646579de5528d95
      https://github.com/llvm/llvm-project/commit/1710c8cf0f8def4984893e9dd646579de5528d95
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2024-05-08 (Wed, 08 May 2024)

  Changed paths:
    M flang/include/flang/Lower/AbstractConverter.h
    M flang/include/flang/Optimizer/Builder/HLFIRTools.h
    M flang/include/flang/Optimizer/HLFIR/HLFIROps.td
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Lower/ConvertArrayConstructor.cpp
    M flang/lib/Lower/ConvertExprToHLFIR.cpp
    M flang/lib/Lower/ConvertVariable.cpp
    M flang/lib/Lower/OpenACC.cpp
    M flang/lib/Lower/OpenMP/ClauseProcessor.cpp
    M flang/lib/Optimizer/Builder/HLFIRTools.cpp
    M flang/lib/Optimizer/Builder/TemporaryStorage.cpp
    M flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
    M flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp
    M flang/test/Fir/dispatch.f90
    M flang/test/HLFIR/assumed-type-actual-args.f90
    M flang/test/HLFIR/assumed_shape_with_value_keyword.f90
    M flang/test/HLFIR/boxchar_emboxing.f90
    M flang/test/HLFIR/c_ptr_byvalue.f90
    M flang/test/HLFIR/call_with_poly_dummy.f90
    M flang/test/HLFIR/optional_dummy.f90
    M flang/test/HLFIR/order_assignments/where-scheduling.f90
    M flang/test/Lower/CUDA/cuda-data-attribute.cuf
    M flang/test/Lower/HLFIR/actual_target_for_dummy_pointer.f90
    M flang/test/Lower/HLFIR/allocatable-and-pointer-status-change.f90
    M flang/test/Lower/HLFIR/allocatables-and-pointers.f90
    M flang/test/Lower/HLFIR/array-ctor-as-elemental-nested.f90
    M flang/test/Lower/HLFIR/array-ctor-as-elemental.f90
    M flang/test/Lower/HLFIR/array-ctor-as-inlined-temp.f90
    M flang/test/Lower/HLFIR/array-ctor-index.f90
    M flang/test/Lower/HLFIR/assignment-intrinsics.f90
    M flang/test/Lower/HLFIR/assumed-rank-iface-alloc-ptr.f90
    M flang/test/Lower/HLFIR/assumed-rank-iface.f90
    M flang/test/Lower/HLFIR/binary-ops.f90
    M flang/test/Lower/HLFIR/bindc-value-derived.f90
    M flang/test/Lower/HLFIR/call-sequence-associated-descriptors.f90
    M flang/test/Lower/HLFIR/calls-assumed-shape.f90
    M flang/test/Lower/HLFIR/calls-constant-expr-arg.f90
    M flang/test/Lower/HLFIR/calls-f77.f90
    M flang/test/Lower/HLFIR/calls-optional.f90
    M flang/test/Lower/HLFIR/calls-percent-val-ref.f90
    M flang/test/Lower/HLFIR/calls-poly-to-assumed-type.f90
    M flang/test/Lower/HLFIR/char_extremum.f03
    M flang/test/Lower/HLFIR/charconvert.f90
    M flang/test/Lower/HLFIR/convert-mbox-to-value.f90
    M flang/test/Lower/HLFIR/convert-variable-block.f90
    M flang/test/Lower/HLFIR/convert-variable.f90
    M flang/test/Lower/HLFIR/cray-pointers.f90
    M flang/test/Lower/HLFIR/custom-intrinsic.f90
    M flang/test/Lower/HLFIR/designators-component-ref.f90
    M flang/test/Lower/HLFIR/designators.f90
    M flang/test/Lower/HLFIR/dot_product.f90
    M flang/test/Lower/HLFIR/elemental-array-ops.f90
    M flang/test/Lower/HLFIR/elemental-polymorphic-merge.f90
    M flang/test/Lower/HLFIR/elemental-user-procedure-ref.f90
    M flang/test/Lower/HLFIR/expr-addr.f90
    M flang/test/Lower/HLFIR/expr-box.f90
    M flang/test/Lower/HLFIR/expr-value.f90
    M flang/test/Lower/HLFIR/ignore-rank-unlimited-polymorphic.f90
    M flang/test/Lower/HLFIR/implicit-type-conversion.f90
    M flang/test/Lower/HLFIR/intentout-allocatable-components.f90
    M flang/test/Lower/HLFIR/internal-procedures.f90
    M flang/test/Lower/HLFIR/intrinsic-dynamically-optional.f90
    M flang/test/Lower/HLFIR/issue80884.f90
    M flang/test/Lower/HLFIR/maxloc.f90
    M flang/test/Lower/HLFIR/minloc.f90
    M flang/test/Lower/HLFIR/procedure-pointer.f90
    M flang/test/Lower/HLFIR/statement-functions.f90
    M flang/test/Lower/HLFIR/structure-constructor.f90
    M flang/test/Lower/HLFIR/transformational.f90
    M flang/test/Lower/HLFIR/transpose.f90
    M flang/test/Lower/HLFIR/unary-ops.f90
    M flang/test/Lower/HLFIR/user-defined-assignment.f90
    M flang/test/Lower/HLFIR/vector-subscript-as-value.f90
    M flang/test/Lower/Intrinsics/associated-proc-pointers.f90
    M flang/test/Lower/Intrinsics/c_f_procpointer.f90
    M flang/test/Lower/Intrinsics/c_funloc-proc-pointers.f90
    M flang/test/Lower/Intrinsics/c_ptr_eq_ne.f90
    M flang/test/Lower/Intrinsics/execute_command_line-optional.f90
    M flang/test/Lower/Intrinsics/execute_command_line.f90
    M flang/test/Lower/Intrinsics/ieee_logb.f90
    M flang/test/Lower/Intrinsics/product.f90
    M flang/test/Lower/Intrinsics/signal.f90
    M flang/test/Lower/Intrinsics/sizeof.f90
    M flang/test/Lower/Intrinsics/sum.f90
    M flang/test/Lower/Intrinsics/system-optional.f90
    M flang/test/Lower/Intrinsics/system.f90
    M flang/test/Lower/OpenACC/acc-atomic-update-array.f90
    M flang/test/Lower/OpenACC/acc-bounds.f90
    M flang/test/Lower/OpenACC/acc-declare.f90
    M flang/test/Lower/OpenACC/acc-loop-exit.f90
    M flang/test/Lower/OpenACC/acc-private.f90
    M flang/test/Lower/OpenACC/acc-reduction.f90
    M flang/test/Lower/OpenMP/allocatable-array-bounds.f90
    M flang/test/Lower/OpenMP/array-bounds.f90
    M flang/test/Lower/OpenMP/flush.f90
    M flang/test/Lower/OpenMP/parallel-firstprivate-clause-scalar.f90
    M flang/test/Lower/OpenMP/parallel-lastprivate-clause-scalar.f90
    M flang/test/Lower/OpenMP/parallel-private-clause-fixes.f90
    M flang/test/Lower/OpenMP/parallel-private-clause-str.f90
    M flang/test/Lower/OpenMP/parallel-reduction3.f90
    M flang/test/Lower/OpenMP/parallel-wsloop-firstpriv.f90
    M flang/test/Lower/OpenMP/parallel-wsloop.f90
    M flang/test/Lower/OpenMP/sections.f90
    M flang/test/Lower/OpenMP/simd.f90
    M flang/test/Lower/OpenMP/single.f90
    M flang/test/Lower/OpenMP/target.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-array-assumed-shape.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-iand-byref.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-iand.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-ieor-byref.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-ieor.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-ior-byref.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-ior.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-logical-and-byref.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-logical-and.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-logical-eqv-byref.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-logical-eqv.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-logical-neqv-byref.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-logical-neqv.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-logical-or-byref.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-logical-or.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-max-byref.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-max-hlfir-byref.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-max-hlfir.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-max.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-min-byref.f90
    M flang/test/Lower/OpenMP/wsloop-reduction-min.f90
    M flang/test/Lower/allocatable-polymorphic.f90
    M flang/test/Lower/array-expression.f90
    M flang/test/Lower/character-substrings.f90
    M flang/test/Lower/charconvert.f90
    M flang/test/Lower/dispatch.f90
    M flang/test/Lower/do_loop.f90
    M flang/test/Lower/pointer-references.f90
    M flang/test/Lower/polymorphic.f90
    M flang/test/Lower/select-type.f90
    M flang/test/Lower/structure-constructors-alloc-comp.f90

  Log Message:
  -----------
  [flang] Lowering changes for assigning dummy_scope to hlfir.declare. (#90989)

The lowering produces fir.dummy_scope operation if the current
function has dummy arguments. Each hlfir.declare generated
for a dummy argument is then using the result of fir.dummy_scope
as its dummy_scope operand. This is only done for HLFIR.

I was not able to find a reliable way to identify dummy symbols
in `genDeclareSymbol`, so I added a set of registered dummy symbols
that is alive during the variables instantiation for the current
function. The set is initialized during the mapping of the dummy
argument symbols to their MLIR values. It is reset right after
all variables are instantiated - this is done to avoid generating
hlfir.declare operations with dummy_scope for the clones of
the dummy symbols (e.g. this happens with OpenMP privatization).

If this can be done in a cleaner way, please advise.



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