diff options
author | Daniel Borkmann <[email protected]> | 2019-10-03 01:45:11 +0200 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2019-10-04 12:26:51 -0700 |
commit | 38f51c07054ff4796e473dba3bff2e648378002c (patch) | |
tree | ce408174555426e21490d6c86c7d32fb1a444d8e /tools/perf/scripts/python/stackcollapse.py | |
parent | c588146378962786ddeec817f7736a53298a7b01 (diff) |
bpf, x86: Small optimization in comparing against imm0
Replace 'cmp reg, 0' with 'test reg, reg' for comparisons against
zero. Saves 1 byte of instruction encoding per occurrence. The flag
results of test 'reg, reg' are identical to 'cmp reg, 0' in all
cases except for AF which we don't use/care about. In terms of
macro-fusibility in combination with a subsequent conditional jump
instruction, both have the same properties for the jumps used in
the JIT translation. For example, same JITed Cilium program can
shrink a bit from e.g. 12,455 to 12,317 bytes as tests with 0 are
used quite frequently.
Signed-off-by: Daniel Borkmann <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Song Liu <[email protected]>
Acked-by: John Fastabend <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions