[PATCH] D61809: [BPF] Preserve debuginfo array/union/struct type/access index

Yonghong Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 27 22:12:53 PDT 2019


yonghong-song marked 2 inline comments as done.
yonghong-song added a comment.

@rsmith I have proposed one clang intrinsic and three IR intrinsics for CO-RE. Could you take a look and share your opinions as well? Thanks!



================
Comment at: docs/LanguageExtensions.rst:1958
+array subscript access and structure/union member access are preserved with
+IR intrinsics ``preserve_array_access_index``, ``preserve_union_access_index``
+and ``preserve_struct_access_index``, instead of IR GetElementPtr instructions.
----------------
efriedma wrote:
> "preserved with the IR intrinsics" isn't really useful; this is the user's manual, not a developer guide to LLVM internals. Probably better to say what it enables from the user's perspective: the CO-RE feature for BPF targets.
Will reword to be more towards users in the next revision.


================
Comment at: docs/LanguageExtensions.rst:1960
+and ``preserve_struct_access_index``, instead of IR GetElementPtr instructions.
+``__builtin_preserve_access_index`` takes effect only when debuginfo (typically
+with ``-g``) is available since debuginfo is used as IR intrinsic metadata
----------------
efriedma wrote:
> I would rather not have __builtin_preserve_access_index fail to do anything when debug info is disabled. If it's hard to fix, making it a hard error is probably okay.
The IR intrinsics needs to have debuginfo as the metadata so that the user-level access info can be reconstructed. If no debug info, just IR intrinsics without debuginfo is less useful. So let me make a hard error.

We can relax it later if IR intrinsics without deebuginfo metadata becomes workable/useful.


Repository:
  rC Clang

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

https://reviews.llvm.org/D61809





More information about the cfe-commits mailing list