Page MenuHomePhabricator

[LTO] Allow passing -Os/-Oz as the optimization level
Needs ReviewPublic

Authored by aeubanks on Thu, Nov 11, 11:22 PM.

Details

Reviewers
MaskRay
gkm
Group Reviewers
Restricted Project

Diff Detail

Event Timeline

aeubanks created this revision.Thu, Nov 11, 11:22 PM
Herald added a reviewer: gkm. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
aeubanks requested review of this revision.Thu, Nov 11, 11:22 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptThu, Nov 11, 11:22 PM
fhahn added a subscriber: fhahn.Fri, Nov 12, 1:32 AM

Could you add tests on the LLVM side for the new options as well? See also D95541

aeubanks updated this revision to Diff 386882.Fri, Nov 12, 10:25 AM

add more tests

pcc added a subscriber: pcc.Fri, Nov 12, 10:46 AM

Please see D63976 where we rejected a similar change in favor of just letting this be controllable at compile time.

To the extent that the pass pipeline is affected by the size optimization level, I think we should change the passes so that they respect the optsize/minsize attributes.

thevinster added inline comments.
lld/Common/Args.cpp
29

nit: getOptLevel seems a bit too generic for something that's LTO specific. The MachO port has the concept of passing an opt level that generates more efficient opcodes. Suggestions are welcome here - perhaps getLTOOptLevel would be better here?