diff options
| author | Eugene Leviant <eleviant@accesssoftek.com> | 2018-02-07 05:38:29 +0000 |
|---|---|---|
| committer | Eugene Leviant <eleviant@accesssoftek.com> | 2018-02-07 05:38:29 +0000 |
| commit | 25347ea8954dea9990ed142c1901d746cdcceeb6 (patch) | |
| tree | 0293a7fc7de067738b454e3677fbcf81a158b533 /llvm/lib | |
| parent | 33445765dde8fa341d71500ae6f734b67de2f275 (diff) | |
| download | bcm5719-llvm-25347ea8954dea9990ed142c1901d746cdcceeb6.tar.gz bcm5719-llvm-25347ea8954dea9990ed142c1901d746cdcceeb6.zip | |
[LegalizeDAG] Truncate condition operand of ISD::SELECT
Differential revision: https://reviews.llvm.org/D42737
llvm-svn: 324447
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp index 2e2619649be..8ca19257154 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -343,8 +343,8 @@ SDValue DAGTypeLegalizer::ScalarizeVecRes_VSELECT(SDNode *N) { ScalarBool = TargetLowering::UndefinedBooleanContent; } + EVT CondVT = Cond.getValueType(); if (ScalarBool != VecBool) { - EVT CondVT = Cond.getValueType(); switch (ScalarBool) { case TargetLowering::UndefinedBooleanContent: break; @@ -365,6 +365,11 @@ SDValue DAGTypeLegalizer::ScalarizeVecRes_VSELECT(SDNode *N) { } } + // Truncate the condition if needed + auto BoolVT = getSetCCResultType(CondVT); + if (BoolVT.bitsLT(CondVT)) + Cond = DAG.getNode(ISD::TRUNCATE, SDLoc(N), BoolVT, Cond); + return DAG.getSelect(SDLoc(N), LHS.getValueType(), Cond, LHS, GetScalarizedVector(N->getOperand(2))); |

