OSDN Git Service

[LV] Move isLegalMasked* functions from Legality to CostModel
authorRenato Golin <renato.golin@linaro.org>
Mon, 26 Feb 2018 11:06:36 +0000 (11:06 +0000)
committerRenato Golin <renato.golin@linaro.org>
Mon, 26 Feb 2018 11:06:36 +0000 (11:06 +0000)
commit3f10059feb49d5a872ee1602784f450abd5f31f1
tree9e2a61569b40f208f7a571d7631efd73da5b5217
parent7d8797ce69bbc764e7df1f323219462ef004eb40
[LV] Move isLegalMasked* functions from Legality to CostModel

All SIMD architectures can emulate masked load/store/gather/scatter
through element-wise condition check, scalar load/store, and
insert/extract. Therefore, bailing out of vectorization as legality
failure, when they return false, is incorrect. We should proceed to cost
model and determine profitability.

This patch is to address the vectorizer's architectural limitation
described above. As such, I tried to keep the cost model and
vectorize/don't-vectorize behavior nearly unchanged. Cost model tuning
should be done separately.

Please see
http://lists.llvm.org/pipermail/llvm-dev/2018-January/120164.html for
RFC and the discussions.

Closes D43208.

Patch by: Hideki Saito <hideki.saito@intel.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326079 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/conditional-assignment.ll
test/Transforms/LoopVectorize/hoist-loads.ll