OSDN Git Service

SparseSolver: Rename getOrInitValueState to getValueState, matching what SCCP calls it
authorDaniel Berlin <dberlin@dberlin.org>
Tue, 3 Oct 2017 00:26:21 +0000 (00:26 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Tue, 3 Oct 2017 00:26:21 +0000 (00:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314744 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/SparsePropagation.h
lib/Analysis/SparsePropagation.cpp

index be93d78..35c7e4c 100644 (file)
@@ -141,18 +141,18 @@ public:
 
   /// getLatticeState - Return the LatticeVal object that corresponds to the
   /// value.  If an value is not in the map, it is returned as untracked,
-  /// unlike the getOrInitValueState method.
+  /// unlike the getValueState method.
   LatticeVal getLatticeState(Value *V) const {
     auto I = ValueState.find(V);
     return I != ValueState.end() ? I->second : LatticeFunc->getUntrackedVal();
   }
 
-  /// getOrInitValueState - Return the LatticeVal object that corresponds to the
+  /// getValueState - Return the LatticeVal object that corresponds to the
   /// value, initializing the value's state if it hasn't been entered into the
   /// map yet.   This function is necessary because not all values should start
   /// out in the underdefined state... Arguments should be overdefined, and
   /// constants should be marked as constants.
-  LatticeVal getOrInitValueState(Value *V);
+  LatticeVal getValueState(Value *V);
 
   /// isEdgeFeasible - Return true if the control flow edge from the 'From'
   /// basic block to the 'To' basic block is currently feasible.  If
index 82a3934..0451eb2 100644 (file)
@@ -57,13 +57,13 @@ void AbstractLatticeFunction<LatticeVal>::PrintValue(LatticeVal V,
 //                          SparseSolver Implementation
 //===----------------------------------------------------------------------===//
 
-/// getOrInitValueState - Return the LatticeVal object that corresponds to the
+/// getValueState - Return the LatticeVal object that corresponds to the
 /// value, initializing the value's state if it hasn't been entered into the
 /// map yet.   This function is necessary because not all values should start
 /// out in the underdefined state... Arguments should be overdefined, and
 /// constants should be marked as constants.
 template <class LatticeVal>
-LatticeVal SparseSolver<LatticeVal>::getOrInitValueState(Value *V) {
+LatticeVal SparseSolver<LatticeVal>::getValueState(Value *V) {
   auto I = ValueState.find(V);
   if (I != ValueState.end()) return I->second;  // Common case, in the map
   
@@ -147,7 +147,7 @@ void SparseSolver<LatticeVal>::getFeasibleSuccessors(
     
     LatticeVal BCValue;
     if (AggressiveUndef)
-      BCValue = getOrInitValueState(BI->getCondition());
+      BCValue = getValueState(BI->getCondition());
     else
       BCValue = getLatticeState(BI->getCondition());
     
@@ -189,7 +189,7 @@ void SparseSolver<LatticeVal>::getFeasibleSuccessors(
   SwitchInst &SI = cast<SwitchInst>(TI);
   LatticeVal SCValue;
   if (AggressiveUndef)
-    SCValue = getOrInitValueState(SI.getCondition());
+    SCValue = getValueState(SI.getCondition());
   else
     SCValue = getLatticeState(SI.getCondition());
   
@@ -255,7 +255,7 @@ void SparseSolver<LatticeVal>::visitPHINode(PHINode &PN) {
     return;
   }
 
-  LatticeVal PNIV = getOrInitValueState(&PN);
+  LatticeVal PNIV = getValueState(&PN);
   LatticeVal Overdefined = LatticeFunc->getOverdefinedVal();
   
   // If this value is already overdefined (common) just return.
@@ -278,7 +278,7 @@ void SparseSolver<LatticeVal>::visitPHINode(PHINode &PN) {
       continue;
     
     // Merge in this value.
-    LatticeVal OpVal = getOrInitValueState(PN.getIncomingValue(i));
+    LatticeVal OpVal = getValueState(PN.getIncomingValue(i));
     if (OpVal != PNIV)
       PNIV = LatticeFunc->MergeValues(PNIV, OpVal);