[PATCH] D92189: [OpenMPIRBuilder] forward arguments as pointers to outlined function

Alex Zinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 26 09:33:05 PST 2020

ftynse created this revision.
ftynse added reviewers: jdoerfert, Meinersbur, llitchev.
Herald added subscribers: llvm-commits, guansong, hiraditya, yaxunl.
Herald added a project: LLVM.
ftynse requested review of this revision.
Herald added a subscriber: sstefan1.

OpenMPIRBuilder::createParallel outlines the body region of the parallel
construct into a new function that accepts any value previously defined outside
the region as a function argument. This function is called back by OpenMP
runtime function __kmpc_fork_call, which expects trailing arguments to be
pointers. If the region uses a value that is not of a pointer type, e.g. a
struct, the produced code would be invalid. In such cases, make createParallel
emit IR that stores the value on stack and pass the pointer to the outlined
function instead. The outlined function then loads the value back and uses as

  rG LLVM Github Monorepo



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92189.307899.patch
Type: text/x-patch
Size: 6590 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201126/eac49075/attachment.bin>

More information about the llvm-commits mailing list