Skip to content

Commit c1cf0c2

Browse files
committed
Address review comments
1 parent 6b6819d commit c1cf0c2

File tree

1 file changed

+9
-18
lines changed

1 file changed

+9
-18
lines changed
Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
11
; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize \
22
; RUN: -force-tail-folding-style=data-with-evl \
33
; RUN: -prefer-predicate-over-epilogue=predicate-dont-vectorize \
4-
; RUN: -mtriple=riscv64 -mattr=+v -S < %s 2>&1 | FileCheck %s \
5-
; RUN: --check-prefix=EVL
4+
; RUN: -mtriple=riscv64 -mattr=+v -S < %s 2>&1 | FileCheck %s
65

7-
; RUN: opt -passes=loop-vectorize -debug-only=loop-vectorize \
8-
; RUN: -prefer-predicate-over-epilogue=predicate-dont-vectorize \
9-
; RUN: -mtriple=riscv64 -mattr=+v -S < %s 2>&1 | FileCheck %s \
10-
; RUN: --check-prefix=NO-EVL
11-
12-
; EVL: Cost of 2 for VF vscale x 4: WIDEN-INTRINSIC vp<%{{.+}}> = call llvm.vp.merge(ir<true>, ir<%add>, ir<%rdx>, vp<%{{.+}}>)
13-
; EVL: LV: Found an estimated cost of 2 for VF vscale x 4 For instruction: %rdx = phi i32 [ %start, %entry ], [ %add, %for.body ]
14-
15-
; NO-EVL: Cost of 0 for VF vscale x 4: EMIT vp<%{{.+}}> = select vp<%active.lane.mask>, ir<%add>, ir<%rdx>
16-
; NO-EVL: LV: Found an estimated cost of 0 for VF vscale x 4 For instruction: %rdx = phi i32 [ %start, %entry ], [ %add, %for.body ]
6+
; CHECK: Cost of 2 for VF vscale x 4: WIDEN-INTRINSIC vp<%{{.+}}> = call llvm.vp.merge(ir<true>, ir<%add>, ir<%rdx>, vp<%{{.+}}>)
7+
; CHECK: LV: Found an estimated cost of 2 for VF vscale x 4 For instruction: %rdx = phi i32 [ %start, %entry ], [ %add, %loop ]
178

189
define i32 @add(ptr %a, i64 %n, i32 %start) {
1910
entry:
20-
br label %for.body
11+
br label %loop
2112

22-
for.body:
23-
%iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
24-
%rdx = phi i32 [ %start, %entry ], [ %add, %for.body ]
13+
loop:
14+
%iv = phi i64 [ 0, %entry ], [ %iv.next, %loop ]
15+
%rdx = phi i32 [ %start, %entry ], [ %add, %loop ]
2516
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %iv
2617
%0 = load i32, ptr %arrayidx, align 4
2718
%add = add nsw i32 %0, %rdx
2819
%iv.next = add nuw nsw i64 %iv, 1
2920
%exitcond.not = icmp eq i64 %iv.next, %n
30-
br i1 %exitcond.not, label %for.end, label %for.body
21+
br i1 %exitcond.not, label %exit, label %loop
3122

32-
for.end:
23+
exit:
3324
ret i32 %add
3425
}

0 commit comments

Comments
 (0)