File: cfg_deopt_unreach.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (31 lines) | stat: -rw-r--r-- 2,199 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
; RUN: rm -rf %t
; RUN: mkdir -p %t
; RUN: opt < %s -passes=dot-cfg -cfg-hide-unreachable-paths -cfg-dot-filename-prefix=%t/unreach 2>/dev/null > /dev/null
; RUN: FileCheck %s -input-file=%t/unreach.callee.dot -check-prefix=UNREACH
; RUN: opt < %s -passes=dot-cfg -cfg-hide-deoptimize-paths -cfg-dot-filename-prefix=%t/deopt 2>/dev/null > /dev/null
; RUN: FileCheck %s -input-file=%t/deopt.callee.dot -check-prefix=DEOPT
; RUN: opt < %s -passes=dot-cfg -cfg-dot-filename-prefix=%t/no-flags 2>/dev/null > /dev/null
; RUN: FileCheck %s -input-file=%t/no-flags.callee.dot -check-prefix=NO-FLAGS
; RUN: opt < %s -passes=dot-cfg -cfg-hide-unreachable-paths -cfg-hide-deoptimize-paths -cfg-dot-filename-prefix=%t/both-flags 2>/dev/null > /dev/null
; RUN: FileCheck %s -input-file=%t/both-flags.callee.dot -check-prefix=BOTH-FLAGS

declare i8 @llvm.experimental.deoptimize.i8(...)

define i8 @callee(ptr %c) alwaysinline {
  %c0 = load volatile i1, ptr %c
  br i1 %c0, label %lleft, label %lright
; NO-FLAGS: label="{lleft:                                            \l  %v0 = call i8 (...) @llvm.experimental.deoptimize.i8(i32 1) [ \"deopt\"(i32 1)\l... ]\l  ret i8 %v0\l}"
; DEOPT-NOT: label="{lleft:                                            \l  %v0 = call i8 (...) @llvm.experimental.deoptimize.i8(i32 1) [ \"deopt\"(i32 1)\l... ]\l  ret i8 %v0\l}"
; UNREACH: label="{lleft:                                            \l  %v0 = call i8 (...) @llvm.experimental.deoptimize.i8(i32 1) [ \"deopt\"(i32 1)\l... ]\l  ret i8 %v0\l}"
; BOTH-FLAGS-NOT: label="{lleft:                                            \l  %v0 = call i8 (...) @llvm.experimental.deoptimize.i8(i32 1) [ \"deopt\"(i32 1)\l... ]\l  ret i8 %v0\l}"
lleft:
  %v0 = call i8(...) @llvm.experimental.deoptimize.i8(i32 1) [ "deopt"(i32 1) ]
  ret i8 %v0

; NO-FLAGS: label="{lright:                                           \l  unreachable\l}"
; DEOPT: label="{lright:                                           \l  unreachable\l}"
; UNREACH-NOT: label="{lright:                                           \l  unreachable\l}"
; BOTH-FLAGS-NOT: label="{lright:                                           \l  unreachable\l}"
lright:
  unreachable
}