https://bugs.llvm.org/show_bug.cgi?id=52462
Bug ID: 52462
Summary: Missed removal of cross-iteration dep in Loop
Vectorizer
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Loop Optimizer
Assignee: unassignedb...@nondot.org
Reporter: david.bolvan...@gmail.com
CC: llvm-bugs@lists.llvm.org
#include<stdint.h>
void
foo (uint64_t* __restrict pdst, uint64_t* psrc, uint64_t shift)
{
for (int64_t i = 0; i != 64; i++)
{
uint64_t shift_i = shift >> i;
pdst[i] = psrc[i] + shift_i;
}
}
void
bar (uint64_t* __restrict pdst, uint64_t* psrc, uint64_t shift)
{
for (int64_t i = 0; i != 64; i++)
{
pdst[i] = psrc[i] + shift;
shift >>= 1;
}
}
LLVM/GCC can vectorize foo but not bar since there's cross-iteration dep for
shift >>= 1, but shift >>= 1 is just shift >> i in loop.
https://godbolt.org/z/GfccMhszc
--
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