[PATCH] D113496: BPF: change btf_type_tag BTF output format

Yonghong Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 9 10:04:07 PST 2021


yonghong-song created this revision.
yonghong-song added reviewers: ast, anakryiko.
Herald added a subscriber: hiraditya.
yonghong-song requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

For the declaration like below:

  int __tag1 * __tag1 __tag2 *g

Commit 41860e602aaa <https://reviews.llvm.org/rG41860e602aaa94556ba996fae7b8baa268e25096> ("BPF: Support btf_type_tag attribute")
implemented the following encoding:

  VAR(g) -> __tag1 --> __tag2 -> pointer -> __tag1 -> pointer -> int 

Some further experiments with linux btf_type_tag support, esp.
with generating attributes in vmlinux.h, and also some internal
discussion showed the following format is more desirable:

  VAR(g) -> pointer -> __tag2 -> __tag1 -> pointer -> __tag1 -> int 

The format makes it similar to other modifier like 'const', e.g.,

  const int *g

which has encoding VAR(g) -> PTR -> CONST -> int


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113496

Files:
  llvm/lib/Target/BPF/BTFDebug.cpp
  llvm/lib/Target/BPF/BTFDebug.h
  llvm/test/CodeGen/BPF/BTF/type-tag-var.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113496.385869.patch
Type: text/x-patch
Size: 7700 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211109/f9f91a43/attachment-0001.bin>


More information about the llvm-commits mailing list