This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Capture global variables in target regions.
ClosedPublic

Authored by sfantao on Aug 21 2015, 8:07 PM.

Details

Summary

All global variables that are not enclosed in a declare target region must be captured in the target region as local variables do. Currently, there is no support for declare target, so this patch adds support for capturing all the global variables used in a the target region.

This patch requires http://reviews.llvm.org/D12871.

Diff Detail

Event Timeline

sfantao updated this revision to Diff 32895.Aug 21 2015, 8:07 PM
sfantao retitled this revision from to [OpenMP] Capture global variables in target regions..
sfantao updated this object.
sfantao added reviewers: ABataev, rjmccall, hfinkel.
sfantao added a subscriber: cfe-commits.
ABataev accepted this revision.Aug 28 2015, 6:12 AM
ABataev edited edge metadata.
This revision is now accepted and ready to land.Aug 28 2015, 6:12 AM
sfantao updated this revision to Diff 33712.Sep 1 2015, 11:04 AM
sfantao edited edge metadata.

Rebase on top of the last changes in http://reviews.llvm.org/D11361.

sfantao added inline comments.Sep 1 2015, 11:08 AM
lib/Sema/SemaOpenMP.cpp
707

Alexey, after rebasing this patch with the latest changes, I started having a regression related with how DSAStack->hasDirective works. In my understanding it requires that a valid scope exists in the stack, or alternatively that 2 or more entries exist in the stack. In some cases DSAStack->hasDirective was being called with only one entry causing the iterators in there not to work properly. The fix for that was adding DSAStack->getCurScope(). It seems to be a harmless change, but still wanted to make sure you agree with that.

Thanks!

sfantao updated this revision to Diff 34870.Sep 15 2015, 8:25 PM
sfantao updated this object.

Rebase with the last changes in http://reviews.llvm.org/D12871.

sfantao closed this revision.Oct 2 2015, 10:16 AM

Committed in r249154.

Thanks!
Samuel