This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP] Codegen for 'copyin' clause in 'parallel' directive.
ClosedPublic

Authored by ABataev on Apr 15 2015, 12:23 AM.

Details

Summary

Emits the following code for the clause at the beginning of the outlined function for implicit threads:

if (<not a master thread>) {
  ...
  <thread local copy of var> = <master thread local copy of var>;
  ...
}
<sync point>;

Checking for a non-master thread is performed by comparing of the address of the thread local variable with the address of the master's variable. Master thread always uses original variables, so you always know the address of the variable in the master thread.

Diff Detail

Event Timeline

ABataev updated this revision to Diff 23754.Apr 15 2015, 12:23 AM
ABataev retitled this revision from to [OPENMP] Codegen for 'copyin' clause in 'parallel' directive..
ABataev updated this object.
ABataev edited the test plan for this revision. (Show Details)
ABataev added a subscriber: Unknown Object (MLST).
rjmccall edited edge metadata.Apr 15 2015, 11:28 AM

LGTM.

include/clang/AST/OpenMPClause.h
1713

Just as for lastprivate, this should be a // comment within the class body.

This revision was automatically updated to reflect the committed changes.