This is an archive of the discontinued LLVM Phabricator instance.

[NVPTX] Infer AS of pointers passed to kernels as integers.
ClosedPublic

Authored by tra on Jan 26 2023, 1:35 PM.

Details

Summary

When pointers are passed within aggregates, we sometimes end up with IR that
loads them as integers and the converts them back to pointers. Typically it's
due to a memcpy or SROA. E.g. https://godbolt.org/z/xM3n5daaa

Normally we treat all pointers passed to a CUDA kernel as global pointers and
the same treatment should be applied to the pointers we load/store as integers.

Diff Detail

Event Timeline

tra created this revision.Jan 26 2023, 1:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2023, 1:35 PM
tra updated this revision to Diff 492568.Jan 26 2023, 2:16 PM

Updated tests.

tra published this revision for review.Jan 26 2023, 2:18 PM
tra added reviewers: jlebar, yaxunl.
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2023, 2:18 PM
jlebar accepted this revision.Jan 26 2023, 2:54 PM

Maybe worth a comment in the code that says basically what you say in the commit message? Otherwise LGTM.

This revision is now accepted and ready to land.Jan 26 2023, 2:54 PM
tra updated this revision to Diff 492588.Jan 26 2023, 3:32 PM

Added a comment.

tra edited the summary of this revision. (Show Details)Jan 26 2023, 3:43 PM
This revision was automatically updated to reflect the committed changes.