brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.1 KiB · 2cd555f Raw
95 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: %if x86-registered-target %{ opt -passes=slp-vectorizer -S -mtriple=x86_64-pc-windows-msvc19.29.30145 < %s | FileCheck %s %}3; RUN: %if aarch64-registered-target %{ opt -passes=slp-vectorizer -S -mtriple=aarch64-unknown-linux-gnu < %s | FileCheck %s %}4 5; This used to crash in SLP vectorization when attempting to set the6; IRBuilder's insertion point to the end of a catchswitch block, which7; is invalid.  Only phis and the catchswitch may be present, so we must8; avoid trying to insert shuffles into such a block.9 10%typeA = type { ptr, ptr, [20 x i8] }11@globalA = external global %typeA12 13declare i32 @__CxxFrameHandler3(...)14declare void @funcA()15 16define void @important_func() personality ptr @__CxxFrameHandler3 {17; CHECK-LABEL: @important_func(18; CHECK-NEXT:  entry:19; CHECK-NEXT:    br label [[LABELB:%.*]]20; CHECK:       labelB:21; CHECK-NEXT:    invoke void @funcA()22; CHECK-NEXT:    to label [[LABELC:%.*]] unwind label [[LABELD:%.*]]23; CHECK:       labelC:24; CHECK-NEXT:    invoke void @funcA()25; CHECK-NEXT:    to label [[LABELE:%.*]] unwind label [[LABELF:%.*]]26; CHECK:       labelD:27; CHECK-NEXT:    [[TMP0:%.*]] = cleanuppad within none []28; CHECK-NEXT:    unreachable29; CHECK:       labelE:30; CHECK-NEXT:    [[TMP1:%.*]] = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 131; CHECK-NEXT:    [[F:%.*]] = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 232; CHECK-NEXT:    invoke void @funcA()33; CHECK-NEXT:    to label [[LABELG:%.*]] unwind label [[CATCH_DISPATCH:%.*]]34; CHECK:       labelF:35; CHECK-NEXT:    [[TMP2:%.*]] = cleanuppad within none []36; CHECK-NEXT:    cleanupret from [[TMP2]] unwind to caller37; CHECK:       labelG:38; CHECK-NEXT:    [[G:%.*]] = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 039; CHECK-NEXT:    [[H:%.*]] = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 340; CHECK-NEXT:    invoke void @funcA()41; CHECK-NEXT:    to label [[LABELH:%.*]] unwind label [[CATCH_DISPATCH]]42; CHECK:       labelH:43; CHECK-NEXT:    unreachable44; CHECK:       catch.dispatch:45; CHECK-NEXT:    [[TMP3:%.*]] = phi float [ [[G]], [[LABELG]] ], [ [[TMP1]], [[LABELE]] ]46; CHECK-NEXT:    [[TMP4:%.*]] = phi float [ [[H]], [[LABELG]] ], [ [[F]], [[LABELE]] ]47; CHECK-NEXT:    [[TMP5:%.*]] = catchswitch within none [label %catch] unwind to caller48; CHECK:       catch:49; CHECK-NEXT:    [[TMP6:%.*]] = catchpad within [[TMP5]] [ptr @globalA, i32 8, ptr null]50; CHECK-NEXT:    unreachable51;52entry:53  br label %labelB54 55labelB:56  invoke void @funcA()57  to label %labelC unwind label %labelD58 59labelC:60  invoke void @funcA()61  to label %labelE unwind label %labelF62 63labelD:64  %0 = cleanuppad within none []65  unreachable66 67labelE:68  %1 = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 169  %f = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 270  invoke void @funcA()71  to label %labelG unwind label %catch.dispatch72 73labelF:74  %2 = cleanuppad within none []75  cleanupret from %2 unwind to caller76 77labelG:78  %g = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 079  %h = extractelement <4 x float> <float 0x7FF0000000000000, float 0x7FF0000000000000, float 0x7FF0000000000000, float 0xFFF0000000000000>, i64 380  invoke void @funcA()81  to label %labelH unwind label %catch.dispatch82 83labelH:84  unreachable85 86catch.dispatch:87  %3 = phi float [ %g, %labelG ], [ %1, %labelE ]88  %4 = phi float [ %h, %labelG ], [ %f, %labelE ]89  %5 = catchswitch within none [label %catch] unwind to caller90 91catch:92  %6 = catchpad within %5 [ptr @globalA, i32 8, ptr null]93  unreachable94}95