integers.ll
3.98 KB
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
; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
; Check that we correctly convert integers to isl values.
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"
; Large positive integer
define void @f(i1024* nocapture %a) nounwind {
entry:
br label %bb
bb:
%indvar = phi i1024 [ 0, %entry ], [ %indvar.next, %bb ]
store i1024 %indvar, i1024* %a, align 8
%indvar.next = add nsw i1024 %indvar, 1
%exitcond = icmp eq i1024 %indvar, 123456000000000000000000000
; CHECK-LABEL: Function: f
; CHECK-NEXT: Region: %bb---%return
; CHECK: i0 <= 123456000000000000000000000
br i1 %exitcond, label %return, label %bb
return:
ret void
}
; Normal positive integer
define void @f2(i32* nocapture %a) nounwind {
entry:
br label %bb
bb:
%indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb ]
%scevgep = getelementptr i32, i32* %a, i32 %indvar
store i32 %indvar, i32* %scevgep, align 8
%indvar.next = add nsw i32 %indvar, 1
%exitcond = icmp eq i32 %indvar, 123456
; CHECK-LABEL: Function: f2
; CHECK-NEXT: Region: %bb---%return
; CHECK: i0 <= 123456
br i1 %exitcond, label %return, label %bb
return:
ret void
}
; Normal negative integer
define void @f3(i32* nocapture %a, i32 %n) nounwind {
entry:
br label %bb
bb:
%indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb ]
%scevgep = getelementptr i32, i32* %a, i32 %indvar
store i32 %indvar, i32* %scevgep, align 8
%indvar.next = add nsw i32 %indvar, 1
%sub = sub i32 %n, 123456
%exitcond = icmp eq i32 %indvar, %sub
; CHECK-LABEL: Function: f3
; CHECK-NEXT: Region: %bb---%return
; CHECK: -123456
br i1 %exitcond, label %return, label %bb
return:
ret void
}
; Large negative integer
define void @f4(i1024* nocapture %a, i1024 %n) nounwind {
entry:
br label %bb
bb:
%indvar = phi i1024 [ 0, %entry ], [ %indvar.next, %bb ]
%scevgep = getelementptr i1024, i1024* %a, i1024 %indvar
store i1024 %indvar, i1024* %scevgep, align 8
%indvar.next = add nsw i1024 %indvar, 1
%sub = sub i1024 %n, 123456000000000000000000000000000000
; CHECK-LABEL: Function: f4
; CHECK-NEXT: Region: %bb---%return
; CHECK: -123456000000000000000000000000000000
%exitcond = icmp eq i1024 %indvar, %sub
br i1 %exitcond, label %return, label %bb
return:
ret void
}
define void @f5(i1023* nocapture %a, i1023 %n) nounwind {
entry:
br label %bb
bb:
%indvar = phi i1023 [ 0, %entry ], [ %indvar.next, %bb ]
%scevgep = getelementptr i1023, i1023* %a, i1023 %indvar
store i1023 %indvar, i1023* %scevgep, align 8
%indvar.next = add nsw i1023 %indvar, 1
%sub = sub i1023 %n, 123456000000000000000000000000000000
; CHECK-LABEL: Function: f5
; CHECK-NEXT: Region: %bb---%return
; CHECK: -123456000000000000000000000000000000
%exitcond = icmp eq i1023 %indvar, %sub
br i1 %exitcond, label %return, label %bb
return:
ret void
}
; Tiny negative integer
define void @f6(i3* nocapture %a, i3 %n) nounwind {
entry:
br label %bb
bb:
%indvar = phi i3 [ 0, %entry ], [ %indvar.next, %bb ]
%scevgep = getelementptr i3, i3* %a, i3 %indvar
store i3 %indvar, i3* %scevgep, align 8
%indvar.next = add nsw i3 %indvar, 1
%sub = sub i3 %n, 3
; CHECK-LABEL: Function: f6
; CHECK-NEXT: Region: %bb---%return
; CHECK: Context:
; CHECK-NEXT: [n] -> { : -4 <= n <= 3 }
; CHECK-NEXT: Assumed Context:
; CHECK-NEXT: [n] -> { : }
; CHECK-NEXT: Invalid Context:
; CHECK-NEXT: [n] -> { : false }
; CHECK: Statements {
; CHECK-NEXT: Stmt_bb
; CHECK-NEXT: Domain :=
; CHECK-NEXT: [n] -> { Stmt_bb[i0] : i0 >= 0 and 8*floor((2 - n)/8) >= -5 - n + i0 and 8*floor((2 - n)/8) <= -2 - n };
; CHECK-NEXT: Schedule :=
; CHECK-NEXT: [n] -> { Stmt_bb[i0] -> [i0] };
; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
; CHECK-NEXT: [n] -> { Stmt_bb[i0] -> MemRef_a[i0] };
; CHECK-NEXT:}
%exitcond = icmp eq i3 %indvar, %sub
br i1 %exitcond, label %return, label %bb
return:
ret void
}