File: avoid-predspill-calleesaved.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (48 lines) | stat: -rw-r--r-- 1,485 bytes parent folder | download | duplicates (19)
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
; Check that a callee-saved register will be saved correctly if
; the predicate-to-GPR spilling code uses it.
;
; RUN: llc -march=hexagon -hexagon-initial-cfg-cleanup=0 < %s | FileCheck %s
;
; We expect to spill p0 into a general-purpose register and keep it there,
; without adding an extra spill of that register.
;
; CHECK: PredSpill:
; CHECK-DAG: r{{[0-9]+}} = p0
; CHECK-DAG: p0 = r{{[0-9]+}}
; CHECK-NOT: = memw(r29
;

define void @PredSpill() {
entry:
  br i1 undef, label %if.then, label %if.else.14

if.then:                                          ; preds = %entry
  br i1 undef, label %if.end.57, label %if.else

if.else:                                          ; preds = %if.then
  unreachable

if.else.14:                                       ; preds = %entry
  br i1 undef, label %if.then.17, label %if.end.57

if.then.17:                                       ; preds = %if.else.14
  br i1 undef, label %if.end.57, label %if.then.20

if.then.20:                                       ; preds = %if.then.17
  %call21 = tail call i32 @myfun()
  %tobool22 = icmp eq i32 %call21, 0
  %0 = tail call i32 @myfun()
  br i1 %tobool22, label %if.else.42, label %if.then.23

if.then.23:                                       ; preds = %if.then.20
  unreachable

if.else.42:                                       ; preds = %if.then.20
  ret void

if.end.57:                                        ; preds = %if.then.17, %if.else.14, %if.then
  ret void
}

declare i32 @myfun()