[cfe-dev] Proposed changes to vectorize_width #pragma

Michael Kruse via cfe-dev cfe-dev at lists.llvm.org
Mon Nov 30 09:53:02 PST 2020


Am Mo., 30. Nov. 2020 um 07:34 Uhr schrieb Roger Ferrer Ibáñez via
cfe-dev <cfe-dev at lists.llvm.org>:
> Your proposal looks sensible to me. I understand that for reasons of evolution of the pragma, you chose to give it `fixed` semantics if no explicit mark of vectorisation style appears, right?

If LoopVectorize is able to generate SVE without pragma, it should
still be able to do so with a hint that does not force a fixed vector
width. E.g. vectorize_predicate(enable) may implicitly enable
vectorization, but does (should not?) change the choses vector width.

An interpretation is that loop hint restrict the choices the
LoopVectorize's profitability heuristic can make. If the choices are

(interleave_count=1,vectorize_width=1) // .i.e. don't do anything
(interleave_count=1,vectorize_width=2)
(interleave_count=1,vectorize_width=4)
(interleave_count=2,vectorize_width=1)
(interleave_count=2,vectorize_width=2)
(interleave_count=2,vectorize_width=4)

then vectorize_width(4) only keeps

(interleave_count=1,vectorize_width=4)
(interleave_count=2,vectorize_width=4)

as available options. vectorize_enable(enable), or those that enable
vectorization implicitly, remove the vectorize_width=1 options from
the list.


More information about the cfe-dev mailing list