summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* [llvm-readobj/llvm-readelf] - Improve dumping of versioning sections.Georgii Rymar2019-11-205-44/+167
| | | | | | | | | | | | | Our elf-versioninfo.test is not perfect. It does not properly test how flags are dumped and also we have a bug: they are dumped as enums in LLVM style now, i.e not dumped properly. GNU style uses a `versionFlagToString` method to build a string from flags which seems is consistent with GNU readelf. In this patch I fixed the issues mentioned. Differential revision: https://reviews.llvm.org/D70399
* Introduce llvm-install-name-toolAlexander Shaposhnikov2019-11-195-0/+212
| | | | | | | | | | This diff adds a new "driver" for llvm-objcopy which is supposed to emulate the behavior of install-name-tool. This is a recommit of b5913e6 with ubsan, test dependencies issues fixed. Differential revision: https://reviews.llvm.org/D69146 Test plan: make check-all
* Revert "Introduce llvm-install-name-tool"Alexander Shaposhnikov2019-11-195-212/+0
| | | | | This temporarily reverts the commit 88f00aef684ff84a6494e1f17d5466c5678f703d. The change broke the buildbot http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/36836
* Introduce llvm-install-name-toolAlexander Shaposhnikov2019-11-195-0/+212
| | | | | | | | | | This diff adds a new "driver" for llvm-objcopy which is supposed to emulate the behavior of install-name-tool. This is a recommit of b5913e6d2 with ubsan issues fixed. Differential revision: https://reviews.llvm.org/D69146 Test plan: make check-all
* implement printing out raw section data of xcoff objectfile for llvm-objdumpdiggerlin2019-11-192-0/+90
| | | | | | | | | | | SUMMARY: implement printing out raw section data of xcoff objectfile for llvm-objdump and option -D --disassemble-all option for llvm-objdump Reviewers: Sean Fertile Subscribers: rupprecht, seiyai,hiraditya Differential Revision: https://reviews.llvm.org/D70255
* [llvm-objdump] Print relocation addends in hexadecimalDavid Bozier2019-11-195-10/+116
| | | | | | | | | | | | | | Summary: Matches GNU objdump. Makes debugging easier for me as I'm working out addresses from symbol+addend, so it would be good to be calculating in a single format. Reviewers: MaskRay, grimar, jhenderson, bd1976llvm Reviewed By: jhenderson Subscribers: sdardis, jrtc27, atanasyan, rupprecht, seiya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69997
* Revert "implement printing out raw section data of xcoff objectfile for ↵Leonard Chan2019-11-182-90/+0
| | | | | | | | llvm-objdump" This reverts commit 8f8a9f3437d4517f674395da30edb59d5514f7bc. Reverting since this patch seems to break a lot of llvm buildbots.
* [llvm-cxxfilt] Improve strip-underscore behaviorSteven Wu2019-11-1810-11/+15
| | | | | | | | | | | | | | | | | | | | Summary: For platform that uses macho format, c++filt should be stripping the leading underscore by default. Introduce the binutil compatible "-n" option to control strip-undercore behaivor together with the existing "-_" option and fallback to system default if none of them are set. rdar://problem/57173514 Reviewers: compnerd, erik.pilkington, dexonsmith, mattd Reviewed By: compnerd, erik.pilkington Subscribers: jkorous, ributzka, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70250
* implement printing out raw section data of xcoff objectfile for llvm-objdumpdiggerlin2019-11-182-0/+90
| | | | | | | | | | | SUMMARY: implement printing out raw section data of xcoff objectfile for llvm-objdump and option -D --disassemble-all option for llvm-objdump Reviewers: Sean Fertile Subscribers: rupprecht, seiyai,hiraditya Differential Revision: https://reviews.llvm.org/D70255
* [yaml2obj][test] Move tests to binary format specific subdirectoriesFangrui Song2019-11-1886-102/+93
| | | | | | | | | | | | | | | | | | Create COFF/, ELF/, and Minidump and move tests there. Also * Rename `*.test` to `*.yaml` * For yaml2obj RUN lines, use `-o %t` instead of `> %t` for consistency. We still have tests that check stdout is the default output, e.g. multi-doc.test * Update tests to consistently use `##` for comments. `#` is for RUN and CHECK lines. * Merge symboless-relocation.yaml and invalid-symboless-relocation.yaml to ELF/relocation-implicit-symbol-index.test Reviewed By: grimar, jhenderson Differential Revision: https://reviews.llvm.org/D70264
* [NFC] Clean up debug-names-verify-completeness.s testPavel Labath2019-11-181-179/+157
| | | | | | | This patch replaces the tabs by spaces and avoid the need for a debug_str section by moving all strings inline. It also removes the hardcoded DIE offsets in the test, which will simplify a follow-up patch.
* [llvm-objcopy][MachO] Implement --redefine-sym and --redefine-symsFangrui Song2019-11-151-0/+51
| | | | | | | | | | Similar to D46029 (ELF) and D70036 (COFF), but for MachO. Note, when --strip-symbol (not implemented for MachO) is also specified, --redefine-sym executes before --strip-symbol. Reviewed By: jhenderson, seiya Differential Revision: https://reviews.llvm.org/D70212
* [DebugInfo] Allow spill slots in call site parameter descriptionsVedant Kumar2019-11-151-0/+0
| | | | | | | | | | | | | | | | | | | | | | Allow call site paramter descriptions to reference spill slots. Spill slots are not visible to high-level LLVM IR, so they can safely be referenced during entry value evaluation (as they cannot be clobbered by some other function). This gives a 5% increase in the number of call site parameter DIEs in an LTO x86_64 build of the xnu kernel. This reverts commit eb4c98ca3d2590bad9f6542afbf3a7824d2b53fa ( [DebugInfo] Exclude memory location values as parameter entry values), effectively reintroducing the portion of D60716 which dealt with memory locations (authored by Djordje, Nikola, Ananth, and Ivan). This partially addresses llvm.org/PR43343. However, not all memory operands forwarded to callees live in spill slots. In the xnu build, it may be possible to use an escape analysis to increase the number of call site parameter by another 15% (more details in PR43343). Differential Revision: https://reviews.llvm.org/D70254
* [llvm-objcopy][NFC] Use generated object file in COFF/add-section.testSergey Dmitriev2019-11-153-13/+6
| | | | | | Updated LIT test from D70205 to use generated object file with extended relocation table. Differential Revision: https://reviews.llvm.org/D70269
* DWARFDebugLoc(v4): Add an incremental parsing functionPavel Labath2019-11-157-25/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This adds a visitLocationList function to the DWARF v4 location lists, similar to what already exists for DWARF v5. It follows the approach outlined in previous patches (D69672), where the parsed form is always stored in the DWARF v5 format, which makes it easier for generic code to be built on top of that. v4 location lists are "upgraded" during parsing, and then this upgrade is undone while dumping. Both "inline" and section-based dumping is rewritten to reuse the existing "generic" location list dumper. This means that the output format is consistent for all location lists (the only thing one needs to implement is the function which prints the "raw" form of a location list), and that debug_loc dumping correctly processes base address selection entries, etc. The previous existing debug_loc functionality (e.g., parseOneLocationList) is rewritten on top of the new API, but it is not removed as there is still code which uses them. This will be done in follow-up patches, after I build the API to access the "interpreted" location lists in a generic way (as that is what those users really want). Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69847
* [llvm-objcopy][MachO] Implement --remove-sectionSeiya Nuta2019-11-151-0/+127
| | | | | | | | | | | | Reviewers: alexshap, rupprecht, jhenderson Reviewed By: rupprecht, jhenderson Subscribers: jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66282
* [yaml2obj][COFF] Add support for extended relocation tablesSergey Dmitriev2019-11-141-0/+71
| | | | | | | | | | | | | | | | | Summary: The tool does not correctly handle COFF sections with extended relocation tables (with IMAGE_SCN_LNK_NRELOC_OVFL bit set), this patch fixes this problem. But I have cheated a bit in the test (to make it smaller) because extended relocation table is supposed to be used when the number of relocations exceeds 65534. Otherwise the test size would be pretty big. Reviewers: jhenderson, MaskRay, mstorsjo Reviewed By: mstorsjo Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70251
* [llvm-objcopy][COFF] Add support for extended relocation tablesSergey Dmitriev2019-11-142-0/+32
| | | | | | | | | | | | | | Summary: This patch adds support for COFF objects with extended relocation tables to the llvm-objcopy tool. Reviewers: jhenderson, MaskRay, mstorsjo, alexshap, rupprecht Reviewed By: mstorsjo Subscribers: jakehehrlich, abrachet, seiya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70205
* DWARFDebugLoclists: stricter base address handlingPavel Labath2019-11-142-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This removes the use of zero as a base address in section-based dumping. Although this will often be true for (unlinked) object files with a single compile unit, it is not true in general. This means that section-based dumping will not be able to resolve entries referencing the base address (DW_LLE_offset_pair) -- it wasn't able to do that correctly before either, but now it will be more explicit about it. One exception to that is if the location list contains an explicit DW_LLE_base_address entry -- in this case the dumper will pick it up, and resolve subsequent entries normally. The patch also removes the fallback to zero in the "inline" dumping in case the compile unit does not contain a base address. Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70115
* [dsymutil] Add -dump to llvm-bcanalyzer invocationsFrancis Visoiu Mistrih2019-11-132-4/+4
|
* [llvm-objcopy][COFF] Implement --redefine-sym and --redefine-symsFangrui Song2019-11-123-15/+106
| | | | | | | | | | | | | The parsing error tests in ELF/redefine-symbols.test are not specific to ELF. Move them to redefine-symbols.test. Add COFF/redefine-symbols.test for COFF specific tests. Also fix the documentation regarding --redefine-syms: the old and new names are separated by whitespace, not an equals sign. Reviewed By: mstorsjo Differential Revision: https://reviews.llvm.org/D70036
* DWARFDebugLoclists: add location list "interpretation" logicPavel Labath2019-11-123-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch extracts the logic for computing the "absolute" locations, which was partially present in the debug_loclists dumper, completes it, and moves it into a separate function. This makes it possible to later reuse the same logic for uses other than dumping. The dumper is changed to reuse the location list interpreter, and its format is changed somewhat. In "verbose" mode it prints the "raw" value of a location list, the interpreted location (if available) and the expression itself. In non-verbose mode it prints only one of the location forms: it prefers the interpreted form, but falls back to the "raw" format if interpretation is not possible (for instance, because we were not given a base address, or the resolution of indirect addresses failed). This patch also undos some of the changes made in D69672, namely the part about making all functions static. The main reason for this is that I learned that the original approach (dumping only fully resolved locations) meant that it was impossible to rewrite one of the existing tests. To make that possible (and make the "inline location" dump work in more cases), I now reuse the same dumping mechanism as is used for section-based dumping. As this required having more objects know about the various location lists classes, it seemed like a good idea to create an interface abstracting the difference between them. Therefore, I now create a DWARFLocationTable class, which will serve as a base class for the location list classes. DWARFDebugLoclists is made to inherit from that. DWARFDebugLoc will follow. Another positive effect of this change is that section-based dumping code will not need to use templates (as originally) envisioned, and that the argument lists of the dumping functions become shorter. Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D70081
* [llvm-readelf/llvm-readobj][test] - Convert elf-linker-options.ll to use YAML.Georgii Rymar2019-11-122-12/+30
| | | | | | | | | This converts elf-linker-options.ll to use yaml2obj instead of llc, improves and cleanups it a bit. This opens a road to add an additional tests for checking the broken cases. Differential revision: https://reviews.llvm.org/D70004
* [yaml2obj/obj2yaml] - Add support for SHT_LLVM_LINKER_OPTIONS sections.Georgii Rymar2019-11-122-0/+189
| | | | | | | SHT_LLVM_LINKER_OPTIONS section contains pairs of null-terminated strings. This patch adds support for them. Differential revision: https://reviews.llvm.org/D69895
* [yaml2obj] - Add a way to describe the custom data that is not part of an ↵Georgii Rymar2019-11-113-5/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | output section. Currently there is no way to describe the data that is not a part of an output section. It can be a data used to align sections or to fill the gaps with something, or another kind of custom data. In this patch I suggest a way to describe it. It looks like that: ``` Sections: - Type: CustomFiller Pattern: "CCDD" Size: 4 - Name: .bar Type: SHT_PROGBITS Content: "FF" ``` I.e. I've added a kind of synthetic section with a synthetic type "CustomFiller". In the code it is called a "SyntheticFiller", which is "a synthetic section which might be used to write the custom data around regular output sections. It does not present in the sections header table, but it might affect the output file size and program headers produced. Think about it as about piece of data." `SyntheticFiller` currently has a `Pattern` field and a `Size` field + an optional `Name`. When written, `Size` of bytes in the output will be filled with a `Pattern`. It is possible to reference a named filler it by name from the program headers description, just like any other normal section. Differential revision: https://reviews.llvm.org/D69709
* Revert "Fixed a profdata file size detection on Windows system."Vladimir Vereschaka2019-11-101-1/+1
| | | | | | | | | | This reverts commit bcbb121ff6c8440382abfce8f2911a095f14602b. Using 'ls -o' is not compatible way to fix the problem. FreeBSD and OSX version of 'ls' do not support -o flag and test gets failed on these platforms. Differential Revision: https://reviews.llvm.org/D69317
* llvm-ranlib/nm: Don't print usage message except for usage errorsSam Clegg2019-11-083-0/+18
| | | | | | | Also, fix a bug in ranlib where it didn't correctly detect being run without any argument and would try to operate on the empty string. Differential Revision: https://reviews.llvm.org/D70021
* [llvm-xray] Add basic test for AArch64 supportShoaib Meenai2019-11-082-0/+173
| | | | Based on a test provided by Ian Levesque <ianlevesque@fb.com>.
* [llvm-ar] Support verbose mode for operation 'x'Fangrui Song2019-11-071-3/+12
| | | | | | Reviewed By: jhenderson, kongyi Differential Revision: https://reviews.llvm.org/D69911
* [ThinLTO] Import readonly vars with refsevgeny2019-11-071-1/+1
| | | | | | Patch allows importing declarations of functions and variables, referenced by the initializer of some other readonly variable. Differential revision: https://reviews.llvm.org/D69561
* [llvm-readobj] - Simplify elf-hash-symbols.test. NFCI.Georgii Rymar2019-11-071-10/+24
| | | | | | | | It converts binary contents of .hash and .gnu.hash that were generated by a linker to YAML descriptions. I've also dropped Shift2 and BloomFilter values because they are not needed here. Differential revision: https://reviews.llvm.org/D69881
* Revert "Introduce llvm-install-name-tool"Alexander Shaposhnikov2019-11-065-212/+0
| | | | This reverts commit b5913e6d2f6d13fb753df701619731ca11936316.
* Introduce llvm-install-name-toolAlexander Shaposhnikov2019-11-065-0/+212
| | | | | | | | | This diff adds a new "driver" for llvm-objcopy which is supposed to emulate the behavior of install-name-tool. Differential revision: https://reviews.llvm.org/D69146 Test plan: make check-all
* [X86] Fix SLM v2i64 ADD/Sub/CMPEQ instruction schedulesSimon Pilgrim2019-11-062-14/+14
| | | | | | Noticed while fixing the reduction costs for D59710 - the SLM model doesn't account for the poor throughput of v2i64 ops. Numbers taken from Intel AOM (+ checked against Agner)
* [X86] Fix SLM v2f64 ADD/MUL + FP BLEND/HADD instruction schedulesSimon Pilgrim2019-11-063-43/+43
| | | | Noticed while fixing the reduction costs for D59710 - the SLM model doesn't account for the poor throughput of v2f64/v2i64 ops.
* DWARFDebugLoclists: Move to a incremental parsing modelPavel Labath2019-11-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch stems from the discussion D68270 (including some offline talks). The idea is to provide an "incremental" api for parsing location lists, which will avoid caching or materializing parsed data. An additional goal is to provide a high level location list api, which abstracts the differences between different encoding schemes, and can be used by users which don't care about those (such as LLDB). This patch implements the first part. It implements a call-back based "visitLocationList" api. This function parses a single location list, calling a user-specified callback for each entry. This is going to be the base api, which other location list functions (right now, just the dumping code) are going to be based on. Future patches will do something similar for the v4 location lists, and add a mechanism to translate raw entries into concrete address ranges. Reviewers: dblaikie, probinson, JDevlieghere, aprantl, SouraVX Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D69672
* Fixed a profdata file size detection on Windows system.Vladimir Vereschaka2019-11-051-1/+1
| | | | | | | | | | | The space symbols are allowed in the group names on Windows system (as example: Domain Users). In that case the test extracts a wrong field from the output to get a size of the profdata file. This patch avoids a printing of the group names in the test output and extracts a proper field as a file size. Differential Revision: https://reviews.llvm.org/D69317
* [llvm-objdump] Fix spurious "The end of the file was unexpectedly ↵Sid Manning2019-11-051-0/+37
| | | | | | | | | | | | | | | | | | | | | encountered" if a SHT_NOBITS sh_offset is larger than the file size llvm-objdump -D this file: int a[100000]; int main() { return 0; } Will produce an error: "The end of the file was unexpectedly encountered". This happens because of a check in Binary.h checkOffset. (Addr + Size > M.getBufferEnd()). The sh_offset and sh_size fields can be ignored for SHT_NOBITS sections. Fix the error by changing ELFObjectFile<ELFT>::getSectionContents to use the file base for SHT_NOBITS sections. Reviewed By: grimar, MaskRay Differential Revision: https://reviews.llvm.org/D69192
* [llvm-objcopy][ELF] Implement --only-keep-debugFangrui Song2019-11-052-22/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --only-keep-debug produces a debug file as the output that only preserves contents of sections useful for debugging purposes (the binutils implementation preserves SHT_NOTE and non-SHF_ALLOC sections), by changing their section types to SHT_NOBITS and rewritting file offsets. See https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html The intended use case is: ``` llvm-objcopy --only-keep-debug a a.dbg llvm-objcopy --strip-debug a b llvm-objcopy --add-gnu-debuglink=a.dbg b ``` The current layout algorithm is incapable of deleting contents and shrinking segments, so it is not suitable for implementing the functionality. This patch adds a new algorithm which assigns sh_offset to sections first, then modifies p_offset/p_filesz of program headers. It bears a resemblance to lld/ELF/Writer.cpp. Reviewed By: jhenderson, jakehehrlich Differential Revision: https://reviews.llvm.org/D67137
* DWARFDebugLoclists: Make it possible to read relocated addressesPavel Labath2019-11-051-0/+120
| | | | | | | | | | | | | | | | | Summary: Handling relocations was not needed when the loclists section was a DWO-only thing. But since DWARF5, it is possible to use it in regular objects too, and the standard permits embedding addresses into the section directly. These addresses need to be relocated in unlinked files. Reviewers: JDevlieghere, dblaikie, probinson Subscribers: aprantl, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68271
* [test] Use system locale for mri-utf8.testThomas Preud'homme2019-11-042-23/+21
| | | | | | | | | | | | | | | | | | | | | | | Summary: llvm-ar's mri-utf8.test test relies on the en_US.UTF-8 locale to be installed for its last RUN line to work. If not installed, the unicode string gets encoded (interpreted) as ascii which fails since the most significant byte is non zero. This commit changes the test to only rely on the system being able to encode the pound sign in its default encoding (e.g. UTF-16 for Microsoft Windows) by always opening the file via input/output redirection. This avoids forcing a given locale to be present and supported. A Byte Order Mark is also added to help recognizing the encoding of the file and its endianness. Finally the XFAIL on system-darwin is removed since the test actually passes fine on Mac OS X and XFAIL was only added because it failed before. Reviewers: gbreynoo, MaskRay, rupprecht, JamesNagurne, jfb Subscribers: dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68472
* [llvm-readobj] Change errors to warnings for symbol section name dumpingJames Henderson2019-11-044-21/+192
| | | | | | | | | | | | | | | Also only print each such warning once. LLVM-style output will now print "<?>" for sections it cannot identify, e.g. because the section index is invalid. GNU output continues to print the raw index. In both cases where the st_shndx value is SHN_XINDEX and the index cannot be looked up in the SHT_SYMTAB_SHNDX section (e.g. because it is missing), the symbol is printed like other symbols with st_shndx >= SHN_LORESERVE. Reviewed by: grimar, MaskRay Differential Revision: https://reviews.llvm.org/D69671
* [dsymutil] Second attempt to fix dsymutil tests on non-darwin platformsFrancis Visoiu Mistrih2019-11-011-1/+1
|
* [dsymutil] Require darwin in fat binary testFrancis Visoiu Mistrih2019-11-011-0/+2
| | | | | | | dsymutil uses lipo(1) to build the fat binary, which it invokes as a process. For that, we need to only run this test on darwin systems. Should fix: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-ubuntu/builds/181/steps/test-check-all/logs/stdio
* [dsymutil] Add support for linking remarksFrancis Visoiu Mistrih2019-11-0119-0/+101
| | | | | | | | | | | | | | | | | | | | This adds support to dsymutil for linking remark files and placing them in the final .dSYM bundle. The result will be placed in: * a.out.dSYM/Contents/Resources/Remarks/a.out or * a.out.dSYM/Contents/Resources/Remarks/a.out-<arch> for universal binaries When multi-threaded, this runs a third thread which loops over all the object files and parses remarks as it finds __remarks sections. Testing this involves running dsymutil on pre-built binaries and object files, then running llvm-bcanalyzer on the final result to check for remarks. Differential Revision: https://reviews.llvm.org/D69142
* [NFC][llvm-readobj] Split getSectionIndexName function into twoJames Henderson2019-11-011-36/+33
| | | | | | | | | | | | | | | | | | | getSectionIndexName was trying to fetch two things at once, which led to a somewhat tricky to understand interface involving passing output parameters in, and also made it hard to return Errors further up the stack. This change is in preparation for changing the error handling. Additionally, update a related test now that yaml2obj supports SHT_SYMTAB_SHNDX properly (see d3963051c490), and add missing LLVM-style coverage for symbols with shndx SHN_XINDEX. This test (after fixing) caught a mistake in my first attempt at this patch, hence I'm including it as part of this patch. Reviewed by: grimar, MaskRay Differential Revision: https://reviews.llvm.org/D69670
* [profile] Fourth fix for toolchains without zlib after D68351Vedant Kumar2019-10-311-0/+0
| | | | | Fix llvm/test/tools/llvm-profdata/nocompress.test, which I missed when authoring D68351 because my toolchain is configured with zlib support.
* [profile] Add a mode to continuously sync counter updates to a fileVedant Kumar2019-10-318-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for continuously syncing profile counter updates to a file. The motivation for this is that programs do not always exit cleanly. On iOS, for example, programs are usually killed via a signal from the OS. Running atexit() handlers after catching a signal is unreliable, so some method for progressively writing out profile data is necessary. The approach taken here is to mmap() the `__llvm_prf_cnts` section onto a raw profile. To do this, the linker must page-align the counter and data sections, and the runtime must ensure that counters are mapped to a page-aligned offset within a raw profile. Continuous mode is (for the moment) incompatible with the online merging mode. This limitation is lifted in https://reviews.llvm.org/D69586. Continuous mode is also (for the moment) incompatible with value profiling, as I'm not sure whether there is interest in this and the implementation may be tricky. As I have not been able to test extensively on non-Darwin platforms, only Darwin support is included for the moment. However, continuous mode may "just work" without modification on Linux and some UNIX-likes. AIUI the default value for the GNU linker's `--section-alignment` flag is set to the page size on many systems. This appears to be true for LLD as well, as its `no_nmagic` option is on by default. Continuous mode will not "just work" on Fuchsia or Windows, as it's not possible to mmap() a section on these platforms. There is a proposal to add a layer of indirection to the profile instrumentation to support these platforms. rdar://54210980 Differential Revision: https://reviews.llvm.org/D68351
* [mca] Fix test case (NFC)Evandro Menezes2019-10-311-6/+6
| | | | Fix test case for Darwin builds.
* [AArch64] Update for ExynosEvandro Menezes2019-10-311-0/+71
| | | | Fix the costs of `add` and `orr` with an immediate operand.
OpenPOWER on IntegriCloud