]> git.ipfire.org Git - thirdparty/zstd.git/commit
[linux-kernel] Don't add -O3 to CFLAGS 2866/head
authorNick Terrell <terrelln@fb.com>
Tue, 16 Nov 2021 22:25:18 +0000 (14:25 -0800)
committerNick Terrell <terrelln@fb.com>
Tue, 16 Nov 2021 23:42:36 +0000 (15:42 -0800)
commite2d01863bce98a4642c98cf7727ed8bfb0f33c81
treeda95fc804f2d14f7b31f55fdd82fb58c9415c2ba
parentddae153947beb03b9c9b64dc0ecf43b37e924e4d
[linux-kernel] Don't add -O3 to CFLAGS

It is no longer necessary to get good performance, there is only a small
speed difference between -O2 and -O3, so just stick to the default of
-O2. I've measured neutral compression speed and a ~3% decompression
speed loss in userspace with clang & gcc. I've also measured neutral
compression speed and a ~1% decompression speed loss in the kernel
benchmarks.

This also fixes the stack space usage on parisc. The compiler was buggy
for -O3 and used ~3KB of stack space for several functions. With -O2 the
problem is completely resolved, and stack space is back to a few hundred
bytes.

Additionally, we get a large code size win on gcc:

| Compiler | Before (Bytes) | After (Bytes) | Delta (Bytes) |
|----------|----------------|---------------|---------------|
| gcc-11   |         952754 |        738954 |       -213800 |
| clang-12 |         976290 |        938826 |        -37464 |
contrib/linux-kernel/linux.mk