[CodeGen] Avoid repeated map lookups (NFC) (#140662)

This commit is contained in:
Kazu Hirata 2025-05-19 21:36:31 -07:00 committed by GitHub
parent 95202ab54e
commit a754bc27e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -603,11 +603,8 @@ void Liveness::computePhiInfo() {
for (NodeAddr<DefNode *> D : Ds) {
if (D.Addr->getFlags() & NodeAttrs::PhiRef) {
NodeId RP = D.Addr->getOwner(DFG).Id;
std::map<NodeId, RegisterAggr> &M = PhiUp[PUA.Id];
auto F = M.find(RP);
if (F == M.end())
M.insert(std::make_pair(RP, DefRRs));
else
auto [F, Inserted] = PhiUp[PUA.Id].try_emplace(RP, DefRRs);
if (!Inserted)
F->second.insert(DefRRs);
}
DefRRs.insert(D.Addr->getRegRef(DFG));