llvm-project/llvm/test/CodeGen/BPF/BTF
Yonghong Song 00602ee7ef BPF: simplify IR generation for __builtin_btf_type_id()
This patch simplified IR generation for __builtin_btf_type_id().
For __builtin_btf_type_id(obj, flag), previously IR builtin
looks like
   if (obj is a lvalue)
     llvm.bpf.btf.type.id(obj.ptr, 1, flag)  !type
   else
     llvm.bpf.btf.type.id(obj, 0, flag)  !type
The purpose of the 2nd argument is to differentiate
   __builtin_btf_type_id(obj, flag) where obj is a lvalue
vs.
   __builtin_btf_type_id(obj.ptr, flag)

Note that obj or obj.ptr is never used by the backend
and the `obj` argument is only used to derive the type.
This code sequence is subject to potential llvm CSE when
  - obj is the same .e.g., nullptr
  - flag is the same
  - metadata type is different, e.g., typedef of struct "s"
    and strust "s".
In the above, we don't want CSE since their metadata is different.

This patch change IR builtin to
   llvm.bpf.btf.type.id(seq_num, flag)  !type
and seq_num is always increasing. This will prevent potential
llvm CSE.

Also report an error if the type name is empty for
remote relocation since remote relocation needs non-empty
type name to do relocation against vmlinux.

Differential Revision: https://reviews.llvm.org/D85174
2020-08-04 16:29:42 -07:00
..
array-1d-char.ll
array-1d-int.ll
array-2d-int.ll
array-size-0.ll
array-typedef.ll
binary-format.ll [llvm-readobj] Update tests because of changes in llvm-readobj behavior 2020-07-20 10:39:04 +01:00
builtin-btf-type-id.ll BPF: simplify IR generation for __builtin_btf_type_id() 2020-08-04 16:29:42 -07:00
char-no-debuginfo.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
char.ll
empty-btf.ll
enum-basic.ll
extern-builtin.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-func-arg.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-global-var.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-var-func-weak-section.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-var-func-weak.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-var-func.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-var-section.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-var-struct-weak.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-var-struct.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
extern-var-weak-section.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
filename.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
func-func-ptr.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
func-non-void.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
func-source.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
func-typedef.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
func-unused-arg.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
func-void.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
fwd-no-define.ll
fwd-with-define.ll
global-var-inited.ll [BPF] generate BTF_KIND_VARs for all non-static globals 2019-11-12 14:34:08 -08:00
global-var-sec-readonly.ll
global-var-sec.ll
int.ll
local-var-readonly-1.ll BPF: generate .rodata BTF datasec for certain initialized local var's 2020-07-17 09:45:57 -07:00
local-var-readonly-2.ll BPF: generate .rodata BTF datasec for certain initialized local var's 2020-07-17 09:45:57 -07:00
local-var.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
longlong.ll
map-def-2.ll BPF: permit .maps section variables with typedef type 2020-07-12 09:42:25 -07:00
map-def-3.ll BPF: permit .maps section variables with typedef type 2020-07-12 09:42:25 -07:00
map-def.ll BPF: permit .maps section variables with typedef type 2020-07-12 09:42:25 -07:00
pruning-const.ll [BPF] fix a bug for BTF pointee type pruning 2020-06-17 15:13:46 -07:00
pruning-typedef.ll [BPF] fix a bug for BTF pointee type pruning 2020-06-17 15:13:46 -07:00
ptr-const-void.ll
ptr-func-1.ll
ptr-func-2.ll
ptr-func-3.ll
ptr-int.ll
ptr-prune-type.ll
ptr-void.ll
ptr-volatile-const-void.ll
ptr-volatile-void.ll
restrict-ptr.ll
short.ll
static-func.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var-derived-type.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var-inited-sec.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var-inited.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var-readonly-sec.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var-readonly.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var-sec.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var-zerolen-array.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
static-var.ll [BPF] extend BTF_KIND_FUNC to cover global, static and extern funcs 2020-01-10 09:06:31 -08:00
struct-anon-2.ll [BPF] Fix a BTF gen bug related to a pointer struct member 2020-07-01 09:55:01 -07:00
struct-anon.ll
struct-basic.ll
struct-bitfield-typedef.ll
struct-enum.ll
uchar.ll
uint.ll
ulonglong.ll
union-array-typedef.ll
ushort.ll
weak-global-2.ll [BPF] Support weak global variables for BTF 2019-12-07 08:58:19 -08:00
weak-global.ll [BPF] Support weak global variables for BTF 2019-12-07 08:58:19 -08:00