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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 01:51:26 PDT 2022


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/FunctionSpecialization.cpp:301
-  /// \returns true if at least one function is specialized.
-  bool specializeFunctions(FuncList &Candidates, FuncList &WorkList) {
-    bool Changed = false;
----------------
can you fix the indentation here in a NFC?


================
Comment at: llvm/lib/Transforms/IPO/FunctionSpecialization.cpp:778
+    for (Argument &Arg : F->args())
+      if (!Arg.use_empty() && tryToReplaceWithConstant(&Arg))
+        LLVM_DEBUG(dbgs() << "FnSpecialization: Replaced constant argument: "
----------------
IIUC this is done during in between solver runs, right? Is this needed? Isn't it sufficient to continue with the constant value in the value mapping? This would probably remove the need to tell the solver to forget instructions/values.


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

https://reviews.llvm.org/D126455



More information about the llvm-commits mailing list