[llvm] 935685f - [SCCP] Re-use pushToWorkList in pushToWorkListMsg (NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 02:20:39 PDT 2020


Author: Florian Hahn
Date: 2020-05-04T10:19:39+01:00
New Revision: 935685f42025a58cb84e34714075f98878496a22

URL: https://github.com/llvm/llvm-project/commit/935685f42025a58cb84e34714075f98878496a22
DIFF: https://github.com/llvm/llvm-project/commit/935685f42025a58cb84e34714075f98878496a22.diff

LOG: [SCCP] Re-use pushToWorkList in pushToWorkListMsg (NFC).

There's no need to duplicate the logic to push to the different
work-lists.

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/SCCP.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index e5fd6167f47e..e6477e3d259b 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -361,9 +361,7 @@ class SCCPSolver : public InstVisitor<SCCPSolver> {
   // prints a debug message with the updated value.
   void pushToWorkListMsg(ValueLatticeElement &IV, Value *V) {
     LLVM_DEBUG(dbgs() << "updated " << IV << ": " << *V << '\n');
-    if (IV.isOverdefined())
-      return OverdefinedInstWorkList.push_back(V);
-    InstWorkList.push_back(V);
+    pushToWorkList(IV, V);
   }
 
   // markConstant - Make a value be marked as "constant".  If the value


        


More information about the llvm-commits mailing list