https://llvm.org/bugs/show_bug.cgi?id=26167
Bug ID: 26167 Summary: Loop vectorizer fails to maximize the use of __builtin_assume() Product: tools Version: 3.7 Hardware: All OS: All Status: NEW Severity: normal Priority: P Component: opt Assignee: unassignedb...@nondot.org Reporter: mar...@synopsys.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified I've been able to get the loop vectorizer to understand that the number of iterations is positive, but I can't get it to understand it's both positive and will iterate an even number of times. A scalar loop is produced for each of the following test cases. void vcpy1(short* restrict d, const char* restrict l, const char* restrict r, int N) { __builtin_assume( (N > 1) && (N%2 == 0) ); #pragma clang loop vectorize(enable) vectorize_width(2) for (int j=0;j<N;j++) d[j] = l[j] + r[j]; } void vcpy2(short* restrict d, const char* restrict l, const char* restrict r, int N) { __builtin_assume( (N > 1) && ((N&1) == 0) ); #pragma clang loop vectorize(enable) vectorize_width(2) for (int j=0;j<N;j++) d[j] = l[j] + r[j]; } void vcpy3(short* restrict d, const char* restrict l, const char* restrict r, int N) { __builtin_assume(N > 1); __builtin_assume(N%2 == 0); #pragma clang loop vectorize(enable) vectorize_width(2) for (int j=0;j<N;j++) d[j] = l[j] + r[j]; } void vcpy4(short* restrict d, const char* restrict l, const char* restrict r, int N) { __builtin_assume(N > 1); __builtin_assume((N&1) == 0); #pragma clang loop vectorize(enable) vectorize_width(2) for (int j=0;j<N;j++) d[j] = l[j] + r[j]; } -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs