[PATCH] D126455: [FuncSpec] Make the Function Specializer part of the IPSCCP pass.

Alexandros Lamprineas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 10 05:28:16 PST 2022


labrinea added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/FunctionSpecialization.cpp:695
 
-  LLVM_DEBUG(dbgs() << "FnSpecialization: Number of specializations = "
-                    << NumFuncSpecialized << "\n");
-
-  // Remove any ssa_copy intrinsics that may have been introduced.
-  removeSSACopy(M);
-  return Changed;
+  // If the function has been completely specialized, the original function
+  // is no longer needed. Mark it unreachable.
----------------
chill wrote:
> chill wrote:
> > This is better placed outside of `rewriteCallSites`, perhaps just after the call to `rewriteCallSites`.
> Or a better idea: get the initial size of  `CallSitesToRewrite`, decrement that number every time you update a call site. At the end if this number drops to zero mark the function unreachable.
that won't work for dead recursive functions


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126455



More information about the llvm-commits mailing list