diff options
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 8edbdf07cce..9a656a7c83a 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 && | 

