[PATCH] D140210: [IPSCCP] Enable specialization of functions.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 22 04:29:14 PST 2022


fhahn added a comment.

> Consequently FuncSpec does too. Should we disable the latter for Os, Oz

For `-Os` and `-Oz` it would be good to directly disable it (making it a pass parameter will make this possible), as the specializer bails out on functions with `optsize` and `minsize` attributes anyways



================
Comment at: llvm/lib/Transforms/IPO/SCCP.cpp:45-46
 
 static cl::opt<bool> SpecializeFunctions("specialize-functions",
-    cl::init(false), cl::Hidden, cl::desc("Enable function specialization"));
+    cl::init(true), cl::Hidden, cl::desc("Enable function specialization"));
 
----------------
labrinea wrote:
> arsenm wrote:
> > Should this move to be a pass parameter
> I think it's preferable to control from the command line for unit testing.
I think @arsenm was referring to pass parameters for NewPM passes, e.g. like https://github.com/llvm/llvm-project/blob/main/llvm/lib/Passes/PassRegistry.def#L423

Those can be supplied at the command line with the pass in `-passes`. IMO that would be more in-line with new-pm only passes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140210



More information about the llvm-commits mailing list