llvm-project/llvm/test/CodeGen/BPF
Yonghong Song 3671bdbcd2 [BPF] Fix a BTF type pruning bug
In BPF backend, BTF type generation may skip
some debuginfo types if they are the pointee
type of a struct member. For example,
  struct task_struct {
    ...
    struct mm_struct                *mm;
    ...
  };
BPF backend may generate a forward decl for
'struct mm_struct' instead of full type if
there are no other usage of 'struct mm_struct'.
The reason is to avoid bringing too much unneeded types
in BTF.

Alexei found a pruning bug where we may miss
some full type generation. The following is an illustrating
example:
   struct t1 { ... }
   struct t2 { struct t1 *p; };
   struct t2 g;
   void foo(struct t1 *arg) { ... }
In the above case, we will have partial debuginfo chain like below:
   struct t2 -> member p
                        \ -> ptr -> struct t1
                        /
     foo -> argument arg
During traversing
   struct t2 -> member p -> ptr -> struct t1
The corresponding BTF types are generated except 'struct t1' which
will be in FixUp stage. Later, when traversing
   foo -> argument arg -> ptr -> struct t1
The 'ptr' BTF type has been generated and currently implementation
ignores 'pointer' type hence 'struct t1' is not generated.

This patch fixed the issue not just for the above case, but for
general case with multiple derived types, e.g.,
   struct t2 -> member p
                        \ -> const -> ptr -> volatile -> struct t1
                        /
     foo -> argument arg

Differential Revision: https://reviews.llvm.org/D119986
2022-02-16 17:23:34 -08:00
..
BTF [BPF] Fix a BTF type pruning bug 2022-02-16 17:23:34 -08:00
CORE [OpaquePtr] Forbid mixing typed and opaque pointers 2021-09-10 15:18:23 +02:00
32-bit-subreg-alu.ll
32-bit-subreg-cond-select.ll
32-bit-subreg-load-store.ll
32-bit-subreg-peephole-phi-1.ll
32-bit-subreg-peephole-phi-2.ll
32-bit-subreg-peephole-phi-3.ll
32-bit-subreg-peephole.ll
32-bit-subreg-zext.ll
adjust-opt-icmp1.ll [InstCombine] Canonicalize range test idiom 2021-11-08 21:15:46 +01:00
adjust-opt-icmp2.ll [InstCombine] Canonicalize range test idiom 2021-11-08 21:15:46 +01:00
adjust-opt-icmp3.ll BPF: Workaround an InstCombine ICmp transformation with llvm.bpf.compare builtin 2021-11-01 14:46:20 -07:00
adjust-opt-icmp4.ll BPF: Workaround InstCombine trunc+icmp => mask+icmp Optimization 2021-11-18 20:25:28 -08:00
adjust-opt-speculative1.ll [InstCombine] Fold (select C, (gep Ptr, Idx), Ptr) -> (gep Ptr, (select C, Idx, 0)) (PR50183) (REAPPLIED) 2021-07-14 12:21:01 +01:00
adjust-opt-speculative2.ll [InstCombine] Fold (select C, (gep Ptr, Idx), Ptr) -> (gep Ptr, (select C, Idx, 0)) (PR50183) (REAPPLIED) 2021-07-14 12:21:01 +01:00
alu8.ll
atomics.ll
atomics_2.ll
basictest.ll
byval.ll
callx.ll Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
cc_args.ll
cc_args_be.ll
cc_ret.ll
cmp.ll
dwarfdump.ll Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
elf-symbol-information.ll
ex1.ll
fi_ri.ll
i128.ll Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
inline_asm.ll [Tests] Add elementtype attribute to indirect inline asm operands (NFC) 2022-01-06 14:23:51 +01:00
inlineasm-output-template.ll
inlineasm-wreg.ll [BPF] add support for 32 bit registers in inline asm 2021-05-16 11:01:47 -07:00
intrinsics.ll
is_trunc_free.ll Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
is_zext_free.ll Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
lit.local.cfg [BPF][Test] Disable codegen test on AIX 2021-05-06 02:38:46 +00:00
load.ll
loop-exit-cond.ll BPF: avoid NE/EQ loop exit condition 2021-08-04 16:54:16 -07:00
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_dis_all.ll
objdump_imm_hex.ll
objdump_intrinsics.ll
objdump_nop.ll
objdump_static_var.ll
objdump_trivial.ll
objdump_two_funcs.ll Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
optnone-1.ll Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
optnone-2.ll
reloc-2.ll BPF: Add more relocation kinds 2021-05-25 08:19:13 -07:00
reloc-3.ll BPF: Add more relocation kinds 2021-05-25 08:19:13 -07:00
reloc-btf-2.ll BPF: Add more relocation kinds 2021-05-25 08:19:13 -07:00
reloc-btf.ll BPF: Add more relocation kinds 2021-05-25 08:19:13 -07:00
reloc.ll BPF: Add more relocation kinds 2021-05-25 08:19:13 -07: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
remove_truncate_7.ll
remove_truncate_8.ll
rodata_1.ll
rodata_2.ll
rodata_3.ll
rodata_4.ll
rodata_5.ll
rodata_6.ll
rodata_7.ll
sanity.ll
sdiv_error.ll
select_ri.ll
selectiondag-bug.ll
setcc.ll
shifts.ll
simplifycfg.ll Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
sockex2.ll
spill-alu32.ll BPF: make 32bit register spill with 64bit alignment 2021-09-20 21:00:25 -07:00
struct_ret1.ll
struct_ret2.ll
undef.ll
vararg1.ll
vla.ll BPF: remove intrindics @llvm.stacksave() and @llvm.stackrestore() 2021-10-18 09:51:19 -07:00
warn-call.ll
warn-stack.ll Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
xadd.ll Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
xadd_legal.ll