[DAGCombiner] don't try to extract a fraction of a vector binop and crash (PR39893)
authorSanjay Patel <spatel@rotateright.com>
Wed, 5 Dec 2018 17:10:30 +0000 (17:10 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 5 Dec 2018 17:10:30 +0000 (17:10 +0000)
commit33a448f935286de94f00a631277340b8c471a4c0
treee2e7d43a7319b3f76fd5cd98080c4d1f90973e8b
parent12e3a8af81da5f55381a47fada6f76a63ca735ce
[DAGCombiner] don't try to extract a fraction of a vector binop and crash (PR39893)

Because we're potentially peeking through a bitcast in this transform,
we need to use overall bitwidths rather than number of elements to
determine when it's safe to proceed.

Should fix:
https://bugs.llvm.org/show_bug.cgi?id=39893

llvm-svn: 348383
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/vector-narrow-binop.ll