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...
testcase.cpp
(847 bytes, application/octet-stream)