@@ -1263,7 +1263,7 @@ bool llvm::maskIsAllZeroOrUndef(Value *Mask) {
12631263 auto *ConstMask = dyn_cast<Constant>(Mask);
12641264 if (!ConstMask)
12651265 return false ;
1266- if (ConstMask-> isNullValue () || isa<UndefValue>(ConstMask ))
1266+ if (match ( ConstMask, m_CombineOr ( m_Zero (), m_Undef ()) ))
12671267 return true ;
12681268 if (isa<ScalableVectorType>(ConstMask->getType ()))
12691269 return false ;
@@ -1272,7 +1272,7 @@ bool llvm::maskIsAllZeroOrUndef(Value *Mask) {
12721272 E = cast<FixedVectorType>(ConstMask->getType ())->getNumElements ();
12731273 I != E; ++I) {
12741274 if (auto *MaskElt = ConstMask->getAggregateElement (I))
1275- if (MaskElt-> isNullValue () || isa<UndefValue>(MaskElt ))
1275+ if (match ( MaskElt, m_CombineOr ( m_Zero (), m_Undef ()) ))
12761276 continue ;
12771277 return false ;
12781278 }
@@ -1289,7 +1289,7 @@ bool llvm::maskIsAllOneOrUndef(Value *Mask) {
12891289 auto *ConstMask = dyn_cast<Constant>(Mask);
12901290 if (!ConstMask)
12911291 return false ;
1292- if (ConstMask-> isAllOnesValue () || isa<UndefValue>(ConstMask ))
1292+ if (match ( ConstMask, m_CombineOr ( m_AllOnes (), m_Undef ()) ))
12931293 return true ;
12941294 if (isa<ScalableVectorType>(ConstMask->getType ()))
12951295 return false ;
@@ -1298,7 +1298,7 @@ bool llvm::maskIsAllOneOrUndef(Value *Mask) {
12981298 E = cast<FixedVectorType>(ConstMask->getType ())->getNumElements ();
12991299 I != E; ++I) {
13001300 if (auto *MaskElt = ConstMask->getAggregateElement (I))
1301- if (MaskElt-> isAllOnesValue () || isa<UndefValue>(MaskElt ))
1301+ if (match ( MaskElt, m_CombineOr ( m_AllOnes (), m_Undef ()) ))
13021302 continue ;
13031303 return false ;
13041304 }
@@ -1315,7 +1315,7 @@ bool llvm::maskContainsAllOneOrUndef(Value *Mask) {
13151315 auto *ConstMask = dyn_cast<Constant>(Mask);
13161316 if (!ConstMask)
13171317 return false ;
1318- if (ConstMask-> isAllOnesValue () || isa<UndefValue>(ConstMask ))
1318+ if (match ( ConstMask, m_CombineOr ( m_AllOnes (), m_Undef ()) ))
13191319 return true ;
13201320 if (isa<ScalableVectorType>(ConstMask->getType ()))
13211321 return false ;
@@ -1324,7 +1324,7 @@ bool llvm::maskContainsAllOneOrUndef(Value *Mask) {
13241324 E = cast<FixedVectorType>(ConstMask->getType ())->getNumElements ();
13251325 I != E; ++I) {
13261326 if (auto *MaskElt = ConstMask->getAggregateElement (I))
1327- if (MaskElt-> isAllOnesValue () || isa<UndefValue>(MaskElt ))
1327+ if (match ( MaskElt, m_CombineOr ( m_AllOnes (), m_Undef ()) ))
13281328 return true ;
13291329 }
13301330 return false ;
0 commit comments