Skip to content

Commit 7447e0e

Browse files
[SelectionDAG] Avoid repeated hash lookups (NFC)
1 parent 110b77f commit 7447e0e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,10 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
343343
for (auto &KV : EHInfo.UnwindDestToSrcs) {
344344
const auto *Dest = cast<const BasicBlock *>(KV.first);
345345
MachineBasicBlock *DestMBB = getMBB(Dest);
346-
UnwindDestToSrcs[DestMBB] = SmallPtrSet<BBOrMBB, 4>();
346+
auto &Srcs = UnwindDestToSrcs[DestMBB];
347+
Srcs = SmallPtrSet<BBOrMBB, 4>();
347348
for (const auto P : KV.second)
348-
UnwindDestToSrcs[DestMBB].insert(getMBB(cast<const BasicBlock *>(P)));
349+
Srcs.insert(getMBB(cast<const BasicBlock *>(P)));
349350
}
350351
EHInfo.UnwindDestToSrcs = std::move(UnwindDestToSrcs);
351352
}

0 commit comments

Comments
 (0)