[LLVMbugs] [Bug 1792] New: LLVM unable to unroll trivial code

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Nov 12 15:09:56 PST 2007


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

           Summary: LLVM unable to unroll trivial code
           Product: libraries
           Version: 2.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Loop Optimizer
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: nadav256 at gmail.com
                CC: llvmbugs at cs.uiuc.edu


The trivial code below is not unrolled.

nlewycky: okay, so -scalar-evolutions correctly detects that the loop runs
exactly 31 iterations. that's good.
 hm, but it doesn't unroll anyways. That's not right.

Code:

unsigned int bitCount(unsigned int input) {
        unsigned int count = 0;
        unsigned int i;
        for (i=0; i<sizeof(input)*8; i++) {
                count += (input>>i) & 1;
        }
        return count;
}


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