This is an archive of the discontinued LLVM Phabricator instance.

[CUDA] More correctly inherit primitive types from the host during device compilation.
ClosedPublic

Authored by jlebar on Jan 4 2017, 1:59 PM.

Details

Summary

CUDA lets users share structs between the host and device, so for that
and other reasons, primitive types such as ptrdiff_t should be the same
on both sides of the compilation.

Our code to do this wasn't entirely successful. In particular, we did a
bunch of work during the NVPTXTargetInfo constructor, only to override
it in the NVPTX{32,64}TargetInfo constructors. It worked well enough on
Linux and Mac, but Windows is LLP64, which is different enough to break
it.

This patch removes the NVPTX{32,64}TargetInfo classes entirely and fixes
the bug described above.

Event Timeline

jlebar updated this revision to Diff 83129.Jan 4 2017, 1:59 PM
jlebar retitled this revision from to [CUDA] More correctly inherit primitive types from the host during device compilation..
jlebar updated this object.
jlebar added a reviewer: tra.
jlebar added a subscriber: cfe-commits.
tra accepted this revision.Jan 4 2017, 5:08 PM
tra edited edge metadata.
This revision is now accepted and ready to land.Jan 4 2017, 5:08 PM
This revision was automatically updated to reflect the committed changes.