This is an archive of the discontinued LLVM Phabricator instance.

[cuda] Preserve TLS storage class of host variable during device-side compilation.
ClosedPublic

Authored by tra on Apr 28 2015, 10:16 AM.

Details

Reviewers
eliben
jpienaar
Summary

Side effect of r235907 is that host-side TLS variables ended up in AST as non-TLS during device-side compilation.
While missing thread storage class spec does not affect generated code because the variable will be ignored
during code generation, we've lost information which is useful during source analysis.

This patch preserves host variable's TLS class during device-side compilation.

Diff Detail

Event Timeline

tra updated this revision to Diff 24562.Apr 28 2015, 10:16 AM
tra retitled this revision from to [cuda] Preserve TLS storage class of host variable during device-side compilation..
tra updated this object.
tra edited the test plan for this revision. (Show Details)
tra added reviewers: eliben, jpienaar.
tra added a subscriber: Unknown Object (MLST).
eliben edited edge metadata.Apr 28 2015, 10:19 AM

Is there any way to create a test that would catch this?

tra added a comment.Apr 28 2015, 10:23 AM

Is there any way to create a test that would catch this?

I can check what ends up in AST. Stay tuned.

tra updated this revision to Diff 24565.Apr 28 2015, 10:40 AM
tra edited edge metadata.

Added a test case to verify that TLS info is preserved in AST.

eliben accepted this revision.Apr 28 2015, 11:33 AM
eliben edited edge metadata.
eliben added inline comments.
test/SemaCUDA/qualifiers.cu
3

'not' RUNs are sometimes hard to decipher, so a comment could help here - just to explain what the test is doing and what's the result it expects

This revision is now accepted and ready to land.Apr 28 2015, 11:33 AM

LGTM

[with a small nit]

tra updated this revision to Diff 24570.Apr 28 2015, 1:13 PM
tra edited edge metadata.

Added a comment explaining why some test runs use 'not' to run cc1.

jpienaar accepted this revision.Apr 28 2015, 1:25 PM
jpienaar edited edge metadata.

LGTM

tra updated this revision to Diff 24572.Apr 28 2015, 1:31 PM
tra edited edge metadata.

Added better explanation of the test.

tra added inline comments.Apr 28 2015, 1:33 PM
test/SemaCUDA/qualifiers.cu
3

Done.