This is an archive of the discontinued LLVM Phabricator instance.

[NewPM] Set -enable-npm-optnone to true by default
ClosedPublic

Authored by aeubanks on Sep 17 2020, 4:17 PM.

Details

Summary

This makes the NPM skip not required passes on functions marked optnone.

If this causes a pass that should be required but has not been marked
required to be skipped, add
static bool isRequired() { return true; }
to the pass class. AlwaysInlinerPass is an example.

clang/test/CodeGen/O0-no-skipped-passes.c is useful for checking that
no passes are skipped under -O0.

The -enable-npm-optnone option will be removed once this has been stable
for long enough without issues.

Diff Detail

Event Timeline

aeubanks created this revision.Sep 17 2020, 4:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 17 2020, 4:17 PM
aeubanks requested review of this revision.Sep 17 2020, 4:17 PM

Could you add a few lines about this in the LLVM documentation?
We've had all the discussion in patches, so it may get unnoticed if it's not documented.

Could you add a few lines about this in the LLVM documentation?
We've had all the discussion in patches, so it may get unnoticed if it's not documented.

Do you mean create new documentation? Or add to the documentation I wrote recently on writing NPM passes?
And do you mean writing up the part about adding isRequired() for passes that shouldn't be skipped? Or something specific about optnone?

Add to the documentation on NPM passes.
I meant to add about isRequired, but with mentioning the behavior for optnone functions. I didn't mean to document what optnone means.

ychen accepted this revision.Oct 5 2020, 5:04 PM

LGTM

This revision is now accepted and ready to land.Oct 5 2020, 5:04 PM
asbirlea accepted this revision.Oct 5 2020, 5:15 PM

Thank you, and sorry for the delays in reviews.

This revision was landed with ongoing or failed builds.Oct 5 2020, 6:42 PM
This revision was automatically updated to reflect the committed changes.