[PATCH] D126455: [FuncSpec] Make the Function Specializer part of the IPSCCP pass.
Momchil Velikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 10 02:13:12 PST 2022
chill 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:
> 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.
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