summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-06-01 19:55:10 +0000
committerEric Christopher <echristo@apple.com>2011-06-01 19:55:10 +0000
commit690030c11645c8d39b6689d34ff5044eee394e08 (patch)
treed42747c420941f8041cbe7b611f1235297f455a2 /llvm/lib
parentaab130d9955dd9cae2f0207d59f9228c830927db (diff)
downloadbcm5719-llvm-690030c11645c8d39b6689d34ff5044eee394e08.tar.gz
bcm5719-llvm-690030c11645c8d39b6689d34ff5044eee394e08.zip
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')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp6
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 &&
OpenPOWER on IntegriCloud