1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx908 < %s | FileCheck %s 3 4; Don't crash. 5 6; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn 7declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 8 9declare ptr @__kmpc_alloc_shared() 10 11define weak_odr void @test(i32 %0) !dbg !34 { 12; CHECK-LABEL: test: 13; CHECK: .Lfunc_begin0: 14; CHECK-NEXT: .loc 1 288 0 ; dummy:288:0 15; CHECK-NEXT: .cfi_sections .debug_frame 16; CHECK-NEXT: .cfi_startproc 17; CHECK-NEXT: ; %bb.0: 18; CHECK-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) 19; CHECK-NEXT: s_or_saveexec_b64 s[16:17], -1 20; CHECK-NEXT: buffer_store_dword v40, off, s[0:3], s32 offset:4 ; 4-byte Folded Spill 21; CHECK-NEXT: buffer_store_dword v42, off, s[0:3], s32 offset:8 ; 4-byte Folded Spill 22; CHECK-NEXT: s_mov_b64 exec, s[16:17] 23; CHECK-NEXT: v_writelane_b32 v40, s30, 0 24; CHECK-NEXT: v_writelane_b32 v40, s31, 1 25; CHECK-NEXT: v_writelane_b32 v40, s34, 2 26; CHECK-NEXT: v_writelane_b32 v40, s35, 3 27; CHECK-NEXT: v_writelane_b32 v40, s36, 4 28; CHECK-NEXT: v_writelane_b32 v40, s37, 5 29; CHECK-NEXT: v_writelane_b32 v40, s38, 6 30; CHECK-NEXT: v_writelane_b32 v40, s39, 7 31; CHECK-NEXT: v_writelane_b32 v40, s40, 8 32; CHECK-NEXT: v_writelane_b32 v40, s41, 9 33; CHECK-NEXT: v_writelane_b32 v40, s42, 10 34; CHECK-NEXT: v_writelane_b32 v40, s43, 11 35; CHECK-NEXT: v_writelane_b32 v40, s44, 12 36; CHECK-NEXT: v_writelane_b32 v42, s33, 0 37; CHECK-NEXT: s_mov_b32 s33, s32 38; CHECK-NEXT: s_addk_i32 s32, 0x400 39; CHECK-NEXT: v_writelane_b32 v40, s45, 13 40; CHECK-NEXT: v_writelane_b32 v40, s46, 14 41; CHECK-NEXT: s_mov_b64 s[40:41], s[4:5] 42; CHECK-NEXT: ;DEBUG_VALUE: dummy:dummy <- undef 43; CHECK-NEXT: .Ltmp0: 44; CHECK-NEXT: .loc 1 49 9 prologue_end ; dummy:49:9 45; CHECK-NEXT: s_getpc_b64 s[4:5] 46; CHECK-NEXT: s_add_u32 s4, s4, __kmpc_alloc_shared@gotpcrel32@lo+4 47; CHECK-NEXT: s_addc_u32 s5, s5, __kmpc_alloc_shared@gotpcrel32@hi+12 48; CHECK-NEXT: v_writelane_b32 v40, s47, 15 49; CHECK-NEXT: s_load_dwordx2 s[46:47], s[4:5], 0x0 50; CHECK-NEXT: s_mov_b64 s[4:5], s[40:41] 51; CHECK-NEXT: buffer_store_dword v41, off, s[0:3], s33 ; 4-byte Folded Spill 52; CHECK-NEXT: v_mov_b32_e32 v41, v31 53; CHECK-NEXT: s_mov_b32 s42, s15 54; CHECK-NEXT: s_mov_b32 s43, s14 55; CHECK-NEXT: s_mov_b32 s44, s13 56; CHECK-NEXT: s_mov_b32 s45, s12 57; CHECK-NEXT: s_mov_b64 s[34:35], s[10:11] 58; CHECK-NEXT: s_mov_b64 s[36:37], s[8:9] 59; CHECK-NEXT: s_mov_b64 s[38:39], s[6:7] 60; CHECK-NEXT: s_waitcnt lgkmcnt(0) 61; CHECK-NEXT: s_swappc_b64 s[30:31], s[46:47] 62; CHECK-NEXT: s_mov_b64 s[4:5], s[40:41] 63; CHECK-NEXT: s_mov_b64 s[6:7], s[38:39] 64; CHECK-NEXT: s_mov_b64 s[8:9], s[36:37] 65; CHECK-NEXT: s_mov_b64 s[10:11], s[34:35] 66; CHECK-NEXT: s_mov_b32 s12, s45 67; CHECK-NEXT: s_mov_b32 s13, s44 68; CHECK-NEXT: s_mov_b32 s14, s43 69; CHECK-NEXT: s_mov_b32 s15, s42 70; CHECK-NEXT: v_mov_b32_e32 v31, v41 71; CHECK-NEXT: s_swappc_b64 s[30:31], s[46:47] 72; CHECK-NEXT: .Ltmp1: 73; CHECK-NEXT: ;DEBUG_VALUE: dummy:dummy <- [$vgpr0_vgpr1+0] 74; CHECK-NEXT: .loc 1 0 9 is_stmt 0 ; dummy:0:9 75; CHECK-NEXT: buffer_load_dword v41, off, s[0:3], s33 ; 4-byte Folded Reload 76; CHECK-NEXT: v_mov_b32_e32 v2, 0 77; CHECK-NEXT: flat_store_dword v[0:1], v2 78; CHECK-NEXT: v_readlane_b32 s47, v40, 15 79; CHECK-NEXT: v_readlane_b32 s46, v40, 14 80; CHECK-NEXT: v_readlane_b32 s45, v40, 13 81; CHECK-NEXT: v_readlane_b32 s44, v40, 12 82; CHECK-NEXT: v_readlane_b32 s43, v40, 11 83; CHECK-NEXT: v_readlane_b32 s42, v40, 10 84; CHECK-NEXT: v_readlane_b32 s41, v40, 9 85; CHECK-NEXT: v_readlane_b32 s40, v40, 8 86; CHECK-NEXT: v_readlane_b32 s39, v40, 7 87; CHECK-NEXT: v_readlane_b32 s38, v40, 6 88; CHECK-NEXT: v_readlane_b32 s37, v40, 5 89; CHECK-NEXT: v_readlane_b32 s36, v40, 4 90; CHECK-NEXT: v_readlane_b32 s35, v40, 3 91; CHECK-NEXT: v_readlane_b32 s34, v40, 2 92; CHECK-NEXT: v_readlane_b32 s31, v40, 1 93; CHECK-NEXT: v_readlane_b32 s30, v40, 0 94; CHECK-NEXT: s_addk_i32 s32, 0xfc00 95; CHECK-NEXT: v_readlane_b32 s33, v42, 0 96; CHECK-NEXT: s_or_saveexec_b64 s[4:5], -1 97; CHECK-NEXT: buffer_load_dword v40, off, s[0:3], s32 offset:4 ; 4-byte Folded Reload 98; CHECK-NEXT: buffer_load_dword v42, off, s[0:3], s32 offset:8 ; 4-byte Folded Reload 99; CHECK-NEXT: s_mov_b64 exec, s[4:5] 100; CHECK-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0) 101; CHECK-NEXT: s_setpc_b64 s[30:31] 102; CHECK-NEXT: .Ltmp2: 103 %2 = call ptr @__kmpc_alloc_shared(), !dbg !43 104 %3 = call ptr @__kmpc_alloc_shared() 105 store i32 0, ptr %3, align 4 106 call void @llvm.dbg.declare(metadata ptr %3, metadata !40, metadata !DIExpression()), !dbg !43 107 ret void 108} 109 110attributes #0 = { nocallback nofree nosync nounwind readnone speculatable willreturn } 111 112!llvm.dbg.cu = !{!0, !25, !26} 113!llvm.module.flags = !{!27, !28, !29, !30, !31, !32, !33} 114 115!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 15.0.0 (https://github.com/llvm/llvm-project.git 05256c8d95e0b15bcc502d595c15d902ff520f97)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !8, imports: !20, splitDebugInlining: false, nameTableKind: None) 116!1 = !DIFile(filename: "dummy", directory: "dummy", checksumkind: CSK_MD5, checksum: "b67bec84bdce3730b4a6f2ed8d50b85c") 117!2 = !{!3, !3, !3} 118!3 = distinct !DICompositeType(tag: DW_TAG_enumeration_type, name: "dummy", scope: !4, file: !1, line: 49, baseType: !5, size: 32, elements: !6, identifier: "dummy") 119!4 = !DINamespace(name: "dummy", scope: null) 120!5 = !DIBasicType(name: "dummy", size: 32, encoding: DW_ATE_unsigned) 121!6 = !{!7} 122!7 = !DIEnumerator(name: "dummy", value: 0, isUnsigned: true) 123!8 = !{!5, !9, !11, !12, !13, !14} 124!9 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "dummy", scope: !10, file: !1, line: 49, size: 32, flags: DIFlagEnumClass, elements: !6, identifier: "dummy") 125!10 = !DINamespace(name: "dummy", scope: !4) 126!11 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "dummy", scope: !4, file: !1, line: 49, size: 32, flags: DIFlagEnumClass, elements: !6, identifier: "dummy") 127!12 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "dummy", scope: !4, file: !1, line: 49, size: 32, flags: DIFlagEnumClass, elements: !6, identifier: "dummy") 128!13 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "dummy", scope: !10, file: !1, line: 49, size: 32, flags: DIFlagEnumClass, elements: !6, identifier: "dummy") 129!14 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "dummy", scope: !10, file: !1, line: 49, size: 32, flags: DIFlagEnumClass, elements: !6, templateParams: !15, identifier: "dummy") 130!15 = !{!16, !17, !19} 131!16 = !DITemplateTypeParameter(name: "dummy", type: !11) 132!17 = !DITemplateTypeParameter(name: "dummy", type: !18) 133!18 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "dummy", scope: !10, file: !1, line: 49, size: 32, flags: DIFlagEnumClass, identifier: "dummy") 134!19 = !DITemplateValueParameter(type: !5, value: i1 true) 135!20 = !{!21} 136!21 = !DIImportedEntity(tag: DW_TAG_imported_module, scope: !4, entity: !22, file: !1, line: 49) 137!22 = !DISubprogram(name: "dummy", scope: !4, file: !1, line: 49, type: !23, flags: DIFlagEnumClass, spFlags: DISPFlagOptimized) 138!23 = !DISubroutineType(types: !24) 139!24 = !{!5} 140!25 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 15.0.0 (https://github.com/llvm/llvm-project.git 05256c8d95e0b15bcc502d595c15d902ff520f97)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, imports: !20, splitDebugInlining: false, nameTableKind: None) 141!26 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 15.0.0 (https://github.com/llvm/llvm-project.git 05256c8d95e0b15bcc502d595c15d902ff520f97)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !24, imports: !20, splitDebugInlining: false, nameTableKind: None) 142!27 = !{i32 7, !"Dwarf Version", i32 5} 143!28 = !{i32 2, !"Debug Info Version", i32 3} 144!29 = !{i32 1, !"wchar_size", i32 4} 145!30 = !{i32 7, !"openmp", i32 50} 146!31 = !{i32 7, !"openmp-device", i32 50} 147!32 = !{i32 7, !"PIC Level", i32 2} 148!33 = !{i32 1, !"LTOPostLink", i32 1} 149!34 = distinct !DISubprogram(name: "dummy", linkageName: "dummy", scope: !35, file: !1, line: 49, type: !23, scopeLine: 288, flags: DIFlagEnumClass, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, declaration: !36, retainedNodes: !37) 150!35 = distinct !DICompositeType(tag: DW_TAG_class_type, file: !1, line: 49, size: 32, flags: DIFlagEnumClass, elements: !6, identifier: "dummy") 151!36 = !DISubprogram(name: "dummy", scope: !35, file: !1, line: 49, type: !23, scopeLine: 288, flags: DIFlagEnumClass, spFlags: DISPFlagOptimized) 152!37 = !{!38, !40, !41, !42} 153!38 = !DILocalVariable(name: "dummy", arg: 1, scope: !34, type: !39, flags: DIFlagEnumClass) 154!39 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !5, size: 32) 155!40 = !DILocalVariable(name: "dummy", arg: 2, scope: !34, file: !1, line: 49, type: !5) 156!41 = !DILocalVariable(name: "dummy", arg: 3, scope: !34, file: !1, line: 49, type: !5) 157!42 = !DILocalVariable(name: "dummy", arg: 4, scope: !34, file: !1, line: 49, type: !5) 158!43 = !DILocation(line: 49, column: 9, scope: !34) 159