Skip to content

Commit 6ecc1ff

Browse files
[CodeGen] Avoid repeated hash lookups (NFC) (llvm#132585)
1 parent ce2c4ea commit 6ecc1ff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/include/llvm/CodeGen/MachinePipeliner.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,9 @@ class NodeSet {
486486
if (PI.getSrc() != FirstNode || !PI.isOrderDep() ||
487487
!DAG->isLoopCarriedDep(PI))
488488
continue;
489-
SUnitToDistance[FirstNode] =
490-
std::max(SUnitToDistance[FirstNode], SUnitToDistance[LastNode] + 1);
489+
unsigned &First = SUnitToDistance[FirstNode];
490+
unsigned Last = SUnitToDistance[LastNode];
491+
First = std::max(First, Last + 1);
491492
}
492493

493494
// The latency is the distance from the source node to itself.

0 commit comments

Comments
 (0)