This is an archive of the discontinued LLVM Phabricator instance.

[cuda] treat file scope __asm as __host__ and ignore it during device-side compilation.
ClosedPublic

Authored by tra on Apr 24 2015, 3:56 PM.

Details

Summary

Currently clang emits file-scope asm during *both* host and device compilation modes which is usually a wrong thing to do.

There's no way to attach any attribute to an __asm statement, so there's no way to differentiate between host-side and device-side file-scope asm.
This patch makes clang to match nvcc behavior and emit file-scope-asm only during host-side compilation.

Diff Detail

Repository
rL LLVM

Event Timeline

tra updated this revision to Diff 24421.Apr 24 2015, 3:56 PM
tra retitled this revision from to [cuda] treat file scope __asm as __host__ and ignore it during device-side compilation..
tra updated this object.
tra edited the test plan for this revision. (Show Details)
tra added reviewers: jpienaar, eliben, rnk.
tra added a subscriber: Unknown Object (MLST).
jpienaar accepted this revision.Apr 24 2015, 4:01 PM
jpienaar edited edge metadata.
This revision is now accepted and ready to land.Apr 24 2015, 4:01 PM
eliben accepted this revision.Apr 27 2015, 9:48 AM
eliben edited edge metadata.

LGTM

rnk accepted this revision.Apr 27 2015, 10:36 AM
rnk edited edge metadata.

lgtm

This revision was automatically updated to reflect the committed changes.