[PATCH] D140210: [IPSCCP] Enable specialization of functions.

Alexandros Lamprineas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 08:07:02 PST 2022


labrinea added a comment.

So I had a closer look to the code size increase in terminator.c from SPASS. This is the breakdown of LOC for the x86 disassembly:

| **function**                    | **baseline** | **patch** |
| red_Terminator                  | 104          | 513       |
| red_SearchTerminator            | 792          | 415       |
| red_CreateTerminatorEmptyClause | 0            | 253       |
| red_TerminatorLitIsBetter       | 25           | 26        |
| red_GetTerminatorPartnerLits    | 0            | 169       |
| total                           | 921          | 1376      |
|

The code size increase is close to what @nikic had reported (+49,40 %). The patched compiler creates one specialization for `red_SearchTerminator` which gets inlined inside `red_Terminator`.  The baseline compiler inlines `red_CreateTerminatorEmptyClause` and `red_GetTerminatorPartnerLits` inside `red_SearchTerminator`. I suspect that the patched compiler fails to do so as it reaches the inlining threshold, therefore these functions remain.

Quickly measuring the size of the final image (after LTO) is not worrying me: 608KB vs 616KB (+1.316%).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140210/new/

https://reviews.llvm.org/D140210



More information about the llvm-commits mailing list