This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP] Codegen for 'firstprivate' clause in 'for' directive.
ClosedPublic

Authored by ABataev on Mar 27 2015, 6:00 AM.

Details

Summary

Adds proper codegen for 'firstprivate' clause in for directive. Initially codegen for 'firstprivate' clause was implemented for 'parallel' directive only.
Also this patch emits sync point only after initialization of firstprivate variables, not all private variables. This sync point is not required for privates, lastprivates etc., only for initialization of firstprivate variables.

Diff Detail

Event Timeline

ABataev updated this revision to Diff 22789.Mar 27 2015, 6:00 AM
ABataev retitled this revision from to [OPENMP] Codegen for 'firstprivate' clause in 'for' directive..
ABataev updated this object.
ABataev edited the test plan for this revision. (Show Details)
ABataev added a subscriber: Unknown Object (MLST).
ABataev updated this revision to Diff 23594.Apr 10 2015, 6:14 AM

Updated to latest changes in OpenMP API.

rjmccall added inline comments.Apr 10 2015, 10:49 AM
lib/CodeGen/CGOpenMPRuntime.cpp
168

It's probably worth leaving a comment here describing the valid situations in which this can fail.

lib/CodeGen/CGStmtOpenMP.cpp
159

This is the sort of place you should be using comments on arguments: something like /*refersToEnclosing*/ would be helpful here.

ABataev updated this revision to Diff 23719.Apr 14 2015, 2:15 AM

Updated after review

This revision was automatically updated to reflect the committed changes.