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 | 9aaa02a1d26a0969e95b285ea1190920a5bb37db (patch) | |
tree | 1abe38e491c7250219a29fe82edf5f3634784f46 /lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | 4abc5fea9c6c3b329fec58840999db06e108e535 (diff) |
Allow bitcasts between valid types of the same size and vector
types if the vector type is legal.
Fixes rdar://9306086
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132420 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 8edbdf07cc..9a656a7c83 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/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 && |