summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorTim Renouf <tpr.llvm@botech.co.uk>2018-01-09 21:36:25 +0000
committerTim Renouf <tpr.llvm@botech.co.uk>2018-01-09 21:36:25 +0000
commitd68fa1be57ae66236af53f7a16e78309d2aecdea (patch)
tree8a0815339babc3ff1f7a2d53e63529f9b23e3705 /llvm/lib/CodeGen/SelectionDAG
parent6eaad1e5397dc84c7dbb78be4fa433bcd6fb137f (diff)
downloadbcm5719-llvm-d68fa1be57ae66236af53f7a16e78309d2aecdea.tar.gz
bcm5719-llvm-d68fa1be57ae66236af53f7a16e78309d2aecdea.zip
[SelectionDAG] Fixed f16-from-vector promotion problem
Summary: In the case of an fp_extend of v1f16 to v1f32 where the v1f16 is the result of a bitcast from i16, avoid creating an illegal fp16_to_fp where the input is not a vector and the result is a v1f32. V2: The fix is now to avoid vector scalarization creating a v1->scalar bitcast. Reviewers: srhines, t.p.northover Subscribers: nhaehnle, llvm-commits, dstuttard, t-tye, yaxunl, wdng, kzhuravl, arsenm Differential Revision: https://reviews.llvm.org/D41126 llvm-svn: 322120
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index 4b5cf6de5a5..ee9b3fde711 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -169,9 +169,15 @@ SDValue DAGTypeLegalizer::ScalarizeVecRes_MERGE_VALUES(SDNode *N,
}
SDValue DAGTypeLegalizer::ScalarizeVecRes_BITCAST(SDNode *N) {
+ SDValue Op = N->getOperand(0);
+ if (Op.getValueType().isVector()
+ && Op.getValueType().getVectorNumElements() == 1) {
+ assert(!isSimpleLegalType(Op.getValueType()));
+ Op = GetScalarizedVector(Op);
+ }
EVT NewVT = N->getValueType(0).getVectorElementType();
return DAG.getNode(ISD::BITCAST, SDLoc(N),
- NewVT, N->getOperand(0));
+ NewVT, Op);
}
SDValue DAGTypeLegalizer::ScalarizeVecRes_BUILD_VECTOR(SDNode *N) {
OpenPOWER on IntegriCloud