File: si-annotate-nested-control-flows.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (60 lines) | stat: -rw-r--r-- 2,171 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
60
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -mtriple=amdgcn-amd-amdhsa -p simplifycfg,amdgpu-unify-divergent-exit-nodes %s -S -o - | FileCheck %s --check-prefix=OPT
; RUN: llc -mtriple=amdgcn-amd-amdhsa %s -o - | FileCheck %s --check-prefix=ISA

define void @nested_inf_loop(i1 %0, i1 %1) {
; OPT-LABEL: @nested_inf_loop(
; OPT-NEXT:  BB:
; OPT-NEXT:    br label [[BB1:%.*]]
; OPT:       BB1:
; OPT-NEXT:    [[BRMERGE:%.*]] = select i1 [[TMP0:%.*]], i1 true, i1 [[TMP1:%.*]]
; OPT-NEXT:    br i1 [[BRMERGE]], label [[BB1]], label [[INFLOOP:%.*]]
; OPT:       infloop:
; OPT-NEXT:    br i1 true, label [[INFLOOP]], label [[DUMMYRETURNBLOCK:%.*]]
; OPT:       DummyReturnBlock:
; OPT-NEXT:    ret void
;
; ISA-LABEL: nested_inf_loop:
; ISA-NEXT: %bb.0:                                ; %BB
; ISA-NEXT: 	s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; ISA-NEXT: 	v_and_b32_e32 v1, 1, v1
; ISA-NEXT: 	v_and_b32_e32 v0, 1, v0
; ISA-NEXT: 	v_cmp_eq_u32_e64 s[4:5], 1, v1
; ISA-NEXT: 	v_cmp_eq_u32_e32 vcc, 1, v0
; ISA-NEXT: 	s_xor_b64 s[6:7], vcc, -1
; ISA-NEXT: 	s_mov_b64 s[8:9], 0
; ISA-NEXT: .LBB0_1:                                ; %BB1
; ISA: 	      s_and_b64 s[10:11], exec, s[6:7]
; ISA-NEXT: 	s_or_b64 s[8:9], s[10:11], s[8:9]
; ISA-NEXT: 	s_andn2_b64 exec, exec, s[8:9]
; ISA-NEXT: 	s_cbranch_execnz .LBB0_1
; ISA-NEXT: %bb.2:                                ; %BB2
; ISA: 	      s_or_b64 exec, exec, s[8:9]
; ISA-NEXT: 	s_mov_b64 s[8:9], 0
; ISA-NEXT: .LBB0_3:                                ; %BB4
; ISA: 	      s_and_b64 s[10:11], exec, s[4:5]
; ISA-NEXT: 	s_or_b64 s[8:9], s[10:11], s[8:9]
; ISA-NEXT: 	s_andn2_b64 exec, exec, s[8:9]
; ISA-NEXT: 	s_cbranch_execnz .LBB0_3
; ISA-NEXT: %bb.4:                                ; %loop.exit.guard
; ISA: 	      s_or_b64 exec, exec, s[8:9]
; ISA-NEXT: 	s_mov_b64 vcc, 0
; ISA-NEXT: 	s_mov_b64 s[8:9], 0
; ISA-NEXT: 	s_branch .LBB0_1
; ISA-NEXT: %bb.5:                                ; %DummyReturnBlock
; ISA-NEXT: 	s_setpc_b64 s[30:31]
BB:
  br label %BB1

BB1:
  br i1 %0, label %BB3, label %BB2

BB2:
  br label %BB4

BB4:
  br i1 %1, label %BB3, label %BB4

BB3:
  br label %BB1
}