• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -march=hexagon < %s
2; REQUIRES: asserts
3
4target triple = "hexagon"
5
6declare i8* @llvm.hexagon.circ.ldb(i8*, i8*, i32, i32) #1
7declare i8* @llvm.hexagon.circ.stb(i8*, i32, i32, i32) #1
8
9define zeroext i8 @circular_loop_test10(i8* %A, i8* %B, i32 %x, i32 %y, i32 %z, i32 %w) #0 {
10entry:
11  %element_load0 = alloca i8, align 1
12  %element_load2 = alloca i8, align 1
13  %element_load3 = alloca i8, align 1
14  %element_load5 = alloca i8, align 1
15  %or = or i32 %x, 100663296
16  %or5 = or i32 %z, 100663296
17  %or7 = or i32 %w, 100663296
18  br label %for.body
19
20for.body:                                         ; preds = %for.body, %entry
21  %p0.082 = phi i8* [ %A, %entry ], [ undef, %for.body ]
22  %element_load.080 = phi i32 [ 0, %entry ], [ %add18, %for.body ]
23  %p1.079 = phi i8* [ %B, %entry ], [ %1, %for.body ]
24  %p2.078 = phi i8* [ undef, %entry ], [ %3, %for.body ]
25  %p3.077 = phi i8* [ undef, %entry ], [ %4, %for.body ]
26  %0 = call i8* @llvm.hexagon.circ.ldb(i8* %p0.082, i8* nonnull %element_load0, i32 %or, i32 2)
27  %1 = call i8* @llvm.hexagon.circ.ldb(i8* %p1.079, i8* nonnull null, i32 0, i32 1)
28  %2 = call i8* @llvm.hexagon.circ.ldb(i8* %p2.078, i8* nonnull %element_load2, i32 %or5, i32 3)
29  %3 = call i8* @llvm.hexagon.circ.ldb(i8* %2, i8* nonnull %element_load5, i32 %or5, i32 1)
30  %4 = call i8* @llvm.hexagon.circ.ldb(i8* %p3.077, i8* nonnull %element_load3, i32 %or7, i32 1)
31  %5 = load i8, i8* null, align 1
32  %conv = zext i8 %5 to i32
33  %6 = load i8, i8* %element_load2, align 1
34  %conv8 = zext i8 %6 to i32
35  %7 = load i8, i8* %element_load3, align 1
36  %conv9 = zext i8 %7 to i32
37  %8 = load i8, i8* undef, align 1
38  %conv11 = zext i8 %8 to i32
39  %9 = load i8, i8* %element_load5, align 1
40  %conv13 = zext i8 %9 to i32
41  %10 = load i8, i8* %element_load0, align 1
42  %conv15 = zext i8 %10 to i32
43  %conv17 = and i32 %element_load.080, 255
44  %add = add nuw nsw i32 %conv, %conv17
45  %add10 = add nuw nsw i32 %add, %conv8
46  %add12 = add nuw nsw i32 %add10, %conv9
47  %add14 = add nuw nsw i32 %add12, %conv11
48  %add16 = add nuw nsw i32 %add14, %conv13
49  %add18 = add nuw nsw i32 %add16, %conv15
50  %exitcond84 = icmp eq i32 undef, 200
51  br i1 %exitcond84, label %for.body23, label %for.body
52
53for.body23:                                       ; preds = %for.body23, %for.body
54  %11 = call i8* @llvm.hexagon.circ.stb(i8* undef, i32 undef, i32 %or, i32 3)
55  br i1 undef, label %for.body34, label %for.body23
56
57for.body34:                                       ; preds = %for.body34, %for.body23
58  %element_load.173 = phi i32 [ %add38, %for.body34 ], [ %add18, %for.body23 ]
59  %arrayidx35 = getelementptr inbounds i8, i8* %B, i32 0
60  %12 = load i8, i8* %arrayidx35, align 1
61  %conv36 = zext i8 %12 to i32
62  %conv37 = and i32 %element_load.173, 255
63  %add38 = add nuw nsw i32 %conv36, %conv37
64  br i1 undef, label %for.end42, label %for.body34
65
66for.end42:                                        ; preds = %for.body34
67  %conv39 = trunc i32 %add38 to i8
68  ret i8 %conv39
69}
70
71attributes #0 = { nounwind optsize }
72attributes #1 = { argmemonly nounwind }
73