-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Reland "[ThinLTO][Bitcode] Generate import type in bitcode" #97253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…eSummary::GVFlags - This change doesn't set the bit in the summaries, just make the code changes.
Update this one accordingly
1. Set 'import-instr-evolution-factor' to 1.0 (default 0.7) to make sure import limit remains 7 (otherwise import limit decays through each edge) 2. Updated bar* function names 3. Explain why aliasee is null for bar* functions
✅ With the latest revision this PR passed the C/C++ code formatter. |
@@ -1277,7 +1278,7 @@ using ModulePathStringTableTy = StringMap<ModuleHash>; | |||
using GVSummaryMapTy = DenseMap<GlobalValue::GUID, GlobalValueSummary *>; | |||
|
|||
/// A set of global value summary pointers. | |||
using GVSummaryPtrSet = SmallPtrSet<GlobalValueSummary *, 4>; | |||
using GVSummaryPtrSet = std::unordered_set<GlobalValueSummary *>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah nice -- interesting that SmallPtrSet also has a big jump when growing at small sizes! (
Grow(CurArraySize < 64 ? 128 : CurArraySize * 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I corrected the patch description with this link. thanks!
@@ -453,11 +458,16 @@ class IndexBitcodeWriter : public BitcodeWriterBase { | |||
/// Constructs a IndexBitcodeWriter object for the given combined index, | |||
/// writing to the provided \p Buffer. When writing a subset of the index | |||
/// for a distributed backend, provide a \p ModuleToSummariesForIndex map. | |||
/// If provided, \p ModuleToDecSummaries specifies the set of summaries for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: DecSummaries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
The pre-commit buildbot failure is irrelevant
|
llvm#87600 was reverted in order to revert llvm@6262763. Now llvm#95482 is fix forward for llvm@6262763. This patch is a reland for llvm#87600 **Changes on top of original patch** In `llvm/include/llvm/IR/ModuleSummaryIndex.h`, make the type of `GVSummaryPtrSet` an `unordered_set` which is more memory efficient when the number of elements is smaller than 128 [1] **Original commit message** For distributed ThinLTO, the LTO indexing step generates combined summary for each module, and postlink pipeline reads the combined summary which stores the information for link-time optimization. This patch populates the 'import type' of a summary in bitcode, and updates bitcode reader to parse the bit correctly. [1] https://github.com/llvm/llvm-project/blob/393eff4e02e7ab3d234d246a8d6912c8e745e6f9/llvm/lib/Support/SmallPtrSet.cpp#L43
#87600 was reverted in order to revert 6262763. Now #95482 is fix forward for 6262763. This patch is a reland for #87600
Changes on top of original patch
In
llvm/include/llvm/IR/ModuleSummaryIndex.h
, make the type ofGVSummaryPtrSet
anunordered_set
which is more memory efficient when the number of elements is smaller than 128 [1]Original commit message
For distributed ThinLTO, the LTO indexing step generates combined summary for each module, and postlink pipeline reads the combined summary which stores the information for link-time optimization.
This patch populates the 'import type' of a summary in bitcode, and updates bitcode reader to parse the bit correctly.
[1]
llvm-project/llvm/lib/Support/SmallPtrSet.cpp
Line 43 in 393eff4