[LV] Don't emit unused scalars for uniform instructions
authorMatthew Simpson <mssimpso@codeaurora.org>
Wed, 21 Sep 2016 16:50:24 +0000 (16:50 +0000)
committerMatthew Simpson <mssimpso@codeaurora.org>
Wed, 21 Sep 2016 16:50:24 +0000 (16:50 +0000)
commit15869f86d84927ceb965eb5eaecabf523d8c7eb9
tree51acc1d72ca8e54fd0fcbee7742c1f98b0be05f1
parent2e217b87cbd844720ed2e46d003d6fb59ad087d9
[LV] Don't emit unused scalars for uniform instructions

If we identify an instruction as uniform after vectorization, we know that we
should only use the value corresponding to the first vector lane of each unroll
iteration. However, when scalarizing such instructions, we still produce values
for the other vector lanes. This patch prevents us from generating the unused
scalars.

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

llvm-svn: 282087
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/induction.ll
llvm/test/Transforms/LoopVectorize/reverse_induction.ll