diff options
author | Fangrui Song <i@maskray.me> | 2023-07-24 22:04:03 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2023-07-24 22:04:03 -0700 |
commit | fb2a971c015fa991b47aa8d93bd97379c012cb68 (patch) | |
tree | 37041f9336f4eebd1634bcc15672ab8036634aa9 /llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | |
parent | 480d7a3aff8db0b812bdd36e7be8d78a7a0fd430 (diff) | |
download | llvm-fb2a971c015fa991b47aa8d93bd97379c012cb68.zip llvm-fb2a971c015fa991b47aa8d93bd97379c012cb68.tar.gz llvm-fb2a971c015fa991b47aa8d93bd97379c012cb68.tar.bz2 |
[Support] Change MapVector's default template parameter to SmallVector<*, 0>
SmallVector<*, 0> is often a better replacement for std::vector :
both the object size and the code size are smaller.
(SmallMapVector uses SmallVector as well, but it is not common.)
clang size decreases by 0.0226%.
instructions:u decreases 0.037% when compiling a sqlite3 amalgram.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D156016
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp index 165b8f1..2076ed4 100644 --- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp +++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp @@ -266,7 +266,9 @@ static void computeFunctionSummary( unsigned NumInsts = 0; // Map from callee ValueId to profile count. Used to accumulate profile // counts for all static calls to a given callee. - MapVector<ValueInfo, CalleeInfo> CallGraphEdges; + MapVector<ValueInfo, CalleeInfo, DenseMap<ValueInfo, unsigned>, + std::vector<std::pair<ValueInfo, CalleeInfo>>> + CallGraphEdges; SetVector<ValueInfo> RefEdges, LoadRefEdges, StoreRefEdges; SetVector<GlobalValue::GUID> TypeTests; SetVector<FunctionSummary::VFuncId> TypeTestAssumeVCalls, |