summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2013-11-25 11:14:43 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2013-11-25 11:14:43 +0000
commit4ac67fa809e447127872674647822819c0e8de9b (patch)
tree67c2e0c5d2a96d25454f375ef969fec1adc8f0a9 /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parent8a6c627fd04c45bb9aee7e469311adbdc4f44639 (diff)
downloadllvm-4ac67fa809e447127872674647822819c0e8de9b.tar.gz
llvm-4ac67fa809e447127872674647822819c0e8de9b.tar.bz2
llvm-4ac67fa809e447127872674647822819c0e8de9b.tar.xz
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
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index c0e8a72aa3..6c335d96c7 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -671,6 +671,8 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
DEBUG(dbgs() << "Type-legalized selection DAG: BB#" << BlockNumber
<< " '" << BlockName << "'\n"; CurDAG->dump());
+ CurDAG->NewNodesMustHaveLegalTypes = true;
+
if (Changed) {
if (ViewDAGCombineLT)
CurDAG->viewGraph("dag-combine-lt input for " + BlockName);
@@ -712,8 +714,6 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
<< BlockNumber << " '" << BlockName << "'\n"; CurDAG->dump());
}
- CurDAG->NewNodesMustHaveLegalTypes = true;
-
if (ViewLegalizeDAGs) CurDAG->viewGraph("legalize input for " + BlockName);
{