[PATCH] D146777: [clang] Preliminary fat-lot-object support

Paul Kirth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 23 17:56:51 PDT 2023


paulkirth created this revision.
paulkirth added reviewers: phosek, tejohnson, MaskRay, alexander-shaposhnikov.
Herald added subscribers: ormris, steven_wu, hiraditya.
Herald added a project: All.
paulkirth requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Fat LTO objects contain both LTO compatible IR, as well as generated
object code. This allows users to defer the choice of whether to use LTO
or not to link-time. This is a feature available in GCC for some time,
and makes the existing -ffat-lto-objects flag functional in the same
way as GCC's.

This patch adds support for that flag in the driver, as well as setting the
necessary codegen options for the backend. Largely, this means we select
the newly added pass pipeline for generating fat objects.

Users are expected to pass -ffat-lto-objects to clang in addition to one
of the -flto variants. Without the -flto flag, -ffat-lto-objects has no
effect.

Original RFC: https://discourse.llvm.org/t/rfc-ffat-lto-objects-support/63977

Depends on D146776 <https://reviews.llvm.org/D146776>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146777

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Driver/Driver.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/CodeGen/embed-lto-fatlto.c
  clang/test/Driver/clang_f_opts.c
  clang/test/Driver/fatlto-objects.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146777.507931.patch
Type: text/x-patch
Size: 7362 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230324/82bf807f/attachment-0001.bin>


More information about the cfe-commits mailing list