File: invariant_load_addrec_sum.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 (50 lines) | stat: -rw-r--r-- 1,958 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
44
45
46
47
48
49
50
; RUN: opt %loadPolly -polly-print-scops -polly-invariant-load-hoisting=true -polly-ignore-aliasing -polly-process-unprofitable -disable-output < %s | FileCheck %s
;
; CHECK: Region: %entry.split---%if.end
; CHECK:     Invariant Accesses: {
; CHECK:             ReadAccess :=       [Reduction Type: NONE] [Scalar: 0]
; CHECK:                 [y, p_1_loaded_from_j] -> { Stmt_for_body[i0] -> MemRef_j[0] };
; CHECK:             Execution Context: [y, p_1_loaded_from_j] -> {  :  }
; CHECK:     }

; CHECK:            MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]
; CHECK:                [y, p_1_loaded_from_j] -> { Stmt_for_body5[i0] -> MemRef_p[p_1_loaded_from_j + i0] };
; CHECK:            MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 0]
; CHECK:                [y, p_1_loaded_from_j] -> { Stmt_for_body[i0] -> MemRef_p[p_1_loaded_from_j + i0] };


define void @a(i32 %y, ptr nocapture %p, ptr nocapture readonly %j) local_unnamed_addr #0 {
entry:
  br label %entry.split

entry.split:
  %tobool = icmp eq i32 %y, 0
  br i1 %tobool, label %for.body5, label %for.body

for.body:
  %i.024 = phi i32 [ %inc, %for.body ], [ 0, %entry.split ]
  %0 = load i32, ptr %j, align 4
  %add = add nsw i32 %0, %i.024
  %idxprom = sext i32 %add to i64
  %arrayidx = getelementptr inbounds i32, ptr %p, i64 %idxprom
  store i32 %i.024, ptr %arrayidx, align 4
  %inc = add nuw nsw i32 %i.024, 1
  %exitcond26 = icmp eq i32 %inc, 10000
  br i1 %exitcond26, label %if.end, label %for.body

for.body5:
  %i1.023 = phi i32 [ %inc10, %for.body5 ], [ 0, %entry.split ]
  %mul = shl nsw i32 %i1.023, 1
  %1 = load i32, ptr %j, align 4
  %add6 = add nsw i32 %1, %i1.023
  %idxprom7 = sext i32 %add6 to i64
  %arrayidx8 = getelementptr inbounds i32, ptr %p, i64 %idxprom7
  store i32 %mul, ptr %arrayidx8, align 4
  %inc10 = add nuw nsw i32 %i1.023, 1
  %exitcond = icmp eq i32 %inc10, 10000
  br i1 %exitcond, label %if.end, label %for.body5

if.end:
  ret void
}