[all-commits] [llvm/llvm-project] 7634a9: [flang][acc] Improve lowering of Fortran optional ...

Razvan Lupusoru via All-commits all-commits at lists.llvm.org
Wed Aug 7 08:04:28 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7634a96589637186b640a0441c0544a9868d9913
      https://github.com/llvm/llvm-project/commit/7634a96589637186b640a0441c0544a9868d9913
  Author: Razvan Lupusoru <razvan.lupusoru at gmail.com>
  Date:   2024-08-07 (Wed, 07 Aug 2024)

  Changed paths:
    M flang/lib/Lower/DirectivesCommon.h
    M flang/lib/Lower/OpenACC.cpp
    M flang/test/Lower/OpenACC/acc-bounds.f90

  Log Message:
  -----------
  [flang][acc] Improve lowering of Fortran optional in data clause (#102224)

Fortran optional arguments are effectively null references. To deal with
this possibility, flang lowering of OpenACC data clauses creates three
if-else regions when preparing the data pointer for the data clause:
1) Load box value from box reference
2) Load box addr from box value
3) Load box dims from box value

However, this pattern makes it more complicated to find the original box
reference. Effectively, the first if-else region to get the box value is
not needed - since the value can be loaded before the corresponding
`fir.box_addr` and `fir.box_dims` operations. Thus, reduce the number of
if-else regions by deferring the box load to the use sites.

For non-optional cases, the old functionality is left alone - which
preloads the box value.



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