File: pr42991.ll

package info (click to toggle)
llvm-toolchain-9 1%3A9.0.1-16.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 882,388 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 (44 lines) | stat: -rw-r--r-- 1,106 bytes parent folder | download | duplicates (4)
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
; RUN: opt -S -passes=spec-phis %s

; This testcase crashes during the speculate around PHIs pass. The pass however
; results in no changes.

define i32 @test1() {
entry:
  callbr void asm sideeffect "", "X,X,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@test1, %return), i8* blockaddress(@test1, %f))
          to label %asm.fallthrough [label %return, label %f]

asm.fallthrough:
  br label %return

f:
  br label %return

return:
  %retval.0 = phi i32 [ 0, %f ], [ 1, %asm.fallthrough ], [ 1, %entry ]
  ret i32 %retval.0
}

define void @test2() {
entry:
  br label %tailrecurse

tailrecurse:
  %call = tail call i32 @test3()
  %tobool1 = icmp eq i32 %call, 0
  callbr void asm sideeffect "", "X,X,~{dirflag},~{fpsr},~{flags}"(i8* blockaddress(@test2, %test1.exit), i8* blockaddress(@test2, %f.i))
          to label %if.end6 [label %test1.exit, label %f.i]

f.i:
  br label %test1.exit

test1.exit:
  %retval.0.i = phi i1 [ false, %f.i ], [ true, %tailrecurse ]
  %brmerge = or i1 %tobool1, %retval.0.i
  br i1 %brmerge, label %if.end6, label %tailrecurse

if.end6:
  ret void
}

declare i32 @test3()