@@ -3247,10 +3247,18 @@ static SDValue performAnyAllCombine(SDNode *N, SelectionDAG &DAG) {
32473247  //  all_true (setcc <X>, 0, ne) => (all_true X)
32483248  assert (N->getOpcode () == ISD::INTRINSIC_WO_CHAIN);
32493249  using  namespace  llvm ::SDPatternMatch; 
3250-   SDLoc DL (N);
3251-   auto  CombineSetCC =
3252-       [&N, &DAG, &DL](Intrinsic::WASMIntrinsics InPre, ISD::CondCode SetType,
3253-                       Intrinsic::WASMIntrinsics InPost) -> SDValue {
3250+ 
3251+   SDValue LHS;
3252+   if  (!sd_match (N->getOperand (1 ),
3253+                 m_c_SetCC (m_Value (LHS), m_Zero (), m_CondCode ())))
3254+     return  SDValue ();
3255+   EVT LT = LHS.getValueType ();
3256+   if  (LT.getScalarSizeInBits () > 128  / LT.getVectorNumElements ())
3257+     return  SDValue ();
3258+ 
3259+   auto  CombineSetCC = [&N, &DAG](Intrinsic::WASMIntrinsics InPre,
3260+                                  ISD::CondCode SetType,
3261+                                  Intrinsic::WASMIntrinsics InPost) {
32543262    if  (N->getConstantOperandVal (0 ) != InPre)
32553263      return  SDValue ();
32563264
@@ -3259,11 +3267,7 @@ static SDValue performAnyAllCombine(SDNode *N, SelectionDAG &DAG) {
32593267                                              m_SpecificCondCode (SetType))))
32603268      return  SDValue ();
32613269
3262-     EVT LT = LHS.getValueType ();
3263-     unsigned  NumElts = LT.getVectorNumElements ();
3264-     if  (LT.getScalarSizeInBits () > 128  / NumElts)
3265-       return  SDValue ();
3266- 
3270+     SDLoc DL (N);
32673271    SDValue Ret = DAG.getZExtOrTrunc (
32683272        DAG.getNode (ISD::INTRINSIC_WO_CHAIN, DL, MVT::i32 ,
32693273                    {DAG.getConstant (InPost, DL, MVT::i32 ), LHS}),
0 commit comments