@@ -670,7 +670,7 @@ NVPTXTargetLowering::NVPTXTargetLowering(const NVPTXTargetMachine &TM,
670670 setCondCodeAction ({ISD::SETNE, ISD::SETEQ, ISD::SETUGE, ISD::SETULE,
671671 ISD::SETUGT, ISD::SETULT, ISD::SETGT, ISD::SETLT,
672672 ISD::SETGE, ISD::SETLE},
673- MVT::i1, Custom );
673+ MVT::i1, Expand );
674674
675675 // expand extload of vector of integers.
676676 setLoadExtAction ({ISD::EXTLOAD, ISD::SEXTLOAD, ISD::ZEXTLOAD}, MVT::v2i16,
@@ -2673,46 +2673,6 @@ SDValue NVPTXTargetLowering::LowerShiftLeftParts(SDValue Op,
26732673 }
26742674}
26752675
2676- // Lowers SETCC nodes that aren't directly supported by our arch.
2677- SDValue NVPTXTargetLowering::LowerSETCC (SDValue Op, SelectionDAG &DAG) const {
2678- SDValue L = Op->getOperand (0 );
2679- SDValue R = Op->getOperand (1 );
2680-
2681- if (L.getValueType () != MVT::i1)
2682- return SDValue ();
2683-
2684- SDLoc DL (Op);
2685- SDValue Ret;
2686- switch (cast<CondCodeSDNode>(Op->getOperand (2 ))->get ()) {
2687- default :
2688- llvm_unreachable (" Unknown integer setcc!" );
2689- case ISD::SETEQ: // X == Y -> ~(X^Y)
2690- Ret = DAG.getNOT (DL, DAG.getNode (ISD::XOR, DL, MVT::i1, L, R), MVT::i1);
2691- break ;
2692- case ISD::SETNE: // X != Y --> (X^Y)
2693- Ret = DAG.getNode (ISD::XOR, DL, MVT::i1, L, R);
2694- break ;
2695- case ISD::SETGT: // X >s Y --> X == 0 & Y == 1 --> ~X & Y
2696- case ISD::SETULT: // X <u Y --> X == 0 & Y == 1 --> ~X & Y
2697- Ret = DAG.getNode (ISD::AND, DL, MVT::i1, R, DAG.getNOT (DL, L, MVT::i1));
2698- break ;
2699- case ISD::SETLT: // X <s Y --> X == 1 & Y == 0 --> ~Y & X
2700- case ISD::SETUGT: // X >u Y --> X == 1 & Y == 0 --> ~Y & X
2701- Ret = DAG.getNode (ISD::AND, DL, MVT::i1, L, DAG.getNOT (DL, R, MVT::i1));
2702- break ;
2703- case ISD::SETULE: // X <=u Y --> X == 0 | Y == 1 --> ~X | Y
2704- case ISD::SETGE: // X >=s Y --> X == 0 | Y == 1 --> ~X | Y
2705- Ret = DAG.getNode (ISD::OR, DL, MVT::i1, R, DAG.getNOT (DL, L, MVT::i1));
2706- break ;
2707- case ISD::SETUGE: // X >=u Y --> X == 1 | Y == 0 --> ~Y | X
2708- case ISD::SETLE: // X <=s Y --> X == 1 | Y == 0 --> ~Y | X
2709- Ret = DAG.getNode (ISD::OR, DL, MVT::i1, L, DAG.getNOT (DL, R, MVT::i1));
2710- break ;
2711- }
2712-
2713- return DAG.getZExtOrTrunc (Ret, DL, Op.getValueType ());
2714- }
2715-
27162676// / If the types match, convert the generic copysign to the NVPTXISD version,
27172677// / otherwise bail ensuring that mismatched cases are properly expaned.
27182678SDValue NVPTXTargetLowering::LowerFCOPYSIGN (SDValue Op,
@@ -2966,8 +2926,6 @@ NVPTXTargetLowering::LowerOperation(SDValue Op, SelectionDAG &DAG) const {
29662926 return LowerSTORE (Op, DAG);
29672927 case ISD::LOAD:
29682928 return LowerLOAD (Op, DAG);
2969- case ISD::SETCC:
2970- return LowerSETCC (Op, DAG);
29712929 case ISD::SHL_PARTS:
29722930 return LowerShiftLeftParts (Op, DAG);
29732931 case ISD::SRA_PARTS:
0 commit comments