[llvm] r315356 - [SparseSolver] Rename getLatticeState to getExistingValueState (NFC)
Matthew Simpson via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 10 13:19:34 PDT 2017
Author: mssimpso
Date: Tue Oct 10 13:19:34 2017
New Revision: 315356
URL: http://llvm.org/viewvc/llvm-project?rev=315356&view=rev
Log:
[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.
Modified:
llvm/trunk/include/llvm/Analysis/SparsePropagation.h
Modified: llvm/trunk/include/llvm/Analysis/SparsePropagation.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/SparsePropagation.h?rev=315356&r1=315355&r2=315356&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/SparsePropagation.h (original)
+++ llvm/trunk/include/llvm/Analysis/SparsePropagation.h Tue Oct 10 13:19:34 2017
@@ -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>::getFeasib
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>::getFeasib
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(Fun
else
OS << "; anon bb\n";
for (auto &I : BB) {
- LatticeFunc->PrintValue(getLatticeState(&I), OS);
+ LatticeFunc->PrintValue(getExistingValueState(&I), OS);
OS << I << "\n";
}
More information about the llvm-commits
mailing list