CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
97 lines
5.1 KiB
Fortran
97 lines
5.1 KiB
Fortran
! Test the Parse Tree to ensure the OpenMP Loop Transformation Constructs nest correctly with multiple nested loops.
|
|
|
|
! RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp -fopenmp-version=51 %s | FileCheck %s --check-prefix=CHECK-PARSE
|
|
! RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=51 %s | FileCheck %s --check-prefix=CHECK-UNPARSE
|
|
|
|
subroutine loop_transformation_construct
|
|
implicit none
|
|
integer :: I = 10
|
|
integer :: x
|
|
integer :: y(I)
|
|
|
|
!$omp do
|
|
!$omp unroll partial(1)
|
|
!$omp tile sizes(2)
|
|
do i = 1, I
|
|
y(i) = y(i) * 5
|
|
end do
|
|
!$omp end tile
|
|
!$omp end unroll
|
|
!$omp end do
|
|
end subroutine
|
|
|
|
!CHECK-PARSE: | ExecutionPart -> Block
|
|
!CHECK-PARSE-NEXT: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
|
|
!CHECK-PARSE-NEXT: | | | OmpBeginDirective
|
|
!CHECK-PARSE-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = do
|
|
!CHECK-PARSE-NEXT: | | | | OmpClauseList ->
|
|
!CHECK-PARSE-NEXT: | | | | Flags = {}
|
|
!CHECK-PARSE-NEXT: | | | Block
|
|
!CHECK-PARSE-NEXT: | | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
|
|
!CHECK-PARSE-NEXT: | | | | | OmpBeginDirective
|
|
!CHECK-PARSE-NEXT: | | | | | | OmpDirectiveName -> llvm::omp::Directive = unroll
|
|
!CHECK-PARSE-NEXT: | | | | | | OmpClauseList -> OmpClause -> Partial -> Scalar -> Integer -> Constant -> Expr = '1_4'
|
|
!CHECK-PARSE-NEXT: | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
|
|
!CHECK-PARSE-NEXT: | | | | | | Flags = {}
|
|
!CHECK-PARSE-NEXT: | | | | | Block
|
|
!CHECK-PARSE-NEXT: | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
|
|
!CHECK-PARSE-NEXT: | | | | | | | OmpBeginDirective
|
|
!CHECK-PARSE-NEXT: | | | | | | | | OmpDirectiveName -> llvm::omp::Directive = tile
|
|
!CHECK-PARSE-NEXT: | | | | | | | | OmpClauseList -> OmpClause -> Sizes -> Scalar -> Integer -> Expr = '2_4'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | LiteralConstant -> IntLiteralConstant = '2'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | Flags = {}
|
|
!CHECK-PARSE-NEXT: | | | | | | | Block
|
|
!CHECK-PARSE-NEXT: | | | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> DoConstruct
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | NonLabelDoStmt
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | LoopControl -> LoopBounds
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | Scalar -> Name = 'i'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | Scalar -> Expr = '1_4'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | Scalar -> Expr = 'i'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | | Designator -> DataRef -> Name = 'i'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | Block
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AssignmentStmt = 'y(__builtin_int(i,kind=8))=5_4*y(__builtin_int(i,kind=8))'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | Variable = 'y(__builtin_int(i,kind=8))'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | | Designator -> DataRef -> ArrayElement
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | | | DataRef -> Name = 'y'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | | | SectionSubscript -> Integer -> Expr = 'i'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | | | | Designator -> DataRef -> Name = 'i'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | Expr = '5_4*y(__builtin_int(i,kind=8))'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | | Multiply
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | | | Expr = 'y(__builtin_int(i,kind=8))'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | | | | Designator -> DataRef -> ArrayElement
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | | | | | DataRef -> Name = 'y'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | | | | | SectionSubscript -> Integer -> Expr = 'i'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | | | | | | Designator -> DataRef -> Name = 'i'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | | | Expr = '5_4'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | | | | | | LiteralConstant -> IntLiteralConstant = '5'
|
|
!CHECK-PARSE-NEXT: | | | | | | | | | EndDoStmt ->
|
|
!CHECK-PARSE-NEXT: | | | | | | | OmpEndDirective
|
|
!CHECK-PARSE-NEXT: | | | | | | | | OmpDirectiveName -> llvm::omp::Directive = tile
|
|
!CHECK-PARSE-NEXT: | | | | | | | | OmpClauseList ->
|
|
!CHECK-PARSE-NEXT: | | | | | | | | Flags = {}
|
|
!CHECK-PARSE-NEXT: | | | | | OmpEndDirective
|
|
!CHECK-PARSE-NEXT: | | | | | | OmpDirectiveName -> llvm::omp::Directive = unroll
|
|
!CHECK-PARSE-NEXT: | | | | | | OmpClauseList ->
|
|
!CHECK-PARSE-NEXT: | | | | | | Flags = {}
|
|
!CHECK-PARSE-NEXT: | | | OmpEndDirective
|
|
!CHECK-PARSE-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = do
|
|
!CHECK-PARSE-NEXT: | | | | OmpClauseList ->
|
|
!CHECK-PARSE-NEXT: | | | | Flags = {}
|
|
|
|
!CHECK-UNPARSE: SUBROUTINE loop_transformation_construct
|
|
!CHECK-UNPARSE-NEXT: IMPLICIT NONE
|
|
!CHECK-UNPARSE-NEXT: INTEGER :: i = 10_4
|
|
!CHECK-UNPARSE-NEXT: INTEGER x
|
|
!CHECK-UNPARSE-NEXT: INTEGER y(i)
|
|
!CHECK-UNPARSE-NEXT: !$OMP DO
|
|
!CHECK-UNPARSE-NEXT: !$OMP UNROLL PARTIAL(1_4)
|
|
!CHECK-UNPARSE-NEXT: !$OMP TILE
|
|
!CHECK-UNPARSE-NEXT: DO i=1_4,i
|
|
!CHECK-UNPARSE-NEXT: y(__builtin_int(i,kind=8))=5_4*y(__builtin_int(i,kind=8))
|
|
!CHECK-UNPARSE-NEXT: END DO
|
|
!CHECK-UNPARSE-NEXT: !$OMP END TILE
|
|
!CHECK-UNPARSE-NEXT: !$OMP END UNROLL
|
|
!CHECK-UNPARSE-NEXT: !$OMP END DO
|
|
!CHECK-UNPARSE-NEXT: END SUBROUTINE
|