llvm-project/llvm/test/CodeGen/BPF
Yonghong Song 360a4e2ca6 [BPF] add proper multi-dimensional array support
For multi-dimensional array like below
  int a[2][3];
the previous implementation generates BTF_KIND_ARRAY type
like below:
  . element_type: int
  . index_type: unsigned int
  . number of elements: 6

This is not the best way to represent arrays, esp.,
when converting BTF back to headers and users will see
  int a[6];
instead.

This patch generates proper support for multi-dimensional arrays.
For "int a[2][3]", the two BTF_KIND_ARRAY types will be
generated:
  Type #n:
    . element_type: int
    . index_type: unsigned int
    . number of elements: 3
  Type #(n+1):
    . element_type: #n
    . index_type: unsigned int
    . number of elements: 2

The linux kernel already supports such a multi-dimensional
array representation properly.

Signed-off-by: Yonghong Song <yhs@fb.com>

Differential Revision: https://reviews.llvm.org/D59943

llvm-svn: 357215
2019-03-28 21:59:49 +00:00
..
BTF [BPF] add proper multi-dimensional array support 2019-03-28 21:59:49 +00:00
32-bit-subreg-alu.ll
32-bit-subreg-cond-select.ll
32-bit-subreg-load-store.ll
32-bit-subreg-peephole.ll
alu8.ll
atomics.ll
basictest.ll
byval.ll
cc_args.ll
cc_args_be.ll
cc_ret.ll
cmp.ll
dwarfdump.ll
elf-symbol-information.ll [bpf] Test case for symbol information in object file 2018-09-22 17:31:01 +00:00
ex1.ll
fi_ri.ll
inline_asm.ll
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 [BPF] Don't fail for static variables 2019-02-27 05:36:15 +00:00
objdump_trivial.ll
reloc-btf.ll [BPF] make test case reloc-btf.ll tolerable for old compilers 2019-02-20 00:22:19 +00:00
reloc.ll
remove_truncate_1.ll
remove_truncate_2.ll
remove_truncate_3.ll
remove_truncate_4.ll
remove_truncate_5.ll Revert r354244 "[DAGCombiner] Eliminate dead stores to stack." 2019-02-18 08:24:29 +00:00
rodata_1.ll
rodata_2.ll
rodata_3.ll
rodata_4.ll
sanity.ll
sdiv_error.ll
select_ri.ll
setcc.ll
shifts.ll
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
xadd.ll bpf: enable sub-register code-gen for XADD 2019-02-28 19:21:28 +00:00
xadd_legal.ll bpf: enable sub-register code-gen for XADD 2019-02-28 19:21:28 +00:00