]> git.ipfire.org Git - thirdparty/zstd.git/commit
Reduce function size in fast & dfast 2863/head
authorNick Terrell <terrelln@fb.com>
Tue, 16 Nov 2021 01:25:24 +0000 (17:25 -0800)
committerNick Terrell <terrelln@fb.com>
Tue, 16 Nov 2021 03:05:48 +0000 (19:05 -0800)
commit802ea885efd73572fdd7afcdfd897a4460218cac
treea81d22df845a70d6a5f034bb8a1a2ca31a5bb8be
parentddae153947beb03b9c9b64dc0ecf43b37e924e4d
Reduce function size in fast & dfast

Take the same approach as in PR #2828 [0] to remove functions that force
inline many function bodies and `switch`. Instead, create one function per
"template" combination, and then switch between these functions. This
allows the compiler to break the large function into many small
functions, which generally helps codegen.

Also, in the `extDict` modes when there is no ext-dict, call the top
level function instead of the force inlined one, to save on code size.

I'm specifically doing this because gcc on the parisc architecture doesn't
handle the large function body well, and ends up using a lot of excess
stack space. Outlining these functions fixes it.
lib/compress/zstd_double_fast.c
lib/compress/zstd_fast.c