This is an archive of the discontinued LLVM Phabricator instance.

[openmp][amdgpu] Add comment warning that libm may be broken
ClosedPublic

Authored by JonChesterfield on Oct 27 2021, 10:57 AM.

Diff Detail

Event Timeline

JonChesterfield requested review of this revision.Oct 27 2021, 10:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2021, 10:57 AM

Using phab as a bug tracker here, but am also happy to check in that comment as-is if someone hits the green button.

The problem is that rocm device-libs doesn't have architecture specific attributes set because it uses one IR file for multiple GPU architectures. This relies on -mlink-builtin-bitcode setting appropriate attributes for the target presently being compiled when the files are pulled in.

Since we're passing the device libs at link time (to fit the '-lm' link time mode, and so we don't have N copies of the same code in every application) we can't use mlink-builtin-bitcode and presently use llvm-link.

That means we splice in bitcode that doesn't have the right attributes set, and our backend assumes that the correct attributes will be set. Outlined a few workarounds in the comment, not personally certain which way to go here.

arsenm accepted this revision.Nov 11 2021, 7:37 AM
This revision is now accepted and ready to land.Nov 11 2021, 7:37 AM