Skip to content

Commit f5a628f

Browse files
Dinar TemirbulatovDinar Temirbulatov
authored andcommitted
Further test update.
1 parent 4135912 commit f5a628f

File tree

1 file changed

+13
-18
lines changed

1 file changed

+13
-18
lines changed
Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
; REQUIRES: asserts
2-
; RUN: opt < %s -passes=loop-vectorize -debug-only=loop-vectorize -S 2>&1 | FileCheck %s
2+
; RUN: opt < %s -passes=loop-vectorize -debug-only=loop-vectorize -disable-output -S 2>&1 | FileCheck %s
33

44
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
55
target triple = "arm64-apple-ios5.0.0"
66

77
define void @selects_1(ptr nocapture %dst, i32 %A, i32 %B, i32 %C, i32 %N) {
8+
; CHECK: LV: Checking a loop in 'selects_1'
89
; CHECK: LV: Found an estimated cost of 1 for VF 2 For instruction: %cond = select i1 %cmp1, i32 10, i32 %and
910
; CHECK: LV: Found an estimated cost of 1 for VF 2 For instruction: %cond6 = select i1 %cmp2, i32 30, i32 %and
1011
; CHECK: LV: Found an estimated cost of 1 for VF 2 For instruction: %cond11 = select i1 %cmp7, i32 %cond, i32 %cond6
1112

1213
; CHECK: LV: Found an estimated cost of 1 for VF 4 For instruction: %cond = select i1 %cmp1, i32 10, i32 %and
1314
; CHECK: LV: Found an estimated cost of 1 for VF 4 For instruction: %cond6 = select i1 %cmp2, i32 30, i32 %and
1415
; CHECK: LV: Found an estimated cost of 1 for VF 4 For instruction: %cond11 = select i1 %cmp7, i32 %cond, i32 %cond6
16+
; CHECK: LV: Selecting VF: 4
1517

1618
entry:
1719
%cmp26 = icmp sgt i32 %N, 0
1820
br i1 %cmp26, label %for.body.preheader, label %for.cond.cleanup
1921

2022
for.body.preheader: ; preds = %entry
21-
%wide.trip.count = zext i32 %N to i64
23+
%n = zext i32 %N to i64
2224
br label %for.body
2325

2426
for.body: ; preds = %for.body.preheader, %for.body
@@ -34,7 +36,7 @@ for.body: ; preds = %for.body.preheader,
3436
%cond11 = select i1 %cmp7, i32 %cond, i32 %cond6
3537
store i32 %cond11, ptr %arrayidx, align 4
3638
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
37-
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
39+
%exitcond.not = icmp eq i64 %indvars.iv.next, %n
3840
br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body
3941

4042
for.cond.cleanup.loopexit: ; preds = %for.body
@@ -44,37 +46,30 @@ for.cond.cleanup: ; preds = %for.cond.cleanup.lo
4446
ret void
4547
}
4648

47-
define i32 @multi_user_cmp(ptr readonly %a, i32 noundef %n) {
49+
define i32 @multi_user_cmp(ptr readonly %a, i64 noundef %n) {
50+
; CHECK: LV: Checking a loop in 'multi_user_cmp'
4851
; CHECK: LV: Found an estimated cost of 4 for VF 16 For instruction: %cmp1 = fcmp olt float %load1, 0.000000e+00
4952
; CHECK: LV: Found an estimated cost of 1 for VF 16 For instruction: %.any.0.off0 = select i1 %cmp1, i1 true, i1 %any.0.off09
50-
; CHECK: LV: Found an estimated cost of 1 for VF 16 For instruction: %all.0.off0. = select i1 %cmp1, i1 %all.0.off010, i1 false
53+
; CHECK: LV: Found an estimated cost of 1 for VF 16 For instruction: %all.off = select i1 %cmp1, i1 %all.off.next, i1 false
54+
; CHECK: LV: Selecting VF: 16.
5155
entry:
52-
%wide.trip.count = zext nneg i32 %n to i64
5356
br label %for.body
5457

5558
for.body:
5659
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
57-
%all.0.off010 = phi i1 [ true, %entry ], [ %all.0.off0., %for.body ]
60+
%all.off.next = phi i1 [ true, %entry ], [ %all.off, %for.body ]
5861
%any.0.off09 = phi i1 [ false, %entry ], [ %.any.0.off0, %for.body ]
5962
%arrayidx = getelementptr inbounds float, ptr %a, i64 %indvars.iv
6063
%load1 = load float, ptr %arrayidx, align 4
6164
%cmp1 = fcmp olt float %load1, 0.000000e+00
6265
%.any.0.off0 = select i1 %cmp1, i1 true, i1 %any.0.off09
63-
%all.0.off0. = select i1 %cmp1, i1 %all.0.off010, i1 false
66+
%all.off = select i1 %cmp1, i1 %all.off.next, i1 false
6467
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
65-
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
68+
%exitcond.not = icmp eq i64 %indvars.iv.next, %n
6669
br i1 %exitcond.not, label %exit, label %for.body
6770

6871
exit:
6972
%0 = select i1 %.any.0.off0, i32 2, i32 3
70-
%1 = select i1 %all.0.off0., i32 1, i32 %0
73+
%1 = select i1 %all.off, i32 1, i32 %0
7174
ret i32 %1
7275
}
73-
74-
; CHECK-LABEL: define void @selects_1(
75-
; CHECK: vector.body:
76-
; CHECK: select <4 x i1>
77-
78-
; CHECK-LABEL: define i32 @multi_user_cmp(
79-
; CHECK: vector.body:
80-
; CHECK: %index = phi i64

0 commit comments

Comments
 (0)