-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
4 changed files
with
75 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
flang/test/Lower/OpenMP/omp-declare-target-program-var.f90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
!RUN: %flang_fc1 -emit-fir -fopenmp %s -o - | FileCheck %s | ||
!RUN: %flang_fc1 -emit-fir -fopenmp -fopenmp-is-target-device %s -o - | FileCheck %s | ||
|
||
PROGRAM main | ||
! CHECK-DAG: %0 = fir.alloca f32 {bindc_name = "i", uniq_name = "_QFEi"} | ||
REAL :: I | ||
! CHECK-DAG: fir.global internal @_QFEi {omp.declare_target = #omp.declaretarget<device_type = (any), capture_clause = (to)>} : f32 { | ||
! CHECK-DAG: %0 = fir.undefined f32 | ||
! CHECK-DAG: fir.has_value %0 : f32 | ||
! CHECK-DAG: } | ||
!$omp declare target(I) | ||
END |