diff options
| author | Matthew Simpson <mssimpso@codeaurora.org> | 2017-10-10 20:19:34 +0000 |
|---|---|---|
| committer | Matthew Simpson <mssimpso@codeaurora.org> | 2017-10-10 20:19:34 +0000 |
| commit | e9d85fc8dd0858f160b8e0ecfa26180cf62efaf7 (patch) | |
| tree | 6272426c4887c21d086da37fc2c457c88a0dc1c7 | |
| parent | 51e4481cfede6dbf23553ff95649c8a2ea2b6f0f (diff) | |
| download | bcm5719-llvm-e9d85fc8dd0858f160b8e0ecfa26180cf62efaf7.tar.gz bcm5719-llvm-e9d85fc8dd0858f160b8e0ecfa26180cf62efaf7.zip | |
[SparseSolver] Rename getLatticeState to getExistingValueState (NFC)
The new name clarifies the function's relation to getValueState. That is,
unlike getValueState, the state of a given value will not be initialized if
it's not already in the map.
llvm-svn: 315356
| -rw-r--r-- | llvm/include/llvm/Analysis/SparsePropagation.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/llvm/include/llvm/Analysis/SparsePropagation.h b/llvm/include/llvm/Analysis/SparsePropagation.h index 8479f4c53fd..d4cbf0eb957 100644 --- a/llvm/include/llvm/Analysis/SparsePropagation.h +++ b/llvm/include/llvm/Analysis/SparsePropagation.h @@ -128,19 +128,17 @@ public: void Print(Function &F, raw_ostream &OS) const; - /// 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 getValueState method. - LatticeVal getLatticeState(Value *V) const { + /// getExistingValueState - Return the LatticeVal object corresponding to the + /// given value from the ValueState map. If the value is not in the map, + /// UntrackedVal is returned, unlike the getValueState method. + LatticeVal getExistingValueState(Value *V) const { auto I = ValueState.find(V); return I != ValueState.end() ? I->second : LatticeFunc->getUntrackedVal(); } - /// 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. + /// getValueState - Return the LatticeVal object corresponding to the given + /// value from the ValueState map. If the value is not in the map, its state + /// is initialized. LatticeVal getValueState(Value *V); /// isEdgeFeasible - Return true if the control flow edge from the 'From' @@ -283,7 +281,7 @@ void SparseSolver<LatticeVal>::getFeasibleSuccessors( if (AggressiveUndef) BCValue = getValueState(BI->getCondition()); else - BCValue = getLatticeState(BI->getCondition()); + BCValue = getExistingValueState(BI->getCondition()); if (BCValue == LatticeFunc->getOverdefinedVal() || BCValue == LatticeFunc->getUntrackedVal()) { @@ -325,7 +323,7 @@ void SparseSolver<LatticeVal>::getFeasibleSuccessors( if (AggressiveUndef) SCValue = getValueState(SI.getCondition()); else - SCValue = getLatticeState(SI.getCondition()); + SCValue = getExistingValueState(SI.getCondition()); if (SCValue == LatticeFunc->getOverdefinedVal() || SCValue == LatticeFunc->getUntrackedVal()) { @@ -487,7 +485,7 @@ void SparseSolver<LatticeVal>::Print(Function &F, raw_ostream &OS) const { else OS << "; anon bb\n"; for (auto &I : BB) { - LatticeFunc->PrintValue(getLatticeState(&I), OS); + LatticeFunc->PrintValue(getExistingValueState(&I), OS); OS << I << "\n"; } |

