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: { : }
6 ; CHECK-NEXT: remark: <unknown>:0:0: SCoP ends here.
9 ; SCOP-NEXT: [N, M] -> { : -2147483648 <= 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 }
16 ; This test checks that assumptions over parameters not used in the Scop are
17 ; not modeled. There is no benefit in knowing about parameters that are
18 ; unused in the scop, and adding them will increase the complexity of our
21 ; int f(int *A, int N, int M) {
22 ; __builtin_assume(M > 0);
23 ; for (int i = 0; i < N; i++)
28 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
30 define i32 @f(ptr %A, i32 %N, i32 %M) {
32 %cmp = icmp sgt i32 %M, 0
33 call void @llvm.assume(i1 %cmp)
34 %tmp = sext i32 %N to i64
37 for.cond: ; preds = %for.inc, %entry
38 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
39 %cmp1 = icmp slt i64 %indvars.iv, %tmp
40 br i1 %cmp1, label %for.body, label %for.end
42 for.body: ; preds = %for.cond
43 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
44 %tmp1 = load i32, ptr %arrayidx, align 4
45 %inc = add nsw i32 %tmp1, 1
46 store i32 %inc, ptr %arrayidx, align 4
49 for.inc: ; preds = %for.body
50 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
53 for.end: ; preds = %for.cond
57 declare void @llvm.assume(i1) #1