diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-03-21 14:54:46 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-03-22 10:38:44 +0100 |
commit | dbf78ae12874c5ff2ecf4b6f49bfae616a40e11c (patch) | |
tree | 7145a2f86e36176f6927084b39235196980319e2 /llvm/lib/Analysis/LazyValueInfo.cpp | |
parent | 71f8b78d89798f6b4a4645ffcb3aa461ccb89111 (diff) | |
download | llvm-dbf78ae12874c5ff2ecf4b6f49bfae616a40e11c.zip llvm-dbf78ae12874c5ff2ecf4b6f49bfae616a40e11c.tar.gz llvm-dbf78ae12874c5ff2ecf4b6f49bfae616a40e11c.tar.bz2 |
[LVI] Use SmallDenseMap for getValueFromCondition(); NFC
For the common case, we will only insert one value into this map.
Diffstat (limited to 'llvm/lib/Analysis/LazyValueInfo.cpp')
-rw-r--r-- | llvm/lib/Analysis/LazyValueInfo.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp index 7ae7a1f..4e757ba 100644 --- a/llvm/lib/Analysis/LazyValueInfo.cpp +++ b/llvm/lib/Analysis/LazyValueInfo.cpp @@ -1278,11 +1278,11 @@ static ValueLatticeElement getValueFromOverflowCondition( static ValueLatticeElement getValueFromCondition(Value *Val, Value *Cond, bool isTrueDest, - DenseMap<Value*, ValueLatticeElement> &Visited); + SmallDenseMap<Value*, ValueLatticeElement> &Visited); static ValueLatticeElement getValueFromConditionImpl(Value *Val, Value *Cond, bool isTrueDest, - DenseMap<Value*, ValueLatticeElement> &Visited) { + SmallDenseMap<Value*, ValueLatticeElement> &Visited) { if (ICmpInst *ICI = dyn_cast<ICmpInst>(Cond)) return getValueFromICmpCondition(Val, ICI, isTrueDest); @@ -1315,7 +1315,7 @@ getValueFromConditionImpl(Value *Val, Value *Cond, bool isTrueDest, static ValueLatticeElement getValueFromCondition(Value *Val, Value *Cond, bool isTrueDest, - DenseMap<Value*, ValueLatticeElement> &Visited) { + SmallDenseMap<Value*, ValueLatticeElement> &Visited) { auto I = Visited.find(Cond); if (I != Visited.end()) return I->second; @@ -1328,7 +1328,7 @@ getValueFromCondition(Value *Val, Value *Cond, bool isTrueDest, ValueLatticeElement getValueFromCondition(Value *Val, Value *Cond, bool isTrueDest) { assert(Cond && "precondition"); - DenseMap<Value*, ValueLatticeElement> Visited; + SmallDenseMap<Value*, ValueLatticeElement> Visited; return getValueFromCondition(Val, Cond, isTrueDest, Visited); } |