Skip to content

Commit ac5501c

Browse files
committed
add test
1 parent 1a5f906 commit ac5501c

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

llvm/test/Transforms/LICM/licm-ci.ll

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2+
; RUN: opt -S -passes=licm < %s | FileCheck %s
3+
4+
define void @vmp_test_vmp(ptr addrspace(3) noalias %in1, i32 %y.0, ptr addrspace(3) noalias %in2, ptr addrspace(3) noalias %in3, ptr addrspace(3) noalias %in4, ptr noalias nocapture writeonly %sum1.0.lcssa.out, ptr noalias nocapture writeonly %sum2.0.lcssa.out, ptr noalias nocapture writeonly %sum3.0.lcssa.out, ptr noalias nocapture writeonly %sum4.0.lcssa.out) local_unnamed_addr #2 {
5+
; CHECK-LABEL: @vmp_test_vmp(
6+
; CHECK-NEXT: one.iter.loop.entry15:
7+
; CHECK-NEXT: br label [[ONE_ITER_LOOP_ENTRY:%.*]]
8+
; CHECK: one.iter.loop.entry:
9+
; CHECK-NEXT: [[ONE_ITER_IV:%.*]] = phi i32 [ 0, [[ONE_ITER_LOOP_ENTRY15:%.*]] ], [ [[ONE_ITER_IV_NEXT:%.*]], [[ONE_ITER_LOOP_ENTRY]] ]
10+
; CHECK-NEXT: [[ONE_ITER_IV_NEXT]] = add i32 [[ONE_ITER_IV]], 1
11+
; CHECK-NEXT: [[TMP0:%.*]] = icmp eq i32 [[ONE_ITER_IV_NEXT]], 1
12+
; CHECK-NEXT: br i1 [[TMP0]], label [[ONE_ITER_LOOP_EXIT:%.*]], label [[ONE_ITER_LOOP_ENTRY]]
13+
; CHECK: one.iter.loop.exit:
14+
; CHECK-NEXT: [[MUL_LE:%.*]] = mul nsw i32 [[Y_0:%.*]], 48
15+
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds i16, ptr addrspace(3) [[IN1:%.*]], i32 [[MUL_LE]]
16+
; CHECK-NEXT: [[WIDE_MASKED_LOAD_LE:%.*]] = tail call <4 x i16> @llvm.masked.load.v4i16.p3(ptr addrspace(3) [[TMP1]], i32 2, <4 x i1> <i1 true, i1 false, i1 true, i1 false>, <4 x i16> <i16 0, i16 poison, i16 0, i16 poison>)
17+
; CHECK-NEXT: [[TMP2:%.*]] = tail call i16 @llvm.vector.reduce.add.v4i16(<4 x i16> [[WIDE_MASKED_LOAD_LE]])
18+
; CHECK-NEXT: store i16 [[TMP2]], ptr [[SUM1_0_LCSSA_OUT:%.*]], align 4
19+
; CHECK-NEXT: ret void
20+
;
21+
one.iter.loop.entry15:
22+
br label %one.iter.loop.entry
23+
24+
one.iter.loop.entry: ; preds = %one.iter.loop.entry, %one.iter.loop.entry15
25+
%one.iter.iv = phi i32 [ 0, %one.iter.loop.entry15 ], [ %one.iter.iv.next, %one.iter.loop.entry ]
26+
%mul = mul nsw i32 %y.0, 48
27+
%0 = getelementptr inbounds i16, ptr addrspace(3) %in1, i32 %mul
28+
%wide.masked.load = tail call <4 x i16> @llvm.masked.load.v4i16.p3(ptr addrspace(3) %0, i32 2, <4 x i1> <i1 true, i1 false, i1 true, i1 false>, <4 x i16> <i16 0, i16 poison, i16 0, i16 poison>), !alias.scope !1, !noalias !2
29+
30+
%2 = tail call i16 @llvm.vector.reduce.add.v4i16(<4 x i16> %wide.masked.load)
31+
32+
%one.iter.iv.next = add i32 %one.iter.iv, 1
33+
%16 = icmp eq i32 %one.iter.iv.next, 1
34+
br i1 %16, label %one.iter.loop.exit, label %one.iter.loop.entry
35+
36+
one.iter.loop.exit: ; preds = %one.iter.loop.entry
37+
%.lcssa18 = phi i16 [ %2, %one.iter.loop.entry ]
38+
store i16 %.lcssa18, ptr %sum1.0.lcssa.out, align 4
39+
ret void
40+
}
41+
42+
!1 = !{}
43+
!2 = !{}

0 commit comments

Comments
 (0)