File: reference-preceeding-loop.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (43 lines) | stat: -rw-r--r-- 1,411 bytes parent folder | download | duplicates (5)
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
42
43
; RUN: opt %loadPolly -polly-parallel -polly-parallel-force -polly-print-ast -disable-output < %s | FileCheck %s -check-prefix=AST
; RUN: opt %loadPolly -polly-parallel -polly-parallel-force -polly-codegen -S -verify-dom-info < %s | FileCheck %s -check-prefix=IR


; - Test the case where scalar evolution references a loop that is outside
;   of the scop, but does not contain the scop.

; AST:         {
; AST-NEXT:    #pragma simd
; AST-NEXT:    #pragma omp parallel for
; AST-NEXT:    for (int c0 = 0; c0 < -p_0 + symbol; c0 += 1)
; AST-NEXT:      Stmt_while_body(c0);
; AST-NEXT:    if (p_0 >= symbol)
; AST-NEXT:      Stmt_while_body(0);
; AST-NEXT:    }

; IR: @update_model_polly_subfn
; IR-NOT: @update_model_polly_subfn_1

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

@cum_freq = external global [258 x i64], align 16

define void @update_model(i64 %symbol) {
entry:
  br label %for.one

for.one:
  %i.1 = phi i64 [ %dec07, %for.one ], [ %symbol, %entry ]
  %dec07 = add nsw i64 %i.1, -1
  br i1 undef, label %for.one, label %while.body

while.body:
  %indvar = phi i64 [ %sub42, %while.body ], [ %i.1, %for.one ]
  %sub42 = add nsw i64 %indvar, -1
  %arrayidx44 = getelementptr inbounds [258 x i64], ptr @cum_freq, i64 0, i64 %sub42
  store i64 1, ptr %arrayidx44, align 4
  %cmp40 = icmp sgt i64 %sub42, 0
  br i1 %cmp40, label %while.body, label %while.end

while.end:
  ret void
}