[PATCH] D132144: [Clang][BPF] Support record argument with direct values

Yonghong Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 18 09:51:29 PDT 2022


yonghong-song created this revision.
yonghong-song added a reviewer: ast.
Herald added subscribers: pengfei, kristof.beyls.
Herald added a project: All.
yonghong-song requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Currently, record arguments are always passed by reference by allocating
space for record values in the caller. This is less efficient for 
small records which may take one or two registers. For example,
for x86_64 and aarch64, for a record size up to 16 bytes, the record
values can be passed by values directly on the registers.

This patch added BPF support of record argument with direct values
for up to 16 byte record size. If record size is 0, that record
will not take any register, which is the same behavior for x86_64
and aarch64. If the record size is greater than 16 bytes, the 
record argument will be passed by reference.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132144

Files:
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGen/bpf-struct-argument.c
  clang/test/CodeGen/bpf-union-argument.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132144.453692.patch
Type: text/x-patch
Size: 3891 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220818/bf275825/attachment.bin>


More information about the cfe-commits mailing list