[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
Tue Nov 8 08:30:50 PST 2022


chill added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/FunctionSpecialization.cpp:671-680
+
+  for (unsigned I = 0; I < Clones.size(); ++I) {
+    Function *Clone = Clones[I];
+    CallSpecBinding &Specialization = Specializations[I];
 
-    // Replace some unresolved constant arguments.
-    constantArgPropagation(FuncDecls, M, Solver);
+    LLVM_DEBUG(dbgs() << "FnSpecialization: Replacing call sites of "
+                      << F->getName() << " with " << Clone->getName() << "\n");
----------------
chill wrote:
> You can swap the order of the loops and get rid of `CallSiteToRewrite`.
Maybe I'm getting a bit ahead of me, but you can change the function to rewrite just a single call site and factor out the iteration over call sites.  The benefit is the function becomes more reusable in as you can independently choose the set of call sites it operates upon. (Incidently, I'm planning to use it that way, but it generally a good change, even if what I have in mind  turns out non-working).


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