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

            Bug ID: 51103
           Summary: Not able to vectorize struct members
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedb...@nondot.org
          Reporter: llvm-...@redking.me.uk
                CC: a.bat...@hotmail.com, florian_h...@apple.com,
                    llvm-bugs@lists.llvm.org

Reported here: https://lists.llvm.org/pipermail/llvm-dev/2021-July/151796.html

#define N 10
struct foo {
  float a[N][N];
  float b[N];
};

void compute(struct foo *p)
{
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      p->a[i][j] += 0.1f * p->b[i];
    }
  }
}

LLVM isn't able to vectorize this code. I'm not sure what the issue is here
as it seems to vectorize this code:

#define N 10
struct foo {
  float a[N];
  float b[N];
};

void compute(struct foo *p)
{
  for (int i = 0; i < N; i++) {
      p->a[i] += 0.1f * p->b[i];
  }
}

Current Codegen: https://llvm.godbolt.org/z/nah3ov9fT

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

Reply via email to