Skip to content

Commit 606ff7e

Browse files
[Utils] Avoid repeated hash lookups (NFC) (#127171)
1 parent 6f5ca9b commit 606ff7e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,9 @@ llvm::UnrollAndJamLoop(Loop *L, unsigned Count, unsigned TripCount,
395395
}
396396

397397
// Update our running maps of newest clones
398-
PrevItValueMap[New] = (It == 1 ? *BB : LastValueMap[*BB]);
399-
LastValueMap[*BB] = New;
398+
auto &Last = LastValueMap[*BB];
399+
PrevItValueMap[New] = (It == 1 ? *BB : Last);
400+
Last = New;
400401
for (ValueToValueMapTy::iterator VI = VMap.begin(), VE = VMap.end();
401402
VI != VE; ++VI) {
402403
PrevItValueMap[VI->second] =

0 commit comments

Comments
 (0)