1 ; RUN: llc -march=arc < %s | FileCheck %s
5 define void @copy(i8* inreg nocapture %p, i8* inreg nocapture readonly %q) {
9 while.cond: ; preds = %while.cond, %entry
10 %p.addr.0 = phi i8* [ %p, %entry ], [ %incdec.ptr1, %while.cond ]
11 %q.addr.0 = phi i8* [ %q, %entry ], [ %incdec.ptr, %while.cond ]
12 %incdec.ptr = getelementptr inbounds i8, i8* %q.addr.0, i32 1
13 %0 = load i8, i8* %q.addr.0, align 1
14 %incdec.ptr1 = getelementptr inbounds i8, i8* %p.addr.0, i32 1
15 store i8 %0, i8* %p.addr.0, align 1
16 %tobool = icmp eq i8 %0, 0
17 br i1 %tobool, label %while.end, label %while.cond
19 while.end: ; preds = %while.cond
24 %struct._llist = type { %struct._llist*, %struct._llist*, i32 }
28 define void @neg1(i8* inreg nocapture %a, i8* inreg nocapture readonly %b, i32 inreg %n) {
30 %cmp6 = icmp sgt i32 %n, 0
31 br i1 %cmp6, label %for.body, label %for.cond.cleanup
37 %i.07 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
38 %arrayidx = getelementptr inbounds i8, i8* %b, i32 %i.07
39 %0 = load i8, i8* %arrayidx, align 1
40 %mul = mul nuw nsw i32 %i.07, 257
41 %arrayidx1 = getelementptr inbounds i8, i8* %a, i32 %mul
42 store i8 %0, i8* %arrayidx1, align 1
43 %inc = add nuw nsw i32 %i.07, 1
44 %exitcond = icmp eq i32 %inc, %n
45 br i1 %exitcond, label %for.cond.cleanup, label %for.body
50 define void @neg2(%struct._llist* inreg %a, i32 inreg %n) {
52 %cmp13 = icmp sgt i32 %n, 0
53 br i1 %cmp13, label %for.body, label %for.cond.cleanup
59 %i.014 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
60 %arrayidx = getelementptr inbounds %struct._llist, %struct._llist* %a, i32 %i.014
61 %next = getelementptr inbounds %struct._llist, %struct._llist* %arrayidx, i32 0, i32 0
62 store %struct._llist* %arrayidx, %struct._llist** %next, align 4
63 %prev = getelementptr inbounds %struct._llist, %struct._llist* %a, i32 %i.014, i32 1
64 store %struct._llist* %arrayidx, %struct._llist** %prev, align 4
65 %inc = add nuw nsw i32 %i.014, 1
66 %exitcond = icmp eq i32 %inc, %n
67 br i1 %exitcond, label %for.cond.cleanup, label %for.body