File: catchswitch.ll

package info (click to toggle)
llvm-toolchain-15 1%3A15.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,554,644 kB
  • sloc: cpp: 5,922,452; ansic: 1,012,136; asm: 674,362; python: 191,568; objc: 73,855; f90: 42,327; lisp: 31,913; pascal: 11,973; javascript: 10,144; sh: 9,421; perl: 7,447; ml: 5,527; awk: 3,523; makefile: 2,520; xml: 885; cs: 573; fortran: 567
file content (93 lines) | stat: -rw-r--r-- 4,049 bytes parent folder | download
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -slp-vectorizer -S -mtriple=x86_64-pc-windows-msvc19.29.30145 < %s | FileCheck %s

; This used to crash in SLP vectorization when attempting to set the
; IRBuilder's insertion point to the end of a catchswitch block, which
; is invalid.  Only phis and the catchswitch may be present, so we must
; avoid trying to insert shuffles into such a block.

%typeA = type { i8**, i8*, [20 x i8] }
@globalA = external global %typeA

declare i32 @__CxxFrameHandler3(...)
declare void @funcA()

define void @important_func() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
; CHECK-LABEL: @important_func(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    br label [[LABELB:%.*]]
; CHECK:       labelB:
; CHECK-NEXT:    invoke void @funcA()
; CHECK-NEXT:    to label [[LABELC:%.*]] unwind label [[LABELD:%.*]]
; CHECK:       labelC:
; CHECK-NEXT:    invoke void @funcA()
; CHECK-NEXT:    to label [[LABELE:%.*]] unwind label [[LABELF:%.*]]
; CHECK:       labelD:
; CHECK-NEXT:    [[TMP0:%.*]] = cleanuppad within none []
; CHECK-NEXT:    unreachable
; CHECK:       labelE:
; CHECK-NEXT:    [[TMP1:%.*]] = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 1
; CHECK-NEXT:    [[F:%.*]] = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 2
; CHECK-NEXT:    invoke void @funcA()
; CHECK-NEXT:    to label [[LABELG:%.*]] unwind label [[CATCH_DISPATCH:%.*]]
; CHECK:       labelF:
; CHECK-NEXT:    [[TMP2:%.*]] = cleanuppad within none []
; CHECK-NEXT:    cleanupret from [[TMP2]] unwind to caller
; CHECK:       labelG:
; CHECK-NEXT:    [[G:%.*]] = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 0
; CHECK-NEXT:    [[H:%.*]] = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 3
; CHECK-NEXT:    invoke void @funcA()
; CHECK-NEXT:    to label [[LABELH:%.*]] unwind label [[CATCH_DISPATCH]]
; CHECK:       labelH:
; CHECK-NEXT:    unreachable
; CHECK:       catch.dispatch:
; CHECK-NEXT:    [[TMP3:%.*]] = phi float [ [[G]], [[LABELG]] ], [ [[TMP1]], [[LABELE]] ]
; CHECK-NEXT:    [[TMP4:%.*]] = phi float [ [[H]], [[LABELG]] ], [ [[F]], [[LABELE]] ]
; CHECK-NEXT:    [[TMP5:%.*]] = catchswitch within none [label %catch] unwind to caller
; CHECK:       catch:
; CHECK-NEXT:    [[TMP6:%.*]] = catchpad within [[TMP5]] [%typeA* @globalA, i32 8, i8* null]
; CHECK-NEXT:    unreachable
;
entry:
  br label %labelB

labelB:
  invoke void @funcA()
  to label %labelC unwind label %labelD

labelC:
  invoke void @funcA()
  to label %labelE unwind label %labelF

labelD:
  %0 = cleanuppad within none []
  unreachable

labelE:
  %1 = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 1
  %f = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 2
  invoke void @funcA()
  to label %labelG unwind label %catch.dispatch

labelF:
  %2 = cleanuppad within none []
  cleanupret from %2 unwind to caller

labelG:
  %g = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 0
  %h = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 3
  invoke void @funcA()
  to label %labelH unwind label %catch.dispatch

labelH:
  unreachable

catch.dispatch:
  %3 = phi float [ %g, %labelG ], [ %1, %labelE ]
  %4 = phi float [ %h, %labelG ], [ %f, %labelE ]
  %5 = catchswitch within none [label %catch] unwind to caller

catch:
  %6 = catchpad within %5 [%typeA* @globalA, i32 8, i8* null]
  unreachable
}