mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-19 00:56:41 +00:00
[BOLT] Avoid repeated map lookups (NFC) (#112118)
This commit is contained in:
parent
464a7ee79e
commit
7928e14f5e
@ -3684,9 +3684,8 @@ BinaryFunction::BasicBlockListType BinaryFunction::dfs() const {
|
||||
BinaryBasicBlock *BB = Stack.top();
|
||||
Stack.pop();
|
||||
|
||||
if (Visited.find(BB) != Visited.end())
|
||||
if (!Visited.insert(BB).second)
|
||||
continue;
|
||||
Visited.insert(BB);
|
||||
DFS.push_back(BB);
|
||||
|
||||
for (BinaryBasicBlock *SuccBB : BB->landing_pads()) {
|
||||
@ -3879,11 +3878,8 @@ void BinaryFunction::disambiguateJumpTables(
|
||||
JumpTable *JT = getJumpTable(Inst);
|
||||
if (!JT)
|
||||
continue;
|
||||
auto Iter = JumpTables.find(JT);
|
||||
if (Iter == JumpTables.end()) {
|
||||
JumpTables.insert(JT);
|
||||
if (JumpTables.insert(JT).second)
|
||||
continue;
|
||||
}
|
||||
// This instruction is an indirect jump using a jump table, but it is
|
||||
// using the same jump table of another jump. Try all our tricks to
|
||||
// extract the jump table symbol and make it point to a new, duplicated JT
|
||||
|
Loading…
x
Reference in New Issue
Block a user