Skip to content

Commit 6a1fd24

Browse files
[CodeGen] Avoid repeated hash lookups (NFC) (#131422)
1 parent 0320512 commit 6a1fd24

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2772,14 +2772,15 @@ void InstrRefBasedLDV::buildMLocValueMap(
27722772
// visited this pass, if they're not going to be already.
27732773
for (auto *s : MBB->successors()) {
27742774
// Does branching to this successor represent a back-edge?
2775-
if (BBToOrder[s] > BBToOrder[MBB]) {
2775+
unsigned Order = BBToOrder[s];
2776+
if (Order > BBToOrder[MBB]) {
27762777
// No: visit it during this dataflow iteration.
27772778
if (OnWorklist.insert(s).second)
2778-
Worklist.push(BBToOrder[s]);
2779+
Worklist.push(Order);
27792780
} else {
27802781
// Yes: visit it on the next iteration.
27812782
if (OnPending.insert(s).second)
2782-
Pending.push(BBToOrder[s]);
2783+
Pending.push(Order);
27832784
}
27842785
}
27852786
}
@@ -3349,11 +3350,12 @@ void InstrRefBasedLDV::buildVLocValueMap(
33493350
if (!LiveInIdx.contains(s))
33503351
continue;
33513352

3352-
if (BBToOrder[s] > BBToOrder[MBB]) {
3353+
unsigned Order = BBToOrder[s];
3354+
if (Order > BBToOrder[MBB]) {
33533355
if (OnWorklist.insert(s).second)
3354-
Worklist.push(BBToOrder[s]);
3356+
Worklist.push(Order);
33553357
} else if (OnPending.insert(s).second && (FirstTrip || OLChanged)) {
3356-
Pending.push(BBToOrder[s]);
3358+
Pending.push(Order);
33573359
}
33583360
}
33593361
}

0 commit comments

Comments
 (0)