[LLVMbugs] [Bug 7026] New: Loop unroll thinks inline assembly blocks are function calls and does not unroll loops having them

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 3 10:15:34 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7026

           Summary: Loop unroll thinks inline assembly blocks are function
                    calls and does not unroll loops having them
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: pekka.jaaskelainen at tut.fi
                CC: llvmbugs at cs.uiuc.edu


LLVM 2.7 does not unroll loops with inline assembly in the body.

This is caused by the following new code in LoopUnrollPass.cpp:

+    unsigned NumCalls;
+    unsigned LoopSize = ApproximateLoopSize(L, NumCalls);
+    DEBUG(dbgs() << "  Loop Size = " << LoopSize << "\n");
+    if (NumCalls != 0) {
+      DEBUG(dbgs() << "  Not unrolling loop with function calls.\n");
+      return false;
+    }

The NumCalls should not include the inline assembly calls, I think.

This code is in the current trunk also.

This is quite a bad performance regression to us in the TCE project as we
heavily use custom operations available in the designed target processor by
means of inline assembly, and loop unroll is quite important optimization for a
static VLIW-style architecture like ours for extracting static instruction
level parallelism from the loops. 

Should be an issue also for other targets with special instructions as quite
often performance critical loops are optimized with inline assembly access to
special instructions which also benefit from unrolling.

-- 
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