forked from OSchip/llvm-project
ac2e25026f
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 |
||
---|---|---|
.. | ||
alu8.ll | ||
atomics.ll | ||
basictest.ll | ||
byval.ll | ||
cc_args.ll | ||
cc_args_be.ll | ||
cc_ret.ll | ||
cmp.ll | ||
dwarfdump.ll | ||
ex1.ll | ||
fi_ri.ll | ||
intrinsics.ll | ||
lit.local.cfg | ||
load.ll | ||
loops.ll | ||
many_args1.ll | ||
many_args2.ll | ||
mem_offset.ll | ||
mem_offset_be.ll | ||
objdump_atomics.ll | ||
objdump_intrinsics.ll | ||
objdump_trivial.ll | ||
reloc.ll | ||
rodata_1.ll | ||
rodata_2.ll | ||
rodata_3.ll | ||
rodata_4.ll | ||
sanity.ll | ||
sdiv_error.ll | ||
setcc.ll | ||
shifts.ll | ||
sockex2.ll | ||
struct_ret1.ll | ||
struct_ret2.ll | ||
undef.ll | ||
vararg1.ll | ||
warn-call.ll | ||
warn-stack.ll |