[llvm] 44b456e - [CodeGenPrepare] Avoid double map lookup. NFCI
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 26 10:47:33 PDT 2022
Author: Craig Topper
Date: 2022-06-26T10:47:14-07:00
New Revision: 44b456e5f0b35600607e2fdf1469d077492f5251
URL: https://github.com/llvm/llvm-project/commit/44b456e5f0b35600607e2fdf1469d077492f5251
DIFF: https://github.com/llvm/llvm-project/commit/44b456e5f0b35600607e2fdf1469d077492f5251.diff
LOG: [CodeGenPrepare] Avoid double map lookup. NFCI
Added:
Modified:
llvm/lib/CodeGen/CodeGenPrepare.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 4b5f37e2ab961..9bdf6e05a5783 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -5181,8 +5181,7 @@ bool CodeGenPrepare::optimizeMemoryInst(Instruction *MemoryInst, Value *Addr,
// GEP, collect the GEP. Skip the GEPs that are the new bases of
// previously split data structures.
LargeOffsetGEPMap[GEP->getPointerOperand()].push_back(LargeOffsetGEP);
- if (LargeOffsetGEPID.find(GEP) == LargeOffsetGEPID.end())
- LargeOffsetGEPID[GEP] = LargeOffsetGEPID.size();
+ LargeOffsetGEPID.insert(std::make_pair(GEP, LargeOffsetGEPID.size()));
}
NewAddrMode.OriginalValue = V;
More information about the llvm-commits
mailing list