From 84be8d28a04cea95c142bebbf96a7cbf6531fe17 Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Tue, 3 Oct 2017 00:26:21 +0000 Subject: [PATCH] SparseSolver: Rename getOrInitValueState to getValueState, matching what SCCP calls it git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314744 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/SparsePropagation.h | 6 +++--- lib/Analysis/SparsePropagation.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/llvm/Analysis/SparsePropagation.h b/include/llvm/Analysis/SparsePropagation.h index be93d78162a..35c7e4c0a4e 100644 --- a/include/llvm/Analysis/SparsePropagation.h +++ b/include/llvm/Analysis/SparsePropagation.h @@ -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 diff --git a/lib/Analysis/SparsePropagation.cpp b/lib/Analysis/SparsePropagation.cpp index 82a39341e5a..0451eb2c26d 100644 --- a/lib/Analysis/SparsePropagation.cpp +++ b/lib/Analysis/SparsePropagation.cpp @@ -57,13 +57,13 @@ void AbstractLatticeFunction::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 -LatticeVal SparseSolver::getOrInitValueState(Value *V) { +LatticeVal SparseSolver::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::getFeasibleSuccessors( LatticeVal BCValue; if (AggressiveUndef) - BCValue = getOrInitValueState(BI->getCondition()); + BCValue = getValueState(BI->getCondition()); else BCValue = getLatticeState(BI->getCondition()); @@ -189,7 +189,7 @@ void SparseSolver::getFeasibleSuccessors( SwitchInst &SI = cast(TI); LatticeVal SCValue; if (AggressiveUndef) - SCValue = getOrInitValueState(SI.getCondition()); + SCValue = getValueState(SI.getCondition()); else SCValue = getLatticeState(SI.getCondition()); @@ -255,7 +255,7 @@ void SparseSolver::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::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); -- 2.11.0