diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp index 40f33d664414d..9a0d1cc94d24b 100644 --- a/llvm/lib/CodeGen/MachineSink.cpp +++ b/llvm/lib/CodeGen/MachineSink.cpp @@ -57,7 +57,6 @@ #include #include #include -#include #include #include @@ -139,7 +138,7 @@ namespace { DenseSet RegsToClearKillFlags; using AllSuccsCache = - std::map>; + DenseMap>; /// DBG_VALUE pointer and flag. The flag is true if this DBG_VALUE is /// post-dominated by another DBG_VALUE of the same variable location. @@ -160,14 +159,15 @@ namespace { /// current block. DenseSet SeenDbgVars; - std::map, bool> + DenseMap, bool> HasStoreCache; - std::map, - std::vector> + + DenseMap, + SmallVector> StoreInstrCache; /// Cached BB's register pressure. - std::map> + DenseMap> CachedRegisterPressure; bool EnableSinkAndFold; @@ -1429,11 +1429,11 @@ bool MachineSinking::hasStoreBetween(MachineBasicBlock *From, // Does these two blocks pair be queried before and have a definite cached // result? - if (HasStoreCache.find(BlockPair) != HasStoreCache.end()) - return HasStoreCache[BlockPair]; + if (auto It = HasStoreCache.find(BlockPair); It != HasStoreCache.end()) + return It->second; - if (StoreInstrCache.find(BlockPair) != StoreInstrCache.end()) - return llvm::any_of(StoreInstrCache[BlockPair], [&](MachineInstr *I) { + if (auto It = StoreInstrCache.find(BlockPair); It != StoreInstrCache.end()) + return llvm::any_of(It->second, [&](MachineInstr *I) { return I->mayAlias(AA, MI, false); });