• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt %loadPolly -polly-parallel -polly-parallel-force -polly-ast -analyze < %s | FileCheck %s -check-prefix=AST
2; RUN: opt %loadPolly -polly-parallel -polly-parallel-force -polly-codegen -S -verify-dom-info < %s | FileCheck %s -check-prefix=IR
3
4
5; - Test the case where scalar evolution references a loop that is outside
6;   of the scop, but does not contain the scop.
7
8; AST:         {
9; AST-NEXT:    #pragma simd
10; AST-NEXT:    #pragma omp parallel for
11; AST-NEXT:    for (int c0 = 0; c0 < -p_0 + symbol; c0 += 1)
12; AST-NEXT:      Stmt_while_body(c0);
13; AST-NEXT:    if (p_0 >= symbol)
14; AST-NEXT:      Stmt_while_body(0);
15; AST-NEXT:    }
16
17; IR: @update_model_polly_subfn
18; IR-NOT: @update_model_polly_subfn_1
19
20target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
21
22@cum_freq = external global [258 x i64], align 16
23
24define void @update_model(i64 %symbol) {
25entry:
26  br label %for.one
27
28for.one:
29  %i.1 = phi i64 [ %dec07, %for.one ], [ %symbol, %entry ]
30  %dec07 = add nsw i64 %i.1, -1
31  br i1 undef, label %for.one, label %while.body
32
33while.body:
34  %indvar = phi i64 [ %sub42, %while.body ], [ %i.1, %for.one ]
35  %sub42 = add nsw i64 %indvar, -1
36  %arrayidx44 = getelementptr inbounds [258 x i64], [258 x i64]* @cum_freq, i64 0, i64 %sub42
37  store i64 1, i64* %arrayidx44, align 4
38  %cmp40 = icmp sgt i64 %sub42, 0
39  br i1 %cmp40, label %while.body, label %while.end
40
41while.end:
42  ret void
43}
44