aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.h
diff options
context:
space:
mode:
authorGiorgis Georgakoudis <georgakoudis1@llnl.gov>2021-06-15 10:30:12 -0700
committerGiorgis Georgakoudis <georgakoudis1@llnl.gov>2021-07-16 23:27:44 -0700
commite9c7291cb25f071f1a1dfa4049ed9f5a8a217b3e (patch)
treecbc6c46dd02f8440e3776c76b7fc492aafe5745e /clang/lib/CodeGen/CodeGenFunction.h
parent92430b4937911f935a45f6bd43d70cd5adb0fd51 (diff)
downloadllvm-e9c7291cb25f071f1a1dfa4049ed9f5a8a217b3e.zip
llvm-e9c7291cb25f071f1a1dfa4049ed9f5a8a217b3e.tar.gz
llvm-e9c7291cb25f071f1a1dfa4049ed9f5a8a217b3e.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 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 5e89681..75b6bf1 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -3283,8 +3283,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,