Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

Vectorizer generates useless vector.memcheck block #19650

Open Quuxplusone opened 10 years ago

Quuxplusone commented 10 years ago
Bugzilla Link PR19651
Status NEW
Importance P normal
Reported by Nicola Gigante (nicola.gigante@gmail.com)
Reported on 2014-05-04 06:45:16 -0700
Last modified on 2014-05-05 03:18:09 -0700
Version trunk
Hardware PC MacOS X
CC dsaritz@gmail.com, hfinkel@anl.gov, llvm-bugs@lists.llvm.org, rengolin@gmail.com, zinovy.nis@gmail.com
Fixed by commit(s)
Attachments testcase.cpp (847 bytes, application/octet-stream)
Blocks
Blocked by
See also
Created attachment 12474
Test source code

In the attached code, TBAA correctly recognize the pointers being of different
type, but the vectorizer emits anyway the vector.memcheck block to check if the
buffers overlap.

This happens even in the second part of the attached source code, where the
inputs are not pointers but std::array objects of different element types. The
input arrays are passed by value but the vectorizer still checks for
overlapping buffers.

In a pure compliant C++ context (so no 'restrict' keyword) it seems impossible
to tell the optimizer that I know my arrays won't overlap...
Quuxplusone commented 10 years ago

Attached testcase.cpp (847 bytes, application/octet-stream): Test source code

Quuxplusone commented 10 years ago
See this thread on the mailing list:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-May/036742.html