Go to file
Yonghong Song ac2e25026f bpf: avoid load from read-only sections
If users tried to have a structure decl/init code like below
   struct test_t t = { .memeber1 = 45 };
It is very likely that compiler will generate a readonly section
to hold up the init values for variable t. Later load of t members,
e.g., t.member1 will result in a read from readonly section.

BPF program cannot handle relocation. This will force users to
write:
  struct test_t t = {};
  t.member1 = 45;
This is just inconvenient and unintuitive.

This patch addresses this issue by implementing BPF PreprocessISelDAG.
For any load from a global constant structure or an global array of
constant struct, it attempts to
translate it into a constant directly. The traversal of the
constant struct and other constant data structures are similar
to where the assembler emits read-only sections.

Four different unit test cases are also added to cover
different scenarios.

Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 305560
2017-06-16 15:41:16 +00:00
clang Expand vector oparation to as IR constants, PR28129. 2017-06-16 12:09:52 +00:00
clang-tools-extra [clang-tidy] readability-function-size: fix nesting level calculation 2017-06-16 13:07:47 +00:00
compiler-rt Add test for logging the implicit "this" argument for C++ member functions. 2017-06-16 03:24:07 +00:00
debuginfo-tests Add a test for PR33166. 2017-05-25 19:33:16 +00:00
libclc generic: add missing get_work_dim include 2017-06-02 15:58:35 +00:00
libcxx Fix potential bug by casting to the POSIX specified type 2017-06-16 06:17:52 +00:00
libcxxabi Use _LIBCPP_FALLTHROUGH() to avoid warnings about [[gnu::fallthrough]] being unsupported 2017-06-15 20:18:10 +00:00
libunwind [libunwind] Fix executable stack directive on Linux. 2017-05-16 20:18:57 +00:00
lld [ELF] Enable createThunks to be called more than once. 2017-06-16 13:10:08 +00:00
lldb Change the code I added to LocateDSYMInVincinityOfExecutable to use 2017-06-16 04:19:36 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm bpf: avoid load from read-only sections 2017-06-16 15:41:16 +00:00
openmp Set affinity to none/false in child processes 2017-06-15 21:51:07 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly [Docs] Add a catch-all file to document workflow & tricks. 2017-06-15 12:43:12 +00:00