aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorGiorgis Georgakoudis <georgakoudis1@llnl.gov>2021-09-20 17:12:14 -0700
committerGiorgis Georgakoudis <georgakoudis1@llnl.gov>2021-09-21 10:50:04 -0700
commit1d66649adf28d48ae1731516d87fb899426e3349 (patch)
tree1382d91112066e704b0cdef5453f68f2d5ad0f91 /clang/lib/CodeGen/CodeGenFunction.h
parent2af57b6099e1750c375cfc1321d1a5ef0a65c085 (diff)
downloadllvm-1d66649adf28d48ae1731516d87fb899426e3349.zip
llvm-1d66649adf28d48ae1731516d87fb899426e3349.tar.gz
llvm-1d66649adf28d48ae1731516d87fb899426e3349.tar.bz2
[OpenMP] Codegen aggregate for outlined function captures
Parallel regions are outlined as functions with capture variables explicitly generated as distinct parameters in the function's argument list. That complicates the fork_call interface in the OpenMP runtime: (1) the fork_call is variadic since there is a variable number of arguments to forward to the outlined function, (2) wrapping/unwrapping arguments happens in the OpenMP runtime, which is sub-optimal, has been a source of ABI bugs, and has a hardcoded limit (16) in the number of arguments, (3) forwarded arguments must cast to pointer types, which complicates debugging. This patch avoids those issues by aggregating captured arguments in a struct to pass to the fork_call. Reviewed By: jdoerfert, jhuber6 Differential Revision: https://reviews.llvm.org/D102107
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 6c13445..908ae52 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -3309,8 +3309,13 @@ public:
llvm::Function *EmitCapturedStmt(const CapturedStmt &S, CapturedRegionKind K);
llvm::Function *GenerateCapturedStmtFunction(const CapturedStmt &S);
Address GenerateCapturedStmtArgument(const CapturedStmt &S);
+ llvm::Function *
+ GenerateOpenMPCapturedStmtFunctionAggregate(const CapturedStmt &S,
+ SourceLocation Loc);
llvm::Function *GenerateOpenMPCapturedStmtFunction(const CapturedStmt &S,
SourceLocation Loc);
+ void GenerateOpenMPCapturedVarsAggregate(
+ const CapturedStmt &S, SmallVectorImpl<llvm::Value *> &CapturedVars);
void GenerateOpenMPCapturedVars(const CapturedStmt &S,
SmallVectorImpl<llvm::Value *> &CapturedVars);
void emitOMPSimpleStore(LValue LVal, RValue RVal, QualType RValTy,