[OMPIRBuilder] Add ordered directive to OMPBuilder
authorPeixinQiao <qiaopeixin@huawei.com>
Fri, 3 Sep 2021 01:37:58 +0000 (09:37 +0800)
committerPeixinQiao <qiaopeixin@huawei.com>
Fri, 3 Sep 2021 01:37:58 +0000 (09:37 +0800)
commita42380ce837994725dd9b22c35412e0f4bd52431
tree25531770a1ad8640b5c84f13376bdc570bfb05db
parent91eda9c30f33da6ec6da70b59a5f5da6c6397039
[OMPIRBuilder] Add ordered directive to OMPBuilder

Add support for ordered directive in the OpenMPIRBuilder.

This patch also modidies clang to use the ordered directive when the
option -fopenmp-enable-irbuilder is enabled.

Also fix one ICE when parsing one canonical for loop with the relational
operator LE or GE in openmp region by replacing unary increment
operation of the expression of the variable "Expr A" minus the variable
"Expr B" (++(Expr A - Expr B)) with binary addition operation of the
experssion of the variable "Expr A" minus the variable "Expr B" and the
expression with constant value "1" (Expr A - Expr B + "1").

Reviewed By: Meinersbur, kiranchandramohan

Differential Revision: https://reviews.llvm.org/D107430
clang/lib/CodeGen/CGStmtOpenMP.cpp
clang/lib/CodeGen/CodeGenFunction.h
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/ordered_codegen.cpp
clang/test/OpenMP/ordered_doacross_codegen.c
clang/test/OpenMP/ordered_doacross_codegen.cpp
llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp