[PATCH] D150649: [FuncSpec] Enable specialization of literal constants.

Alexandros Lamprineas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 02:19:58 PDT 2023


labrinea created this revision.
labrinea added reviewers: chill, ChuanqiXu, SjoerdMeijer.
Herald added subscribers: hoy, snehasish, ormris, hiraditya.
Herald added a project: All.
labrinea requested review of this revision.
Herald added a project: LLVM.

To do so we have to tweak the cost model such that specialization does not trigger excessively.

Stats from the llvm testsuite (CTMark):
**-O3 pipeline**

| Nspecs before                        | ClamAV : 5 | lencod : 0 | SPASS : 0 | consumer-typeset : 1 | Bullet : 1 |
| Nspecs after                         | ClamAV : 5 | lencod : 1 | SPASS : 1 | consumer-typeset : 0 | Bullet : 1 |
| InstrCount delta (geomean) : +0.075% |
|

**LTO pipeline**

| Nspecs before                        | lencod : 0 | SPASS : 3 | consumer-typeset : 1 |
| Nspecs after                         | lencod : 3 | SPASS : 1 | consumer-typeset : 0 |
| InstrCount delta (geomean) : +0.007% |


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150649

Files:
  llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
  llvm/test/Transforms/FunctionSpecialization/compiler-crash-58759.ll
  llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression.ll
  llvm/test/Transforms/FunctionSpecialization/function-specialization-minsize3.ll
  llvm/test/Transforms/FunctionSpecialization/function-specialization.ll
  llvm/test/Transforms/FunctionSpecialization/function-specialization2.ll
  llvm/test/Transforms/FunctionSpecialization/get-possible-constants.ll
  llvm/test/Transforms/FunctionSpecialization/global-rank.ll
  llvm/test/Transforms/FunctionSpecialization/identical-specializations.ll
  llvm/test/Transforms/FunctionSpecialization/literal-const.ll
  llvm/test/Transforms/FunctionSpecialization/max-iters.ll
  llvm/test/Transforms/FunctionSpecialization/noinline.ll
  llvm/test/Transforms/FunctionSpecialization/remove-dead-recursive-function.ll
  llvm/test/Transforms/FunctionSpecialization/specialize-multiple-arguments.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150649.522503.patch
Type: text/x-patch
Size: 26630 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230516/d94066da/attachment.bin>


More information about the llvm-commits mailing list