1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-parallel -polly-parallel-force -polly-ast -analyze < %s | FileCheck %s -check-prefix=AST
2 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-parallel -polly-parallel-force -polly-codegen-isl -S -verify-dom-info < %s | FileCheck %s -check-prefix=IR
4 ; This code has failed the scev based code generation as the scev in the scop
5 ; contains an AddRecExpr of an outer loop. When generating code, we did not
6 ; properly forward the value of this expression to the subfunction.
8 ; AST: #pragma omp parallel for
9 ; AST: for (int c0 = 0; c0 <= 1023; c0 += 1)
10 ; AST: Stmt_for_j(c0);
12 ; IR: @single_parallel_loop.polly.subfn
14 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
15 target triple = "x86_64-unknown-linux-gnu"
17 @A = common global [1024 x float] zeroinitializer, align 16
19 define void @single_parallel_loop() nounwind {
24 %indvar.i = phi i64 [ %indvar.i.next, %for.i.inc], [ 0, %entry ]
28 %indvar.j = phi i64 [ %indvar.j.next, %for.j], [ 0, %for.i ]
29 %sum = add i64 %indvar.j, %indvar.i
30 %scevgep = getelementptr [1024 x float], [1024 x float]* @A, i64 0, i64 %sum
31 store float 0.0, float *%scevgep
32 %indvar.j.next = add i64 %indvar.j, 1
33 %exitcond.j = icmp slt i64 %indvar.j.next, 1024
34 br i1 %exitcond.j, label %for.j, label %for.i.inc
38 %indvar.i.next = add i64 %indvar.i, 1
39 %exitcond.i = icmp ne i64 %indvar.i.next, 1024
40 br i1 %exitcond.i, label %for.i, label %exit