[PATCH] D65776: [Clang] Pragma vectorize_predicate implies vectorize

Michael Kruse via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 5 15:14:41 PDT 2019


Meinersbur added a comment.

Mmmh, I would have expected this to work the same way as `vectorize_width`. According to the docs:

> The following example implicitly enables vectorization and interleaving by specifying a vector width and interleaving count:
>  `#pragma clang loop vectorize_width(2) interleave_count(2)`
>  `for(...) {`
>  ` ...`
>  `}`

However, `vectorize_width` does not automatically set `llvm.loop.vectorize.enable`. Neither does `llvm.loop.vectorize.width` > 1 imply `LoopVectorizeHints::getForce()`. At some places they are checked together, such as `LoopVectorizeHints::allowReordering()`. Other places, notably `LoopVectorizationCostModel::selectVectorizationFactor()`, only queries `getForce()`. That is, `vectorize_width(2)` does not implicitly force vectorization in practice.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65776/new/

https://reviews.llvm.org/D65776





More information about the cfe-commits mailing list