aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/IndVarSimplify/max-pointer.ll
blob: ba2b2fa83486065de560b1ec289e810944095ca3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
; RUN: llvm-as < %s | opt -indvars | llvm-dis > %t
; RUN: grep {icmp ugt i8\\\*} %t | count 1
; RUN: grep {icmp sgt i8\\\*} %t | count 1

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"

	%struct.CKenCodeCodec = type <{ i8 }>

define void @foo(i8* %str1Ptr, i8* %str2Ptr, i8* %inLastBytePtr) nounwind {
entry:
	%0 = icmp ult i8* %str2Ptr, %str1Ptr		; <i1> [#uses=1]
	%str2Ptr_addr.0 = select i1 %0, i8* %str1Ptr, i8* %str2Ptr		; <i8*> [#uses=1]
	br label %bb2

bb2:		; preds = %bb2, %entry
	%str2Ptr_addr.1 = phi i8* [ %str2Ptr_addr.0, %entry ], [ %1, %bb2 ]		; <i8*> [#uses=1]
	%1 = getelementptr i8* %str2Ptr_addr.1, i64 1		; <i8*> [#uses=2]
	%2 = icmp ult i8* %1, %inLastBytePtr		; <i1> [#uses=0]
	br i1 false, label %bb2, label %return

return:		; preds = %bb2
	ret void
}

define void @bar(i8* %str1Ptr, i64 %s, i8* %inLastBytePtr) nounwind {
entry:
        %str2Ptr = inttoptr i64 %s to i8*
	%0 = icmp ult i8* %str2Ptr, %str1Ptr		; <i1> [#uses=1]
	%str2Ptr_addr.0 = select i1 %0, i8* %str1Ptr, i8* %str2Ptr		; <i8*> [#uses=1]
	br label %bb2

bb2:		; preds = %bb2, %entry
	%str2Ptr_addr.1 = phi i8* [ %str2Ptr_addr.0, %entry ], [ %1, %bb2 ]		; <i8*> [#uses=1]
	%1 = getelementptr i8* %str2Ptr_addr.1, i64 1		; <i8*> [#uses=2]
	%2 = icmp ult i8* %1, %inLastBytePtr		; <i1> [#uses=0]
	br i1 false, label %bb2, label %return

return:		; preds = %bb2
	ret void
}

define void @qux(i64 %t, i64 %s, i8* %inLastBytePtr) nounwind {
entry:
        %str1Ptr = inttoptr i64 %t to i8*
        %str2Ptr = inttoptr i64 %s to i8*
	%0 = icmp ult i8* %str2Ptr, %str1Ptr		; <i1> [#uses=1]
	%str2Ptr_addr.0 = select i1 %0, i8* %str1Ptr, i8* %str2Ptr		; <i8*> [#uses=1]
	br label %bb2

bb2:		; preds = %bb2, %entry
	%str2Ptr_addr.1 = phi i8* [ %str2Ptr_addr.0, %entry ], [ %1, %bb2 ]		; <i8*> [#uses=1]
	%1 = getelementptr i8* %str2Ptr_addr.1, i64 1		; <i8*> [#uses=2]
	%2 = icmp ult i8* %1, %inLastBytePtr		; <i1> [#uses=0]
	br i1 false, label %bb2, label %return

return:		; preds = %bb2
	ret void
}

define void @vor(i64 %t, i8* %str2Ptr, i8* %inLastBytePtr) nounwind {
entry:
        %str1Ptr = inttoptr i64 %t to i8*
	%0 = icmp ult i8* %str2Ptr, %str1Ptr		; <i1> [#uses=1]
	%str2Ptr_addr.0 = select i1 %0, i8* %str1Ptr, i8* %str2Ptr		; <i8*> [#uses=1]
	br label %bb2

bb2:		; preds = %bb2, %entry
	%str2Ptr_addr.1 = phi i8* [ %str2Ptr_addr.0, %entry ], [ %1, %bb2 ]		; <i8*> [#uses=1]
	%1 = getelementptr i8* %str2Ptr_addr.1, i64 1		; <i8*> [#uses=2]
	%2 = icmp ult i8* %1, %inLastBytePtr		; <i1> [#uses=0]
	br i1 false, label %bb2, label %return

return:		; preds = %bb2
	ret void
}

define void @sfoo(i8* %str1Ptr, i8* %str2Ptr, i8* %inLastBytePtr) nounwind {
entry:
	%0 = icmp slt i8* %str2Ptr, %str1Ptr		; <i1> [#uses=1]
	%str2Ptr_addr.0 = select i1 %0, i8* %str1Ptr, i8* %str2Ptr		; <i8*> [#uses=1]
	br label %bb2

bb2:		; preds = %bb2, %entry
	%str2Ptr_addr.1 = phi i8* [ %str2Ptr_addr.0, %entry ], [ %1, %bb2 ]		; <i8*> [#uses=1]
	%1 = getelementptr i8* %str2Ptr_addr.1, i64 1		; <i8*> [#uses=2]
	%2 = icmp slt i8* %1, %inLastBytePtr		; <i1> [#uses=0]
	br i1 false, label %bb2, label %return

return:		; preds = %bb2
	ret void
}

define void @sbar(i8* %str1Ptr, i64 %s, i8* %inLastBytePtr) nounwind {
entry:
        %str2Ptr = inttoptr i64 %s to i8*
	%0 = icmp slt i8* %str2Ptr, %str1Ptr		; <i1> [#uses=1]
	%str2Ptr_addr.0 = select i1 %0, i8* %str1Ptr, i8* %str2Ptr		; <i8*> [#uses=1]
	br label %bb2

bb2:		; preds = %bb2, %entry
	%str2Ptr_addr.1 = phi i8* [ %str2Ptr_addr.0, %entry ], [ %1, %bb2 ]		; <i8*> [#uses=1]
	%1 = getelementptr i8* %str2Ptr_addr.1, i64 1		; <i8*> [#uses=2]
	%2 = icmp slt i8* %1, %inLastBytePtr		; <i1> [#uses=0]
	br i1 false, label %bb2, label %return

return:		; preds = %bb2
	ret void
}

define void @squx(i64 %t, i64 %s, i8* %inLastBytePtr) nounwind {
entry:
        %str1Ptr = inttoptr i64 %t to i8*
        %str2Ptr = inttoptr i64 %s to i8*
	%0 = icmp slt i8* %str2Ptr, %str1Ptr		; <i1> [#uses=1]
	%str2Ptr_addr.0 = select i1 %0, i8* %str1Ptr, i8* %str2Ptr		; <i8*> [#uses=1]
	br label %bb2

bb2:		; preds = %bb2, %entry
	%str2Ptr_addr.1 = phi i8* [ %str2Ptr_addr.0, %entry ], [ %1, %bb2 ]		; <i8*> [#uses=1]
	%1 = getelementptr i8* %str2Ptr_addr.1, i64 1		; <i8*> [#uses=2]
	%2 = icmp slt i8* %1, %inLastBytePtr		; <i1> [#uses=0]
	br i1 false, label %bb2, label %return

return:		; preds = %bb2
	ret void
}

define void @svor(i64 %t, i8* %str2Ptr, i8* %inLastBytePtr) nounwind {
entry:
        %str1Ptr = inttoptr i64 %t to i8*
	%0 = icmp slt i8* %str2Ptr, %str1Ptr		; <i1> [#uses=1]
	%str2Ptr_addr.0 = select i1 %0, i8* %str1Ptr, i8* %str2Ptr		; <i8*> [#uses=1]
	br label %bb2

bb2:		; preds = %bb2, %entry
	%str2Ptr_addr.1 = phi i8* [ %str2Ptr_addr.0, %entry ], [ %1, %bb2 ]		; <i8*> [#uses=1]
	%1 = getelementptr i8* %str2Ptr_addr.1, i64 1		; <i8*> [#uses=2]
	%2 = icmp slt i8* %1, %inLastBytePtr		; <i1> [#uses=0]
	br i1 false, label %bb2, label %return

return:		; preds = %bb2
	ret void
}