Skip to content

Commit 6f0183e

Browse files
kazutakahiratafrederik-h
authored andcommitted
[Utils] Avoid repeated hash lookups (NFC) (llvm#130892)
1 parent d9df950 commit 6f0183e

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)