1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

[LVI] Use find_as() where possible (NFC)

This prevents us from creating temporary PoisoningVHs and
AssertingVHs while performing hashmap lookups. As such, it only
matters in assertion-enabled builds.
This commit is contained in:
Nikita Popov 2020-06-13 15:15:39 +02:00
parent fddd42bd0e
commit 440488f2a7

View File

@ -168,14 +168,14 @@ namespace {
DenseSet<LVIValueHandle, DenseMapInfo<Value *>> ValueHandles;
const BlockCacheEntry *getBlockEntry(BasicBlock *BB) const {
auto It = BlockCache.find(BB);
auto It = BlockCache.find_as(BB);
if (It == BlockCache.end())
return nullptr;
return It->second.get();
}
BlockCacheEntry *getOrCreateBlockEntry(BasicBlock *BB) {
auto It = BlockCache.find(BB);
auto It = BlockCache.find_as(BB);
if (It == BlockCache.end())
It = BlockCache.insert({ BB, std::make_unique<BlockCacheEntry>() })
.first;
@ -209,7 +209,7 @@ namespace {
if (Entry->OverDefined.count(V))
return ValueLatticeElement::getOverdefined();
auto LatticeIt = Entry->LatticeElements.find(V);
auto LatticeIt = Entry->LatticeElements.find_as(V);
if (LatticeIt == Entry->LatticeElements.end())
return None;
@ -290,7 +290,7 @@ void LazyValueInfoCache::threadEdgeImpl(BasicBlock *OldSucc,
if (ToUpdate == NewSucc) continue;
// If a value was marked overdefined in OldSucc, and is here too...
auto OI = BlockCache.find(ToUpdate);
auto OI = BlockCache.find_as(ToUpdate);
if (OI == BlockCache.end() || OI->second->OverDefined.empty())
continue;
auto &ValueSet = OI->second->OverDefined;