[SLP] Initialize VectorizedValue when gathering
authorMatthew Simpson <mssimpso@codeaurora.org>
Thu, 18 Aug 2016 19:50:32 +0000 (19:50 +0000)
committerMatthew Simpson <mssimpso@codeaurora.org>
Thu, 18 Aug 2016 19:50:32 +0000 (19:50 +0000)
commit11db6b6b8c01161e0e67de462552e481194515e9
treea504cdb74ce050a70db28e7d5c3847e6a82e03ef
parent075d0c23d5885d926a3497bd3504df1d81f04270
[SLP] Initialize VectorizedValue when gathering

We abort building vectorizable trees in some cases (e.g., if the maximum
recursion depth is reached, if the region size is too large, etc.). If this
happens for a reduction, we can be left with a root entry that needs to be
gathered. For these cases, we need make sure we actually set VectorizedValue to
the resulting vector.

This patch ensures we properly set VectorizedValue, and it also ensures the
insertelement sequence generated for the gathers is inserted at the correct
location.

Reference: https://llvm.org/bugs/show_bug.cgi?id=28330
Differential Revison: https://reviews.llvm.org/D23410

llvm-svn: 279125
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/AArch64/gather-root.ll [new file with mode: 0644]