Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore -enable-cross-module-inlining if inlining is generally disabled #3664

Merged
merged 1 commit into from
Feb 12, 2021

Conversation

kinke
Copy link
Member

@kinke kinke commented Feb 12, 2021

People use dflags "-enable-cross-module-inlining" platform="ldc" in their dub.sdl files; default and debug builds without -O thus incur a superfluous compile-time cost (extra available_externally emissions) for no benefit.

@kinke kinke requested a review from JohanEngelen February 12, 2021 03:22
People use `dflags "-enable-cross-module-inlining" platform="ldc"`
in their dub.sdl files; default and debug builds without -O thus
incur a superfluous compile-time cost for no benefit.
@kinke kinke force-pushed the no_cross_without_O branch from 2788b9a to 3f3ed2d Compare February 12, 2021 03:49
int call_easily_inlinable(int i)
{
// DISABLED: call {{.*}} @easily_inlinable(
// CHECK: call {{.*}} @easily_inlinable(
return easily_inlinable(i);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call was previously there for -enable-cross-module-inlining -O0 too.

@JohanEngelen
Copy link
Member

Makes total sense. The flag is meant to tweak inlining behavior, and when inlining generally is not enabled, it should not be enabled by this flag for some special cases.

Does this impact pragma(inline,true) functions cross-module?

@kinke
Copy link
Member Author

kinke commented Feb 12, 2021

Does this impact pragma(inline,true) functions cross-module?

Nope, these functions circumvent this check:

if (fdecl.inlining == PINLINE::always) {
IF_LOG Logger::println(
"pragma(inline, true) specified, overrides cmdline flags");
} else if (!willCrossModuleInline()) {
IF_LOG Logger::println("Commandline flags indicate no inlining");
return false;
}

@kinke kinke merged commit 98a066e into ldc-developers:master Feb 12, 2021
@kinke kinke deleted the no_cross_without_O branch February 12, 2021 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants