@@ -3383,65 +3383,15 @@ static SDValue TryMatchTrue(SDNode *N, EVT VecVT, SelectionDAG &DAG) {
33833383 return DAG.getZExtOrTrunc (Ret, DL, N->getValueType (0 ));
33843384}
33853385
3386- // / Try to convert a i128 comparison to a v16i8 comparison before type
3387- // / legalization splits it up into chunks
3388- static SDValue
3389- combineVectorSizedSetCCEquality (SDNode *N, TargetLowering::DAGCombinerInfo &DCI,
3390- const WebAssemblySubtarget *Subtarget) {
3391-
3392- SDLoc DL (N);
3393- SDValue X = N->getOperand (0 );
3394- SDValue Y = N->getOperand (1 );
3395- EVT VT = N->getValueType (0 );
3396- EVT OpVT = X.getValueType ();
3397-
3398- SelectionDAG &DAG = DCI.DAG ;
3399- if (DCI.DAG .getMachineFunction ().getFunction ().hasFnAttribute (
3400- Attribute::NoImplicitFloat))
3401- return SDValue ();
3402-
3403- ISD::CondCode CC = cast<CondCodeSDNode>(N->getOperand (2 ))->get ();
3404- // We're looking for an oversized integer equality comparison with SIMD
3405- if (!OpVT.isScalarInteger () || !OpVT.isByteSized () || OpVT != MVT::i128 ||
3406- !Subtarget->hasSIMD128 () || !isIntEqualitySetCC (CC))
3407- return SDValue ();
3408-
3409- // Don't perform this combine if constructing the vector will be expensive.
3410- auto IsVectorBitCastCheap = [](SDValue X) {
3411- X = peekThroughBitcasts (X);
3412- return isa<ConstantSDNode>(X) || X.getOpcode () == ISD::LOAD;
3413- };
3414-
3415- if (!IsVectorBitCastCheap (X) || !IsVectorBitCastCheap (Y))
3416- return SDValue ();
3417-
3418- SDValue VecX = DAG.getBitcast (MVT::v16i8, X);
3419- SDValue VecY = DAG.getBitcast (MVT::v16i8, Y);
3420- SDValue Cmp = DAG.getSetCC (DL, MVT::v16i8, VecX, VecY, CC);
3421-
3422- SDValue Intr =
3423- DAG.getNode (ISD::INTRINSIC_WO_CHAIN, DL, MVT::i32 ,
3424- {DAG.getConstant (CC == ISD::SETEQ ? Intrinsic::wasm_alltrue
3425- : Intrinsic::wasm_anytrue,
3426- DL, MVT::i32 ),
3427- Cmp});
3428-
3429- return DAG.getSetCC (DL, VT, Intr, DAG.getConstant (0 , DL, MVT::i32 ), CC);
3430- }
3431-
34323386static SDValue performSETCCCombine (SDNode *N,
3433- TargetLowering::DAGCombinerInfo &DCI,
3434- const WebAssemblySubtarget *Subtarget) {
3387+ TargetLowering::DAGCombinerInfo &DCI) {
34353388 if (!DCI.isBeforeLegalize ())
34363389 return SDValue ();
34373390
34383391 EVT VT = N->getValueType (0 );
34393392 if (!VT.isScalarInteger ())
34403393 return SDValue ();
34413394
3442- if (SDValue V = combineVectorSizedSetCCEquality (N, DCI, Subtarget))
3443- return V;
3444-
34453395 SDValue LHS = N->getOperand (0 );
34463396 if (LHS->getOpcode () != ISD::BITCAST)
34473397 return SDValue ();
@@ -3621,7 +3571,7 @@ WebAssemblyTargetLowering::PerformDAGCombine(SDNode *N,
36213571 case ISD::BITCAST:
36223572 return performBitcastCombine (N, DCI);
36233573 case ISD::SETCC:
3624- return performSETCCCombine (N, DCI, Subtarget );
3574+ return performSETCCCombine (N, DCI);
36253575 case ISD::VECTOR_SHUFFLE:
36263576 return performVECTOR_SHUFFLECombine (N, DCI);
36273577 case ISD::SIGN_EXTEND:
0 commit comments