[InstCombine] allow SimplifyDemandedVectorElts to work with FP binops
authorSanjay Patel <spatel@rotateright.com>
Wed, 3 Oct 2018 21:44:59 +0000 (21:44 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 3 Oct 2018 21:44:59 +0000 (21:44 +0000)
commitcafdeb1aa64e4437c93da9fa7e0cc1b81dd89433
tree4283cb12fb281bf705cd6c8a943a02108fdb88e5
parent0e99f561e1fc419eb5d67a8b7f4a1149906fff4f
[InstCombine] allow SimplifyDemandedVectorElts to work with FP binops

We're a long way from D50992 and D51553, but this is where we have to start.
We weren't back-propagating undefs into binop constant values for anything but
add/sub/mul/and/or/xor.

This is likely because we have to be careful about not introducing UB/poison
with div/rem/shift. But I suspect we already are getting the poison part wrong
for add/sub/mul (although it may not be possible to expose the bug currently
because we use SimplifyDemandedVectorElts from a limited set of opcodes).
See the discussion/implementation from D48987 and D49047.

This patch just enables functionality for FP ops because those do not have
UB/poison potential.

llvm-svn: 343727
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
llvm/test/Transforms/InstCombine/X86/x86-avx512.ll
llvm/test/Transforms/InstCombine/shuffle_select.ll
llvm/test/Transforms/InstCombine/vec_demanded_elts.ll
llvm/test/Transforms/InstCombine/vec_shuffle.ll