2
2
3
3
; CHECK-LABEL: copy
4
4
; CHECK-NOT: add
5
- define void @copy (i8* inreg nocapture %p , i8* inreg nocapture readonly %q ) {
5
+ define void @copy (ptr inreg nocapture %p , ptr inreg nocapture readonly %q ) {
6
6
entry:
7
7
br label %while.cond
8
8
9
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
10
+ %p.addr.0 = phi ptr [ %p , %entry ], [ %incdec.ptr1 , %while.cond ]
11
+ %q.addr.0 = phi ptr [ %q , %entry ], [ %incdec.ptr , %while.cond ]
12
+ %incdec.ptr = getelementptr inbounds i8 , ptr %q.addr.0 , i32 1
13
+ %0 = load i8 , ptr %q.addr.0 , align 1
14
+ %incdec.ptr1 = getelementptr inbounds i8 , ptr %p.addr.0 , i32 1
15
+ store i8 %0 , ptr %p.addr.0 , align 1
16
16
%tobool = icmp eq i8 %0 , 0
17
17
br i1 %tobool , label %while.end , label %while.cond
18
18
@@ -21,11 +21,11 @@ while.end: ; preds = %while.cond
21
21
}
22
22
23
23
24
- %struct._llist = type { %struct._llist* , %struct._llist* , i32 }
24
+ %struct._llist = type { ptr , ptr , i32 }
25
25
26
26
; CHECK-LABEL: neg1
27
27
; CHECK-NOT: std.ab
28
- define void @neg1 (i8* inreg nocapture %a , i8* inreg nocapture readonly %b , i32 inreg %n ) {
28
+ define void @neg1 (ptr inreg nocapture %a , ptr inreg nocapture readonly %b , i32 inreg %n ) {
29
29
entry:
30
30
%cmp6 = icmp sgt i32 %n , 0
31
31
br i1 %cmp6 , label %for.body , label %for.cond.cleanup
@@ -35,19 +35,19 @@ for.cond.cleanup:
35
35
36
36
for.body:
37
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
38
+ %arrayidx = getelementptr inbounds i8 , ptr %b , i32 %i.07
39
+ %0 = load i8 , ptr %arrayidx , align 1
40
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
41
+ %arrayidx1 = getelementptr inbounds i8 , ptr %a , i32 %mul
42
+ store i8 %0 , ptr %arrayidx1 , align 1
43
43
%inc = add nuw nsw i32 %i.07 , 1
44
44
%exitcond = icmp eq i32 %inc , %n
45
45
br i1 %exitcond , label %for.cond.cleanup , label %for.body
46
46
}
47
47
48
48
; CHECK-LABEL: neg2
49
49
; CHECK-NOT: st.ab
50
- define void @neg2 (%struct._llist* inreg %a , i32 inreg %n ) {
50
+ define void @neg2 (ptr inreg %a , i32 inreg %n ) {
51
51
entry:
52
52
%cmp13 = icmp sgt i32 %n , 0
53
53
br i1 %cmp13 , label %for.body , label %for.cond.cleanup
@@ -57,11 +57,11 @@ for.cond.cleanup:
57
57
58
58
for.body:
59
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
60
+ %arrayidx = getelementptr inbounds %struct._llist , ptr %a , i32 %i.014
61
+ %next = getelementptr inbounds %struct._llist , ptr %arrayidx , i32 0 , i32 0
62
+ store ptr %arrayidx , ptr %next , align 4
63
+ %prev = getelementptr inbounds %struct._llist , ptr %a , i32 %i.014 , i32 1
64
+ store ptr %arrayidx , ptr %prev , align 4
65
65
%inc = add nuw nsw i32 %i.014 , 1
66
66
%exitcond = icmp eq i32 %inc , %n
67
67
br i1 %exitcond , label %for.cond.cleanup , label %for.body
0 commit comments