[SLP] Use the width of value truncated just before storing
authorAnton Afanasyev <anton.a.afanasyev@gmail.com>
Tue, 8 Dec 2020 09:51:45 +0000 (12:51 +0300)
committerAnton Afanasyev <anton.a.afanasyev@gmail.com>
Wed, 9 Dec 2020 13:38:45 +0000 (16:38 +0300)
commite5bf2e8989469ec328d910be26bd3ee0710326d9
tree3f2daaa8df5b921ac957fc4990fbeeb2d4a0c11a
parent163c223161b8cd33e812613b27fbc52ea6e0f880
[SLP] Use the width of value truncated just before storing

For stores chain vectorization we choose the size of vector
elements to ensure we fit to minimum and maximum vector register
size for the number of elements given. This patch corrects vector
element size choosing the width of value truncated just before
storing instead of the width of value stored.

Fixes PR46983

Differential Revision: https://reviews.llvm.org/D92824
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/insert-after-bundle.ll
llvm/test/Transforms/SLPVectorizer/X86/pr46983.ll