Fixed tryFoldToZero() for vector types that need expansion.
authorDaniel Sanders <daniel.sanders@imgtec.com>
Mon, 25 Nov 2013 11:14:43 +0000 (11:14 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Mon, 25 Nov 2013 11:14:43 +0000 (11:14 +0000)
commit4ac67fa809e447127872674647822819c0e8de9b
tree67c2e0c5d2a96d25454f375ef969fec1adc8f0a9
parent8a6c627fd04c45bb9aee7e469311adbdc4f44639
Fixed tryFoldToZero() for vector types that need expansion.

Summary:
Moved the requirement for SelectionDAG::getConstant() to return legally
typed nodes slightly earlier. There were two optional DAGCombine passes
that were missed out and were required to produce type-legal DAGs.

Simplified a code-path in tryFoldToZero() to use SelectionDAG::getConstant().
This provides support for both promoted and expanded vector types whereas the
previous code only supported promoted vector types.

Fixes a "Type for zero vector elements is not legal" assertion detected by
an llvm-stress generated test.

Reviewers: resistor

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D2251

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195635 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
test/CodeGen/Mips/msa/llvm-stress-s3926023935.ll [new file with mode: 0644]