[LLVMbugs] [Bug 2244] New: LLVM inliner not run at -O2

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Apr 20 23:15:52 PDT 2008


           Summary: LLVM inliner not run at -O2
           Product: tools
           Version: 2.2
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: code-quality
          Severity: normal
          Priority: P2
         Component: llvm-gcc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sabre at nondot.org
                CC: llvmbugs at cs.uiuc.edu

This trivial function isn't inlined at -O2:

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

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

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

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

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list