Skip to content

Commit a588e20

Browse files
[SelectionDAG] Avoid repeated hash lookups (NFC) (#123697)
1 parent 671088b commit a588e20

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
@@ -871,10 +871,11 @@ SDValue SelectionDAGBuilder::LowerAsSTATEPOINT(
871871
for (const auto *Relocate : SI.GCRelocates) {
872872
Value *Derived = Relocate->getDerivedPtr();
873873
SDValue SD = getValue(Derived);
874-
if (!LowerAsVReg.count(SD))
874+
auto It = LowerAsVReg.find(SD);
875+
if (It == LowerAsVReg.end())
875876
continue;
876877

877-
SDValue Relocated = SDValue(StatepointMCNode, LowerAsVReg[SD]);
878+
SDValue Relocated = SDValue(StatepointMCNode, It->second);
878879

879880
// Handle local relocate. Note that different relocates might
880881
// map to the same SDValue.

0 commit comments

Comments
 (0)