Skip to content

Commit 70477d9

Browse files
[Scalar] Avoid repeated hash lookups (NFC) (#130547)
1 parent 0b99a2a commit 70477d9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,10 @@ static void splitCallSite(CallBase &CB,
397397
continue;
398398
PHINode *NewPN = PHINode::Create(CurrentI->getType(), Preds.size());
399399
NewPN->setDebugLoc(CurrentI->getDebugLoc());
400-
for (auto &Mapping : ValueToValueMaps)
401-
NewPN->addIncoming(Mapping[CurrentI],
402-
cast<Instruction>(Mapping[CurrentI])->getParent());
400+
for (auto &Mapping : ValueToValueMaps) {
401+
Value *V = Mapping[CurrentI];
402+
NewPN->addIncoming(V, cast<Instruction>(V)->getParent());
403+
}
403404
NewPN->insertBefore(*TailBB, TailBB->begin());
404405
CurrentI->replaceAllUsesWith(NewPN);
405406
}

0 commit comments

Comments
 (0)