File: isl_trip_count_01.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, 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 (38 lines) | stat: -rw-r--r-- 1,049 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
; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
;
; CHECK: [M, N] -> { Stmt_while_body[i0] : i0 > 0 and 4i0 <= -M + N; Stmt_while_body[0] };
;
;   void f(int *A, int N, int M) {
;     int i = 0;
;     while (M <= N) {
;       A[i++] = 1;
;       M += 4;
;     }
;   }
;
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"

define void @f(ptr nocapture %A, i32 %N, i32 %M) {
entry:
  %cmp3 = icmp sgt i32 %M, %N
  br i1 %cmp3, label %while.end, label %while.body.preheader

while.body.preheader:
  br label %while.body

while.body:
  %i.05 = phi i32 [ %inc, %while.body ], [ 0, %while.body.preheader ]
  %M.addr.04 = phi i32 [ %add, %while.body ], [ %M, %while.body.preheader ]
  %inc = add nuw nsw i32 %i.05, 1
  %arrayidx = getelementptr inbounds i32, ptr %A, i32 %i.05
  store i32 1, ptr %arrayidx, align 4
  %add = add nsw i32 %M.addr.04, 4
  %cmp = icmp sgt i32 %add, %N
  br i1 %cmp, label %while.end.loopexit, label %while.body

while.end.loopexit:
  br label %while.end

while.end:
  ret void
}