1 ; RUN: opt %loadPolly -pass-remarks-analysis="polly-scops" -polly-scops -disable-output < %s 2>&1 | FileCheck %s
2 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s --check-prefix=SCOP
4 ; CHECK: remark: <unknown>:0:0: SCoP begins here.
5 ; CHECK-NEXT: remark: <unknown>:0:0: Use user assumption: [N] -> { : N >= 2 }
6 ; CHECK-NEXT: remark: <unknown>:0:0: SCoP ends here.
9 ; SCOP-NEXT: [N, M] -> { : 2 <= N <= 2147483647 and -2147483648 <= M <= 2147483647 }
10 ; SCOP: Assumed Context:
11 ; SCOP-NEXT: [N, M] -> { : }
12 ; SCOP: Invalid Context:
13 ; SCOP-NEXT: [N, M] -> { : false }
15 ; int f(int *A, int N, int M) {
16 ; __builtin_assume(M > 0 && N > M);
17 ; for (int i = 0; i < N; i++)
22 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
24 define i32 @f(ptr %A, i32 %N, i32 %M) {
26 %cmp = icmp sgt i32 %M, 0
27 %cmp1 = icmp sgt i32 %N, %M
28 %and = and i1 %cmp, %cmp1
29 call void @llvm.assume(i1 %and)
30 %tmp1 = sext i32 %N to i64
33 for.cond: ; preds = %for.inc, %land.end
34 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
35 %cmp2 = icmp slt i64 %indvars.iv, %tmp1
36 br i1 %cmp2, label %for.body, label %for.end
38 for.body: ; preds = %for.cond
39 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
40 %tmp2 = load i32, ptr %arrayidx, align 4
41 %inc = add nsw i32 %tmp2, 1
42 store i32 %inc, ptr %arrayidx, align 4
45 for.inc: ; preds = %for.body
46 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
49 for.end: ; preds = %for.cond
53 declare void @llvm.assume(i1) #1