]> granicus.if.org Git - llvm/commit
[LV] Sink scalar operands of predicated instructions
authorMatthew Simpson <mssimpso@codeaurora.org>
Tue, 25 Oct 2016 18:59:45 +0000 (18:59 +0000)
committerMatthew Simpson <mssimpso@codeaurora.org>
Tue, 25 Oct 2016 18:59:45 +0000 (18:59 +0000)
commitda24afa31cdf7fe71e924861ac088fdfc8763608
tree67ce30bbfc3533f7cfd42649b413272618c8f840
parent5a313363f4e9d925f4c7c3aae15708ac6ae63e5d
[LV] Sink scalar operands of predicated instructions

When we predicate an instruction (div, rem, store) we place the instruction in
its own basic block within the vectorized loop. If a predicated instruction has
scalar operands, it's possible to recursively sink these scalar expressions
into the predicated block so that they might avoid execution. This patch sinks
as much scalar computation as possible into predicated blocks. We previously
were able to sink such operands only if they were extractelement instructions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285097 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/consecutive-ptr-uniforms.ll
test/Transforms/LoopVectorize/if-pred-stores.ll
test/Transforms/LoopVectorize/induction.ll