[InstCombine] Update instcombine for vectorOps to use new shufflevector semantics
authorManuelJBrito <manuel.brito@tecnico.ulisboa.pt>
Tue, 16 May 2023 17:24:55 +0000 (18:24 +0100)
committerManuelJBrito <manuel.brito@tecnico.ulisboa.pt>
Wed, 17 May 2023 06:56:45 +0000 (07:56 +0100)
commite335e8a43287b8258c719d7a21c4264b0550c554
treeb2233e42b593d0b4d30925f9c9335bf81946e99a
parentc04cf58dfc5430f0c82c8ef42c3a8cb43f84020b
[InstCombine] Update instcombine for vectorOps to use new shufflevector semantics

This patch updates the transformations in InstCombineVectorOps to use the new
hufflevector semantics that say that undefined values in the mask yield poison.

To prevent miscompilations we have to match with m_Poison instead of m_Undef.
Otherwise, we might introduce poison where there was previously undef.

Differential Revision: https://reviews.llvm.org/D150039
llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
llvm/test/Transforms/InstCombine/broadcast.ll
llvm/test/Transforms/InstCombine/vec_shuffle-inseltpoison.ll
llvm/test/Transforms/InstCombine/vec_shuffle.ll
llvm/test/Transforms/SLPVectorizer/X86/pr49081.ll