[PATCH] D93838: [LLVM] [SCCP] [WIP] : Add Function Specialization pass

Vinay Madhusudan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 27 07:25:37 PST 2020


mivnay created this revision.
mivnay added reviewers: dmgreen, SjoerdMeijer, davide, efriedma, fhahn, nikic, mssimpso.
Herald added subscribers: jfb, mgorny.
mivnay requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch adds Function specialization pass to LLVM. The constant parameters (like function pointers, numerical constants) are propagated to the callee by specializing the function. It also handles specialization of the recursive functions.  This change is just to give the full context for patch D93762 <https://reviews.llvm.org/D93762>. The pass is still missing the profitability.

The pass is based on the Function specialization proposed here <https://reviews.llvm.org/D36432>.

Performance: There are significant gains in two SPEC CPU 2017 intrate benchmarks. I am yet to do the complete SPEC run and measure the speed /size change.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93838

Files:
  include/llvm/InitializePasses.h
  include/llvm/LinkAllPasses.h
  include/llvm/Transforms/IPO.h
  include/llvm/Transforms/Scalar/SCCP.h
  lib/Transforms/IPO/CMakeLists.txt
  lib/Transforms/IPO/FunctionSpecialization.cpp
  lib/Transforms/IPO/IPO.cpp
  lib/Transforms/IPO/PassManagerBuilder.cpp
  lib/Transforms/Scalar/SCCP.cpp
  test/Transforms/FunctionSpecialize/function-specialize-recursive.ll
  test/Transforms/FunctionSpecialize/function-specialize.ll
  test/Transforms/FunctionSpecialize/function-specialize2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93838.313784.patch
Type: text/x-patch
Size: 81036 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201227/f08df3fc/attachment-0001.bin>


More information about the llvm-commits mailing list