summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2008-07-17 19:28:41 +0000
committerDuncan Sands <baldrick@free.fr>2008-07-17 19:28:41 +0000
commit656b256a1a82b8ce8101ee3d2838b837577db87a (patch)
tree01e640062bdf0d43123003ccc588683b0f853bc6 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent170596810229f6aefeab1adf64f238931f93995f (diff)
downloadbcm5719-llvm-656b256a1a82b8ce8101ee3d2838b837577db87a.tar.gz
bcm5719-llvm-656b256a1a82b8ce8101ee3d2838b837577db87a.zip
Use a legal type for elements of the vector_shuffle
mask. These are just indices into the shuffled vector so their type is unrelated to the type of the shuffled elements (which is what was being used before). This fixes vec_shuffle-11.ll when using LegalizeTypes. What seems to have happened is that Dan's recent change r53687, which corrected the result type of the shuffle, somehow caused LegalizeTypes to notice that the mask operand was a BUILD_VECTOR with a legal type but elements of an illegal type (i64). LegalizeTypes legalized this by introducing a new BUILD_VECTOR of i32 and bitcasting it to the old type. But the mask operand is not supposed to be a bitcast but a straight BUILD_VECTOR of constants, causing a crash. llvm-svn: 53729
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 14efb446fea..bc685efe3a8 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -5046,9 +5046,9 @@ SDOperand DAGCombiner::XformToShuffleWithZero(SDNode *N) {
if (!isa<ConstantSDNode>(Elt))
return SDOperand();
else if (cast<ConstantSDNode>(Elt)->isAllOnesValue())
- IdxOps.push_back(DAG.getConstant(i, EVT));
+ IdxOps.push_back(DAG.getConstant(i, TLI.getPointerTy()));
else if (cast<ConstantSDNode>(Elt)->isNullValue())
- IdxOps.push_back(DAG.getConstant(NumElts, EVT));
+ IdxOps.push_back(DAG.getConstant(NumElts, TLI.getPointerTy()));
else
return SDOperand();
}
@@ -5066,7 +5066,8 @@ SDOperand DAGCombiner::XformToShuffleWithZero(SDNode *N) {
std::vector<SDOperand> ZeroOps(NumElts, DAG.getConstant(0, EVT));
Ops.push_back(DAG.getNode(ISD::BUILD_VECTOR, VT,
&ZeroOps[0], ZeroOps.size()));
- Ops.push_back(DAG.getNode(ISD::BUILD_VECTOR, VT,
+ Ops.push_back(DAG.getNode(ISD::BUILD_VECTOR,
+ MVT::getVectorVT(TLI.getPointerTy(), NumElts),
&IdxOps[0], IdxOps.size()));
SDOperand Result = DAG.getNode(ISD::VECTOR_SHUFFLE, VT,
&Ops[0], Ops.size());
OpenPOWER on IntegriCloud