[llvm] [MergeFuncs] Use sizeWithoutDebug to decide if we create a thunk (PR #68627)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 12 04:59:48 PDT 2023


nikic wrote:

> I modified the check from:
> 
> ```
> if (F->front().sizeWithoutDebug() <= 2) {
> ```
> 
> to:
> 
> ```
> if (F->front().sizeWithoutDebug() < 2) {
> ```
> 
> as internal testing has shown that it reduces binary size.

I'm not convinced this is a good idea. This means you allow merging via thunk for functions that only have a single real instruction (apart from the return). This might minimize binary size, but introducing an extra call seems like a bad size/performance tradeoff for that case.

https://github.com/llvm/llvm-project/pull/68627


More information about the llvm-commits mailing list