File: swp-dag-phi.ll

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,436 kB
  • sloc: cpp: 4,167,636; ansic: 714,256; asm: 457,610; python: 155,927; objc: 65,094; sh: 42,856; lisp: 26,908; perl: 7,786; pascal: 7,722; makefile: 6,881; ml: 5,581; awk: 3,648; cs: 2,027; xml: 888; javascript: 381; ruby: 156
file content (42 lines) | stat: -rw-r--r-- 1,421 bytes parent folder | download | duplicates (16)
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
; RUN: llc -march=hexagon -mcpu=hexagonv5 -enable-pipeliner -pipeliner-max-stages=2 < %s
; REQUIRES: asserts

; This tests check that a dependence is created between a Phi and it's uses.
; An assert occurs if the Phi dependences are not correct.

define void @test1(i32* %f2, i32 %nc) {
entry:
  %i.011 = add i32 %nc, -1
  %cmp12 = icmp sgt i32 %i.011, 1
  br i1 %cmp12, label %for.body.preheader, label %for.end

for.body.preheader:
  %0 = add i32 %nc, -2
  %scevgep = getelementptr i32, i32* %f2, i32 %0
  %sri = load i32, i32* %scevgep, align 4
  %scevgep15 = getelementptr i32, i32* %f2, i32 %i.011
  %sri16 = load i32, i32* %scevgep15, align 4
  br label %for.body

for.body:
  %i.014 = phi i32 [ %i.0, %for.body ], [ %i.011, %for.body.preheader ]
  %i.0.in13 = phi i32 [ %i.014, %for.body ], [ %nc, %for.body.preheader ]
  %sr = phi i32 [ %1, %for.body ], [ %sri, %for.body.preheader ]
  %sr17 = phi i32 [ %sr, %for.body ], [ %sri16, %for.body.preheader ]
  %arrayidx = getelementptr inbounds i32, i32* %f2, i32 %i.014
  %sub1 = add nsw i32 %i.0.in13, -3
  %arrayidx2 = getelementptr inbounds i32, i32* %f2, i32 %sub1
  %1 = load i32, i32* %arrayidx2, align 4
  %sub3 = sub nsw i32 %sr17, %1
  store i32 %sub3, i32* %arrayidx, align 4
  %i.0 = add nsw i32 %i.014, -1
  %cmp = icmp sgt i32 %i.0, 1
  br i1 %cmp, label %for.body, label %for.end.loopexit

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

for.end:
  ret void
}