This is an archive of the discontinued LLVM Phabricator instance.

Enable embedded lto for XCOFF.
Needs ReviewPublic

Authored by sfertile on Jul 29 2022, 7:25 AM.

Details

Summary

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.

Diff Detail

Event Timeline

sfertile created this revision.Jul 29 2022, 7:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 29 2022, 7:25 AM
sfertile requested review of this revision.Jul 29 2022, 7:25 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 29 2022, 7:25 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

This needs rebase after fatLTO support.