Ryan Taylor via llvm-dev
2021-Jul-15 03:04 UTC
[llvm-dev] Not able to vectorize struct members
Given a test case:
#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];
}
}
Is this a known issue?
-Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20210714/2d30b466/attachment.html>
Simon Pilgrim via llvm-dev
2021-Jul-15 09:05 UTC
[llvm-dev] Not able to vectorize struct members
I've reported this here: https://bugs.llvm.org/show_bug.cgi?id=51103 On 15/07/2021 04:04, Ryan Taylor via llvm-dev wrote:> Given a test case: > > #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]; > } > } > > Is this a known issue? > > -Ryan > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210715/c7a0bee4/attachment.html>