This is an archive of the discontinued LLVM Phabricator instance.

[clang] Do not duplicate "EnableSplitLTOUnit" module flag
ClosedPublic

Authored by greened on Oct 20 2021, 1:25 PM.

Details

Summary

If clang's output is set to bitcode and LTO is enabled, clang would
unconditionally add the flag to the module. Unfortunately, if the input were a
bitcode or IR file and had the flag set, this would result in two copies of the
flag, which is illegal IR. Guard the setting of the flag by checking whether it
already exists. This follows existing practice for the related "ThinLTO" module
flag.

Diff Detail

Event Timeline

greened created this revision.Oct 20 2021, 1:25 PM
greened requested review of this revision.Oct 20 2021, 1:25 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2021, 1:25 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision is now accepted and ready to land.Oct 20 2021, 1:29 PM
This revision was automatically updated to reflect the committed changes.