Changeset View
Changeset View
Standalone View
Standalone View
lld/test/ELF/lto/Inputs/bpf-diff-sec-1.ll
- This file was added.
; Source code: | |||||
; static __attribute__((noinline)) __attribute__((section("sec1"))) | |||||
; int add(int a, int b) { | |||||
; return a + b; | |||||
; } | |||||
; static __attribute__((noinline)) __attribute__((section("sec1"))) | |||||
; int sub(int a, int b) { | |||||
; return a - b; | |||||
; } | |||||
; __attribute__((section("sec2"))) | |||||
; int bar(int a, int b) { | |||||
; return add(a, b) + sub(a, b); | |||||
; } | |||||
; Compilation flags: | |||||
; clang -target bpfel -flto -O2 -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" | |||||
; Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress | |||||
define dso_local i32 @bar(i32 %a, i32 %b) local_unnamed_addr #0 section "sec2" { | |||||
entry: | |||||
%call = tail call fastcc i32 @add(i32 %a, i32 %b) | |||||
%call1 = tail call fastcc i32 @sub(i32 %a, i32 %b) | |||||
%add = add nsw i32 %call1, %call | |||||
ret i32 %add | |||||
} | |||||
; Function Attrs: nofree noinline norecurse nosync nounwind readnone willreturn mustprogress | |||||
define internal fastcc i32 @add(i32 %a, i32 %b) unnamed_addr #1 section "sec1" { | |||||
entry: | |||||
%add = add nsw i32 %b, %a | |||||
ret i32 %add | |||||
} | |||||
; Function Attrs: nofree noinline norecurse nosync nounwind readnone willreturn mustprogress | |||||
define internal fastcc i32 @sub(i32 %a, i32 %b) unnamed_addr #1 section "sec1" { | |||||
entry: | |||||
%sub = sub nsw i32 %a, %b | |||||
ret i32 %sub | |||||
} | |||||
attributes #0 = { nofree norecurse nosync nounwind readnone willreturn mustprogress "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" } | |||||
!llvm.module.flags = !{!0, !1} | |||||
!llvm.ident = !{!2} | |||||
!0 = !{i32 1, !"wchar_size", i32 4} | |||||
!1 = !{i32 7, !"frame-pointer", i32 2} | |||||
!2 = !{!"clang version 13.0.0 (https://github.com/llvm/llvm-project.git c16909d7d1000413a32d3fcbc765dc082e8b62c0)"} |