[PATCH] D120908: [FuncSpec] Enable function specialize for a constant range of arguments.
Chuanqi Xu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 4 01:55:59 PST 2022
ChuanqiXu added a comment.
Personally, I feel the design principle of current FuncSpec is to leave opportunities to IPSCCP if possible. I guess the main concern may be compilation time.
(Although I feel FuncSpec could cover IPSCCP.)
================
Comment at: llvm/lib/Transforms/IPO/FunctionSpecialization.cpp:686-693
+ // If the argument is Constant, there's nothing to do. IPSCCP will
+ // propagate the argument.
+ if (isConstant(Solver.getLatticeValueFor(A))) {
LLVM_DEBUG(dbgs() << "FnSpecialization: Nothing to do, argument "
<< A->getNameOrAsOperand()
<< " is already constant?\n");
return false;
----------------
My personal feeling is that FuncSpec might be able to replace IPSCCP completely if FuncSpec is ready enough. I tried to remove the whole check here in downstream and didn't see any regression in performance. (I didn't measure compile time though).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120908/new/
https://reviews.llvm.org/D120908
More information about the llvm-commits
mailing list