diff options
| author | Eric Christopher <echristo@apple.com> | 2011-06-01 19:55:10 +0000 |
|---|---|---|
| committer | Eric Christopher <echristo@apple.com> | 2011-06-01 19:55:10 +0000 |
| commit | 690030c11645c8d39b6689d34ff5044eee394e08 (patch) | |
| tree | d42747c420941f8041cbe7b611f1235297f455a2 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
| parent | aab130d9955dd9cae2f0207d59f9228c830927db (diff) | |
| download | llvm-690030c11645c8d39b6689d34ff5044eee394e08.zip llvm-690030c11645c8d39b6689d34ff5044eee394e08.tar.gz llvm-690030c11645c8d39b6689d34ff5044eee394e08.tar.bz2 | |
Allow bitcasts between valid types of the same size and vector
types if the vector type is legal.
Fixes rdar://9306086
llvm-svn: 132420
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 8edbdf0..9a656a7 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -282,6 +282,12 @@ static SDValue getCopyFromPartsVector(SelectionDAG &DAG, DebugLoc DL, // Vector/Vector bitcast. return DAG.getNode(ISD::BITCAST, DL, ValueVT, Val); } + + // Trivial bitcast if the types are the same size and the destination + // vector type is legal. + if (PartVT.getSizeInBits() == ValueVT.getSizeInBits() && + TLI.isTypeLegal(ValueVT)) + return DAG.getNode(ISD::BITCAST, DL, ValueVT, Val); assert(ValueVT.getVectorElementType() == PartVT && ValueVT.getVectorNumElements() == 1 && |
