This is an archive of the discontinued LLVM Phabricator instance.

Honor -finline-functions and -finline-hint-functions at -O0
AbandonedPublic

Authored by davezarzycki on Feb 9 2020, 9:19 AM.

Details

Reviewers
chandlerc
Summary

This fixes a regression introduced (over three years ago!) by fcd33149b48885ab8e4ca4ffb6977bce5be2e623.

Diff Detail

Event Timeline

davezarzycki created this revision.Feb 9 2020, 9:19 AM

This clearly needs tests

Hi @lebedev.ri – Before I add a small new test file, is there an existing one that you know of that would be good to extend?

MaskRay added a subscriber: MaskRay.EditedFeb 9 2020, 11:24 AM

Why you say regression, do you have a case where fcd33149b48885ab8e4ca4ffb6977bce5be2e623 actually regressed things?

-O0 implies optnone. For -Xclang -disable-O0-optnone -O0 -finline-functions, the patch can indeed make a difference. -disable-O0-optnone is currently a debug aid AFAICT.

GCC -O0 -finline-functions does not seem to have a difference.

clang/lib/Frontend/CompilerInvocation.cpp
702

The old order looks good. The new ordering does not seen to be needed? The assert is also unnecessary.

Hi @MaskRay – I was just looking at the source history. I didn't test the old way. As it turns out there isn't a regression, but just some unexplained code in the current clang option parsing. And the -disable-O0-optnone is a useful hint. Thanks! I've been hacking on clang and trying to get the normal inliner pass to run at -O0, but with no luck so far.

davezarzycki abandoned this revision.Feb 14 2020, 3:18 AM

I'm abandoning this due to lack of time and the problem being more involved than I thought.