Skip to content

LLVM inliner not run at -O2 #2616

@lattner

Description

@lattner
Bugzilla Link 2244
Resolution FIXED
Resolved on Apr 21, 2008 03:27
Version 2.2
OS All

Extended Description

This trivial function isn't inlined at -O2:

void factorial(int a, int* b) {
*b = a + 1;
}
int main() {
int a = 4;
int b;
factorial(a,&b);
return b;
}

The reason is this code in llvm-backend.cpp:

if (optimize > 1) {
  if (flag_inline_trees > 1)                // respect -fno-inline-functions
    PM->add(createFunctionInliningPass());  // Inline small functions

At -O2, flag_inline_trees is equal to 1, so this is not run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillacode-qualityllvm-toolsAll llvm tools that do not have corresponding tag

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions