Changeset View
Changeset View
Standalone View
Standalone View
lld/test/ELF/lto/Inputs/bpf-same-sec-1.ll
- This file was added.
; Source code: | |||||
; struct s { | |||||
; int a; | |||||
; int b; | |||||
; }; | |||||
; extern int foo(int); | |||||
; static __attribute__((noinline)) int add(int a, int b) { | |||||
; return a + b; | |||||
; } | |||||
; int bar(struct s *arg) { | |||||
; return add(arg->a, arg->b) + foo(arg->a); | |||||
; } | |||||
; Compilation flags: | |||||
; clang -target bpfel -flto -O2 -g -S t1.c -o t1.ll | |||||
; ModuleID = 't1.c' | |||||
source_filename = "t1.c" | |||||
target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128" | |||||
target triple = "bpfel" | |||||
%struct.s = type { i32, i32 } | |||||
; Function Attrs: nounwind | |||||
define dso_local i32 @bar(%struct.s* nocapture readonly %arg) local_unnamed_addr #0 !dbg !8 { | |||||
entry: | |||||
call void @llvm.dbg.value(metadata %struct.s* %arg, metadata !18, metadata !DIExpression()), !dbg !19 | |||||
%a = getelementptr inbounds %struct.s, %struct.s* %arg, i64 0, i32 0, !dbg !20 | |||||
%0 = load i32, i32* %a, align 4, !dbg !20, !tbaa !21 | |||||
%b = getelementptr inbounds %struct.s, %struct.s* %arg, i64 0, i32 1, !dbg !26 | |||||
%1 = load i32, i32* %b, align 4, !dbg !26, !tbaa !27 | |||||
%call = tail call fastcc i32 @add(i32 %0, i32 %1), !dbg !28 | |||||
%call2 = tail call i32 @foo(i32 %0) #4, !dbg !29 | |||||
%add = add nsw i32 %call2, %call, !dbg !30 | |||||
ret i32 %add, !dbg !31 | |||||
} | |||||
; Function Attrs: nofree noinline norecurse nosync nounwind readnone willreturn mustprogress | |||||
define internal fastcc i32 @add(i32 %a, i32 %b) unnamed_addr #1 !dbg !32 { | |||||
entry: | |||||
call void @llvm.dbg.value(metadata i32 %a, metadata !36, metadata !DIExpression()), !dbg !38 | |||||
call void @llvm.dbg.value(metadata i32 %b, metadata !37, metadata !DIExpression()), !dbg !38 | |||||
%add = add nsw i32 %b, %a, !dbg !39 | |||||
ret i32 %add, !dbg !40 | |||||
} | |||||
declare !dbg !41 dso_local i32 @foo(i32) local_unnamed_addr #2 | |||||
; Function Attrs: nofree nosync nounwind readnone speculatable willreturn | |||||
declare void @llvm.dbg.value(metadata, metadata, metadata) #3 | |||||
attributes #0 = { nounwind "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" } | |||||
attributes #1 = { nofree noinline norecurse nosync nounwind readnone willreturn mustprogress "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" } | |||||
attributes #2 = { "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" } | |||||
attributes #3 = { nofree nosync nounwind readnone speculatable willreturn } | |||||
attributes #4 = { nounwind } | |||||
!llvm.dbg.cu = !{!0} | |||||
!llvm.module.flags = !{!3, !4, !5, !6} | |||||
!llvm.ident = !{!7} | |||||
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 13.0.0 (https://github.com/llvm/llvm-project.git 433a5046a139601b86ac0f5a8ce89c79e153ff06)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) | |||||
!1 = !DIFile(filename: "t1.c", directory: "/tmp/home/yhs/work/tests/llvm/lto") | |||||
!2 = !{} | |||||
!3 = !{i32 7, !"Dwarf Version", i32 4} | |||||
!4 = !{i32 2, !"Debug Info Version", i32 3} | |||||
!5 = !{i32 1, !"wchar_size", i32 4} | |||||
!6 = !{i32 7, !"frame-pointer", i32 2} | |||||
!7 = !{!"clang version 13.0.0 (https://github.com/llvm/llvm-project.git 433a5046a139601b86ac0f5a8ce89c79e153ff06)"} | |||||
!8 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 9, type: !9, scopeLine: 9, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !17) | |||||
!9 = !DISubroutineType(types: !10) | |||||
!10 = !{!11, !12} | |||||
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) | |||||
!12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64) | |||||
!13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s", file: !1, line: 1, size: 64, elements: !14) | |||||
!14 = !{!15, !16} | |||||
!15 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !13, file: !1, line: 2, baseType: !11, size: 32) | |||||
!16 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !13, file: !1, line: 3, baseType: !11, size: 32, offset: 32) | |||||
!17 = !{!18} | |||||
!18 = !DILocalVariable(name: "arg", arg: 1, scope: !8, file: !1, line: 9, type: !12) | |||||
!19 = !DILocation(line: 0, scope: !8) | |||||
!20 = !DILocation(line: 10, column: 19, scope: !8) | |||||
!21 = !{!22, !23, i64 0} | |||||
!22 = !{!"s", !23, i64 0, !23, i64 4} | |||||
!23 = !{!"int", !24, i64 0} | |||||
!24 = !{!"omnipotent char", !25, i64 0} | |||||
!25 = !{!"Simple C/C++ TBAA"} | |||||
!26 = !DILocation(line: 10, column: 27, scope: !8) | |||||
!27 = !{!22, !23, i64 4} | |||||
!28 = !DILocation(line: 10, column: 10, scope: !8) | |||||
!29 = !DILocation(line: 10, column: 32, scope: !8) | |||||
!30 = !DILocation(line: 10, column: 30, scope: !8) | |||||
!31 = !DILocation(line: 10, column: 3, scope: !8) | |||||
!32 = distinct !DISubprogram(name: "add", scope: !1, file: !1, line: 6, type: !33, scopeLine: 6, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !35) | |||||
!33 = !DISubroutineType(types: !34) | |||||
!34 = !{!11, !11, !11} | |||||
!35 = !{!36, !37} | |||||
!36 = !DILocalVariable(name: "a", arg: 1, scope: !32, file: !1, line: 6, type: !11) | |||||
!37 = !DILocalVariable(name: "b", arg: 2, scope: !32, file: !1, line: 6, type: !11) | |||||
!38 = !DILocation(line: 0, scope: !32) | |||||
!39 = !DILocation(line: 7, column: 12, scope: !32) | |||||
!40 = !DILocation(line: 7, column: 3, scope: !32) | |||||
!41 = !DISubprogram(name: "foo", scope: !1, file: !1, line: 5, type: !42, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2) | |||||
!42 = !DISubroutineType(types: !43) | |||||
!43 = !{!11, !11} |