File: escaping_empty_scop.ll

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (58 lines) | stat: -rw-r--r-- 1,674 bytes parent folder | download | duplicates (12)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
; RUN: opt %loadPolly -polly-stmt-granularity=bb -polly-scops -analyze < %s | FileCheck %s
;
;    void g();
;    int f(int *A) {
;      int a0 = 0, a1 = 0, a2 = 0;
;      for (int i = 0; i < 1000; i++) {
;        a0 = 2 * i;
;        // split
;        A[0] = i;
;        a1 = 2 * i;
;        // split
;        a2 = 2 * i;
;      }
;      g();
;      return a1 + a2;
;    }
;
; CHECK:      Stmt_bb1
; CHECK:            MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
; CHECK:                { Stmt_bb1[i0] -> MemRef_a_0[] };
; CHECK:      Stmt_bb2
; CHECK:            MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
; CHECK:                { Stmt_bb2[i0] -> MemRef_a_1[] };
; CHECK:      Stmt_bb3
; CHECK:            MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
; CHECK:                { Stmt_bb3[i0] -> MemRef_a_2[] };

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

define i32 @f(i32* %A) {
bb:
  br label %bb1

bb1:                                              ; preds = %bb3, %bb
  %i.0 = phi i32 [ 0, %bb ], [ %tmp4, %bb3 ]
  %a.0 = mul i32 %i.0, 2
  br label %bb2

bb2:                                              ; preds = %bb1
  %a.1 = mul i32 %i.0, 2
  store i32 %i.0, i32 *%A, align 4
  br label %bb3

bb3:                                              ; preds = %bb2
  %tmp = shl nsw i32 %i.0, 1
  %tmp4 = add nuw nsw i32 %i.0, 1
  %a.2 = mul i32 %i.0, 2
  %exitcond = icmp ne i32 %i.0, 1000
  br i1 %exitcond, label %bb1, label %bb5

bb5:                                              ; preds = %bb1
  call void (...) @g() #2
  %add = add i32 %a.0, %a.1
  %add2 = add i32 %add, %a.2
  ret i32 %add2
}

declare void @g(...) #1