https://llvm.org/bugs/show_bug.cgi?id=28981
Bug ID: 28981 Summary: Missed forced vectorization due to llvm.mem.parallel_loop_access getting lost Product: tools Version: trunk Hardware: All OS: Linux Status: NEW Severity: normal Priority: P Component: opt Assignee: unassignedb...@nondot.org Reporter: dorit.nuz...@intel.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified Created attachment 16953 --> https://llvm.org/bugs/attachment.cgi?id=16953&action=edit Example loop with #pragma clang loop vectorize(assume_safety) The following loop does not get vectorized because we lose some of the information that is implied by "#pragma clang loop vectorize(assume_safety)": void test(Complex *out, long size) { long m = size / 2; #pragma clang loop vectorize(assume_safety) for (long offset = 0; offset < m; ++offset) { Complex t0 = out[offset]; Complex t1 = out[offset+m]; out[offset] = t0 + t1; out[offset+m] = t0 - t1; } } clang++ -S force-vect-test1.cpp -g -m64 -Ofast -funroll-loops -static -mfpmath=sse -march=core-avx2 -Rpass-analysis=loop-vectorize force-vect-test1.cpp:29:5: remark: loop not vectorized: cannot check memory dependencies at runtime [-Rpass-analysis] for (long offset = 0; offset < m; ++offset) { ^ force-vect-test1.cpp:29:5: warning: loop not vectorized: failed explicitly specified loop vectorization [-Wpass-failed] By the time this loop reaches the vectorizer, some of the memory operations in the loop don't have the llvm.mem.parallel_loop_access metadata, because: 1) clang does not annotate the memcpy that it creates in the loop with the llvm.mem.parallel_loop_access metadata (this is PR28980) 2) Even if we annotate the memcpy manually, InstCombine later replaces it with a ld/st and does not copy over the llvm.mem.parallel_loop_access metadata (this is D23499) 3) later SROA does not preserve the llvm.mem.parallel_loop_access metadata during its transformations (will upload a proposed patch shortly) -- 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