@@ -118,4 +118,36 @@ for.body: ; preds = %entry, %for.body
118118 br i1 %exitcond.not , label %exit , label %for.body
119119}
120120
121+ define i1 @test_extra_cmp_user (ptr nocapture noundef %dst , ptr nocapture noundef readonly %src ) {
122+ ; CHECK-LABEL: LV: Checking a loop in 'test_extra_cmp_user'
123+ ; CHECK: Cost of 4 for VF 8: induction instruction %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
124+ ; CHECK-NEXT: Cost of 0 for VF 8: induction instruction %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
125+ ; CHECK-NEXT: Cost of 4 for VF 8: exit condition instruction %exitcond.not = icmp eq i64 %indvars.iv.next, 16
126+ ; CHECK-NEXT: Cost of 0 for VF 8: EMIT vp<%3> = CANONICAL-INDUCTION ir<0>, vp<%index.next>
127+ ; CHECK: Cost for VF 8: 12
128+ ; CHECK-NEXT: Cost of 8 for VF 16: induction instruction %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
129+ ; CHECK-NEXT: Cost of 0 for VF 16: induction instruction %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
130+ ; CHECK-NEXT: Cost of 8 for VF 16: exit condition instruction %exitcond.not = icmp eq i64 %indvars.iv.next, 16
131+ ; CHECK-NEXT: Cost of 0 for VF 16: EMIT vp<%3> = CANONICAL-INDUCTION ir<0>, vp<%index.next>
132+ ; CHECK: Cost for VF 16: 20
133+ ; CHECK: LV: Selecting VF: 16
134+ entry:
135+ br label %for.body
136+
137+ for.body:
138+ %indvars.iv = phi i64 [ 0 , %entry ], [ %indvars.iv.next , %for.body ]
139+ %arrayidx = getelementptr inbounds nuw i8 , ptr %src , i64 %indvars.iv
140+ %0 = load i8 , ptr %arrayidx , align 4
141+ %arrayidx2 = getelementptr inbounds nuw i8 , ptr %dst , i64 %indvars.iv
142+ %1 = load i8 , ptr %arrayidx2 , align 4
143+ %add = add nsw i8 %1 , %0
144+ store i8 %add , ptr %arrayidx2 , align 4
145+ %indvars.iv.next = add nuw nsw i64 %indvars.iv , 1
146+ %exitcond.not = icmp eq i64 %indvars.iv.next , 16
147+ br i1 %exitcond.not , label %exit , label %for.body
148+
149+ exit:
150+ ret i1 %exitcond.not
151+ }
152+
121153attributes #0 = { vscale_range(1 , 16 ) "target-features" ="+sve" }
0 commit comments