[PATCH] D150464: [FuncSpec] Improve the accuracy of the cost model.

Alexandros Lamprineas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 12 10:43:49 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.

Instead of blindly traversing the use-def chain of constant arguments, compute known constants along the way. Stop as soon as a user cannot be replaced by a constant. Keep it light-weight by handling some basic instruction types.

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

| Nspecs before                       | ClamAV : 5 | SPASS : 2            | Bullet : 1 |
| Nspecs after                        | ClamAV : 5 | consumer-typeset : 1 | Bullet : 1 |
| InstrCount delta (geomean) : -0.04% |
|

**LTO pipeline**

| Nspecs before                        | sqlite3 : 1 | consumer-typeset : 1 |
| Nspecs after                         | SPASS : 3   | consumer-typeset : 1 |
| InstrCount delta (geomean) : -0.033% |


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150464

Files:
  llvm/include/llvm/Transforms/IPO/FunctionSpecialization.h
  llvm/lib/Transforms/IPO/FunctionSpecialization.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150464.521706.patch
Type: text/x-patch
Size: 12846 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230512/a29bb8a0/attachment.bin>


More information about the llvm-commits mailing list