This patch is the combination of several llvm patches that were submitted to the mailing list. There are a couple of clang patches also on the mailing list, but they are small and should easily be reviewed. If you would prefer to see the features split out, please review the patches on the mailing list.
From the list: I’ve been working on the vectorization diagnostics a little more. The first patch makes sure the analysis diagnostics are printed unless a disabling hint is provided. And the two pairs of LLVM and Clang patches make the diagnostic messages easier to understand and extend the vectorize(enable) hint to override the mem-pointer check threshold.
The new diagnostics are:
remark: loop not vectorized: cannot prove it is safe to reorder floating-point operations; allow reordering by specifying '#pragma clang loop vectorize(enable)' before the loop or by providing the compiler option '-ffast-math’.
and
remark: loop not vectorized: cannot prove it is safe to reorder memory operations; allow reordering by specifying '#pragma clang loop vectorize(enable)' before the loop. If the arrays will always be independent specify '#pragma clang loop vectorize(assume_safety)' before the loop or provide the 'restrict' qualifier with the independent array arguments. Erroneous results will occur if these options are incorrectly applied!
Using 'vectorize(enable)' to reorder memory operations is always safe (but not for fp ops), where as using 'vectorize(assume_safety)' might be dangerous. I removed the references to the mem-check threshold because I realized only compiler developers would know what it means.
Feedback is appreciated!
Why do we change this (default?) value?