When loop hints are passed via metadata, the allowReordering() function
in LoopVectorizationLegality will allow the order of floating point
operations to be changed:
bool allowReordering() const { // When enabling loop hints are provided we allow the vectorizer to change // the order of operations that is given by the scalar loop. This is not // enabled by default because can be unsafe or inefficient.
This patch adds a flag to disable this behaviour for testing purposes,
particularly for testing vectorization with in-order reductions, which
requires further changes (D101836) to be enabled without the use of hints.
Can you add to the description that this has always been the default behaviour for Clang, so it is enabled by default to avoid causing unexpected regressions for code that uses these loop hints.