Skip to content

Commit 8d333e1

Browse files
[SelectionDAG] Avoid repeated hash lookups (NFC) (#131266)
1 parent 4acfeaf commit 8d333e1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,8 @@ SDValue SelectionDAGBuilder::LowerAsSTATEPOINT(
889889
}
890890

891891
// Handle multiple gc.relocates of the same input efficiently.
892-
if (VirtRegs.count(SD))
892+
auto [VRegIt, Inserted] = VirtRegs.try_emplace(SD);
893+
if (!Inserted)
893894
continue;
894895

895896
auto *RetTy = Relocate->getType();
@@ -900,7 +901,7 @@ SDValue SelectionDAGBuilder::LowerAsSTATEPOINT(
900901
RFV.getCopyToRegs(Relocated, DAG, getCurSDLoc(), Chain, nullptr);
901902
PendingExports.push_back(Chain);
902903

903-
VirtRegs[SD] = Reg;
904+
VRegIt->second = Reg;
904905
}
905906

906907
// Record for later use how each relocation was lowered. This is needed to

0 commit comments

Comments
 (0)