57 lines · plain
1; RUN: llc < %s -mtriple=bpfel | FileCheck %s2; Source:3; struct t1 {4; long a;5; };6; struct t2 {7; long a;8; long b;9; };10; long foo2(struct t1 a1, struct t1 a2, struct t1 a3, struct t1 a4, struct t1 a5) {11; return a1.a + a2.a + a3.a + a4.a + a5.a;12; }13; long foo3(struct t2 a1, struct t2 a2, struct t1 a3) {14; return a1.a + a2.a + a3.a;15; }16; Compilation flags:17; clang -target bpf -S -emit-llvm -O2 t.c18 19; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn20define dso_local i64 @foo2(i64 %a1.coerce, i64 %a2.coerce, i64 %a3.coerce, i64 %a4.coerce, i64 %a5.coerce) local_unnamed_addr #0 {21entry:22 %add = add nsw i64 %a2.coerce, %a1.coerce23 %add8 = add nsw i64 %add, %a3.coerce24 %add10 = add nsw i64 %add8, %a4.coerce25 %add12 = add nsw i64 %add10, %a5.coerce26 ret i64 %add1227; CHECK: r0 = r228; CHECK: r0 += r129; CHECK: r0 += r330; CHECK: r0 += r431; CHECK: r0 += r532; CHECK-NEXT: exit33}34 35; Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn36define dso_local i64 @foo3([2 x i64] %a1.coerce, [2 x i64] %a2.coerce, i64 %a3.coerce) local_unnamed_addr #0 {37entry:38 %a1.coerce.fca.0.extract = extractvalue [2 x i64] %a1.coerce, 039 %a2.coerce.fca.0.extract = extractvalue [2 x i64] %a2.coerce, 040 %add = add nsw i64 %a2.coerce.fca.0.extract, %a1.coerce.fca.0.extract41 %add6 = add nsw i64 %add, %a3.coerce42 ret i64 %add643; CHECK: r0 = r344; CHECK-NEXT: r0 += r145; CHECK-NEXT: r0 += r546; CHECK-NEXT: exit47}48 49attributes #0 = { mustprogress nofree norecurse nosync nounwind readnone willreturn "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }50 51!llvm.module.flags = !{!0, !1}52!llvm.ident = !{!2}53 54!0 = !{i32 1, !"wchar_size", i32 4}55!1 = !{i32 7, !"frame-pointer", i32 2}56!2 = !{!"clang version 16.0.0 (https://github.com/llvm/llvm-project.git 9385660f4ca87d074410a84df89faca313afcb5a)"}57