[llvm] 70477d9 - [Scalar] Avoid repeated hash lookups (NFC) (#130547)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 10 10:18:34 PDT 2025
Author: Kazu Hirata
Date: 2025-03-10T10:18:31-07:00
New Revision: 70477d979fa52910f46db0425eac04f34074e5c3
URL: https://github.com/llvm/llvm-project/commit/70477d979fa52910f46db0425eac04f34074e5c3
DIFF: https://github.com/llvm/llvm-project/commit/70477d979fa52910f46db0425eac04f34074e5c3.diff
LOG: [Scalar] Avoid repeated hash lookups (NFC) (#130547)
Added:
Modified:
llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp b/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
index e644636d42f63..2e955e061111f 100644
--- a/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
+++ b/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
@@ -397,9 +397,10 @@ static void splitCallSite(CallBase &CB,
continue;
PHINode *NewPN = PHINode::Create(CurrentI->getType(), Preds.size());
NewPN->setDebugLoc(CurrentI->getDebugLoc());
- for (auto &Mapping : ValueToValueMaps)
- NewPN->addIncoming(Mapping[CurrentI],
- cast<Instruction>(Mapping[CurrentI])->getParent());
+ for (auto &Mapping : ValueToValueMaps) {
+ Value *V = Mapping[CurrentI];
+ NewPN->addIncoming(V, cast<Instruction>(V)->getParent());
+ }
NewPN->insertBefore(*TailBB, TailBB->begin());
CurrentI->replaceAllUsesWith(NewPN);
}
More information about the llvm-commits
mailing list