DAGCombine tryFoldToZero cannot create illegal types after type legalization
authorHal Finkel <hfinkel@anl.gov>
Tue, 9 Jul 2013 17:02:45 +0000 (17:02 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 9 Jul 2013 17:02:45 +0000 (17:02 +0000)
commitbd6f1f6896275e04ce46c9ef82fd96e2e6c125dd
tree50d0eb0284aa2922c94c32e88017656e7d9171eb
parent7a34599db017a5486cf7cd11eb124984acec8286
DAGCombine tryFoldToZero cannot create illegal types after type legalization

When folding sub x, x (and other similar constructs), where x is a vector, the
result is a vector of zeros. After type legalization, make sure that the input
zero elements have a legal type. This type may be larger than the result's
vector element type.

This was another bug found by llvm-stress.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185949 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/PowerPC/sub-bv-types.ll [new file with mode: 0644]