[DAGCombiner] isAllOnesConstantOrAllOnesSplatConstant(): look through bitcasts
authorRoman Lebedev <lebedev.ri@gmail.com>
Mon, 21 May 2018 21:41:10 +0000 (21:41 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Mon, 21 May 2018 21:41:10 +0000 (21:41 +0000)
commit9f65d16d5d06bbfc075cdd9c8635f5af88baaf8b
tree2202debcdd70e71ae4d06e6cf159c4c8c4b6c05a
parent7772de25d07c977e41f8faa3bbf327033cd81c20
[DAGCombiner] isAllOnesConstantOrAllOnesSplatConstant(): look through bitcasts

Summary:
As pointed out in D46528, we errneously transform cases like `xor X, -1`,
even though we use said function.
It's because the `-1` is actually a bitcast there.
So i think we can just look through it in the function.

Differential Revision: https://reviews.llvm.org/D47156

llvm-svn: 332905
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/unfold-masked-merge-vector-variablemask-const.ll