This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP]Add support for analysis of firstprivate variables.
ClosedPublic

Authored by ABataev on Jul 15 2019, 12:41 PM.

Details

Summary

Firstprivate variables are the variables, for which the private copies
must be created in the OpenMP regions and must be initialized with the
original values. Thus, we must report if the uninitialized variable is
used as firstprivate.

Diff Detail

Event Timeline

ABataev created this revision.Jul 15 2019, 12:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 15 2019, 12:41 PM
ABataev marked 2 inline comments as done.Jul 15 2019, 12:47 PM
ABataev added inline comments.
lib/Analysis/CFG.cpp
4749 ↗(On Diff #209934)

Had to create temp vector explicitly as the implicit one causes use-after-free effect.

test/Analysis/cfg-openmp.cpp
188–191

In task and target regions some of the variables might be implicit firstprivate just like in this case.

NoQ accepted this revision.Jul 19 2019, 3:08 PM
NoQ added inline comments.
include/clang/AST/OpenMPClause.h
2102–2103

So, basically, the first approximation is that all children are used?

test/Analysis/cfg-openmp.cpp
188–191

Aha, yup, i see, so we need to evaluate them again because we're after their lvalues so that to capture them by reference. I guess this kinda sorts out my questions.

This revision is now accepted and ready to land.Jul 19 2019, 3:08 PM
ABataev marked an inline comment as done.Jul 19 2019, 3:53 PM
ABataev added inline comments.
include/clang/AST/OpenMPClause.h
2102–2103

Yes, but only for some clauses.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2019, 6:51 AM