File: hwloop-pos-ivbump1.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (45 lines) | stat: -rw-r--r-- 1,387 bytes parent folder | download | duplicates (29)
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
;RUN: llc -march=hexagon < %s | FileCheck %s

; Test that a hardware loop is not generaetd due to a potential
; underflow.

; CHECK-NOT: loop0

define i32 @main() #0 {
entry:
  br label %while.cond.outer

while.cond.outer.loopexit:
  %.lcssa = phi i32 [ %0, %for.body.preheader ]
  br label %while.cond.outer

while.cond.outer:
  %i.0.ph = phi i32 [ 0, %entry ], [ 3, %while.cond.outer.loopexit ]
  %j.0.ph = phi i32 [ 0, %entry ], [ %.lcssa, %while.cond.outer.loopexit ]
  %k.0.ph = phi i32 [ 0, %entry ], [ 1, %while.cond.outer.loopexit ]
  br label %while.cond

while.cond:
  %i.0 = phi i32 [ %i.0.ph, %while.cond.outer ], [ %inc, %for.body.preheader ]
  %j.0 = phi i32 [ %j.0.ph, %while.cond.outer ], [ %0, %for.body.preheader ]
  %inc = add nsw i32 %i.0, 1
  %cmp = icmp slt i32 %i.0, 4
  br i1 %cmp, label %for.body.preheader, label %while.end

for.body.preheader:
  %0 = add i32 %j.0, 3
  %cmp5 = icmp eq i32 %inc, 3
  br i1 %cmp5, label %while.cond.outer.loopexit, label %while.cond

while.end:
  %k.0.ph.lcssa = phi i32 [ %k.0.ph, %while.cond ]
  %inc.lcssa = phi i32 [ %inc, %while.cond ]
  %j.0.lcssa = phi i32 [ %j.0, %while.cond ]
  %cmp6 = icmp ne i32 %inc.lcssa, 5
  %cmp7 = icmp ne i32 %j.0.lcssa, 12
  %or.cond = or i1 %cmp6, %cmp7
  %cmp9 = icmp ne i32 %k.0.ph.lcssa, 1
  %or.cond12 = or i1 %or.cond, %cmp9
  %locflg.0 = zext i1 %or.cond12 to i32
  ret i32 %locflg.0
}