@@ -3046,35 +3046,8 @@ inline InsertValue_match<Ind, Val_t, Elt_t> m_InsertValue(const Val_t &Val,
30463046 return InsertValue_match<Ind, Val_t, Elt_t>(Val, Elt);
30473047}
30483048
3049- // / Matches patterns for `vscale`. This can either be a call to `llvm.vscale` or
3050- // / the constant expression
3051- // / `ptrtoint(gep <vscale x 1 x i8>, <vscale x 1 x i8>* null, i32 1>`
3052- // / under the right conditions determined by DataLayout.
3053- struct VScaleVal_match {
3054- template <typename ITy> bool match (ITy *V) const {
3055- if (m_Intrinsic<Intrinsic::vscale>().match (V))
3056- return true ;
3057-
3058- Value *Ptr;
3059- if (m_PtrToInt (m_Value (Ptr)).match (V)) {
3060- if (auto *GEP = dyn_cast<GEPOperator>(Ptr)) {
3061- auto *DerefTy =
3062- dyn_cast<ScalableVectorType>(GEP->getSourceElementType ());
3063- if (GEP->getNumIndices () == 1 && DerefTy &&
3064- DerefTy->getElementType ()->isIntegerTy (8 ) &&
3065- m_Zero ().match (GEP->getPointerOperand ()) &&
3066- m_SpecificInt (1 ).match (GEP->idx_begin ()->get ()))
3067- return true ;
3068- }
3069- }
3070-
3071- return false ;
3072- }
3073- };
3074-
3075- inline VScaleVal_match m_VScale () {
3076- return VScaleVal_match ();
3077- }
3049+ // / Matches a call to `llvm.vscale()`.
3050+ inline IntrinsicID_match m_VScale () { return m_Intrinsic<Intrinsic::vscale>(); }
30783051
30793052template <typename Opnd0, typename Opnd1>
30803053inline typename m_Intrinsic_Ty<Opnd0, Opnd1>::Ty
0 commit comments