diff options
author | PeixinQiao <qiaopeixin@huawei.com> | 2021-09-03 09:37:58 +0800 |
---|---|---|
committer | PeixinQiao <qiaopeixin@huawei.com> | 2021-09-03 09:37:58 +0800 |
commit | a42380ce837994725dd9b22c35412e0f4bd52431 (patch) | |
tree | 25531770a1ad8640b5c84f13376bdc570bfb05db /clang/lib/CodeGen/CodeGenFunction.h | |
parent | 91eda9c30f33da6ec6da70b59a5f5da6c6397039 (diff) | |
download | llvm-a42380ce837994725dd9b22c35412e0f4bd52431.zip llvm-a42380ce837994725dd9b22c35412e0f4bd52431.tar.gz llvm-a42380ce837994725dd9b22c35412e0f4bd52431.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 1f05877..a27f4da 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -1775,6 +1775,24 @@ public: CGF.Builder.CreateBr(&FiniBB); } + static void EmitCaptureStmt(CodeGenFunction &CGF, InsertPointTy CodeGenIP, + llvm::BasicBlock &FiniBB, llvm::Function *Fn, + ArrayRef<llvm::Value *> Args) { + llvm::BasicBlock *CodeGenIPBB = CodeGenIP.getBlock(); + if (llvm::Instruction *CodeGenIPBBTI = CodeGenIPBB->getTerminator()) + CodeGenIPBBTI->eraseFromParent(); + + CGF.Builder.SetInsertPoint(CodeGenIPBB); + + if (Fn->doesNotThrow()) + CGF.EmitNounwindRuntimeCall(Fn, Args); + else + CGF.EmitRuntimeCall(Fn, Args); + + if (CGF.Builder.saveIP().isSet()) + CGF.Builder.CreateBr(&FiniBB); + } + /// RAII for preserving necessary info during Outlined region body codegen. class OutlinedRegionBodyRAII { |