[PATCH] D67688: [BPF] Permit all user instructed offset relocatiions
Yonghong Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 17 20:12:48 PDT 2019
yonghong-song created this revision.
yonghong-song added a reviewer: ast.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
Currently, not all user specified relocations
(with clang intrinsic __builtin_preserve_access_index())
will turn into relocations.
In the current implementation, a __builtin_preserve_access_index()
chain is turned into relocation only if the result of the clang
intrinsic is used in a function call or a nonzero offset computation
of getelementptr. For all other cases, the relocatiion request
is ignored and the __builtin_preserve_access_index() is turned
into regular getelementptr instructions.
The main reason is to mimic bpf_probe_read() requirement.
But there are other use cases where relocatable offset is
generated but not used for bpf_probe_read(). This patch
relaxed previous constraints when to generate relocations.
Now, all user __builtin_preserve_access_index() will have
relocations generated.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D67688
Files:
llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp
llvm/test/CodeGen/BPF/CORE/offset-reloc-end-load.ll
llvm/test/CodeGen/BPF/CORE/offset-reloc-end-ret.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67688.220603.patch
Type: text/x-patch
Size: 9598 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190918/9208fdcd/attachment.bin>
More information about the llvm-commits
mailing list