[llvm-bugs] [Bug 26957] New: pragma unroll ignores non-power-of-2 counts

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 15 15:24:47 PDT 2016


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: unassignedbugs at nondot.org
          Reporter: evstupac at gmail.com
                CC: llvm-bugs at lists.llvm.org
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160315/cf360635/attachment.html>


More information about the llvm-bugs mailing list