brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 52fde26 Raw
59 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2;3; Test comes from a bug (15771) or better a feature request. It was not allowed4; in Polly in the old domain generation as ScalarEvolution cannot figure out the5; loop bounds. However, the new domain generation will detect the SCoP.6 7; CHECK:      Context:8; CHECK-NEXT: [n] -> {  : -2147483648 <= n <= 2147483647 }9;10; CHECK:      p0: %n11;12; CHECK:      Statements {13; CHECK-NEXT:     Stmt_for_next14; CHECK-NEXT:         Domain :=15; CHECK-NEXT:             [n] -> { Stmt_for_next[i0] : i0 >= 0 and 2i0 <= -3 + n };16; CHECK-NEXT:         Schedule :=17; CHECK-NEXT:             [n] -> { Stmt_for_next[i0] -> [i0] };18; CHECK-NEXT:         ReadAccess :=    [Reduction Type: +] [Scalar: 0]19; CHECK-NEXT:             [n] -> { Stmt_for_next[i0] -> MemRef_A[i0] };20; CHECK-NEXT:         MustWriteAccess :=    [Reduction Type: +] [Scalar: 0]21; CHECK-NEXT:             [n] -> { Stmt_for_next[i0] -> MemRef_A[i0] };22; CHECK-NEXT: }23 24@A = common global [100 x i32] zeroinitializer, align 1625 26define void @foo(i32 %n) #0 {27entry:28  br label %entry.split29 30entry.split:                                      ; preds = %entry31  %cmp2 = icmp sgt i32 %n, 032  br i1 %cmp2, label %for.body.lr.ph, label %for.end33 34for.body.lr.ph:                                   ; preds = %entry.split35  br label %for.body36 37for.body:                                         ; preds = %for.body.lr.ph, %for.body38  %indvar = phi i64 [ 0, %for.body.lr.ph ], [ %indvar.next, %for.next ]39  %arrayidx = getelementptr [100 x i32], ptr @A, i64 0, i64 %indvar40  %0 = mul i64 %indvar, 241  %1 = add i64 %0, 242  %add1 = trunc i64 %1 to i3243  %cmp = icmp slt i32 %add1, %n44  %indvar.next = add i64 %indvar, 145  br i1 %cmp, label %for.next, label %for.cond.for.end_crit_edge46 47for.next:48  %2 = load i32, ptr %arrayidx, align 449  %add = add nsw i32 %2, 150  store i32 %add, ptr %arrayidx, align 451  br label %for.body52 53for.cond.for.end_crit_edge:                       ; preds = %for.body54  br label %for.end55 56for.end:                                          ; preds = %for.cond.for.end_crit_edge, %entry.split57  ret void58}59