[DAG] Ensure Legal BUILD_VECTOR elements types in shuffle->And combine
authorDavid Green <david.green@arm.com>
Mon, 8 Aug 2022 08:47:55 +0000 (09:47 +0100)
committerTobias Hieta <tobias@hieta.se>
Wed, 10 Aug 2022 08:58:53 +0000 (10:58 +0200)
commitbcd9043ccc96512ff97bb140a1ddc5b8e82902c3
tree1aa60c9bff5efd52803424fda7f7faa9c6df339a
parentb914b21ad19180da3c34ab39918fffcb51590cb7
[DAG] Ensure Legal BUILD_VECTOR elements types in shuffle->And combine

D129150 added a combine from shuffles to And that creates a BUILD_VECTOR
of constant elements. We need to ensure that the elements are of a legal
type, to prevent asserts during lowering.

Fixes #56970.

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

(cherry picked from commit 061e0189a3dab6b1831a80d489ff1b15ad93aafb)
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/ARM/vector-store.ll