[PATCH] D146158: [FuncSpec] Track the return values of specializations.

Alexandros Lamprineas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 11:08:59 PDT 2023


labrinea created this revision.
labrinea added a reviewer: fhahn.
Herald added subscribers: snehasish, ormris, StephenFan, hiraditya.
Herald added a project: All.
labrinea requested review of this revision.
Herald added a project: LLVM.

If the lattice value of the original callsite (prior to specialization) was already overdefined, then it cannot transition to constant once the return value of the specialization proves to be one. Therefore we cannot zap the return values for all the specializations whose return value is a constant.

      

I am also removing `markArgInFuncSpecialization` and replacing it with a visit of the callsites to the specializations, if any, which is sufficient for marking the constant arguments. If there are no callsites associated with the specialization yet (happens with recusive calls), then we just mark the entry block executable before running the solver.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146158

Files:
  llvm/include/llvm/Transforms/Utils/SCCPSolver.h
  llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
  llvm/lib/Transforms/IPO/SCCP.cpp
  llvm/lib/Transforms/Utils/SCCPSolver.cpp
  llvm/test/Transforms/FunctionSpecialization/function-specialization-constant-expression.ll
  llvm/test/Transforms/FunctionSpecialization/specialize-multiple-arguments.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146158.505573.patch
Type: text/x-patch
Size: 10742 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230315/95eecb95/attachment.bin>


More information about the llvm-commits mailing list