llvm-project/llvm/test/CodeGen/BPF
Yonghong Song dc1dbf6ef3 bpf: add variants of -mcpu=# and support for additional jmp insns
-mcpu=# will support:
  . generic: the default insn set
  . v1: insn set version 1, the same as generic
  . v2: insn set version 2, version 1 + additional jmp insns
  . probe: the compiler will probe the underlying kernel to
           decide proper version of insn set.

We did not not use -mcpu=native since llc/llvm will interpret -mcpu=native
as the underlying hardware architecture regardless of -march value.

Currently, only x86_64 supports -mcpu=probe. Other architecture will
silently revert to "generic".

Also added -mcpu=help to print available cpu parameters.
llvm will print out the information only if there are at least one
cpu and at least one feature. Add an unused dummy feature to
enable the printout.

Examples for usage:
$ llc -march=bpf -mcpu=v1 -filetype=asm t.ll
$ llc -march=bpf -mcpu=v2 -filetype=asm t.ll
$ llc -march=bpf -mcpu=generic -filetype=asm t.ll
$ llc -march=bpf -mcpu=probe -filetype=asm t.ll
$ llc -march=bpf -mcpu=v3 -filetype=asm t.ll
'v3' is not a recognized processor for this target (ignoring processor)
...
$ llc -march=bpf -mcpu=help -filetype=asm t.ll
Available CPUs for this target:

  generic - Select the generic processor.
  probe   - Select the probe processor.
  v1      - Select the v1 processor.
  v2      - Select the v2 processor.

Available features for this target:

  dummy - unused feature.

Use +feature to enable a feature, or -feature to disable it.
For example, llc -mcpu=mycpu -mattr=+feature1,-feature2
...

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 311522
2017-08-23 04:25:57 +00:00
..
alu8.ll convert bpf assembler to look like kernel verifier output 2016-11-18 02:32:35 +00:00
atomics.ll [bpf] add BPF disassembler 2016-11-20 02:25:00 +00:00
basictest.ll convert bpf assembler to look like kernel verifier output 2016-11-18 02:32:35 +00:00
byval.ll
cc_args.ll [bpf] error when unknown bpf helper is called 2017-01-17 07:26:17 +00:00
cc_args_be.ll [bpf] error when unknown bpf helper is called 2017-01-17 07:26:17 +00:00
cc_ret.ll [bpf] error when unknown bpf helper is called 2017-01-17 07:26:17 +00:00
cmp.ll convert bpf assembler to look like kernel verifier output 2016-11-18 02:32:35 +00:00
dwarfdump.ll [bpf] fix a bug which causes incorrect big endian reloc fixup 2017-05-05 18:05:00 +00:00
ex1.ll convert bpf assembler to look like kernel verifier output 2016-11-18 02:32:35 +00:00
fi_ri.ll [bpf] error when unknown bpf helper is called 2017-01-17 07:26:17 +00:00
intrinsics.ll [bpf] error when unknown bpf helper is called 2017-01-17 07:26:17 +00:00
lit.local.cfg
load.ll convert bpf assembler to look like kernel verifier output 2016-11-18 02:32:35 +00:00
loops.ll convert bpf assembler to look like kernel verifier output 2016-11-18 02:32:35 +00:00
many_args1.ll
many_args2.ll
mem_offset.ll [bpf] Fix memory offset check for loads and stores 2017-04-13 22:24:13 +00:00
mem_offset_be.ll [bpf] add bigendian support to disassembler 2017-04-28 16:51:01 +00:00
objdump_atomics.ll [bpf] add BPF disassembler 2016-11-20 02:25:00 +00:00
objdump_intrinsics.ll [bpf] error when unknown bpf helper is called 2017-01-17 07:26:17 +00:00
objdump_trivial.ll [bpf] error when unknown bpf helper is called 2017-01-17 07:26:17 +00:00
reloc.ll [bpf] add relocation support 2017-05-03 17:30:56 +00:00
remove_truncate_1.ll bpf: remove unnecessary truncate operation 2017-06-29 15:18:54 +00:00
remove_truncate_2.ll bpf: remove unnecessary truncate operation 2017-06-29 15:18:54 +00:00
rodata_1.ll bpf: avoid load from read-only sections 2017-06-16 15:41:16 +00:00
rodata_2.ll bpf: avoid load from read-only sections 2017-06-16 15:41:16 +00:00
rodata_3.ll bpf: avoid load from read-only sections 2017-06-16 15:41:16 +00:00
rodata_4.ll bpf: avoid load from read-only sections 2017-06-16 15:41:16 +00:00
sanity.ll [bpf] error when unknown bpf helper is called 2017-01-17 07:26:17 +00:00
sdiv_error.ll
select_ri.ll bpf: generate better lowering code for certain select/setcc instructions 2017-07-15 05:41:42 +00:00
setcc.ll bpf: add variants of -mcpu=# and support for additional jmp insns 2017-08-23 04:25:57 +00:00
shifts.ll convert bpf assembler to look like kernel verifier output 2016-11-18 02:32:35 +00:00
sockex2.ll convert bpf assembler to look like kernel verifier output 2016-11-18 02:32:35 +00:00
struct_ret1.ll
struct_ret2.ll
undef.ll DAG: Undo and->or combine with FrameIndexes 2017-08-02 00:43:42 +00:00
vararg1.ll
warn-call.ll [bpf] error when unknown bpf helper is called 2017-01-17 07:26:17 +00:00
warn-stack.ll Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00