This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Try to embed offloading objects after codegen
ClosedPublic

Authored by jhuber6 on Feb 21 2022, 11:44 AM.

Details

Summary

Currently we use the -fembed-offload-object option to embed a binary
file into the host as a named section. This is currently only used as a
codegen action, meaning we only handle this option correctly when the
input is a bitcode file. This patch adds the same handling to embed an
offloading object after we complete code generation. This allows us to
embed the object correctly if the input file is source or bitcode.

Diff Detail

Event Timeline

jhuber6 created this revision.Feb 21 2022, 11:44 AM
jhuber6 requested review of this revision.Feb 21 2022, 11:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 21 2022, 11:44 AM

Can we have a test for this?

clang/include/clang/CodeGen/BackendUtil.h
48 ↗(On Diff #410350)

Seems unrelated, please remove it from this patch.

clang/lib/CodeGen/BackendUtil.cpp
1774 ↗(On Diff #410350)

Same as above?

Can we have a test for this?

Sure.

clang/include/clang/CodeGen/BackendUtil.h
48 ↗(On Diff #410350)

Yeah this is unrelated somewhat, just felt like changing it after doing another pass through. I can probably just commit this separately.

jhuber6 updated this revision to Diff 410405.Feb 21 2022, 3:20 PM

Removing unrelated changes and adding test.

jdoerfert accepted this revision.Feb 21 2022, 3:22 PM

LG, wait for the other patches though.

This revision is now accepted and ready to land.Feb 21 2022, 3:22 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2022, 5:09 PM