This got reverted because given the following source:
void a() { #pragma clang loop vectorize(disable) for (;;) ; }
it incorrectly enabled vectorisation and set metadata due to a logic error. With this fixed, we now imply vectorisation when:
- vectorisation is enabled, which means: VectorizeWidth > 1
- and don't want to add it when it is disabled or enabled, otherwise we would be incorrectly setting it or duplicating the metadata, respectively.
[serious] Please handle the llvm.loop.vectorize.enable metadata in one place, i.e. where the other llvm.loop.vectorize.enable is handled. This introduces yet another mechanism when to add llvm.loop.vectorize.enable besides the one for IsVectorPredicateEnabled. Btw, with vectorize_predicate(enable) vectorize_width(2) this emits two llvm.loop.vectorize.enable.
Also, the changing relative order of llvm.loop.vectorize.enable to other metadata makes D69092 difficult.