Page MenuHomePhabricator

Support Os or Oz inside the LTO
Needs RevisionPublic

Authored by jinlin on Jan 27 2021, 9:39 AM.

Details

Summary

The changes are to support Os and Oz inside the LTO.

Diff Detail

Event Timeline

jinlin created this revision.Jan 27 2021, 9:39 AM
jinlin requested review of this revision.Jan 27 2021, 9:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 27 2021, 9:39 AM
fhahn requested changes to this revision.Jan 27 2021, 11:52 AM
fhahn added a subscriber: fhahn.

Thanks for the patch.

I think this probably should be split up in 2 different changes:

  1. Changes to the pipeline (llvm/lib/Transforms/IPO/PassManagerBuilder.cpp). Ideally those come with some data motivating the change and why there won't be regressions.
  2. Changes to LTOCodeGenerator & co. They also need a test.
This revision now requires changes to proceed.Jan 27 2021, 11:52 AM
jinlin updated this revision to Diff 340068.Apr 23 2021, 9:15 AM
jinlin edited the summary of this revision. (Show Details)
jinlin updated this revision to Diff 340096.Apr 23 2021, 10:05 AM
jinlin updated this revision to Diff 340237.Apr 23 2021, 9:47 PM
jinlin retitled this revision from Support Os or Oz during LTO to Support Os or Oz inside the LTO.Apr 26 2021, 2:27 PM
jinlin edited the summary of this revision. (Show Details)
MaskRay requested changes to this revision.Apr 26 2021, 4:09 PM
MaskRay added a subscriber: MaskRay.

I don' think mapping 's' to 4 and 'z' to 5 is suitable. It is quite different. If you just want clang -fuse-ld=lld -Oz -flto{,=thin} to work, it already does after D79919

This revision now requires changes to proceed.Apr 26 2021, 4:09 PM

I don' think mapping 's' to 4 and 'z' to 5 is suitable. It is quite different. If you just want clang -fuse-ld=lld -Oz -flto{,=thin} to work, it already does after D79919

First of all, the changes in D719919 does not pass the SizeLevel information to any optimizations including inlining.

Secondly, the changes in D79919 is not general. It does not work in MacOS.