Page MenuHomePhabricator

[LTO] Add support for existing Config::Freestanding option.
Needs ReviewPublic

Authored by fhahn on Wed, Jan 13, 1:00 PM.

Details

Summary

lto::Config has a field to control whether the build is "freestanding"
(no builtins) or not, but it is not hooked up to the code actually
running the passes.

This patch adds support for the flag to both the code that runs
optimization with the new and old pass managers, by explicitly adding a
TargetLibraryInfo instance. If Freestanding is true, all library functions
are disabled.

Diff Detail

Event Timeline

fhahn created this revision.Wed, Jan 13, 1:00 PM
fhahn requested review of this revision.Wed, Jan 13, 1:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptWed, Jan 13, 1:00 PM
fhahn added inline comments.Wed, Jan 13, 1:07 PM
llvm/lib/LTO/LTOBackend.cpp
307

@asbirlea I am trying to make the new PM use a TargetLibraryInfo with all functions disabled here. But for some reason, it appears as if the custom TLI is not used. Do you have any idea what the right way to do that would be?