-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang][openacc] Add basic lowering for OpenACC declare construct in …
…module This patch adds the skeleton and the basic lowering for OpenACC declare construct when located in the module declaration. This patch just lower the create clause with or without modifier. Other clause and global descrutor lowering will come in follow up patches to keep this one small enough for review. Reviewed By: razvanlupusoru Differential Revision: https://reviews.llvm.org/D156266
- Loading branch information
1 parent
e5df048
commit c217ff8
Showing
5 changed files
with
167 additions
and
5 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
! This test checks lowering of OpenACC declare directive. | ||
|
||
! RUN: bbc -fopenacc -emit-fir %s -o - | FileCheck %s | ||
|
||
module acc_declare_test | ||
integer, parameter :: n = 100000 | ||
real, dimension(n) :: data1, data2 | ||
!$acc declare create(data1) create(zero: data2) | ||
end module | ||
|
||
! CHECK-LABEL: fir.global @_QMacc_declare_testEdata1 {acc.declare = #acc.declare<dataClause = acc_create>} : !fir.array<100000xf32> | ||
|
||
! CHECK-LABEL: acc.global_ctor @_QMacc_declare_testEdata1_acc_ctor { | ||
! CHECK: %[[GLOBAL_ADDR:.*]] = fir.address_of(@_QMacc_declare_testEdata1) {acc.declare = #acc.declare<dataClause = acc_create>} : !fir.ref<!fir.array<100000xf32>> | ||
! CHECK: %[[CREATE:.*]] = acc.create varPtr(%[[GLOBAL_ADDR]] : !fir.ref<!fir.array<100000xf32>>) -> !fir.ref<!fir.array<100000xf32>> {name = "data1"} | ||
! CHECK: acc.declare_enter dataOperands(%[[CREATE]] : !fir.ref<!fir.array<100000xf32>>) | ||
! CHECK: acc.terminator | ||
! CHECK: } | ||
|
||
! CHECK-LABEL: fir.global @_QMacc_declare_testEdata2 {acc.declare = #acc.declare<dataClause = acc_create_zero>} : !fir.array<100000xf32> | ||
|
||
! CHECK-LABEL: acc.global_ctor @_QMacc_declare_testEdata2_acc_ctor { | ||
! CHECK: %[[GLOBAL_ADDR:.*]] = fir.address_of(@_QMacc_declare_testEdata2) {acc.declare = #acc.declare<dataClause = acc_create_zero>} : !fir.ref<!fir.array<100000xf32>> | ||
! CHECK: %[[CREATE:.*]] = acc.create varPtr(%[[GLOBAL_ADDR]] : !fir.ref<!fir.array<100000xf32>>) -> !fir.ref<!fir.array<100000xf32>> {dataClause = #acc<data_clause acc_create_zero>, name = "data2"} | ||
! CHECK: acc.declare_enter dataOperands(%[[CREATE]] : !fir.ref<!fir.array<100000xf32>>) | ||
! CHECK: acc.terminator | ||
! CHECK: } |