[PATCH] D130777: Enable embedded lto for XCOFF.
Sean Fertile via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 29 07:25:50 PDT 2022
sfertile created this revision.
sfertile added reviewers: hubert.reinterpretcast, DiggerLin, nemanjai, MaskRay, tejohnson, mehdi_amini, phosek, arda.
Herald added subscribers: ormris, StephenFan, steven_wu, kbarton, hiraditya, inglorion, mgorny.
Herald added a project: All.
sfertile requested review of this revision.
Herald added projects: clang, LLVM.
Herald added a subscriber: cfe-commits.
The traditional system compiler (xlc) on AIX uses a 'fat' object format for LTO by default, embedding the intermediate representation into a special '.ipa' section in native XCOFF object files. Then at link time depending on command line options either a native link or an ipa link can be performed. This patch adds support for embedding the pre-link IR into the module which is then codegened to a native XCOFF object with the bitcode emebededed in the .info section. The .info section representation starts with a magic number, followed by an 8-byte size, an identifier string and a 4-byte unsigned difference, finally followed by the payload. The magic number and identifier string indcate to the linker that the embedded metadata is bitcode and it is appropriate for use in LTO.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D130777
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/PowerPC/aix-embedded-bitcode.c
clang/test/CodeGen/embed-lto-metadata.c
clang/test/Driver/embedded-lto.c
llvm/include/llvm/Bitcode/EmbedBitcodePass.h
llvm/include/llvm/MC/MCStreamer.h
llvm/include/llvm/MC/MCXCOFFStreamer.h
llvm/lib/Bitcode/Writer/CMakeLists.txt
llvm/lib/Bitcode/Writer/EmbedBitcodePass.cpp
llvm/lib/MC/MCAsmStreamer.cpp
llvm/lib/MC/MCStreamer.cpp
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Passes/PassRegistry.def
llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
llvm/test/Bitcode/embed-multiple.ll
llvm/test/Bitcode/embed-unsupported-object-format.ll
llvm/test/Bitcode/embed.ll
llvm/test/CodeGen/PowerPC/aix-embeded-bitcode.ll
llvm/test/CodeGen/PowerPC/aix-embeded-module-padding.ll
llvm/test/Transforms/Util/embeded-lto-TLI-mappings.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130777.448626.patch
Type: text/x-patch
Size: 34587 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220729/69f6c5d8/attachment-0001.bin>
More information about the cfe-commits
mailing list