This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Fix offload packager not writing to temps correctly
ClosedPublic

Authored by jhuber6 on Jun 13 2022, 10:44 AM.

Details

Summary

The offloading packager doesn't have a normal offloading kind. This
would result in its output being sent to the executable name when in
save-temps mode. This would then get overwritten by the actual output.
This patch adds specific checks to make sure that it gets the correct
name.

Diff Detail

Event Timeline

jhuber6 created this revision.Jun 13 2022, 10:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2022, 10:44 AM
Herald added a subscriber: guansong. · View Herald Transcript
jhuber6 requested review of this revision.Jun 13 2022, 10:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 13 2022, 10:44 AM
tra accepted this revision.Jun 13 2022, 11:28 AM

LGTM overall with a couple of nits.

clang/lib/Driver/Driver.cpp
5420

!! assumes specific values for the mask returned by getOffloadingHostActiveKinds().

(A->getOffloadingHostActiveKinds() != OFK_None && !AtTopLevel) would be a bit easier to understand, IMO.
Maybe even !(A->getOffloadingHostActiveKinds() == OFK_None || AtTopLevel).

5658–5659
bool UseOutExt = IsHIPNoRDC || isa<OffloadPackagerJobAction>(JA);
if (UseOutExt)
  ...
This revision is now accepted and ready to land.Jun 13 2022, 11:28 AM
jhuber6 marked an inline comment as done.Jun 13 2022, 11:30 AM

Thanks for the review.

clang/lib/Driver/Driver.cpp
5420

That was confusing me as well, might as well change it while I'm here.

jhuber6 updated this revision to Diff 436493.Jun 13 2022, 11:35 AM

Addressing nits.

This revision was landed with ongoing or failed builds.Jun 14 2022, 6:16 AM
This revision was automatically updated to reflect the committed changes.