[PATCH] D81479: [BPF] introduce __builtin_load_u32_to_ptr() intrinsic

Yonghong Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 11:32:56 PDT 2020


yonghong-song marked an inline comment as done.
yonghong-song added inline comments.


================
Comment at: clang/test/CodeGen/builtin-bpf-load-u32-to-ptr.c:5
+struct t { int a; int b; };
+void *test(struct t *arg) { return __builtin_load_u32_to_ptr(arg, 4); }
+
----------------
ast wrote:
> can it be expressed as:
> __builtin_load_u32_to_ptr(&arg->b) ?
Good question. If this, we will have code like
   tmp = ctx + 76
   void *ptr = *(u32 *)(tmp + 0)

IIRC, the verifier does not like this. The verifier prefers `ctx + offset`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81479





More information about the cfe-commits mailing list