File: hwloop2.ll

package info (click to toggle)
llvm-toolchain-3.9 1%3A3.9.1-8
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 441,060 kB
  • ctags: 428,777
  • sloc: cpp: 2,546,577; ansic: 538,318; asm: 119,677; objc: 103,316; python: 102,148; sh: 27,847; pascal: 5,626; ml: 5,510; perl: 5,293; lisp: 4,801; makefile: 2,177; xml: 686; cs: 362; php: 212; csh: 117
file content (37 lines) | stat: -rw-r--r-- 1,146 bytes parent folder | download | duplicates (6)
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
; RUN: llc -disable-lsr -march=hexagon < %s | FileCheck %s

; Test for multiple phis with induction variables.

; CHECK: loop0(.LBB{{.}}_{{.}}, r{{[0-9]+}})
; CHECK: endloop0

define i32 @hwloop4(i32* nocapture %s, i32* nocapture %a, i32 %n) {
entry:
  %cmp3 = icmp eq i32 %n, 0
  br i1 %cmp3, label %for.end, label %for.body.lr.ph

for.body.lr.ph:
  %.pre = load i32, i32* %s, align 4
  br label %for.body

for.body:
  %0 = phi i32 [ %.pre, %for.body.lr.ph ], [ %add1, %for.body ]
  %j.05 = phi i32 [ 0, %for.body.lr.ph ], [ %add2, %for.body ]
  %lsr.iv = phi i32 [ %lsr.iv.next, %for.body ], [ %n, %for.body.lr.ph ]
  %lsr.iv1 = phi i32* [ %scevgep, %for.body ], [ %a, %for.body.lr.ph ]
  %1 = load i32, i32* %lsr.iv1, align 4
  %add1 = add nsw i32 %0, %1
  store i32 %add1, i32* %s, align 4
  %add2 = add nsw i32 %j.05, 1
  %lsr.iv.next = add i32 %lsr.iv, -1
  %scevgep = getelementptr i32, i32* %lsr.iv1, i32 1
  %cmp = icmp eq i32 %lsr.iv.next, 0
  br i1 %cmp, label %for.end.loopexit, label %for.body

for.end.loopexit:
  br label %for.end

for.end:
  %j.0.lcssa = phi i32 [ 0, %entry ], [ %add2, %for.end.loopexit ]
  ret i32 %j.0.lcssa
}