OSDN Git Service

[LV] Avoid redundant operations manipulating masks
authorAyal Zaks <ayal.zaks@intel.com>
Mon, 31 Jul 2017 13:21:42 +0000 (13:21 +0000)
committerAyal Zaks <ayal.zaks@intel.com>
Mon, 31 Jul 2017 13:21:42 +0000 (13:21 +0000)
commit343f60c4b20e14528fc519c83b7bbd9e2a48423b
tree45b44b1c5e57a3d635cd10eb67f7c9ce7f0715f8
parente863b15ae6da0f8dcd311613939b989c18933af8
[LV] Avoid redundant operations manipulating masks

The Loop Vectorizer generates redundant operations when manipulating masks:
AND with true, OR with false, compare equal to true. Instead of relying on
a subsequent pass to clean them up, this patch avoids generating them.

Use null (no-mask) to represent all-one full masks, instead of a constant
all-one vector, following the convention of masked gathers and scatters.

Preparing for a follow-up VPlan patch in which these mask manipulating
operations are modeled using recipes.

Differential Revision: https://reviews.llvm.org/D35725

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309558 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/IRBuilder.cpp
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/if-pred-non-void.ll
test/Transforms/LoopVectorize/if-pred-stores.ll