[PATCH] D93762: SCCP: Refactor SCCPSolver

Sanne Wouda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 12 08:51:17 PDT 2021


sanwou01 added a comment.

Thanks! This seems to be moving in the right direction. Now that SCCPInstVisitor is separate, its declaration can move into SCCPSolver.cpp entirely.



================
Comment at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:39
+// all the state.
+class SCCPInstVisitor : public InstVisitor<SCCPInstVisitor> {
+  const DataLayout &DL;
----------------
It should be possible to move this class to SCCPSolver.cpp now, with a few modifications to SCCPSolver (see below).


================
Comment at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:428
+class SCCPSolver {
+  SCCPInstVisitor *Visitor;
+
----------------
This can be a void * or an SCCPInstVisitor * with a forward declaration of SCCPInstVisitor


================
Comment at: llvm/include/llvm/Transforms/Utils/SCCPSolver.h:434
+             LLVMContext &Ctx)
+      : Visitor(new SCCPInstVisitor(DL, std::move(GetTLI), Ctx)) {}
+
----------------
Implementations should go into SCCPSolver.cpp


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

https://reviews.llvm.org/D93762



More information about the llvm-commits mailing list