[PATCH] D36432: [IPSCCP] Add function specialization ability

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 10:53:48 PDT 2017


efriedma added a comment.

The way this is written, there isn't much point to sticking the code into IPSCCP; you could just as easily make this a separate pass which runs afterwards.  (The only thing you're getting is constant propagation inside the cloned function, which you could just as easily run separately.)



================
Comment at: lib/Transforms/Scalar/SCCP.cpp:2279
+    DEBUG(dbgs() << "SPECIALIZING FUNCTIONS\n");
+    SolveForConstants |= FS.specializeFunctions();
   }
----------------
This loop doesn't work the way you want it to.  IPSCCP isn't actually complete until the "while (ResolvedUndefs)" loop finishes, and specializing based on a partially unsolved Solver probably won't give you the results you want.


https://reviews.llvm.org/D36432





More information about the llvm-commits mailing list