1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=slp-vectorizer -S -mtriple=x86_64-pc-windows-msvc19.29.30145 < %s | FileCheck %s
4 ; This used to crash in SLP vectorization when attempting to set the
5 ; IRBuilder's insertion point to the end of a catchswitch block, which
6 ; is invalid. Only phis and the catchswitch may be present, so we must
7 ; avoid trying to insert shuffles into such a block.
9 %typeA = type { ptr, ptr, [20 x i8] }
10 @globalA = external global %typeA
12 declare i32 @__CxxFrameHandler3(...)
15 define void @important_func() personality ptr @__CxxFrameHandler3 {
16 ; CHECK-LABEL: @important_func(
18 ; CHECK-NEXT: br label [[LABELB:%.*]]
20 ; CHECK-NEXT: invoke void @funcA()
21 ; CHECK-NEXT: to label [[LABELC:%.*]] unwind label [[LABELD:%.*]]
23 ; CHECK-NEXT: invoke void @funcA()
24 ; CHECK-NEXT: to label [[LABELE:%.*]] unwind label [[LABELF:%.*]]
26 ; CHECK-NEXT: [[TMP0:%.*]] = cleanuppad within none []
27 ; CHECK-NEXT: unreachable
29 ; CHECK-NEXT: [[TMP1:%.*]] = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 1
30 ; CHECK-NEXT: [[F:%.*]] = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 2
31 ; CHECK-NEXT: invoke void @funcA()
32 ; CHECK-NEXT: to label [[LABELG:%.*]] unwind label [[CATCH_DISPATCH:%.*]]
34 ; CHECK-NEXT: [[TMP2:%.*]] = cleanuppad within none []
35 ; CHECK-NEXT: cleanupret from [[TMP2]] unwind to caller
37 ; CHECK-NEXT: [[G:%.*]] = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 0
38 ; CHECK-NEXT: [[H:%.*]] = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 3
39 ; CHECK-NEXT: invoke void @funcA()
40 ; CHECK-NEXT: to label [[LABELH:%.*]] unwind label [[CATCH_DISPATCH]]
42 ; CHECK-NEXT: unreachable
43 ; CHECK: catch.dispatch:
44 ; CHECK-NEXT: [[TMP3:%.*]] = phi float [ [[G]], [[LABELG]] ], [ [[TMP1]], [[LABELE]] ]
45 ; CHECK-NEXT: [[TMP4:%.*]] = phi float [ [[H]], [[LABELG]] ], [ [[F]], [[LABELE]] ]
46 ; CHECK-NEXT: [[TMP5:%.*]] = catchswitch within none [label %catch] unwind to caller
48 ; CHECK-NEXT: [[TMP6:%.*]] = catchpad within [[TMP5]] [ptr @globalA, i32 8, ptr null]
49 ; CHECK-NEXT: unreachable
56 to label %labelC unwind label %labelD
60 to label %labelE unwind label %labelF
63 %0 = cleanuppad within none []
67 %1 = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 1
68 %f = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 2
70 to label %labelG unwind label %catch.dispatch
73 %2 = cleanuppad within none []
74 cleanupret from %2 unwind to caller
77 %g = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 0
78 %h = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 3
80 to label %labelH unwind label %catch.dispatch
86 %3 = phi float [ %g, %labelG ], [ %1, %labelE ]
87 %4 = phi float [ %h, %labelG ], [ %f, %labelE ]
88 %5 = catchswitch within none [label %catch] unwind to caller
91 %6 = catchpad within %5 [ptr @globalA, i32 8, ptr null]