New issue
Advanced search Search tips

Issue 770902 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Feature



Sign in to add a comment

libwebp: strip unused C functions when optimized versions will be unconditionally used

Project Member Reported by jzern@chromium.org, Oct 2 2017

Issue description

Chrome Version: M63
OS: Android

libwebp uses function pointers along with runtime cpu-detection to select optimized versions of speed critical functions [1]. In the case the build is targeting a particular set of optimizations already (aarch64/mfpu=neon) the C code will remain, but will never be used aside from the base initialization of the function table. Dropping the functions in this case will save a bit of size.

Android (arm) would be the primary target, but the same could be done for x86_64 where we're guaranteed to have sse2.

https://chromium.googlesource.com/chromium/src/+/63.0.3230.3/third_party/libwebp/src/dsp/dec.c#712
 

Comment 1 by jzern@chromium.org, Dec 8 2017

I addressed this for NEON with:

commit b7971d0e2205ded6be4a846dbc1d55fb44f24dec
Author: James Zern <jzern@google.com>
Date:   Thu Oct 26 20:31:27 2017 -0700

    dsp: avoid defining _C functions w/NEON builds

    when targeting NEON C functions with NEON equivalents won't be used, but
    will contribute to binary size. the same goes for sse2, etc., but this
    change is primarily concerned with binary sizes for android arm targets.

    note '-noasm' or otherwise modifying VP8GetCPUInfo will have no effect
    on the use of NEON functions.

    this decision can be overridden by defining WEBP_DSP_OMIT_C_CODE to 0.

    Change-Id: I47bd453c84a3d341ca39bc986a39eb9c785aface

Comment 2 by jzern@chromium.org, Dec 8 2017

The change in comment #1 was brought in with  crbug.com/788275 . Further size reductions were applied in  crbug.com/789665 . x86-64 is still open to the same function pointer removal for sse2.
Labels: -OS-Android
Removing Android label since this is now done on Android

Comment 4 by jzern@chromium.org, Apr 3 2018

Owner: jzern@chromium.org
Status: Fixed (was: Untriaged)
Marking this one as fixed. We'd need additional changes upstream for the defines to have the same effect as for NEON and there's nothing planned at the moment.

Sign in to add a comment