File: hwloop-crit-edge.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (59 lines) | stat: -rw-r--r-- 2,256 bytes parent folder | download | duplicates (8)
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
59
; RUN: llc -O3 -march=hexagon -mcpu=hexagonv5 < %s | FileCheck %s
; XFAIL: *
;
; Generate hardware loop when loop 'latch' block is different
; from the loop 'exiting' block.

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

define void @test(ptr nocapture %pFL, i16 signext %nBS, ptr nocapture readonly %pHT) #0 {
entry:
  %0 = load i32, ptr %pFL, align 4
  %1 = tail call i64 @llvm.hexagon.M2.dpmpyss.s0(i32 %0, i32 246)
  %2 = tail call i64 @llvm.hexagon.S2.asl.r.p(i64 %1, i32 -13)
  %3 = tail call i32 @llvm.hexagon.A2.sat(i64 %2)
  store i32 %3, ptr %pFL, align 4
  %cmp16 = icmp sgt i16 %nBS, 0
  br i1 %cmp16, label %for.body.lr.ph, label %for.end

for.body.lr.ph:
  %4 = sext i16 %nBS to i32
  br label %for.body

for.body:
  %5 = phi i32 [ %3, %for.body.lr.ph ], [ %.pre, %for.body.for.body_crit_edge ]
  %arrayidx3.phi = phi ptr [ %pFL, %for.body.lr.ph ], [ %arrayidx3.inc, %for.body.for.body_crit_edge ]
  %arrayidx5.phi = phi ptr [ %pHT, %for.body.lr.ph ], [ %arrayidx5.inc, %for.body.for.body_crit_edge ]
  %i.017.pmt = phi i32 [ 1, %for.body.lr.ph ], [ %phitmp, %for.body.for.body_crit_edge ]
  %6 = load i16, ptr %arrayidx5.phi, align 2
  %conv6 = sext i16 %6 to i32
  %7 = tail call i64 @llvm.hexagon.M2.dpmpyss.s0(i32 %5, i32 %conv6)
  %8 = tail call i64 @llvm.hexagon.S2.asl.r.p(i64 %7, i32 -13)
  %9 = tail call i32 @llvm.hexagon.A2.sat(i64 %8)
  store i32 %9, ptr %arrayidx3.phi, align 4
  %exitcond = icmp eq i32 %i.017.pmt, %4
  %arrayidx3.inc = getelementptr i32, ptr %arrayidx3.phi, i32 1
  br i1 %exitcond, label %for.end.loopexit, label %for.body.for.body_crit_edge

for.body.for.body_crit_edge:
  %arrayidx5.inc = getelementptr i16, ptr %arrayidx5.phi, i32 1
  %.pre = load i32, ptr %arrayidx3.inc, align 4
  %phitmp = add i32 %i.017.pmt, 1
  br label %for.body

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

for.end:
  ret void
}

declare i32 @llvm.hexagon.A2.sat(i64) #1

declare i64 @llvm.hexagon.S2.asl.r.p(i64, i32) #1

declare i64 @llvm.hexagon.M2.dpmpyss.s0(i32, i32) #1

attributes #0 = { nounwind "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "ssp-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone }