https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71921
Bug ID: 71921 Summary: missed vectorization optimization Product: gcc Version: 6.1.1 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: arjan at linux dot intel.com Target Milestone: --- program below does not auto-vectorize to use the x86 "maxps" instruction even though gcc is smart enough to know there is a "maxss" instruction... gcc -O3 -ftree-vectorize -fopt-info-vec -fopt-info-vec-missed -march=westmere test.cpp -S -o test.S does not show any use of maxps in test.S #include <vector> void relu(float * __restrict__ output, const float * __restrict__ input, int size) { int i; int s2; s2 = size / 4; for (i = 0; i < s2 * 4; i++) { float t; t = input[i]; output[i] = std::max(t, float(0)); } }