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

            Bug ID: 48044
           Summary: Missed loop vectorization with gather
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

int c1[256], c2[256], r[256];
unsigned int f[256*257];
#define SETMASK (1 << 21)
#define CLEARMASK (~(SETMASK))

void foo(void) 
{
  int i, j, base;
  for (i = 0; i <=255; i++) {
    base = r[i];
    for (j = 0; j <= 255; j++) {
      c1[j] =  f[(j << 8) + base]     & CLEARMASK;
      c2[j] = (f[(j << 8) + base + 1] & CLEARMASK) - 1;
    }
  }
}

O3 AVX2: Loop not vectorized due to cost model.

ICC vectorizes it.

https://godbolt.org/z/9E5ehz

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

Reply via email to