This is an archive of the discontinued LLVM Phabricator instance.

[bugpoint] Add support for -Oz and properly enable -Os.
ClosedPublic

Authored by fhahn on Sep 15 2019, 11:25 AM.

Details

Summary

This patch adds -Oz as option and also properly enables support for -Os.
Currently, the existing check for -Os is dead, because the enclosing if
only checks of O1, O2 and O3.

There is still a difference between the -Oz pipeline compared to opt,
but I have not been able to track that down yet.

Diff Detail

Repository
rL LLVM

Event Timeline

fhahn created this revision.Sep 15 2019, 11:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 15 2019, 11:25 AM
efriedma accepted this revision.Sep 16 2019, 6:11 PM

LGTM

I took a quick glance at what opt is doing, and I see a few differences that likely matter:

  1. bugpoint never calls createTargetTransformInfoWrapperPass
  2. bugpoint never calls adjustPassManager
  3. bugpoint doesn't tweak Builder.LoopVectorize/Builder.SLPVectorize the same way
This revision is now accepted and ready to land.Sep 16 2019, 6:11 PM
This revision was automatically updated to reflect the committed changes.
fhahn added a comment.Sep 17 2019, 1:23 AM

LGTM

I took a quick glance at what opt is doing, and I see a few differences that likely matter:

  1. bugpoint never calls createTargetTransformInfoWrapperPass
  2. bugpoint never calls adjustPassManager
  3. bugpoint doesn't tweak Builder.LoopVectorize/Builder.SLPVectorize the same way

Yep, I'll look into making additional adjustments as follow-ups.