[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
Mon Oct 10 04:14:27 PDT 2022


chill added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SCCP.cpp:509
   }
 
   bool MadeChanges = false;
----------------
IMHO, the invocation of the `FunctionSpecialization` pass ought to happen in this place. The general flow would be like:

1. Initialise solver
1. Run solver once (`Solver.solve()` + `resolvedUndefsIn` loop)
1. Run function specialisation
1. Run solver again
1. Optionally go to 2.
1. Do replacements (from line 512 on)

At no point before the last step the passes ought to replace or delete anything (well, except called function operand for cloned functions). If an operand/argument is determined to be a constant, it does not need to be replaced right away, because the passes should consult its lattice value.

Yeah, the devil is in the details, but this is the approach  to merging the tow passes, as I see it.


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

https://reviews.llvm.org/D126455



More information about the llvm-commits mailing list