140 lines · plain
1; Check info on calls.2 3; RUN: opt -pass-remarks=kernel-info -passes=kernel-info \4; RUN: -disable-output %s 2>&1 | \5; RUN: FileCheck -match-full-lines %s6 7target datalayout = "e-i65:64-i128:128-v16:16-v32:32-n16:32:64"8target triple = "nvptx64-nvidia-cuda"9 10declare void @personality()11 12define void @h() personality ptr @personality !dbg !100 {13entry:14 ; CHECK: remark: test.c:16:5: in artificial function 'h_dbg', direct call, callee is '@f'15 call void @f(), !dbg !10216 ; CHECK: remark: test.c:17:5: in artificial function 'h_dbg', direct call to defined function, callee is 'g_dbg'17 call void @g(), !dbg !10418 ; CHECK: remark: test.c:18:5: in artificial function 'h_dbg', direct call to defined function, callee is artificial 'h_dbg'19 call void @h(), !dbg !10520 ; CHECK: remark: test.c:24:5: in artificial function 'h_dbg', direct call to inline assembly, callee is 'asm sideeffect "eieio", ""'21 call void asm sideeffect "eieio", ""(), !dbg !11122 %fnPtr = load ptr, ptr null, align 823 ; CHECK: remark: test.c:19:5: in artificial function 'h_dbg', indirect call, callee is '%fnPtr'24 call void %fnPtr(), !dbg !10625 ; CHECK: remark: test.c:20:5: in artificial function 'h_dbg', direct invoke, callee is '@f'26 invoke void @f() to label %fcont unwind label %cleanup, !dbg !10727fcont:28 ; CHECK: remark: test.c:21:5: in artificial function 'h_dbg', direct invoke to defined function, callee is 'g_dbg'29 invoke void @g() to label %gcont unwind label %cleanup, !dbg !10830gcont:31 ; CHECK: remark: test.c:22:5: in artificial function 'h_dbg', direct invoke to defined function, callee is artificial 'h_dbg'32 invoke void @h() to label %hcont unwind label %cleanup, !dbg !10933hcont:34 ; CHECK: remark: test.c:25:5: in artificial function 'h_dbg', direct invoke to inline assembly, callee is 'asm sideeffect "eieio", ""'35 invoke void asm sideeffect "eieio", ""() to label %asmcont unwind label %cleanup, !dbg !11236asmcont:37 ; CHECK: remark: test.c:23:5: in artificial function 'h_dbg', indirect invoke, callee is '%fnPtr'38 invoke void %fnPtr() to label %end unwind label %cleanup, !dbg !11039cleanup:40 %ll = landingpad { ptr, i32 }41 cleanup42 br label %end43end:44 ret void45}46; CHECK: remark: test.c:13:0: in artificial function 'h_dbg', DirectCalls = 847; CHECK: remark: test.c:13:0: in artificial function 'h_dbg', IndirectCalls = 248; CHECK: remark: test.c:13:0: in artificial function 'h_dbg', DirectCallsToDefinedFunctions = 449; CHECK: remark: test.c:13:0: in artificial function 'h_dbg', InlineAssemblyCalls = 250; CHECK: remark: test.c:13:0: in artificial function 'h_dbg', Invokes = 551 52declare void @f()53 54define void @g() personality ptr @personality !dbg !200 {55entry:56 ; CHECK: remark: test.c:6:3: in function 'g_dbg', direct call, callee is '@f'57 call void @f(), !dbg !20258 ; CHECK: remark: test.c:7:3: in function 'g_dbg', direct call to defined function, callee is 'g_dbg'59 call void @g(), !dbg !20360 ; CHECK: remark: test.c:8:3: in function 'g_dbg', direct call to defined function, callee is artificial 'h_dbg'61 call void @h(), !dbg !20462 ; CHECK: remark: test.c:14:3: in function 'g_dbg', direct call to inline assembly, callee is 'asm sideeffect "eieio", ""'63 call void asm sideeffect "eieio", ""(), !dbg !21064 %fnPtr = load ptr, ptr null, align 865 ; CHECK: remark: test.c:9:3: in function 'g_dbg', indirect call, callee is '%fnPtr'66 call void %fnPtr(), !dbg !20567 ; CHECK: remark: test.c:10:3: in function 'g_dbg', direct invoke, callee is '@f'68 invoke void @f() to label %fcont unwind label %cleanup, !dbg !20669fcont:70 ; CHECK: remark: test.c:11:3: in function 'g_dbg', direct invoke to defined function, callee is 'g_dbg'71 invoke void @g() to label %gcont unwind label %cleanup, !dbg !20772gcont:73 ; CHECK: remark: test.c:12:3: in function 'g_dbg', direct invoke to defined function, callee is artificial 'h_dbg'74 invoke void @h() to label %hcont unwind label %cleanup, !dbg !20875hcont:76 ; CHECK: remark: test.c:15:3: in function 'g_dbg', direct invoke to inline assembly, callee is 'asm sideeffect "eieio", ""'77 invoke void asm sideeffect "eieio", ""() to label %asmcont unwind label %cleanup, !dbg !21178asmcont:79 ; CHECK: remark: test.c:13:3: in function 'g_dbg', indirect invoke, callee is '%fnPtr'80 invoke void %fnPtr() to label %end unwind label %cleanup, !dbg !20981cleanup:82 %ll = landingpad { ptr, i32 }83 cleanup84 br label %end85end:86 ret void87}88; CHECK: remark: test.c:3:0: in function 'g_dbg', DirectCalls = 889; CHECK: remark: test.c:3:0: in function 'g_dbg', IndirectCalls = 290; CHECK: remark: test.c:3:0: in function 'g_dbg', DirectCallsToDefinedFunctions = 491; CHECK: remark: test.c:3:0: in function 'g_dbg', InlineAssemblyCalls = 292; CHECK: remark: test.c:3:0: in function 'g_dbg', Invokes = 593 94define void @i() {95 ; CHECK: remark: <unknown>:0:0: in function '@i', direct call, callee is '@f'96 call void @f()97 ret void98}99; CHECK: remark: <unknown>:0:0: in function '@i', DirectCalls = 1100; CHECK: remark: <unknown>:0:0: in function '@i', IndirectCalls = 0101; CHECK: remark: <unknown>:0:0: in function '@i', DirectCallsToDefinedFunctions = 0102; CHECK: remark: <unknown>:0:0: in function '@i', InlineAssemblyCalls = 0103; CHECK: remark: <unknown>:0:0: in function '@i', Invokes = 0104 105!llvm.module.flags = !{!0}106!llvm.dbg.cu = !{!1}107 108!0 = !{i32 2, !"Debug Info Version", i32 3}109!1 = distinct !DICompileUnit(language: DW_LANG_C11, file: !2, producer: "clang version 19.0.0git", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)110!2 = !DIFile(filename: "test.c", directory: "/tmp")111!3 = !{null}112!4 = !{}113 114!100 = distinct !DISubprogram(name: "h_dbg", scope: !2, file: !2, line: 13, type: !101, scopeLine: 13, flags: DIFlagArtificial | DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition, unit: !1, retainedNodes: !4)115!101 = distinct !DISubroutineType(types: !3)116!102 = !DILocation(line: 16, column: 5, scope: !103)117!103 = distinct !DILexicalBlock(scope: !100, file: !2, line: 13, column: 3)118!104 = !DILocation(line: 17, column: 5, scope: !103)119!105 = !DILocation(line: 18, column: 5, scope: !103)120!106 = !DILocation(line: 19, column: 5, scope: !103)121!107 = !DILocation(line: 20, column: 5, scope: !103)122!108 = !DILocation(line: 21, column: 5, scope: !103)123!109 = !DILocation(line: 22, column: 5, scope: !103)124!110 = !DILocation(line: 23, column: 5, scope: !103)125!111 = !DILocation(line: 24, column: 5, scope: !103)126!112 = !DILocation(line: 25, column: 5, scope: !103)127 128!200 = distinct !DISubprogram(name: "g_dbg", scope: !2, file: !2, line: 3, type: !201, scopeLine: 3, spFlags: DISPFlagDefinition, unit: !1, retainedNodes: !4)129!201 = !DISubroutineType(types: !3)130!202 = !DILocation(line: 6, column: 3, scope: !200)131!203 = !DILocation(line: 7, column: 3, scope: !200)132!204 = !DILocation(line: 8, column: 3, scope: !200)133!205 = !DILocation(line: 9, column: 3, scope: !200)134!206 = !DILocation(line: 10, column: 3, scope: !200)135!207 = !DILocation(line: 11, column: 3, scope: !200)136!208 = !DILocation(line: 12, column: 3, scope: !200)137!209 = !DILocation(line: 13, column: 3, scope: !200)138!210 = !DILocation(line: 14, column: 3, scope: !200)139!211 = !DILocation(line: 15, column: 3, scope: !200)140