This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget][nvptx] Undef, weak shared variables
ClosedPublic

Authored by JonChesterfield on Oct 27 2020, 9:50 AM.

Details

Summary

[libomptarget][nvptx] Undef, weak shared variables

Shared variables on nvptx, and LDS on amdgcn, are uninitialized at
the start of kernel execution. Therefore create the variables with
undef instead of zeros, motivated in part by the amdgcn back end
rejecting LDS+initializer.

Common is zero initialized, which seems incompatible with shared. Thus
change them to weak, following the direction of
https://reviews.llvm.org/rG7b3eabdcd215

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2020, 9:50 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
JonChesterfield requested review of this revision.Oct 27 2020, 9:50 AM
jdoerfert accepted this revision.Oct 28 2020, 7:04 AM

LGTM, not totally convinced about weak linkage but ok

This revision is now accepted and ready to land.Oct 28 2020, 7:04 AM
This revision was landed with ongoing or failed builds.Oct 28 2020, 7:25 AM
This revision was automatically updated to reflect the committed changes.