[VectorCombine] make load transform poison-safe
authorSanjay Patel <spatel@rotateright.com>
Mon, 14 Dec 2020 22:20:15 +0000 (17:20 -0500)
committerSanjay Patel <spatel@rotateright.com>
Mon, 14 Dec 2020 22:42:01 +0000 (17:42 -0500)
commitd399f870b5a94b9dcc1817ed69fec88c325bb817
tree525d3d22875e4e0507cf3dfcb484e4c22a9d5045
parentd636b881bb9214938973098a012fad453082c444
[VectorCombine] make load transform poison-safe

As noted in D93229, the transform from scalar load to vector load
potentially leaks poison from the extra vector elements that are
being loaded.

We could use freeze here (and x86 codegen at least appears to be
the same either way), but we already have a shuffle in this logic
to optionally change the vector size, so let's allow that
instruction to serve both purposes.

Differential Revision: https://reviews.llvm.org/D93238
llvm/lib/Transforms/Vectorize/VectorCombine.cpp
llvm/test/Transforms/VectorCombine/X86/load.ll