[PATCH] D61810: [BPF] add new intrinsics preserve_{array,union,struct}_access_index

Yonghong Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 22:10:41 PDT 2019


yonghong-song added a subscriber: rsmith.
yonghong-song added a comment.

@eli.friedman @rsmith @lebedev.ri I just loaded a new set of patches. Notable changes include

- introduce clang intrinsic `base = __builtin_preserve_access_index(base)`, which is used to identify relocatable geps. This is a buy-in approach from user so we do not pay performance penalty for transforming gep's to intrinsics and later back to gep with some performance loss.
- for IR intrinsics preserve_*_access_index, struct/union names are removed from the argument list. Instead a new metadata type MD_preserve_access_index is introduced. This metadata has struct/union debuginfo type and attached to preserve_*_access_index.

The noticable change in BPF backend:

- During IR, we create a global variable to represent the relocable gep. this global also has MD_preserve_access_index metadata attached, which is available later in AsmPrinter, to avoid any type name comparison.
- a BPF subtarget feature `checkoffsetreloc` is implemented to warn users of any bpf_probe_read() without relocatable gep. This is mostly for debugging.

Please let me know what you think? Thanks!


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61810/new/

https://reviews.llvm.org/D61810





More information about the llvm-commits mailing list