If a variable is implicitly mapped (doesn't show in a map clause), the runtime library has to be informed if the corresponding capture shows up in first-private clause, so that the storage previously allocated in the device is used. This patch adds the support for that.
Details
- Reviewers
kkwli0 arpith-jacob carlo.bertolli ABataev hfinkel - Commits
- rGd486f84c579d: [OpenMP] Add support for the 'private pointer' flag to signal variables…
rC270870: [OpenMP] Add support for the 'private pointer' flag to signal variables…
rL270870: [OpenMP] Add support for the 'private pointer' flag to signal variables…
Diff Detail
Event Timeline
- Move the flags adjustment for first private declarations to the mappable expressions handler.
Hi Alexey,
Thanks for the review!
lib/CodeGen/CGOpenMPRuntime.cpp | ||
---|---|---|
5609 | Ok, I'm now saving the extracted first private info in the mappable expression handler so it can be reused for different captures. | |
5615 | The directives with target only take firstprivate or private. So, we disregard lastprivate in this code. |
Please, update to latest revision. I made some changes in firstprivates that may affect your patch. Will review it after it.
lib/CodeGen/CGOpenMPRuntime.cpp | ||
---|---|---|
5651–5652 | Maybe it is better to join all this code into a single function? |
Hi Alexey,
Thanks for the review!
lib/CodeGen/CGOpenMPRuntime.cpp | ||
---|---|---|
5651–5652 | I agree. Moved all the default map information generation to a new function in the mappable expressions handler. |
I think this is too greedy. You're rescanning list of firstprivates clauses/variables for each variable.