diff options
author | Adenilson Cavalcanti <adenilson.cavalcanti@arm.com> | 2020-05-21 21:44:13 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-05-21 21:44:13 +0000 |
commit | 9444fdb7d9f9e33e5c948aae6a84df66643f7100 (patch) | |
tree | 4ba88bcbe3f900f01aab2ee9d819d64ed8cdc63f /BUILD.gn | |
parent | 94df8b72aaa3c0ae63462d2c6c51dc58bac1e0b4 (diff) | |
download | zlib-9444fdb7d9f9e33e5c948aae6a84df66643f7100.tar.gz |
[zlib] Enable compiler optimized flags on whole zlib
This change enables building zlib using -O3 for the remaining code [1]
including the portable files (e.g. deflate.c, etc).
[1] We were already using optimize_speed for the majority of SIMD code
and this CL extends that to build the same code we ship to users.
Bug: 1084371
Change-Id: I02b0da7d0849478714bb7e3388c0d218fd13ecda
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2197140
Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org>
Reviewed-by: Noel Gordon <noel@chromium.org>
Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#771209}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: aa2865de5f8879f323dde4a03c324cb04fb3ce34
Diffstat (limited to 'BUILD.gn')
-rw-r--r-- | BUILD.gn | 24 |
1 files changed, 5 insertions, 19 deletions
@@ -18,6 +18,11 @@ config("zlib_config") { config("zlib_internal_config") { defines = [ "ZLIB_IMPLEMENTATION" ] + + if (!is_debug) { + # Build code using -O3, see: crbug.com/1084371. + configs = [ "//build/config/compiler:optimize_speed" ] + } } use_arm_neon_optimizations = false @@ -67,12 +72,6 @@ source_set("zlib_adler32_simd") { "adler32_simd.c", "adler32_simd.h", ] - - if (!is_debug) { - # Use optimize_speed (-O3) to output the _smallest_ code. - configs -= [ "//build/config/compiler:default_optimization" ] - configs += [ "//build/config/compiler:optimize_speed" ] - } } configs += [ ":zlib_internal_config" ] @@ -117,11 +116,6 @@ if (use_arm_neon_optimizations) { "crc32_simd.c", "crc32_simd.h", ] - - if (!is_debug) { - configs -= [ "//build/config/compiler:default_optimization" ] - configs += [ "//build/config/compiler:optimize_speed" ] - } } configs += [ ":zlib_internal_config" ] @@ -160,13 +154,6 @@ source_set("zlib_inflate_chunk_simd") { "contrib/optimizations/inffast_chunk.h", "contrib/optimizations/inflate.c", ] - - if (use_arm_neon_optimizations && !is_debug) { - # Here we trade better performance on newer/bigger ARMv8 cores - # for less perf on ARMv7, per crbug.com/772870#c40 - configs -= [ "//build/config/compiler:default_optimization" ] - configs += [ "//build/config/compiler:optimize_speed" ] - } } configs += [ ":zlib_internal_config" ] @@ -392,7 +379,6 @@ executable("zlib_bench") { include_dirs = [ "." ] sources = [ "contrib/bench/zlib_bench.cc" ] - if (!is_debug) { configs -= [ "//build/config/compiler:default_optimization" ] configs += [ "//build/config/compiler:optimize_speed" ] |