diff options
author | Nadav Rotem <nadav.rotem@intel.com> | 2012-01-10 14:28:46 +0000 |
---|---|---|
committer | Nadav Rotem <nadav.rotem@intel.com> | 2012-01-10 14:28:46 +0000 |
commit | 61bdf790355f8f67978acec217fa19fc39914031 (patch) | |
tree | 008c1edc191687b2d5486c9afde9fb3cff128d89 /llvm/lib/CodeGen | |
parent | 569f215771ab1d453f07a579c6d58efb740839b9 (diff) | |
download | bcm5719-llvm-61bdf790355f8f67978acec217fa19fc39914031.tar.gz bcm5719-llvm-61bdf790355f8f67978acec217fa19fc39914031.zip |
Fix a bug in the legalization of shuffle vectors. When we emulate shuffles using BUILD_VECTORS we may be using a BV of different type. Make sure to cast it back.
llvm-svn: 147851
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index e69cfd0bf49..4c5bb9e5055 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -2862,8 +2862,10 @@ void SelectionDAGLegalize::ExpandNode(SDNode *Node) { Op1, DAG.getIntPtrConstant(Idx - NumElems))); } - + Tmp1 = DAG.getNode(ISD::BUILD_VECTOR, dl, VT, &Ops[0], Ops.size()); + // We may have changed the BUILD_VECTOR type. Cast it back to the Node type. + Tmp1 = DAG.getNode(ISD::BITCAST, dl, Node->getValueType(0), Tmp1); Results.push_back(Tmp1); break; } |