File: isl_trip_count_01.ll

package info (click to toggle)
llvm-toolchain-6.0 1%3A6.0.1-10
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 598,080 kB
  • sloc: cpp: 3,046,253; ansic: 595,057; asm: 271,965; python: 128,926; objc: 106,554; sh: 21,906; lisp: 10,191; pascal: 6,094; ml: 5,544; perl: 5,265; makefile: 2,227; cs: 2,027; xml: 686; php: 212; csh: 117
file content (38 lines) | stat: -rw-r--r-- 1,039 bytes parent folder | download | duplicates (16)
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-scops -analyze < %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(i32* 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, i32* %A, i32 %i.05
  store i32 1, i32* %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
}