[all-commits] [llvm/llvm-project] f8843e: [flang][hlfir] Lower Cray pointee references. (#65...

Slava Zakharin via All-commits all-commits at lists.llvm.org
Thu Sep 7 11:41:35 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f8843efbb2190db85c696001ffd6211a2c20ac37
      https://github.com/llvm/llvm-project/commit/f8843efbb2190db85c696001ffd6211a2c20ac37
  Author: Slava Zakharin <szakharin at nvidia.com>
  Date:   2023-09-07 (Thu, 07 Sep 2023)

  Changed paths:
    M flang/include/flang/Lower/ConvertExpr.h
    M flang/include/flang/Lower/ConvertVariable.h
    A flang/include/flang/Optimizer/Builder/Runtime/Pointer.h
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Lower/ConvertExpr.cpp
    M flang/lib/Lower/ConvertExprToHLFIR.cpp
    M flang/lib/Lower/ConvertVariable.cpp
    M flang/lib/Optimizer/Builder/CMakeLists.txt
    A flang/lib/Optimizer/Builder/Runtime/Pointer.cpp
    A flang/test/Lower/HLFIR/cray-pointers.f90

  Log Message:
  -----------
  [flang][hlfir] Lower Cray pointee references. (#65563)

A Cray pointee reference must be done using the characteristics
(bounds, type params) of the original pointee declaration, but
using the actual address value of the associated Cray pointer.
There might be multiple Cray pointees associated with the same
Cray pointer.

The proposed solution is to lower each Cray pointee into a POINTER
variable with a descriptor. The descriptor is initialized at the point
of declaration of the pointee, though its base_addr is set to null.
Before each reference of the Cray pointee its descriptor's base_addr
is updated to the current value of the Cray pointer.

The update of the base_addr is done using PointerAssociateScalar
runtime call, which just updates the base_addr of the descriptor.
This is a temporary solution just to make Cray pointers work
to the same extent they work with FIR lowering.




More information about the All-commits mailing list