@@ -3033,6 +3033,7 @@ bool DAGTypeLegalizer::SplitVectorOperand(SDNode *N, unsigned OpNo) {
3033
3033
" operand!\n " );
3034
3034
3035
3035
case ISD::VP_SETCC:
3036
+ case ISD::STRICT_FSETCC:
3036
3037
case ISD::SETCC: Res = SplitVecOp_VSETCC (N); break ;
3037
3038
case ISD::BITCAST: Res = SplitVecOp_BITCAST (N); break ;
3038
3039
case ISD::EXTRACT_SUBVECTOR: Res = SplitVecOp_EXTRACT_SUBVECTOR (N); break ;
@@ -3997,14 +3998,16 @@ SDValue DAGTypeLegalizer::SplitVecOp_TruncateHelper(SDNode *N) {
3997
3998
}
3998
3999
3999
4000
SDValue DAGTypeLegalizer::SplitVecOp_VSETCC (SDNode *N) {
4001
+ bool isStrict = N->getOpcode () == ISD::STRICT_FSETCC;
4000
4002
assert (N->getValueType (0 ).isVector () &&
4001
- N->getOperand (0 ).getValueType ().isVector () &&
4003
+ N->getOperand (isStrict ? 1 : 0 ).getValueType ().isVector () &&
4002
4004
" Operand types must be vectors" );
4003
4005
// The result has a legal vector type, but the input needs splitting.
4004
4006
SDValue Lo0, Hi0, Lo1, Hi1, LoRes, HiRes;
4005
4007
SDLoc DL (N);
4006
- GetSplitVector (N->getOperand (0 ), Lo0, Hi0);
4007
- GetSplitVector (N->getOperand (1 ), Lo1, Hi1);
4008
+ GetSplitVector (N->getOperand (isStrict ? 1 : 0 ), Lo0, Hi0);
4009
+ GetSplitVector (N->getOperand (isStrict ? 2 : 1 ), Lo1, Hi1);
4010
+
4008
4011
auto PartEltCnt = Lo0.getValueType ().getVectorElementCount ();
4009
4012
4010
4013
LLVMContext &Context = *DAG.getContext ();
@@ -4014,6 +4017,16 @@ SDValue DAGTypeLegalizer::SplitVecOp_VSETCC(SDNode *N) {
4014
4017
if (N->getOpcode () == ISD::SETCC) {
4015
4018
LoRes = DAG.getNode (ISD::SETCC, DL, PartResVT, Lo0, Lo1, N->getOperand (2 ));
4016
4019
HiRes = DAG.getNode (ISD::SETCC, DL, PartResVT, Hi0, Hi1, N->getOperand (2 ));
4020
+ } else if (N->getOpcode () == ISD::STRICT_FSETCC) {
4021
+ LoRes = DAG.getNode (ISD::STRICT_FSETCC, DL,
4022
+ DAG.getVTList (PartResVT, N->getValueType (1 )),
4023
+ N->getOperand (0 ), Lo0, Lo1, N->getOperand (3 ));
4024
+ HiRes = DAG.getNode (ISD::STRICT_FSETCC, DL,
4025
+ DAG.getVTList (PartResVT, N->getValueType (1 )),
4026
+ N->getOperand (0 ), Hi0, Hi1, N->getOperand (3 ));
4027
+ SDValue NewChain = DAG.getNode (ISD::TokenFactor, DL, MVT::Other,
4028
+ LoRes.getValue (1 ), HiRes.getValue (1 ));
4029
+ ReplaceValueWith (SDValue (N, 1 ), NewChain);
4017
4030
} else {
4018
4031
assert (N->getOpcode () == ISD::VP_SETCC && " Expected VP_SETCC opcode" );
4019
4032
SDValue MaskLo, MaskHi, EVLLo, EVLHi;
0 commit comments