Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions llvm/lib/CodeGen/GlobalMerge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ bool GlobalMergeImpl::doMerge(SmallVectorImpl<GlobalVariable *> &Globals,

size_t UGSIdx = GlobalUsesByFunction[ParentFn];

// If this is the first global the basic block uses, map it to the set
// If this is the first global the function uses, map it to the set
// consisting of this global only.
if (!UGSIdx) {
// If that set doesn't exist yet, create it.
Expand All @@ -393,7 +393,8 @@ bool GlobalMergeImpl::doMerge(SmallVectorImpl<GlobalVariable *> &Globals,
continue;
}

// If we already encountered this BB, just increment the counter.
// If we already encountered a use of this global in this function, just
// increment the counter.
if (UsedGlobalSets[UGSIdx].Globals.test(GI)) {
++UsedGlobalSets[UGSIdx].UsageCount;
continue;
Expand Down Expand Up @@ -423,7 +424,7 @@ bool GlobalMergeImpl::doMerge(SmallVectorImpl<GlobalVariable *> &Globals,
}

// Now we found a bunch of sets of globals used together. We accumulated
// the number of times we encountered the sets (i.e., the number of blocks
// the number of times we encountered the sets (i.e., the number of functions
// that use that exact set of globals).
//
// Multiply that by the size of the set to give us a crude profitability
Expand Down
Loading