Skip to content

Commit 2620742

Browse files
[Utils] Avoid repeated hash lookups (NFC) (#130892)
1 parent a3b0189 commit 2620742

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
@@ -400,9 +400,10 @@ llvm::UnrollAndJamLoop(Loop *L, unsigned Count, unsigned TripCount,
400400
Last = New;
401401
for (ValueToValueMapTy::iterator VI = VMap.begin(), VE = VMap.end();
402402
VI != VE; ++VI) {
403+
auto &LVM = LastValueMap[VI->first];
403404
PrevItValueMap[VI->second] =
404-
const_cast<Value *>(It == 1 ? VI->first : LastValueMap[VI->first]);
405-
LastValueMap[VI->first] = VI->second;
405+
const_cast<Value *>(It == 1 ? VI->first : LVM);
406+
LVM = VI->second;
406407
}
407408

408409
NewBlocks.push_back(New);

0 commit comments

Comments
 (0)