-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang][openacc] Lower acc routine with function name
The routine directive can appear in the specification part of a subroutine, function or module and therefore appear before the function or subroutine is lowered. We keep track of the created routine info attribute and attach them to the function at the end of the lowering if the directive appeared before the function was lowered. Reviewed By: razvanlupusoru Differential Revision: https://reviews.llvm.org/D158204
- Loading branch information
1 parent
1f7d034
commit 69a6bd5
Showing
4 changed files
with
105 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
! This test checks lowering of OpenACC routine directive. | ||
|
||
! RUN: bbc -fopenacc -emit-fir %s -o - | FileCheck %s | ||
|
||
module acc_routines | ||
|
||
! CHECK: acc.routine @acc_routine_1 func(@_QMacc_routinesPacc2) | ||
! CHECK: acc.routine @acc_routine_0 func(@_QMacc_routinesPacc1) seq | ||
|
||
!$acc routine(acc1) seq | ||
|
||
contains | ||
|
||
subroutine acc1() | ||
end subroutine | ||
|
||
! CHECK-LABEL: func.func @_QMacc_routinesPacc1() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_0]>} | ||
|
||
subroutine acc2() | ||
!$acc routine(acc2) | ||
end subroutine | ||
|
||
! CHECK-LABEL: func.func @_QMacc_routinesPacc2() attributes {acc.routine_info = #acc.routine_info<[@acc_routine_1]>} | ||
|
||
end module |