[Flang][OpenMP][Lower] Program level implicit SAVE variable handling for declare...
authorAndrew Gozillon <Andrew.Gozillon@amd.com>
Thu, 13 Jul 2023 16:41:06 +0000 (11:41 -0500)
committerAndrew Gozillon <Andrew.Gozillon@amd.com>
Thu, 13 Jul 2023 17:07:21 +0000 (12:07 -0500)
commite909a2c1ca4d1f37a28293e6607136888ed889db
treee8999f5a34d0cf4db87615975dd4d14fec38c460
parentf648c9f71ee0cb619eac82b2bf5b5ca94c702555
[Flang][OpenMP][Lower] Program level implicit SAVE variable handling for declare target

This is an attempt at mimicing the method in which
threadprivate handles the following type of variables:

program main
  integer :: i
  !$omp declare target to(i)
end

Which essentially generates a GlobalOp for the variable (which
would normally only be an alloca) when it's instantiated. The
main difference is there is no operation generated within the
function, instead the declare target attribute is appended
later within handleDeclareTarget.

Reviewers: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D152037
flang/include/flang/Lower/OpenMP.h
flang/lib/Lower/Bridge.cpp
flang/lib/Lower/OpenMP.cpp
flang/test/Lower/OpenMP/omp-declare-target-program-var.f90 [new file with mode: 0644]