Messages in this thread | | | Date | Thu, 4 Dec 2014 15:31:00 -0800 | Subject | Re: [PATCH] x86: bpf_jit_comp: Reduce is_ereg() code size | From | Alexei Starovoitov <> |
| |
On Thu, Dec 4, 2014 at 3:14 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote: > On Thu, 2014-12-04 at 15:00 -0800, Joe Perches wrote: >> Use the (1 << reg) & mask trick to reduce code size. >> >> x86-64 size difference -O2 without profiling for various >> gcc versions: > >> >> Signed-off-by: Joe Perches <joe@perches.com> >> --- >> >> compiled, untested by me, but per Alexei Starovoitov this passes >> the test_bpf suite > > Really, the root cause of this is the 'inline' abuse in non fast paths > for non trivial functions.
well, it is a trivial function even from compiler point of view. Dropping inline keyword doesn't help. gcc still inlines them. Changing all 3 functions to _noinline_ doesn't help either. So I think this patch is actually quite helpful to reduce code size.
| |