summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-07-21 10:20:31 +0000
committerDuncan Sands <baldrick@free.fr>2008-07-21 10:20:31 +0000
commitb0e39386516c94edba98e7853b0f1f886ae428e9 (patch)
treef67d743ce03f5dff5eaf4d7dd710d2d0180c9446 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parentb3fa8639e1483909c733da224990feb401cab119 (diff)
downloadbcm5719-llvm-b0e39386516c94edba98e7853b0f1f886ae428e9.tar.gz
bcm5719-llvm-b0e39386516c94edba98e7853b0f1f886ae428e9.zip
Add VerifyNode, a place to put sanity checks on
generic SDNode's (nodes with their own constructors should do sanity checking in the constructor). Add sanity checks for BUILD_VECTOR and fix all the places that were producing bogus BUILD_VECTORs, as found by "make check". My favorite is the BUILD_VECTOR with only two operands that was being used to build a vector with four elements! llvm-svn: 53850
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 14efb446fea..aff38699185 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -5011,7 +5011,8 @@ SDOperand DAGCombiner::visitVECTOR_SHUFFLE(SDNode *N) {
} else {
unsigned NewIdx =
cast<ConstantSDNode>(ShufMask.getOperand(i))->getValue() - NumElts;
- MappedOps.push_back(DAG.getConstant(NewIdx, MVT::i32));
+ MappedOps.push_back(DAG.getConstant(NewIdx,
+ ShufMask.getOperand(i).getValueType()));
}
}
ShufMask = DAG.getNode(ISD::BUILD_VECTOR, ShufMask.getValueType(),
OpenPOWER on IntegriCloud