File tree Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,18 @@ struct is_specific_cst {
116
116
// / Match an SCEV constant with a plain unsigned integer.
117
117
inline cst_pred_ty<is_specific_cst> m_scev_SpecificInt (uint64_t V) { return V; }
118
118
119
+ struct is_specific_signed_cst {
120
+ int64_t CV;
121
+ is_specific_signed_cst (int64_t C) : CV(C) {}
122
+ bool isValue (const APInt &C) const { return C.trySExtValue () == CV; }
123
+ };
124
+
125
+ // / Match an SCEV constant with a plain signed integer (sign-extended value will
126
+ // / be matched)
127
+ inline cst_pred_ty<is_specific_signed_cst> m_scev_SpecificSInt (int64_t V) {
128
+ return V;
129
+ }
130
+
119
131
struct bind_cst_ty {
120
132
const APInt *&CR;
121
133
Original file line number Diff line number Diff line change @@ -5918,21 +5918,11 @@ void LoopVectorizationCostModel::setVectorizedCallDecision(ElementCount VF) {
5918
5918
// TODO: do we need to figure out the cost of an extract to get the
5919
5919
// first lane? Or do we hope that it will be folded away?
5920
5920
ScalarEvolution *SE = PSE.getSE ();
5921
- const auto *SAR =
5922
- dyn_cast<SCEVAddRecExpr>(SE-> getSCEV (ScalarParam));
5923
-
5924
- if (!SAR || SAR-> getLoop () != TheLoop) {
5921
+ if (! match (SE-> getSCEV (ScalarParam),
5922
+ m_scev_AffineAddRec (
5923
+ m_SCEV (), m_scev_SpecificSInt (Param. LinearStepOrPos ),
5924
+ m_SpecificLoop ( TheLoop))))
5925
5925
ParamsOk = false ;
5926
- break ;
5927
- }
5928
-
5929
- const SCEVConstant *Step =
5930
- dyn_cast<SCEVConstant>(SAR->getStepRecurrence (*SE));
5931
-
5932
- if (!Step ||
5933
- Step->getAPInt ().getSExtValue () != Param.LinearStepOrPos )
5934
- ParamsOk = false ;
5935
-
5936
5926
break ;
5937
5927
}
5938
5928
case VFParamKind::GlobalPredicate:
You can’t perform that action at this time.
0 commit comments