https://llvm.org/bugs/show_bug.cgi?id=26957

            Bug ID: 26957
           Summary: pragma unroll ignores non-power-of-2 counts
           Product: compiler-rt
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: compiler-rt
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

consider we have the following loop:

for (i = 0; i < n; i++) {
  if (k == 3) s += a[i] * a[i];
  else s += a[i];
  k++
  if(k == 7) k = 0;
}

I see that unroll on 7 is profitable here. However even if I insert:
#pragma unroll(7)
I didn't get the loop unrolled.
The potential gain for this loop is ~3 times.
(assuming we add epilogue unrolling: http://reviews.llvm.org/D18158)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to