[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)
commitc62266d680d8796c56b51f143e1e08789381e6c4
tree64f8ef046786e384e0cda157b25842c7401fd4f6
parent0519a53d7d938c33dcedda5e9581f35150269944
[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

llvm-svn: 285097
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/consecutive-ptr-uniforms.ll
llvm/test/Transforms/LoopVectorize/if-pred-stores.ll
llvm/test/Transforms/LoopVectorize/induction.ll