1 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
3 ; Check that we correctly convert integers to isl values.
5 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"
7 ; Large positive integer
8 define void @f(ptr nocapture %a) nounwind {
13 %indvar = phi i1024 [ 0, %entry ], [ %indvar.next, %bb ]
14 store i1024 %indvar, ptr %a, align 8
15 %indvar.next = add nsw i1024 %indvar, 1
16 %exitcond = icmp eq i1024 %indvar, 123456000000000000000000000
17 ; CHECK-LABEL: Function: f
18 ; CHECK-NEXT: Region: %bb---%return
19 ; CHECK: i0 <= 123456000000000000000000000
20 br i1 %exitcond, label %return, label %bb
26 ; Normal positive integer
27 define void @f2(ptr nocapture %a) nounwind {
32 %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb ]
33 %scevgep = getelementptr i32, ptr %a, i32 %indvar
34 store i32 %indvar, ptr %scevgep, align 8
35 %indvar.next = add nsw i32 %indvar, 1
36 %exitcond = icmp eq i32 %indvar, 123456
37 ; CHECK-LABEL: Function: f2
38 ; CHECK-NEXT: Region: %bb---%return
40 br i1 %exitcond, label %return, label %bb
46 ; Normal negative integer
47 define void @f3(ptr nocapture %a, i32 %n) nounwind {
52 %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb ]
53 %scevgep = getelementptr i32, ptr %a, i32 %indvar
54 store i32 %indvar, ptr %scevgep, align 8
55 %indvar.next = add nsw i32 %indvar, 1
56 %sub = sub i32 %n, 123456
57 %exitcond = icmp eq i32 %indvar, %sub
58 ; CHECK-LABEL: Function: f3
59 ; CHECK-NEXT: Region: %bb---%return
61 br i1 %exitcond, label %return, label %bb
67 ; Large negative integer
68 define void @f4(ptr nocapture %a, i1024 %n) nounwind {
73 %indvar = phi i1024 [ 0, %entry ], [ %indvar.next, %bb ]
74 %scevgep = getelementptr i1024, ptr %a, i1024 %indvar
75 store i1024 %indvar, ptr %scevgep, align 8
76 %indvar.next = add nsw i1024 %indvar, 1
77 %sub = sub i1024 %n, 123456000000000000000000000000000000
78 ; CHECK-LABEL: Function: f4
79 ; CHECK-NEXT: Region: %bb---%return
80 ; CHECK: -123456000000000000000000000000000000
81 %exitcond = icmp eq i1024 %indvar, %sub
82 br i1 %exitcond, label %return, label %bb
88 define void @f5(ptr nocapture %a, i1023 %n) nounwind {
93 %indvar = phi i1023 [ 0, %entry ], [ %indvar.next, %bb ]
94 %scevgep = getelementptr i1023, ptr %a, i1023 %indvar
95 store i1023 %indvar, ptr %scevgep, align 8
96 %indvar.next = add nsw i1023 %indvar, 1
97 %sub = sub i1023 %n, 123456000000000000000000000000000000
98 ; CHECK-LABEL: Function: f5
99 ; CHECK-NEXT: Region: %bb---%return
100 ; CHECK: -123456000000000000000000000000000000
101 %exitcond = icmp eq i1023 %indvar, %sub
102 br i1 %exitcond, label %return, label %bb
108 ; Tiny negative integer
109 define void @f6(ptr nocapture %a, i3 %n) nounwind {
114 %indvar = phi i3 [ 0, %entry ], [ %indvar.next, %bb ]
115 %scevgep = getelementptr i3, ptr %a, i3 %indvar
116 store i3 %indvar, ptr %scevgep, align 8
117 %indvar.next = add nsw i3 %indvar, 1
119 ; CHECK-LABEL: Function: f6
120 ; CHECK-NEXT: Region: %bb---%return
122 ; CHECK-NEXT: [n] -> { : -4 <= n <= 3 }
123 ; CHECK-NEXT: Assumed Context:
124 ; CHECK-NEXT: [n] -> { : }
125 ; CHECK-NEXT: Invalid Context:
126 ; CHECK-NEXT: [n] -> { : false }
128 ; CHECK: Statements {
129 ; CHECK-NEXT: Stmt_bb
130 ; CHECK-NEXT: Domain :=
131 ; 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 };
132 ; CHECK-NEXT: Schedule :=
133 ; CHECK-NEXT: [n] -> { Stmt_bb[i0] -> [i0] };
134 ; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
135 ; CHECK-NEXT: [n] -> { Stmt_bb[i0] -> MemRef_a[i0] };
138 %exitcond = icmp eq i3 %indvar, %sub
139 br i1 %exitcond, label %return, label %bb