Skip to content

NPM inliner does not perform alloca merging #47253

@aeubanks

Description

@aeubanks
Bugzilla Link 47909
Version unspecified
OS Windows NT
CC @alinas,@vns-mn,@rnk

Extended Description

The NPM inliner does not perform alloca merging. Lifetimes can help mitigate the issue of not reusing stack slots when inlining multiple functions, but they are not emitted at -O0. If we have something like

void a(void*);

attribute((always_inline)) void b() {
long long l[10000];
a(l);
}

void c() {
b();
b();
b();
b();
b();
b();
b();
b();
b();
b();
b();
b();
b();
}

the stack usage in c() is much much larger under the NPM than in the legacy PM under -O0.

https://godbolt.org/z/bWaWvv

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions