Skip to content

Commit dbf78ae

Browse files
committed
[LVI] Use SmallDenseMap for getValueFromCondition(); NFC
For the common case, we will only insert one value into this map.
1 parent 71f8b78 commit dbf78ae

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

llvm/lib/Analysis/LazyValueInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,11 +1278,11 @@ static ValueLatticeElement getValueFromOverflowCondition(
12781278

12791279
static ValueLatticeElement
12801280
getValueFromCondition(Value *Val, Value *Cond, bool isTrueDest,
1281-
DenseMap<Value*, ValueLatticeElement> &Visited);
1281+
SmallDenseMap<Value*, ValueLatticeElement> &Visited);
12821282

12831283
static ValueLatticeElement
12841284
getValueFromConditionImpl(Value *Val, Value *Cond, bool isTrueDest,
1285-
DenseMap<Value*, ValueLatticeElement> &Visited) {
1285+
SmallDenseMap<Value*, ValueLatticeElement> &Visited) {
12861286
if (ICmpInst *ICI = dyn_cast<ICmpInst>(Cond))
12871287
return getValueFromICmpCondition(Val, ICI, isTrueDest);
12881288

@@ -1315,7 +1315,7 @@ getValueFromConditionImpl(Value *Val, Value *Cond, bool isTrueDest,
13151315

13161316
static ValueLatticeElement
13171317
getValueFromCondition(Value *Val, Value *Cond, bool isTrueDest,
1318-
DenseMap<Value*, ValueLatticeElement> &Visited) {
1318+
SmallDenseMap<Value*, ValueLatticeElement> &Visited) {
13191319
auto I = Visited.find(Cond);
13201320
if (I != Visited.end())
13211321
return I->second;
@@ -1328,7 +1328,7 @@ getValueFromCondition(Value *Val, Value *Cond, bool isTrueDest,
13281328
ValueLatticeElement getValueFromCondition(Value *Val, Value *Cond,
13291329
bool isTrueDest) {
13301330
assert(Cond && "precondition");
1331-
DenseMap<Value*, ValueLatticeElement> Visited;
1331+
SmallDenseMap<Value*, ValueLatticeElement> Visited;
13321332
return getValueFromCondition(Val, Cond, isTrueDest, Visited);
13331333
}
13341334

0 commit comments

Comments
 (0)