#
520f8542 |
| 02-Apr-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
Bitcode: Try to emit metadata in function blocks
Whenever metadata is only referenced by a single function, emit the metadata just in that function block. This should improve lazy-loading by reduci
Bitcode: Try to emit metadata in function blocks
Whenever metadata is only referenced by a single function, emit the metadata just in that function block. This should improve lazy-loading by reducing the amount of metadata in the global block.
For now, this should catch all DILocations, and anything else that happens to be referenced only by a single function.
It's also a first step toward a couple of possible future directions (which this commit does *not* implement):
1. Some debug info metadata is only referenced from compile units and individual functions. If we can drop the link from the compile unit, this optimization will get more powerful.
2. Any uniqued metadata that isn't referenced globally can in theory be emitted in every function block that references it (trading off bitcode size and full-parse time vs. lazy-load time).
Note: this assumes the new BitcodeReader error checking from r265223. The metadata stored in function blocks gets purged after parsing each function, which means unresolved forward references will get lost. Since all the global metadata should have already been resolved by the time we get to the function metadata blocks we just need to check for that case. (If for some reason we need to handle bitcode that fails the checks in r265223, the fix is to store about-to-be-dropped unresolved nodes in MetadataList::shrinkTo until they can be handled succesfully by a future call to MetadataList::tryToResolveCycles.)
llvm-svn: 265226
show more ...
|
#
9342911f |
| 02-Apr-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
BitcodeWriter: Further unify function metadata, NFC
Further unify the handling of function-local metadata with global metadata, by exposing the same interface in ValueEnumerator. Both contexts use
BitcodeWriter: Further unify function metadata, NFC
Further unify the handling of function-local metadata with global metadata, by exposing the same interface in ValueEnumerator. Both contexts use the same accessors:
- getMDStrings(): get the strings for this block. - getNonMDStrings(): get the non-strings for this block.
A future commit will start adding strings to the function-block.
llvm-svn: 265224
show more ...
|
#
1e5fddda |
| 02-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
Reverts r265219.
Unintentionally commited... time to call the day off!
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265221
|
#
5921a3ae |
| 02-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
wip
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265219
|
#
ad5741b0 |
| 02-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
Create a typedef GlobalValue::GUID for uint64_t and RAUW (NFC)
Summary: This should make the code more readable, especially all the map declarations.
Reviewers: tejohnson
Subscribers: llvm-commit
Create a typedef GlobalValue::GUID for uint64_t and RAUW (NFC)
Summary: This should make the code more readable, especially all the map declarations.
Reviewers: tejohnson
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D18721
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265215
show more ...
|
#
9bfd0d03 |
| 01-Apr-2016 |
Manman Ren <manman.ren@gmail.com> |
Swift Calling Convention: add swifterror attribute.
A ``swifterror`` attribute can be applied to a function parameter or an AllocaInst.
This commit does not include any target-specific change. The
Swift Calling Convention: add swifterror attribute.
A ``swifterror`` attribute can be applied to a function parameter or an AllocaInst.
This commit does not include any target-specific change. The target-specific optimization will come as a follow-up patch.
Differential Revision: http://reviews.llvm.org/D18092
llvm-svn: 265189
show more ...
|
#
d7ad221c |
| 01-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
Add a module Hash in the bitcode and the combined index, implementing a kind of "build-id"
This is intended to be used for ThinLTO incremental build.
Differential Revision: http://reviews.llvm.org/
Add a module Hash in the bitcode and the combined index, implementing a kind of "build-id"
This is intended to be used for ThinLTO incremental build.
Differential Revision: http://reviews.llvm.org/D18213
This is a recommit of r265095 after fixing the Windows issues.
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265111
show more ...
|
#
85fb9e05 |
| 01-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
Revert "Add support for computing SHA1 in LLVM"
This reverts commit r265096, r265095, and r265094. Windows build is broken, and the validation does not pass.
From: Mehdi Amini <mehdi.amini@apple.co
Revert "Add support for computing SHA1 in LLVM"
This reverts commit r265096, r265095, and r265094. Windows build is broken, and the validation does not pass.
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265102
show more ...
|
#
4c2ed333 |
| 01-Apr-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
Add a module Hash in the bitcode and the combined index, implementing a kind of "build-id"
This is intended to be used for ThinLTO incremental build.
Differential Revision: http://reviews.llvm.org/
Add a module Hash in the bitcode and the combined index, implementing a kind of "build-id"
This is intended to be used for ThinLTO incremental build.
Differential Revision: http://reviews.llvm.org/D18213
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265095
show more ...
|
#
f46262e0 |
| 29-Mar-2016 |
Manman Ren <manman.ren@gmail.com> |
Swift Calling Convention: add swiftself attribute.
Differential Revision: http://reviews.llvm.org/D17866
llvm-svn: 264754
|
#
b42fa2e5 |
| 27-Mar-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
BitcodeWriter: Reuse writeMetadataRecords, NFC
Change writeFunctionMetadata to call writeMetadataRecords. For now there's no functionality change, but makes it easy to serialize other types of meta
BitcodeWriter: Reuse writeMetadataRecords, NFC
Change writeFunctionMetadata to call writeMetadataRecords. For now there's no functionality change, but makes it easy to serialize other types of metadata in the function block in the future.
llvm-svn: 264557
show more ...
|
#
cffd8cb9 |
| 27-Mar-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
BitcodeWriter: Rename some functions for consistency, NFC
To match writeMetadataRecords, writeNamedMetadata and writeMetadataStrings, change:
WriteModuleMetadata => writeModuleMetadata
BitcodeWriter: Rename some functions for consistency, NFC
To match writeMetadataRecords, writeNamedMetadata and writeMetadataStrings, change:
WriteModuleMetadata => writeModuleMetadata WriteFunctionLocalMetadata => writeFunctionMetadata Write##CLASS => write##CLASS
The only major change is "FunctionLocal" => "Function". The point is to be less specific, in preparation for emitting normal metadata records inside function metadata blocks (currently we only emit `LocalAsMetadata` there).
llvm-svn: 264556
show more ...
|
#
80d153f6 |
| 27-Mar-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
BitcodeWriter: Split out writeMetadataRecords, NFC
Besides being a nice cleanup, this is preparation for reusing the code in function metadata blocks.
llvm-svn: 264555
|
#
5465f0ad |
| 27-Mar-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
BitcodeWriter: Restructure WriteFunctionLocalMetadata, NFC
Use an early return to simplify logic.
llvm-svn: 264554
|
#
2766e4d4 |
| 27-Mar-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
BitcodeWriter: Simplify tracking of function-local metadata, NFC
We don't really need a separate vector here; instead, point at a range inside the main MDs array. This matches how r264551 reference
BitcodeWriter: Simplify tracking of function-local metadata, NFC
We don't really need a separate vector here; instead, point at a range inside the main MDs array. This matches how r264551 references the ranges of strings and non-strings.
llvm-svn: 264552
show more ...
|
#
6565a0d4 |
| 27-Mar-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
Reapply ~"Bitcode: Collect all MDString records into a single blob"
Spiritually reapply commit r264409 (reverted in r264410), albeit with a bit of a redesign.
Firstly, avoid splitting the big blob
Reapply ~"Bitcode: Collect all MDString records into a single blob"
Spiritually reapply commit r264409 (reverted in r264410), albeit with a bit of a redesign.
Firstly, avoid splitting the big blob into multiple chunks of strings.
r264409 imposed an arbitrary limit to avoid a massive allocation on the shared 'Record' SmallVector. The bug with that commit only reproduced when there were more than "chunk-size" strings. A test for this would have been useless long-term, since we're liable to adjust the chunk-size in the future.
Thus, eliminate the motivation for chunk-ing by storing the string sizes in the blob. Here's the layout:
vbr6: # of strings vbr6: offset-to-blob blob: [vbr6]: string lengths [char]: concatenated strings
Secondly, make the output of llvm-bcanalyzer readable.
I noticed when debugging r264409 that llvm-bcanalyzer was outputting a massive blob all in one line. Past a small number, the strings were impossible to split in my head, and the lines were way too long. This version adds support in llvm-bcanalyzer for pretty-printing.
<STRINGS abbrevid=4 op0=3 op1=9/> num-strings = 3 { 'abc' 'def' 'ghi' }
From the original commit:
Inspired by Mehdi's similar patch, http://reviews.llvm.org/D18342, this should (a) slightly reduce bitcode size, since there is less record overhead, and (b) greatly improve reading speed, since blobs are super cheap to deserialize.
llvm-svn: 264551
show more ...
|
#
385cf288 |
| 26-Mar-2016 |
Mehdi Amini <mehdi.amini@apple.com> |
Rename ModuleSummaryIndex::modPathStringEntries() into modulePaths()
It now return the map instead of an iterator.
From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 264489
|
#
aae26100 |
| 25-Mar-2016 |
Teresa Johnson <tejohnson@google.com> |
[ThinLTO] Rename edges() to calls() for clarity (NFC)
Helps distinguish from refs() which iterates over non-call references.
llvm-svn: 264445
|
#
fc811004 |
| 25-Mar-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
Revert "Bitcode: Collect all MDString records into a single blob"
This reverts commit r264409 since it failed to bootstrap: http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build/8302/
Revert "Bitcode: Collect all MDString records into a single blob"
This reverts commit r264409 since it failed to bootstrap: http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build/8302/
llvm-svn: 264410
show more ...
|
#
fdbf0a5a |
| 25-Mar-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
Bitcode: Collect all MDString records into a single blob
Optimize output of MDStrings in bitcode. This emits them in big blocks (currently 1024) in a pair of records: - BULK_STRING_SIZES: the siz
Bitcode: Collect all MDString records into a single blob
Optimize output of MDStrings in bitcode. This emits them in big blocks (currently 1024) in a pair of records: - BULK_STRING_SIZES: the sizes of the strings in the block, and - BULK_STRING_DATA: a single blob, which is the concatenation of all the strings.
Inspired by Mehdi's similar patch, http://reviews.llvm.org/D18342, this should (a) slightly reduce bitcode size, since there is less record overhead, and (b) greatly improve reading speed, since blobs are super cheap to deserialize.
I needed to add support for blobs to streaming input to get the test suite passing. - StreamingMemoryObject::getPointer reads ahead and returns the address of the blob. - To avoid a possible reallocation of StreamingMemoryObject::Bytes, BitstreamCursor::readRecord needs to move the call to JumpToEnd forward so that getPointer is the last bitstream operation.
llvm-svn: 264409
show more ...
|
#
68f56243 |
| 25-Mar-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
Bitcode: Stop using MODULE_CODE_METADATA_VALUES
The motivation for MODULE_CODE_METADATA_VALUES was to enable an -flto=thin scheme where:
1. First, one function is cherry-picked from a bitcode file
Bitcode: Stop using MODULE_CODE_METADATA_VALUES
The motivation for MODULE_CODE_METADATA_VALUES was to enable an -flto=thin scheme where:
1. First, one function is cherry-picked from a bitcode file. 2. Later, another function is cherry-picked. 3. Later, ... 4. Finally, the metadata needed by all the previous functions is loaded.
This was abandoned in favour of:
1. Calculate the superset of functions needed from a Module. 2. Link all functions at once.
Delayed metadata reading no longer serves a purpose. It also adds a few complication, since we can't count on metadata being properly parsed when exiting the BitcodeReader. After discussing with Teresa, we agreed to remove it.
The code that depended on this was removed/updated in r264326.
llvm-svn: 264378
show more ...
|
#
a5e25a55 |
| 24-Mar-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
BitcodeWriter: Move abbreviation for GenericDINode; almost NFC
Simplify ValueEnumerator and WriteModuleMetadata by shifting the logic for the METADATA_GENERIC_DEBUG abbreviation into WriteGenericDIN
BitcodeWriter: Move abbreviation for GenericDINode; almost NFC
Simplify ValueEnumerator and WriteModuleMetadata by shifting the logic for the METADATA_GENERIC_DEBUG abbreviation into WriteGenericDINode. (This is just like r264302, but for GenericDINode.)
The only change is that the abbreviation is emitted later in the bitcode, just before the first `GenericDINode` record. This shouldn't be observable though.
llvm-svn: 264303
show more ...
|
#
625fda27 |
| 24-Mar-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
BitcodeWriter: Move abbreviation for DILocation; almost NFC
Simplify ValueEnumerator and WriteModuleMetadata by shifting the logic for the METADATA_LOCATION abbreviation into WriteDILocation.
The o
BitcodeWriter: Move abbreviation for DILocation; almost NFC
Simplify ValueEnumerator and WriteModuleMetadata by shifting the logic for the METADATA_LOCATION abbreviation into WriteDILocation.
The only change is that the abbreviation is emitted later in the bitcode, just before the first `DILocation` record. This shouldn't be observable though.
llvm-svn: 264302
show more ...
|
#
f8ecdf52 |
| 24-Mar-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
BitcodeWriter: Split out named metadata; almost NFC
Split writeNamedMetadata out of WriteModuleMetadata to write named metadata, and createNamedMetadataAbbrev for the abbreviation.
There should be
BitcodeWriter: Split out named metadata; almost NFC
Split writeNamedMetadata out of WriteModuleMetadata to write named metadata, and createNamedMetadataAbbrev for the abbreviation.
There should be no effective functionality change, although the layout of the bitcode will change. Previously, the abbreviation was emitted at the top of the block, but now it is delayed until immediately before the named metadata records are emitted.
llvm-svn: 264301
show more ...
|
#
0b7243ee |
| 24-Mar-2016 |
Duncan P. N. Exon Smith <dexonsmith@apple.com> |
Bitcode: Module* -> Module&, NFC
llvm-svn: 264299
|