summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2018-02-24 01:07:59 +0100
committerAlexei Starovoitov <ast@kernel.org>2018-02-23 22:50:00 -0800
commit6fe8b9c1f41dfe3209dabc5bd0726e003a065288 (patch)
treed252cdd2b889a6b785b499456edda2b0f2759fde /firmware
parent88e69a1fcc1e67dec3025af64736a84532528242 (diff)
downloadlinux-6fe8b9c1f41dfe3209dabc5bd0726e003a065288.tar.bz2
bpf, x64: save several bytes by using mov over movabsq when possible
While analyzing some of the more complex BPF programs from Cilium, I found that LLVM generally prefers to emit LD_IMM64 instead of MOV32 BPF instructions for loading unsigned 32-bit immediates into a register. Given we cannot change the current/stable LLVM versions that are already out there, lets optimize this case such that the JIT prefers to emit 'mov %eax, imm32' over 'movabsq %rax, imm64' whenever suitable in order to reduce the image size by 4-5 bytes per such load in the typical case, reducing image size on some of the bigger programs by up to 4%. emit_mov_imm32() and emit_mov_imm64() have been added as helpers. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'firmware')
0 files changed, 0 insertions, 0 deletions