Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Add lowering stubs for OpenMP/OpenACC declarative constructs
This patch provides the basic infrastructure for lowering declarative constructs for OpenMP and OpenACC. This is part of the upstreaming effort from the fir-dev branch in [1]. [1] https://github.com/flang-compiler/f18-llvm-project Reviewed By: kiranchandramohan, shraiysh, clementval Differential Revision: https://reviews.llvm.org/D124225
- Loading branch information
1 parent
c9a16e8
commit b6b8d34
Showing
12 changed files
with
146 additions
and
8 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
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,10 @@ | ||
! This test checks lowering of OpenACC declare Directive. | ||
|
||
// RUN: not flang-new -fc1 -emit-fir -fopenacc %s 2>&1 | FileCheck %s | ||
|
||
program main | ||
real, dimension(10) :: aa, bb | ||
|
||
// CHECK: not yet implemented: OpenACC Standalone Declarative construct | ||
!$acc declare present(aa, bb) | ||
end |
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 @@ | ||
! This test checks lowering of OpenACC routine Directive. | ||
|
||
// RUN: not flang-new -fc1 -emit-fir -fopenacc %s 2>&1 | FileCheck %s | ||
|
||
program main | ||
// CHECK: not yet implemented: OpenACC Routine construct not lowered yet! | ||
!$acc routine(sub) seq | ||
contains | ||
subroutine sub(a) | ||
real :: a(:) | ||
end | ||
end |
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,10 @@ | ||
! This test checks lowering of OpenMP allocate Directive. | ||
|
||
// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s | ||
|
||
program main | ||
integer :: x, y | ||
|
||
// CHECK: not yet implemented: OpenMPDeclarativeAllocate | ||
!$omp allocate(x, y) | ||
end |
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,10 @@ | ||
! This test checks lowering of OpenMP declare reduction Directive. | ||
|
||
// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s | ||
|
||
subroutine declare_red() | ||
integer :: my_var | ||
// CHECK: not yet implemented: OpenMPDeclareReductionConstruct | ||
!$omp declare reduction (my_red : integer : omp_out = omp_in) initializer (omp_priv = 0) | ||
my_var = 0 | ||
end subroutine declare_red |
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,11 @@ | ||
! This test checks lowering of OpenMP declare simd Directive. | ||
|
||
// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s | ||
|
||
subroutine sub(x, y) | ||
real, intent(inout) :: x, y | ||
|
||
// CHECK: not yet implemented: OpenMPDeclareSimdConstruct | ||
!$omp declare simd(sub) aligned(x) | ||
x = 3.14 + y | ||
end |
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 @@ | ||
! This test checks lowering of OpenMP declare target Directive. | ||
|
||
// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s | ||
|
||
module mod1 | ||
contains | ||
subroutine sub() | ||
integer :: x, y | ||
// CHECK: not yet implemented: OpenMPDeclareTargetConstruct | ||
!$omp declare target | ||
end | ||
end module |
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,10 @@ | ||
! This test checks lowering of OpenMP threadprivate Directive. | ||
|
||
// RUN: not flang-new -fc1 -emit-fir -fopenmp %s 2>&1 | FileCheck %s | ||
|
||
program main | ||
integer, save :: x, y | ||
|
||
// CHECK: not yet implemented: OpenMPThreadprivate | ||
!$omp threadprivate(x, y) | ||
end |