[llvm-dev] Enabling scalarized conditional stores in the loop vectorizer

Matthew Simpson via llvm-dev llvm-dev at lists.llvm.org
Mon Dec 12 14:52:15 PST 2016


Hi,

I'd like to enable the scalarized conditional stores feature in the loop
vectorizer (-enable-cond-stores-vec=true). The feature allows us to
vectorize loops containing conditional stores that must be scalarized and
predicated in the vectorized loop.

Note that this flag does not affect the decision to generate masked vector
stores. That is a separate feature and is guarded by a TTI hook. Currently,
we give up on loops containing conditional stores that must be scalarized
(i.e., conditional stores that can't be represented with masked vector
stores). If the feature is enabled, we attempt to vectorize those loops if
profitable, while scalarizing and predicating the conditional stores.

I think these stores are fairly well modeled in the cost model at this
point using the static estimates. They're modeled similar to the way we
model other non-store conditional instructions that must be scalarized and
predicated (e.g., instructions that may divide by zero); however, only the
conditional stores are currently disabled by default.

I'd appreciate any opinions on how/if we can enable this feature. For
example, can we enable it for all targets or would a target-by-target
opt-in mechanism using a TTI hook be preferable? If you'd like to test the
feature on your target, please report any significant regressions and
improvements you find.

Thanks!

-- Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161212/faf73ae2/attachment.html>


More information about the llvm-dev mailing list