This patch proposes the renaming of certain OpenMP dialect operations with the goal of improving readability and following a uniform naming convention for MLIR operations and associated classes. In particular, the following operations are renamed: - `omp.map_info` -> `omp.map.info` - `omp.target_update_data` -> `omp.target_update` - `omp.ordered_region` -> `omp.ordered.region` - `omp.cancellationpoint` -> `omp.cancellation_point` - `omp.bounds` -> `omp.map.bounds` - `omp.reduction.declare` -> `omp.declare_reduction` Also, the following MLIR operation classes have been renamed: - `omp::TaskLoopOp` -> `omp::TaskloopOp` - `omp::TaskGroupOp` -> `omp::TaskgroupOp` - `omp::DataBoundsOp` -> `omp::MapBoundsOp` - `omp::DataOp` -> `omp::TargetDataOp` - `omp::EnterDataOp` -> `omp::TargetEnterDataOp` - `omp::ExitDataOp` -> `omp::TargetExitDataOp` - `omp::UpdateDataOp` -> `omp::TargetUpdateOp` - `omp::ReductionDeclareOp` -> `omp::DeclareReductionOp` - `omp::WsLoopOp` -> `omp::WsloopOp`
41 lines
1.5 KiB
Fortran
41 lines
1.5 KiB
Fortran
! This test checks lowering of OpenMP ordered directive with threads Clause.
|
|
! Without clause in ordered direcitve, it behaves as if threads clause is
|
|
! specified.
|
|
|
|
!RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp %s -o - | FileCheck %s --check-prefix=FIRDialect
|
|
!RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp %s -o - | fir-opt --fir-to-llvm-ir | FileCheck %s --check-prefix=LLVMIRDialect
|
|
!RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp %s -o - | fir-opt --fir-to-llvm-ir | tco | FileCheck %s --check-prefix=LLVMIR
|
|
|
|
subroutine ordered
|
|
integer :: i
|
|
integer :: a(20)
|
|
|
|
!FIRDialect: omp.ordered.region {
|
|
!LLVMIRDialect: omp.ordered.region {
|
|
!LLVMIR: [[TMP0:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB0:[0-9]+]])
|
|
!LLVMIR-NEXT: call void @__kmpc_ordered(ptr @[[GLOB0]], i32 [[TMP0]])
|
|
!$OMP ORDERED
|
|
a(i) = a(i-1) + 1
|
|
!FIRDialect: omp.terminator
|
|
!FIRDialect-NEXT: }
|
|
!LLVMIRDialect: omp.terminator
|
|
!LLVMIRDialect-NEXT: }
|
|
!LLVMIR: call void @__kmpc_end_ordered(ptr @[[GLOB0]], i32 [[TMP0]])
|
|
!$OMP END ORDERED
|
|
|
|
!FIRDialect: omp.ordered.region {
|
|
!LLVMIRDialect: omp.ordered.region {
|
|
!LLVMIR: [[TMP1:%.*]] = call i32 @__kmpc_global_thread_num(ptr @[[GLOB1:[0-9]+]])
|
|
!LLVMIR-NEXT: call void @__kmpc_ordered(ptr @[[GLOB1]], i32 [[TMP1]])
|
|
!$OMP ORDERED THREADS
|
|
a(i) = a(i-1) + 1
|
|
!FIRDialect: omp.terminator
|
|
!FIRDialect-NEXT: }
|
|
!LLVMIRDialect: omp.terminator
|
|
!LLVMIRDialect-NEXT: }
|
|
!LLVMIR: call void @__kmpc_end_ordered(ptr @[[GLOB1]], i32 [[TMP1]])
|
|
!LLVMIR-NEXT: ret void
|
|
!$OMP END ORDERED
|
|
|
|
end
|