llvm-project/llvm/test/CodeGen/BPF
Yonghong Song 6d07802d63 [BPF] handle typedef of struct/union for CO-RE relocations
Linux commit
  1cf5b23988 (diff-289313b9fec99c6f0acfea19d9cfd949)
uses "#pragma clang attribute push (__attribute__((preserve_access_index)),
      apply_to = record)"
to apply CO-RE relocations to all records including the following pattern:
  #pragma clang attribute push (__attribute__((preserve_access_index)), apply_to = record)
  typedef struct {
    int a;
  } __t;
  #pragma clang attribute pop
  int test(__t *arg) { return arg->a; }

The current approach to use struct/union type in the relocation record will
result in an anonymous struct, which make later type matching difficult
in bpf loader. In fact, current BPF backend will fail the above program
with assertion:
  clang: ../lib/Target/BPF/BPFAbstractMemberAccess.cpp:796: ...
     Assertion `TypeName.size()' failed.

clang will change to use the type of the base of the member access
which will preserve the typedef modifier for the
preserve_{struct,union}_access_index intrinsics in the above example.
Here we adjust BPF backend to accept that the debuginfo
type metadata may be 'typedef' and handle them properly.

Differential Revision: https://reviews.llvm.org/D73902
2020-02-04 08:53:03 -08:00
..
BTF [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
CORE [BPF] handle typedef of struct/union for CO-RE relocations 2020-02-04 08:53:03 -08:00
32-bit-subreg-alu.ll [BPF] turn on -mattr=+alu32 for cpu version v3 and later 2019-11-07 22:08:46 -08:00
32-bit-subreg-cond-select.ll [BPF] Fix a bug in peephole optimization 2019-11-20 15:19:59 -08:00
32-bit-subreg-load-store.ll
32-bit-subreg-peephole-phi-1.ll [BPF] Fix a bug in peephole optimization 2019-11-20 15:19:59 -08:00
32-bit-subreg-peephole-phi-2.ll [BPF] Fix a bug in peephole optimization 2019-11-20 15:19:59 -08:00
32-bit-subreg-peephole-phi-3.ll [BPF] Fix a recursion bug in BPF Peephole ZEXT optimization 2019-11-22 08:05:43 -08:00
32-bit-subreg-peephole.ll [BPF] Fix a bug in peephole optimization 2019-11-20 15:19:59 -08:00
alu8.ll
atomics.ll
basictest.ll
byval.ll
callx.ll [BPF] fix indirect call assembly code 2019-10-21 03:22:03 +00:00
cc_args.ll
cc_args_be.ll
cc_ret.ll
cmp.ll
dwarfdump.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
elf-symbol-information.ll
ex1.ll
fi_ri.ll
inline_asm.ll
inlineasm-output-template.ll [AsmPrinter] refactor to support %c w/ GlobalAddress' 2019-04-26 18:45:04 +00:00
intrinsics.ll
lit.local.cfg
load.ll
loops.ll
many_args1.ll
many_args2.ll
mem_offset.ll
mem_offset_be.ll
memcpy-expand-in-order.ll
objdump_atomics.ll
objdump_cond_op.ll
objdump_cond_op_2.ll
objdump_imm_hex.ll
objdump_intrinsics.ll
objdump_static_var.ll
objdump_trivial.ll
objdump_two_funcs.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
optnone-1.ll [BPF] fix a bug in BPFMISimplifyPatchable pass with -O0 2020-01-30 08:28:39 -08:00
reloc-btf-2.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
reloc-btf.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
reloc.ll [llvm-objdump] - Print relocation record in a GNU format. 2019-05-07 13:14:18 +00:00
remove_truncate_1.ll
remove_truncate_2.ll
remove_truncate_3.ll
remove_truncate_4.ll
remove_truncate_5.ll
remove_truncate_6.ll bpf: fix wrong truncation elimination when there is back-edge/loop 2019-10-16 15:27:59 +00:00
rodata_1.ll
rodata_2.ll
rodata_3.ll
rodata_4.ll
sanity.ll
sdiv_error.ll Revert "[Support] make report_fatal_error `abort` instead of `exit`" 2020-01-15 17:52:25 -08:00
select_ri.ll
setcc.ll
shifts.ll [SelectionDAG] ComputeKnownBits - minimum leading/trailing zero bits in LSHR/SHL (PR44526) 2020-01-13 11:08:12 +00:00
sockex2.ll
struct_ret1.ll
struct_ret2.ll
undef.ll [DAGCombiner] If a TokenFactor would be merged into its user, consider the user later. 2019-03-13 17:07:09 +00:00
vararg1.ll
warn-call.ll
warn-stack.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
xadd.ll Revert "[Support] make report_fatal_error `abort` instead of `exit`" 2020-01-15 17:52:25 -08:00
xadd_legal.ll