brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · aa1f72d Raw
55 lines · plain
1; RUN: opt %loadNPMPolly -pass-remarks-analysis=polly-scops '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s --check-prefix=SCOP3;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.7 8; SCOP:      Context: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 }14;15;    int f(int *A, int N, int M) {16;      __builtin_assume(M > 0 && N > M);17;      for (int i = 0; i < N; i++)18;        A[i]++;19;      return M;20;    }21;22target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"23 24define i32 @f(ptr %A, i32 %N, i32 %M) {25entry:26  %cmp = icmp sgt i32 %M, 027  %cmp1 = icmp sgt i32 %N, %M28  %and = and i1 %cmp, %cmp129  call void @llvm.assume(i1 %and)30  %tmp1 = sext i32 %N to i6431  br label %for.cond32 33for.cond:                                         ; preds = %for.inc, %land.end34  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]35  %cmp2 = icmp slt i64 %indvars.iv, %tmp136  br i1 %cmp2, label %for.body, label %for.end37 38for.body:                                         ; preds = %for.cond39  %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv40  %tmp2 = load i32, ptr %arrayidx, align 441  %inc = add nsw i32 %tmp2, 142  store i32 %inc, ptr %arrayidx, align 443  br label %for.inc44 45for.inc:                                          ; preds = %for.body46  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 147  br label %for.cond48 49for.end:                                          ; preds = %for.cond50  ret i32 %M51}52 53declare void @llvm.assume(i1) #154 55