-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillacode-qualityllvm-toolsAll llvm tools that do not have corresponding tagAll llvm tools that do not have corresponding tag
Description
| 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
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillacode-qualityllvm-toolsAll llvm tools that do not have corresponding tagAll llvm tools that do not have corresponding tag