Using llvm-link to add rocm device-libs probably doesn't work
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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.