Skip to content

Commit 3990d82

Browse files
committed
Precommit test case.
1 parent ee7a6a4 commit 3990d82

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
; REQUIRES: asserts
2+
; RUN: opt -passes=loop-vectorize -mtriple riscv64 -mattr=+v -vectorizer-maximize-bandwidth -debug-only=loop-vectorize,vplan -disable-output -force-vector-interleave=1 -enable-epilogue-vectorization=false -S < %s 2>&1 | FileCheck %s --check-prefixes=CHECK-REGS-VP
3+
; RUN: opt -passes=loop-vectorize -mtriple riscv64 -mattr=+v -vectorizer-maximize-bandwidth -debug-only=loop-vectorize -disable-output -force-target-num-vector-regs=1 -force-vector-interleave=1 -enable-epilogue-vectorization=false -S < %s 2>&1 | FileCheck %s --check-prefixes=CHECK-NOREGS-VP
4+
define i32 @dotp(ptr %a, ptr %b) {
5+
; CHECK-REGS-VP: LV(REG): VF = vscale x 16
6+
; CHECK-REGS-VP-NEXT: LV(REG): Found max usage: 2 item
7+
; CHECK-REGS-VP-NEXT: LV(REG): RegisterClass: RISCV::GPRRC, 5 registers
8+
; CHECK-REGS-VP-NEXT: LV(REG): RegisterClass: RISCV::VRRC, 40 registers
9+
; CHECK-REGS-VP-NEXT: LV(REG): Found invariant usage: 1 item
10+
; CHECK-REGS-VP-NEXT: LV(REG): RegisterClass: RISCV::GPRRC, 1 registers
11+
; CHECK-REGS-VP: LV(REG): Not considering vector loop of width vscale x 16 because it uses too many registers
12+
; CHECK-REGS-VP: LV: Selecting VF: vscale x 8.
13+
;
14+
; CHECK-NOREGS-VP: LV(REG): Not considering vector loop of width vscale x 8 because it uses too many registers
15+
; CHECK-NOREGS-VP: LV(REG): Not considering vector loop of width vscale x 16 because it uses too many registers
16+
; CHECK-NOREGS-VP: LV: Selecting VF: vscale x 4.
17+
entry:
18+
br label %for.body
19+
20+
for.body: ; preds = %for.body, %entry
21+
%iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
22+
%accum = phi i32 [ 0, %entry ], [ %add, %for.body ]
23+
%gep.a = getelementptr i8, ptr %a, i64 %iv
24+
%load.a = load i8, ptr %gep.a, align 1
25+
%ext.a = zext i8 %load.a to i32
26+
%gep.b = getelementptr i8, ptr %b, i64 %iv
27+
%load.b = load i8, ptr %gep.b, align 1
28+
%ext.b = zext i8 %load.b to i32
29+
%mul = mul i32 %ext.b, %ext.a
30+
%sub = sub i32 0, %mul
31+
%add = add i32 %accum, %sub
32+
%iv.next = add i64 %iv, 1
33+
%exitcond.not = icmp eq i64 %iv.next, 1024
34+
br i1 %exitcond.not, label %for.exit, label %for.body
35+
36+
for.exit: ; preds = %for.body
37+
ret i32 %add
38+
}

0 commit comments

Comments
 (0)