This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Fix the wrong features being derivec in the offload packager
ClosedPublic

Authored by jhuber6 on Jul 8 2022, 1:03 PM.

Details

Summary

The offload packager embeds the features in the offloading binary when
performing LTO. This had an incorrect interaction with the
--cuda-feature option because we weren't deriving the features from
the CUDA toolchain arguments when it was being specified. This patch
fixes this so the features are correctly overrideen when using this
argument.

However, this brings up a question of how best to handle conflicting
target features. The user could compile many libraries with different
features, in this case we do not know which one to pick. This was not
previously a problem when we simply passed the features in from the CUDA
installation at link-link because we just defaulted to whatever was
current on the system.

Diff Detail

Event Timeline

jhuber6 created this revision.Jul 8 2022, 1:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 8 2022, 1:03 PM
jhuber6 requested review of this revision.Jul 8 2022, 1:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 8 2022, 1:03 PM
ye-luo accepted this revision.Jul 8 2022, 2:17 PM

LGTM

This revision is now accepted and ready to land.Jul 8 2022, 2:17 PM