Page MenuHomePhabricator

[OpenMP] Initial Implementation of LTO and bitcode linking in linker wrapper
ClosedPublic

Authored by jhuber6 on Jan 10 2022, 2:34 PM.

Details

Summary

This patch implements the fist support for handling LTO in the
offloading pipeline. The flag -foffload-lto is used to control if
bitcode is embedded into the device. If bitcode is found in the device,
the extracted files will be sent to the LTO pipeline to be linked and
sent to the backend. This implementation does not separately link the
device bitcode libraries yet.

Depends on D116675

Diff Detail

Event Timeline

jhuber6 created this revision.Jan 10 2022, 2:34 PM
jhuber6 requested review of this revision.Jan 10 2022, 2:34 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 10 2022, 2:34 PM
jhuber6 updated this revision to Diff 398748.Jan 10 2022, 2:41 PM

Undoing accidental clang format.

jhuber6 updated this revision to Diff 398821.Jan 10 2022, 8:14 PM

Fix tests.

ormris removed a subscriber: ormris.Jan 18 2022, 10:05 AM
jhuber6 updated this revision to Diff 404528.Jan 31 2022, 7:42 AM

Moving adding OpenMPOpt to LTO pipeline to a new patch.

jdoerfert accepted this revision.Jan 31 2022, 6:59 PM

LG, as part of the patch set, and given the runtime test for coverage.

Some nits.

clang/lib/Driver/ToolChains/Clang.cpp
8157

Nit: maybe for (auto &TI : make_range(OpenMPTCRange.first, OpenMPTCRange.second))

8183

I thought there is a helper somewhere that does this translation, isn't there?

This revision is now accepted and ready to land.Jan 31 2022, 6:59 PM
jhuber6 added inline comments.Jan 31 2022, 7:04 PM
clang/lib/Driver/ToolChains/Clang.cpp
8157

Will do, forgot about that helper.

8183

There might be, but I didn't find an easy one. I copied this from the GNU toolchain's handling of the LTO arguments.

This revision was landed with ongoing or failed builds.Jan 31 2022, 8:12 PM
This revision was automatically updated to reflect the committed changes.