File: two-parallel-loops-reference-outer-indvar.ll

package info (click to toggle)
swiftlang 6.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,604 kB
  • sloc: cpp: 9,901,740; ansic: 2,201,431; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (41 lines) | stat: -rw-r--r-- 1,385 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
; RUN: opt %loadNPMPolly -polly-parallel -polly-parallel-force '-passes=print<polly-ast>' -disable-output < %s | FileCheck %s -check-prefix=AST
; RUN: opt %loadNPMPolly -polly-parallel -polly-parallel-force -passes=polly-codegen -S -verify-dom-info < %s | FileCheck %s -check-prefix=IR

; This test case verifies that we create correct code even if two OpenMP loops
; share common outer variables.

; AST:   Stmt_for_body35(0);
; AST:   #pragma simd
; AST:   #pragma omp parallel for
; AST:   for (int c0 = 1; c0 < -p_0 + nj - 1; c0 += 1)
; AST:     Stmt_for_body35(c0);

; IR: @foo_polly_subfn
; IR-NOT: @foo_polly_subfn_1

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

define void @foo(i64 %nj, ptr %R) {
entry:
  br label %for.cond1.preheader

for.cond1.preheader:
  %k.014 = phi i64 [ %inc87, %for.inc86 ], [ 0, %entry ]
  %j.010 = add nsw i64 %k.014, 1
  br i1 undef, label %for.body35, label %for.inc86

for.body35:
  %j.012 = phi i64 [ %j.0, %for.body35 ], [ %j.010, %for.cond1.preheader ]
  %arrayidx39 = getelementptr inbounds [512 x double], ptr %R, i64 0, i64 %j.012
  store double 0.000000e+00, ptr %arrayidx39
  %j.0 = add nsw i64 %j.012, 1
  %cmp34 = icmp slt i64 %j.0, %nj
  br i1 %cmp34, label %for.body35, label %for.inc86

for.inc86:
  %inc87 = add nsw i64 %k.014, 1
  br i1 undef, label %for.cond1.preheader, label %for.end88

for.end88:
  ret void
}