[SLP]Fix PR104422: Wrong value truncation
commit373180b440d04dc3cc0f6111b06684d18779d7c8
authorAlexey Bataev <a.bataev@outlook.com>
Thu, 15 Aug 2024 14:21:10 +0000 (15 07:21 -0700)
committerTobias Hieta <tobias@hieta.se>
Fri, 13 Sep 2024 05:58:38 +0000 (13 07:58 +0200)
treedeedf7a23ddbd7421a9a96776013791cc9e12935
parent32a8b56bbf0a3c7678d44ba690427915446a9a72
[SLP]Fix PR104422: Wrong value truncation

The minbitwidth restrictions can be skipped only for immediate reduced
values, for other nodes still need to check if external users allow
bitwidth reduction.

Fixes https://github.com/llvm/llvm-project/issues/104422

(cherry picked from commit 56140a8258a3498cfcd9f0f05c182457d43cbfd2)
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/test/Transforms/SLPVectorizer/X86/operand-is-reduced-val.ll [new file with mode: 0644]