aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineSink.cpp
diff options
context:
space:
mode:
authorMomchil Velikov <momchil.velikov@arm.com>2023-10-12 10:04:41 +0100
committerGitHub <noreply@github.com>2023-10-12 10:04:41 +0100
commit86d9faa5a97610a1b50b5bffe502b3807c03b0d9 (patch)
tree15174183a7f8e09acc1c9fec84d8e779c0ad65f9 /llvm/lib/CodeGen/MachineSink.cpp
parent7a18b3ce65210c7c71e17fe97b40cf199b3cd6c6 (diff)
downloadllvm-86d9faa5a97610a1b50b5bffe502b3807c03b0d9.zip
llvm-86d9faa5a97610a1b50b5bffe502b3807c03b0d9.tar.gz
llvm-86d9faa5a97610a1b50b5bffe502b3807c03b0d9.tar.bz2
[MachineSink] Use LLVM ADTs (NFC) (#68677)
Replace a few uses of `std::map` with `llvm::DenseMap`.
Diffstat (limited to 'llvm/lib/CodeGen/MachineSink.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineSink.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp
index 40f33d6..9a0d1cc 100644
--- a/llvm/lib/CodeGen/MachineSink.cpp
+++ b/llvm/lib/CodeGen/MachineSink.cpp
@@ -57,7 +57,6 @@
#include <algorithm>
#include <cassert>
#include <cstdint>
-#include <map>
#include <utility>
#include <vector>
@@ -139,7 +138,7 @@ namespace {
DenseSet<Register> RegsToClearKillFlags;
using AllSuccsCache =
- std::map<MachineBasicBlock *, SmallVector<MachineBasicBlock *, 4>>;
+ DenseMap<MachineBasicBlock *, SmallVector<MachineBasicBlock *, 4>>;
/// 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<DebugVariable> SeenDbgVars;
- std::map<std::pair<MachineBasicBlock *, MachineBasicBlock *>, bool>
+ DenseMap<std::pair<MachineBasicBlock *, MachineBasicBlock *>, bool>
HasStoreCache;
- std::map<std::pair<MachineBasicBlock *, MachineBasicBlock *>,
- std::vector<MachineInstr *>>
+
+ DenseMap<std::pair<MachineBasicBlock *, MachineBasicBlock *>,
+ SmallVector<MachineInstr *>>
StoreInstrCache;
/// Cached BB's register pressure.
- std::map<const MachineBasicBlock *, std::vector<unsigned>>
+ DenseMap<const MachineBasicBlock *, std::vector<unsigned>>
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);
});