OSDN Git Service

[DAGCombiner] Don't make a BUILD_VECTOR with operands of illegal type.
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Wed, 5 Apr 2017 13:45:37 +0000 (13:45 +0000)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Wed, 5 Apr 2017 13:45:37 +0000 (13:45 +0000)
commit4a035b600a70f1e1b678186b6fcad5c73603b6a5
treec96aa0e870b65f6da795346ddea52f67f0af8d12
parent0a06935a2e6f997ac2cb682059838b88c4a2abe4
[DAGCombiner]  Don't make a BUILD_VECTOR with operands of illegal type.

When DAGCombiner visits a SIGN_EXTEND_INREG of a BUILD_VECTOR with
constant operands, a new BUILD_VECTOR node will be created transformed
constants.

Llvm-stress found a case where the new BUILD_VECTOR had constant operands
of an illegal type, because the (legal) element type is in fact not a legal
scalar type.

This patch changes this so that the new BUILD_VECTOR has the same operand
type as the old one.

Review: Eli Friedman, Nirav Dave
https://bugs.llvm.org//show_bug.cgi?id=32422

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299540 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
test/CodeGen/SystemZ/DAGCombiner_illegal_BUILD_VECTOR.ll [new file with mode: 0644]