Skip to content

Commit 6220448

Browse files
[CodeGen] Avoid repeated hash lookups (NFC) (#131722)
1 parent f6ad65a commit 6220448

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -916,13 +916,16 @@ SDValue SelectionDAGBuilder::LowerAsSTATEPOINT(
916916
bool IsLocal = (Relocate->getParent() == StatepointInstr->getParent());
917917

918918
RecordType Record;
919-
if (IsLocal && LowerAsVReg.count(SDV)) {
920-
// Result is already stored in StatepointLowering
921-
Record.type = RecordType::SDValueNode;
922-
} else if (LowerAsVReg.count(SDV)) {
923-
Record.type = RecordType::VReg;
924-
assert(VirtRegs.count(SDV));
925-
Record.payload.Reg = VirtRegs[SDV];
919+
if (LowerAsVReg.count(SDV)) {
920+
if (IsLocal) {
921+
// Result is already stored in StatepointLowering
922+
Record.type = RecordType::SDValueNode;
923+
} else {
924+
Record.type = RecordType::VReg;
925+
auto It = VirtRegs.find(SDV);
926+
assert(It != VirtRegs.end());
927+
Record.payload.Reg = It->second;
928+
}
926929
} else if (Loc.getNode()) {
927930
Record.type = RecordType::Spill;
928931
Record.payload.FI = cast<FrameIndexSDNode>(Loc)->getIndex();

0 commit comments

Comments
 (0)