forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Flang][OpenMP] Add lowering support for DISTRIBUTE SIMD (llvm#97819)
This patch adds support for lowering 'DISTRIBUTE SIMD' constructs to MLIR. Translation of `omp.distribute` operations to LLVM IR is still not supported, so its composition with `omp.simd` isn't either.
- Loading branch information
Showing
4 changed files
with
351 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
! This test checks lowering of OpenMP DISTRIBUTE SIMD composite constructs. | ||
|
||
! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s | ||
! RUN: %flang_fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s | ||
|
||
! CHECK-LABEL: func.func @_QPdistribute_simd_aligned( | ||
subroutine distribute_simd_aligned(A) | ||
use iso_c_binding | ||
type(c_ptr) :: A | ||
|
||
!$omp teams | ||
|
||
! CHECK: omp.distribute | ||
! CHECK-NOT: aligned({{.*}}) | ||
! CHECK-SAME: { | ||
! CHECK-NEXT: omp.simd | ||
! CHECK-SAME: aligned({{.*}}) | ||
!$omp distribute simd aligned(A) | ||
do index_ = 1, 10 | ||
call c_test_call(A) | ||
end do | ||
!$omp end distribute simd | ||
|
||
!$omp end teams | ||
end subroutine distribute_simd_aligned | ||
|
||
! CHECK-LABEL: func.func @_QPdistribute_simd_safelen( | ||
subroutine distribute_simd_safelen() | ||
!$omp teams | ||
|
||
! CHECK: omp.distribute | ||
! CHECK-NOT: safelen({{.*}}) | ||
! CHECK-SAME: { | ||
! CHECK-NEXT: omp.simd | ||
! CHECK-SAME: safelen({{.*}}) | ||
!$omp distribute simd safelen(4) | ||
do index_ = 1, 10 | ||
end do | ||
!$omp end distribute simd | ||
|
||
!$omp end teams | ||
end subroutine distribute_simd_safelen | ||
|
||
! CHECK-LABEL: func.func @_QPdistribute_simd_simdlen( | ||
subroutine distribute_simd_simdlen() | ||
!$omp teams | ||
|
||
! CHECK: omp.distribute | ||
! CHECK-NOT: simdlen({{.*}}) | ||
! CHECK-SAME: { | ||
! CHECK-NEXT: omp.simd | ||
! CHECK-SAME: simdlen({{.*}}) | ||
!$omp distribute simd simdlen(4) | ||
do index_ = 1, 10 | ||
end do | ||
!$omp end distribute simd | ||
|
||
!$omp end teams | ||
end subroutine distribute_simd_simdlen |
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
Oops, something went wrong.