Skip to content

Disable gcc inliner #3604

@lattner

Description

@lattner
Bugzilla Link 3232
Resolution FIXED
Resolved on Feb 08, 2009 04:33
Version 2.2
OS All
Depends On #2725 llvm/llvm-bugzilla-archive#3290
Blocks #3371
CC @asl,@efriedma-quic

Extended Description

llvm-gcc is running the GCC tree-inliner as well as the llvm inliner. This has certain advantages, but also brings certain problems. For example, it seriously unrolls code like this C++ code (which is a huge code size problem and not really a win):

#include <stdio.h>
template< typename X >
inline X factorial( X n ) {
if ( n )
return n * factorial(n - 1);
return 1;
}
int main(){
double x = factorial( ( double )19 );
printf( "factorial( (double)19 ): %f\n", x );
return 0;
}

$ llvm-gcc main.opt.cpp -S -o - -emit-llvm -O3 -mllvm -disable-llvm-optzns

Which is basically horrible. Turning off the GCC inliner would also fix Bug 2999, but we have to watch out for 2353.

-Chris

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