#
9254ebe3 |
| 05-May-2016 |
Teresa Johnson <tejohnson@google.com> |
[ThinLTO] Emit individual index files for distributed backends
Summary: When launching ThinLTO backends in a distributed build (currently supported in gold via the thinlto-index-only plugin option),
[ThinLTO] Emit individual index files for distributed backends
Summary: When launching ThinLTO backends in a distributed build (currently supported in gold via the thinlto-index-only plugin option), emit an individual index file for each backend process as described here: http://lists.llvm.org/pipermail/llvm-dev/2016-April/098272.html
The individual index file encodes the summary and module information required for implementing the importing/exporting decisions made for a given module in the thin link step. This is in place of the current mechanism that uses the combined index to make importing decisions in each back end independently. It is an enabler for doing global summary based optimizations in the thin link step (which will be recorded in the individual index files), and reduces the size of the index that must be sent to each backend process, and the amount of work to scan it in the backends.
Rather than create entirely new ModuleSummaryIndex structures (and all the included unique_ptrs) for each backend index file, a map is created to record all of the GUID and summary pointers needed for a particular index file. The IndexBitcodeWriter walks this map instead of the full index (hiding the details of managing the appropriate summary iteration in a new iterator subclass). This is more efficient than walking the entire combined index and filtering out just the needed summaries during each backend bitcode index write.
Depends on D19481.
Reviewers: joker.eph
Subscribers: llvm-commits, joker.eph
Differential Revision: http://reviews.llvm.org/D19556
llvm-svn: 268627
show more ...
|
#
41beee65 |
| 27-Apr-2016 |
Sjoerd Meijer <sjoerd.meijer@arm.com> |
Clean up to avoid compiler warnings for casting away const qualifiers.
Differential Revision: http://reviews.llvm.org/D19598
llvm-svn: 267753
|
#
02e98331 |
| 27-Apr-2016 |
Teresa Johnson <tejohnson@google.com> |
[ThinLTO] Use valueid instead of bitcode offsets in combined index file
Summary: With the removal of support for lazy parsing of combined index summary records (e.g. r267344), we no longer need to i
[ThinLTO] Use valueid instead of bitcode offsets in combined index file
Summary: With the removal of support for lazy parsing of combined index summary records (e.g. r267344), we no longer need to include the summary record bitcode offset in the VST entries for definitions. Change the combined index format to be similar to the per-module index format in using value ids to cross-reference from the summary record to the VST entry (rather than the summary record bitcode offset to cross-reference in the other direction).
The visible changes are: 1) Add the value id to the combined summary records 2) Remove the summary offset from the combined VST records, which has the following effects: - No longer need the VST_CODE_COMBINED_GVDEFENTRY record, as all combined index VST entries now only contain the value id and corresponding GUID. - No longer have duplicate VST entries in the case where there are multiple definitions of a symbol (e.g. weak/linkonce), as they all have the same value id and GUID.
An implication of #2 above is that in order to hook up an alias to the correct aliasee based on the value id of the aliasee recorded in the combined index alias record, we need to scan the entries in the index for that GUID to find the one from the same module (i.e. the case where there are multiple entries for the aliasee). But the reader no longer has to maintain a special map to hook up the alias/aliasee.
Reviewers: joker.eph
Subscribers: joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D19481
llvm-svn: 267712
show more ...
|
#
28e457bc |
| 24-Apr-2016 |
Teresa Johnson <tejohnson@google.com> |
[ThinLTO] Remove GlobalValueInfo class from index
Summary: Remove the GlobalValueInfo and change the ModuleSummaryIndex to directly reference summary objects. The info structure was there to support
[ThinLTO] Remove GlobalValueInfo class from index
Summary: Remove the GlobalValueInfo and change the ModuleSummaryIndex to directly reference summary objects. The info structure was there to support lazy parsing of the combined index summary objects, which is no longer needed and not supported.
Reviewers: joker.eph
Subscribers: joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D19462
llvm-svn: 267344
show more ...
|
#
c79c2be7 |
| 24-Apr-2016 |
Aaron Ballman <aaron@aaronballman.com> |
Silence two C4806 warnings ('|': unsafe operation: no value of type 'bool' promoted to type 'const unsigned int' can equal the given constant). The fact that they trigger with this code seems like it
Silence two C4806 warnings ('|': unsafe operation: no value of type 'bool' promoted to type 'const unsigned int' can equal the given constant). The fact that they trigger with this code seems like it may be a bug, but the warning itself is still generally useful enough to retain it for now.
llvm-svn: 267337
show more ...
|
#
ca2c54e0 |
| 24-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
Add "hasSection" flag in the Summary
Reviewers: tejohnson
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D19405
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267329
|
#
c3ed48c1 |
| 24-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
Reorganize GlobalValueSummary with a "Flags" bitfield.
Right now it only contains the LinkageType, but will be extended with "hasSection", "isOptSize", "hasInlineAssembly", etc.
Differential Revisi
Reorganize GlobalValueSummary with a "Flags" bitfield.
Right now it only contains the LinkageType, but will be extended with "hasSection", "isOptSize", "hasInlineAssembly", etc.
Differential Revision: http://reviews.llvm.org/D19404
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267319
show more ...
|
#
8fe6936e |
| 24-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
Add a version field in the bitcode for the summary
Differential Revision: http://reviews.llvm.org/D19456
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267318
|
#
ae64eafd |
| 23-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
Store and emit original name in combined index
Summary: As discussed in D18298, some local globals can't be renamed/promoted (because they have a section, or because they are referenced from inline
Store and emit original name in combined index
Summary: As discussed in D18298, some local globals can't be renamed/promoted (because they have a section, or because they are referenced from inline assembly). To be able to detect naming collision, we need to keep around the "GUID" using their original name without taking the linkage into account.
Reviewers: tejohnson
Subscribers: joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D19454
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267304
show more ...
|
#
a59d3e5a |
| 23-Apr-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
DebugInfo: Remove MDString-based type references
Eliminate DITypeIdentifierMap and make DITypeRef a thin wrapper around DIType*. It is no longer legal to refer to a DICompositeType by its 'identifi
DebugInfo: Remove MDString-based type references
Eliminate DITypeIdentifierMap and make DITypeRef a thin wrapper around DIType*. It is no longer legal to refer to a DICompositeType by its 'identifier:', and DIBuilder no longer retains all types with an 'identifier:' automatically.
Aside from the bitcode upgrade, this is mainly removing logic to resolve an MDString-based reference to an actualy DIType. The commits leading up to this have made the implicit type map in DICompileUnit's 'retainedTypes:' field superfluous.
This does not remove DITypeRef, DIScopeRef, DINodeRef, and DITypeRefArray, or stop using them in DI-related metadata. Although as of this commit they aren't serving a useful purpose, there are patchces under review to reuse them for CodeView support.
The tests in LLVM were updated with deref-typerefs.sh, which is attached to the thread "[RFC] Lazy-loading of debug info metadata":
http://lists.llvm.org/pipermail/llvm-dev/2016-April/098318.html
llvm-svn: 267296
show more ...
|
#
c814e0c1 |
| 23-Apr-2016 |
Teresa Johnson <tejohnson@google.com> |
Address comments.
llvm-svn: 267274
|
#
37687f39 |
| 23-Apr-2016 |
Teresa Johnson <tejohnson@google.com> |
Refactor bitcode writer into classes (NFC)
Summary: As discussed in on the mailing list yesterday, I have refactored BitcodeWriter.cpp to use classes to manage the bitcode writing process, instead o
Refactor bitcode writer into classes (NFC)
Summary: As discussed in on the mailing list yesterday, I have refactored BitcodeWriter.cpp to use classes to manage the bitcode writing process, instead of passing around long lists of parameters between static functions. See: http://lists.llvm.org/pipermail/llvm-dev/2016-April/098610.html
I created a parent BitcodeWriter class to own the BitstreamWriter, write the header, and contain the main entry point into the writing process. There are two derived classes, one for writing a module and one for writing a combined index file (for ThinLTO), which manage the writing process specific to those bitcode file types.
I also changed the functions to conform to LLVM coding standards (lowercase function name first letter). The only two routines that still start with an uppercase letter are the two external interfaces, which can be fixed as a follow-on (I wanted to keep this round just within BitcodeWriter.cpp).
Reviewers: dexonsmith, joker.eph
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D19447
llvm-svn: 267273
show more ...
|
#
b35cc691 |
| 20-Apr-2016 |
Teresa Johnson <tejohnson@google.com> |
[ThinLTO] Prevent importing of "llvm.used" values
Summary: This patch prevents importing from (and therefore exporting from) any module with a "llvm.used" local value. Local values need to be promot
[ThinLTO] Prevent importing of "llvm.used" values
Summary: This patch prevents importing from (and therefore exporting from) any module with a "llvm.used" local value. Local values need to be promoted and renamed when importing, and their presense on the llvm.used variable indicates that there are opaque uses that won't see the rename. One such example is a use in inline assembly.
See also the discussion at: http://lists.llvm.org/pipermail/llvm-dev/2016-April/098047.html
As part of this, move collectUsedGlobalVariables out of Transforms/Utils and into IR/Module so that it can be used more widely. There are several other places in LLVM that used copies of this code that can be cleaned up as a follow on NFC patch.
Reviewers: joker.eph
Subscribers: pcc, llvm-commits, joker.eph
Differential Revision: http://reviews.llvm.org/D18986
llvm-svn: 266877
show more ...
|
#
b550cb17 |
| 18-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
[NFC] Header cleanup
Removed some unused headers, replaced some headers with forward class declarations.
Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedM
[NFC] Header cleanup
Removed some unused headers, replaced some headers with forward class declarations.
Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap'
Patch by Eugene Kosov <claprix@yandex.ru>
Differential Revision: http://reviews.llvm.org/D19219
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266595
show more ...
|
#
2d28f7aa |
| 16-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
ThinLTO: Make aliases explicit in the summary
To be able to work accurately on the reference graph when taking decision about internalizing, promoting, renaming, etc. We need to have the alias infor
ThinLTO: Make aliases explicit in the summary
To be able to work accurately on the reference graph when taking decision about internalizing, promoting, renaming, etc. We need to have the alias information explicit.
Differential Revision: http://reviews.llvm.org/D18836
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266517
show more ...
|
#
75819aed |
| 15-Apr-2016 |
Adrian Prantl <aprantl@apple.com> |
[PR27284] Reverse the ownership between DICompileUnit and DISubprogram.
Currently each Function points to a DISubprogram and DISubprogram has a scope field. For member functions the scope is a DICom
[PR27284] Reverse the ownership between DICompileUnit and DISubprogram.
Currently each Function points to a DISubprogram and DISubprogram has a scope field. For member functions the scope is a DICompositeType. DIScopes point to the DICompileUnit to facilitate type uniquing.
Distinct DISubprograms (with isDefinition: true) are not part of the type hierarchy and cannot be uniqued. This change removes the subprograms list from DICompileUnit and instead adds a pointer to the owning compile unit to distinct DISubprograms. This would make it easy for ThinLTO to strip unneeded DISubprograms and their transitively referenced debug info.
Motivation ----------
Materializing DISubprograms is currently the most expensive operation when doing a ThinLTO build of clang.
We want the DISubprogram to be stored in a separate Bitcode block (or the same block as the function body) so we can avoid having to expensively deserialize all DISubprograms together with the global metadata. If a function has been inlined into another subprogram we need to store a reference the block containing the inlined subprogram.
Attached to https://llvm.org/bugs/show_bug.cgi?id=27284 is a python script that updates LLVM IR testcases to the new format.
http://reviews.llvm.org/D19034 <rdar://problem/25256815>
llvm-svn: 266446
show more ...
|
#
b5b28933 |
| 13-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
Revert "Make aliases explicit in the summary"
Inadvertently commited...
This reverts commit e618ec93786d99df2ddf280ad2d5e02f5516cecf.
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266215
|
#
ce744a95 |
| 13-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
Make aliases explicit in the summary
Summary: To be able to work accurately on the reference graph when taking decision about internalizing, promoting, renaming, etc. We need to have the alias infor
Make aliases explicit in the summary
Summary: To be able to work accurately on the reference graph when taking decision about internalizing, promoting, renaming, etc. We need to have the alias information explicit.
Reviewers: tejohnson
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D18836
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266214
show more ...
|
#
278199f6 |
| 12-Apr-2016 |
George Burgess IV <george.burgess.iv@gmail.com> |
Add the allocsize attribute to LLVM.
`allocsize` is a function attribute that allows users to request that LLVM treat arbitrary functions as allocation functions.
This patch makes LLVM accept the `
Add the allocsize attribute to LLVM.
`allocsize` is a function attribute that allows users to request that LLVM treat arbitrary functions as allocation functions.
This patch makes LLVM accept the `allocsize` attribute, and makes `@llvm.objectsize` recognize said attribute.
The review for this was split into two patches for ease of reviewing: D18974 and D14933. As promised on the revisions, I'm landing both patches as a single commit.
Differential Revision: http://reviews.llvm.org/D14933
llvm-svn: 266032
show more ...
|
#
2d5487cf |
| 11-Apr-2016 |
Teresa Johnson <tejohnson@google.com> |
[ThinLTO] Move summary computation from BitcodeWriter to new pass
Summary: This is the first step in also serializing the index out to LLVM assembly.
The per-module summary written to bitcode is mo
[ThinLTO] Move summary computation from BitcodeWriter to new pass
Summary: This is the first step in also serializing the index out to LLVM assembly.
The per-module summary written to bitcode is moved out of the bitcode writer and to a new analysis pass (ModuleSummaryIndexWrapperPass). The pass itself uses a new builder class to compute index, and the builder class is used directly in places where we don't have a pass manager (e.g. llvm-as).
Because we are computing summaries outside of the bitcode writer, we no longer can use value ids created by the bitcode writer's ValueEnumerator. This required changing the reference graph edge type to use a new ValueInfo class holding a union between a GUID (combined index) and Value* (permodule index). The Value* are converted to the appropriate value ID during bitcode writing.
Also, this enables removal of the BitWriter library's dependence on the Analysis library that was previously required for the summary computation.
Reviewers: joker.eph
Subscribers: joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D18763
llvm-svn: 265941
show more ...
|
#
4a9a1816 |
| 07-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
Rename parameter I to Index for WriteCombinedGlobalValueSummary() (NFC)
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265729
|
#
a1feff70 |
| 07-Apr-2016 |
Dmitry Polukhin <dmitry.polukhin@gmail.com> |
[GCC] Attribute ifunc support in llvm
This patch add support for GCC attribute((ifunc("resolver"))) for targets that use ELF as object file format. In general ifunc is a special kind of function ali
[GCC] Attribute ifunc support in llvm
This patch add support for GCC attribute((ifunc("resolver"))) for targets that use ELF as object file format. In general ifunc is a special kind of function alias with type @gnu_indirect_function. Patch for Clang http://reviews.llvm.org/D15524
Differential Revision: http://reviews.llvm.org/D15525
llvm-svn: 265667
show more ...
|
#
800f87a8 |
| 06-Apr-2016 |
JF Bastien <jfb@google.com> |
NFC: make AtomicOrdering an enum class
Summary: In the context of http://wg21.link/lwg2445 C++ uses the concept of 'stronger' ordering but doesn't define it properly. This should be fixed in C++17 b
NFC: make AtomicOrdering an enum class
Summary: In the context of http://wg21.link/lwg2445 C++ uses the concept of 'stronger' ordering but doesn't define it properly. This should be fixed in C++17 barring a small question that's still open.
The code currently plays fast and loose with the AtomicOrdering enum. Using an enum class is one step towards tightening things. I later also want to tighten related enums, such as clang's AtomicOrderingKind (which should be shared with LLVM as a 'C++ ABI' enum).
This change touches a few lines of code which can be improved later, I'd like to keep it as NFC for now as it's already quite complex. I have related changes for clang.
As a follow-up I'll add: bool operator<(AtomicOrdering, AtomicOrdering) = delete; bool operator>(AtomicOrdering, AtomicOrdering) = delete; bool operator<=(AtomicOrdering, AtomicOrdering) = delete; bool operator>=(AtomicOrdering, AtomicOrdering) = delete; This is separate so that clang and LLVM changes don't need to be in sync.
Reviewers: jyknight, reames
Subscribers: jyknight, llvm-commits
Differential Revision: http://reviews.llvm.org/D18775
llvm-svn: 265602
show more ...
|
#
1de3c7e7 |
| 05-Apr-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
IR: Introduce ConstantAggregate, NFC
Add a common parent class for ConstantArray, ConstantVector, and ConstantStruct called ConstantAggregate. These are the aggregate subclasses of Constant that ta
IR: Introduce ConstantAggregate, NFC
Add a common parent class for ConstantArray, ConstantVector, and ConstantStruct called ConstantAggregate. These are the aggregate subclasses of Constant that take operands.
This is mainly a cleanup, adding common `isa` target and removing duplicated code. However, it also simplifies caching which constants point transitively at `GlobalValue` (a possible future direction).
llvm-svn: 265466
show more ...
|
#
8958c404 |
| 02-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
Rename FunctionIndex into GlobalValueIndex to reflect the recent changes (NFC)
The index used to contain only Function, but now contains GlobalValue in general.
From: Mehdi Amini <mehdi.amini@apple
Rename FunctionIndex into GlobalValueIndex to reflect the recent changes (NFC)
The index used to contain only Function, but now contains GlobalValue in general.
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265230
show more ...
|