[llvm] a44bf59 - [SCCP] Remove unused toLatticeValue helper (NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 28 08:45:32 PDT 2020


Author: Florian Hahn
Date: 2020-03-28T15:40:24Z
New Revision: a44bf59c93b4807934c896ea25f3628c50dd5f44

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

LOG: [SCCP] Remove unused toLatticeValue helper (NFC).

LatticeVal is an alias for ValueLatticeElement and the function is not
used any longer.

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 fcd7ed195291..8bb437eacc4d 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -441,24 +441,6 @@ class SCCPSolver : public InstVisitor<SCCPSolver> {
     return LV;
   }
 
-  LatticeVal toLatticeVal(const ValueLatticeElement &V, Type *T) {
-    LatticeVal Res;
-    if (V.isUnknownOrUndef())
-      return Res;
-
-    if (V.isConstant()) {
-      Res.markConstant(V.getConstant());
-      return Res;
-    }
-    if (V.isConstantRange() && V.getConstantRange().isSingleElement()) {
-      Res.markConstant(
-          ConstantInt::get(T, *V.getConstantRange().getSingleElement()));
-      return Res;
-    }
-    Res.markOverdefined();
-    return Res;
-  }
-
   /// getStructValueState - Return the LatticeVal object that corresponds to the
   /// value/field pair.  This function handles the case when the value hasn't
   /// been seen yet by properly seeding constants etc.


        


More information about the llvm-commits mailing list