This is an archive of the discontinued LLVM Phabricator instance.

[Inliner] Don't skip inlining alwaysinline in optnone functions
ClosedPublic

Authored by aeubanks on Jul 1 2020, 9:11 PM.

Details

Summary

Previously the NPM inliner would skip all potential inlines in an
optnone function, but alwaysinline callees should be inlined regardless
of optnone.

Fixes inline-optnone.ll under NPM.

Diff Detail

Event Timeline

aeubanks created this revision.Jul 1 2020, 9:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2020, 9:11 PM
aeubanks updated this revision to Diff 275001.Jul 1 2020, 9:12 PM

Remove unused import

kazu accepted this revision.Jul 1 2020, 9:55 PM

LGTM. Thanks!

This revision is now accepted and ready to land.Jul 1 2020, 9:55 PM
Harbormaster completed remote builds in B62623: Diff 274999.

Actually, I'm wondering if the NPM inliner properly handles alwaysinline in all cases? I don't see any other references to "alwaysinline" in Inliner.cpp (besides some legacy passes).

Actually, I'm wondering if the NPM inliner properly handles alwaysinline in all cases? I don't see any other references to "alwaysinline" in Inliner.cpp (besides some legacy passes).

jyknight pointed me to llvm::getAttributeBasedInliningDecision() where alwaysinline is handled.
It still seems a little weird to me that alwaysinline isn't a separate pass under the -O1/-O2/-O3 pipelines and would make opt-bisect always run the inliner pass (once it's implemented in NPM). But this will do for now.

This revision was automatically updated to reflect the committed changes.