summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Rudimentary support for Doxygen \retval commandStephan Bergmann2019-08-202-0/+6
| | | | | | | | | | ...so that at least a preceding \param etc. that lacks a description gets a -Wdocumentation warning (instead of erroneously treating the \retval ... text as its paragraph). Differential Revision: https://reviews.llvm.org/D66350 llvm-svn: 369345
* [ELF][AArch64] Allow PT_LOAD to have overlapping p_offset rangesFangrui Song2019-08-2049-894/+901
| | | | | | | | | | | | | | | | | | | | | | Ported the D64906 technique to AArch64. It deletes 3 alignments at PT_LOAD boundaries for the default case: the size of an aarch64 binary decreases by at most 192kb. If `sh_addralign(.tdata) < sh_addralign(.tbss)`, we can potentially make `p_vaddr(PT_TLS)%p_align(PT_TLS) != 0`. ld.so that are known to have problems if p_vaddr%p_align!=0: * musl<=1.1.22 * FreeBSD 13.0-CURRENT (and before) rtld-elf arm64 New test aarch64-tls-vaddr-align.s checks that our workaround makes p_vaddr%p_align = 0. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D64930 llvm-svn: 369344
* [ELF][PPC] Allow PT_LOAD to have overlapping p_offset rangesFangrui Song2019-08-2035-286/+373
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change affects the non-linker script case (precisely, when the `SECTIONS` command is not used). It deletes 3 alignments at PT_LOAD boundaries for the default case: the size of a powerpc64 binary can be decreased by at most 192kb. The technique can be ported to other targets. Let me demonstrate the idea with a maxPageSize=65536 example: When assigning the address to the first output section of a new PT_LOAD, if the end p_vaddr of the previous PT_LOAD is 0x10020, we advance to the next multiple of maxPageSize: 0x20000. The new PT_LOAD will thus have p_vaddr=0x20000. Because p_offset and p_vaddr are congruent modulo maxPageSize, p_offset will be 0x20000, leaving a p_offset gap [0x10020, 0x20000) in the output. Alternatively, if we advance to 0x20020, the new PT_LOAD will have p_vaddr=0x20020. We can pick either 0x10020 or 0x20020 for p_offset! Obviously 0x10020 is the choice because it leaves no gap. At runtime, p_vaddr will be rounded down by pagesize (65536 if pagesize=maxPageSize). This PT_LOAD will load additional initial contents from p_offset ranges [0x10000,0x10020), which will also be loaded by the previous PT_LOAD. This is fine if -z noseparate-code is in effect or if we are not transiting between executable and non-executable segments. ld.bfd -z noseparate-code leverages this technique to keep output small. This patch implements the technique in lld, which is mostly effective on targets with large defaultMaxPageSize (AArch64/MIPS/PPC: 65536). The 3 removed alignments can save almost 3*65536 bytes. Two places that rely on p_vaddr%pagesize = 0 have to be updated. 1) We used to round p_memsz(PT_GNU_RELRO) up to commonPageSize (defaults to 4096 on all targets). Now p_vaddr%commonPageSize may be non-zero. The updated formula takes account of that factor. 2) Our TP offsets formulae are only correct if p_vaddr%p_align = 0. Fix them. See the updated comments in InputSection.cpp for details. On targets that we enable the technique (only PPC64 now), we can potentially make `p_vaddr(PT_TLS)%p_align(PT_TLS) != 0` if `sh_addralign(.tdata) < sh_addralign(.tbss)` This exposes many problems in ld.so implementations, especially the offsets of dynamic TLS blocks. Known issues: FreeBSD 13.0-CURRENT rtld-elf (i386/amd64/powerpc/arm64) glibc (HEAD) i386 and x86_64 https://sourceware.org/bugzilla/show_bug.cgi?id=24606 musl<=1.1.22 on TLS Variant I architectures (aarch64/powerpc64/...) So, force p_vaddr%p_align = 0 by rounding dot up to p_align(PT_TLS). The technique will be enabled (with updated tests) for other targets in subsequent patches. Reviewed By: ruiu Differential Revision: https://reviews.llvm.org/D64906 llvm-svn: 369343
* [test/Object] - Move/rewrite 2 more test cases.George Rimar2019-08-205-12/+84
| | | | | | | | | | | | | | | This patch makes a change for test/Object tests responsible for relocations. * 2 tests were moved to llvm-readobj/llvm-objdump folders: Object/elf-reloc-no-sym.test -> tools/llvm-readobj/elf-reloc-no-sym.test Object/objdump-reloc-shared.test -> tools/llvm-objdump/relocations-in-nonreloc.test * A prerecompiled binary was removed and these tests were refactored. Differential revision: https://reviews.llvm.org/D66291 llvm-svn: 369342
* [MC] Delete an overload of MCExpr::evaluateKnownAbsolute and its associated hackFangrui Song2019-08-202-18/+7
| | | | | | | | | | The hack dated back to 2010 (r121076) and was documented by r122144: // FIXME: The use if InSet = Addrs is a hack. Setting InSet causes us // absolutize differences across sections and that is what the MachO writer // uses Addrs for. llvm-svn: 369337
* [compiler-rt][crt] Pass -fno-lto in check_cxx_section_existsHans Wennborg2019-08-201-0/+1
| | | | | | | | | Otherwise it doesn't work when building with -DLLVM_ENABLE_LTO=thin (We hit this in Chromium in https://bugs.chromium.org/p/chromium/issues/detail?id=966403) llvm-svn: 369336
* [Attributor] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds ↵Fangrui Song2019-08-201-0/+1
| | | | | | after r369331 llvm-svn: 369334
* [X86] Add back the -x86-experimental-vector-widening-legalization comand ↵Craig Topper2019-08-202-143/+1227
| | | | | | | | | | | | | | | | | | | | | line flag and all associated code, but leave it enabled by default Google is reporting performance issues with the new default behavior and have asked for a way to switch back to the old behavior while we investigate and make fixes. I've restored all of the code that had since been removed and added additional checks of the command flag onto code paths that are not otherwise guarded by a check of getTypeAction. I've also modified the cost model tables to hopefully get us back to the previous costs. Hopefully we won't need to support this for very long since we have no test coverage of the old behavior so we can very easily break it. llvm-svn: 369332
* [Attributor] Create abstract attributes on-demandJohannes Doerfert2019-08-209-228/+275
| | | | | | | | | | | | | | | | | | | | | | | | Before, we create the set of abstract attributes initially and then dealt with the fact hat a lookup could fail, e.g., return a nullptr. This patch will ensure we always return a valid object from a lookup, allowing us not only to remove the nullptr checks but also to grow the set of abstract attributes "in-flight" on-demand. One can now start from those that have the best chance of improving performance without the need to specify all they might depend on. While this introduces some boilerplate, the usage of attributes is much easier and cleaner now. Reviewers: uenoku, sstefan1 Subscribers: hiraditya, bollu, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66276 llvm-svn: 369331
* [Attributor][NFC] Cleanup statistics codeJohannes Doerfert2019-08-201-4/+7
| | | | llvm-svn: 369330
* [Attributor] Use structured deduction for AADereferenceableJohannes Doerfert2019-08-204-151/+86
| | | | | | | | | | | | | | | | | | | | Summary: This is analogous to D66128 but for AADereferenceable. We have the logic concentrated in the floating value updateImpl and we use the combiner helper classes for arguments and return values. The regressions will go away with "on-demand" attribute creation. Improvements are already visible in the existing tests. Reviewers: uenoku, sstefan1 Subscribers: hiraditya, bollu, jfb, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66272 llvm-svn: 369329
* [Attributor] Use structured deduction for AANonNullJohannes Doerfert2019-08-208-122/+128
| | | | | | | | | | | | | | | | | | | Summary: What D66126 did for AAAlign, this patch does for AANonNull. Agian, the logic becomes more concise and localized. Again, returned poiners are not annotated properly but that will not be an issue if this lands with the "on-demand" generation of attributes. First improvements due to the genericValueTraversal are already visible. Reviewers: sstefan1, uenoku Subscribers: hiraditya, bollu, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66128 llvm-svn: 369328
* [Attributor] Fix the "clamp" operatorJohannes Doerfert2019-08-202-3/+12
| | | | | | | | The clamp operator should not take the known of the given state as the known is potentially based on assumed information. This also adds TODOs to guide improvements. llvm-svn: 369327
* [NFC] Test commit, fix some comment spelling.Thomas Raoux2019-08-201-1/+1
| | | | llvm-svn: 369326
* [AsmPrinter] Remove const qualifier from EmitBasicBlockStart.Karl-Johan Karlsson2019-08-206-8/+8
| | | | | | | | | | | | | | | | Overriders may want to modify state in it. AMDGPU wants to, but has to make its members mutable in order to do so. Besides, EmitBasicBlockEnd is not const, so why should Start be? Patch by Bevin Hansson. Reviewed By: nickdesaulniers Differential Revision: https://reviews.llvm.org/D66341 llvm-svn: 369325
* MCAsmMacro: add `#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)` to some ↵Fangrui Song2019-08-202-5/+8
| | | | | | dump() declarations llvm-svn: 369324
* [CallGraph] Take into accound calls that aren't within any function bodies.Artem Dergachev2019-08-204-1/+67
| | | | | | | | | | | | This patch improves Clang call graph analysis by adding in expressions that are not found in regular function bodies, such as default arguments or member initializers. Patch by Joshua Cranmer! Differential Revision: https://reviews.llvm.org/D65453 llvm-svn: 369321
* [analyzer] NFC: Rename GRBugReporter to PathSensitiveBugReporter.Artem Dergachev2019-08-203-21/+27
| | | | | | The GR prefix is super ancient. llvm-svn: 369320
* [analyzer] NFC: Drop support for extra text attached to bug reports.Artem Dergachev2019-08-202-18/+0
| | | | | | It was introduced in 2011 but never used since then. llvm-svn: 369319
* [WebAssembly][MC] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off ↵Fangrui Song2019-08-201-3/+1
| | | | | | builds after r369317 llvm-svn: 369318
* [WebAssembly][MC] Simplify WasmObjectWriter::recordRelocation. NFC.Sam Clegg2019-08-202-43/+47
| | | | | | | | | | | | WebAssembly doesn't support PC relative relocation or relocation expressions that can't be reduced to single symbol. The only support for we have for fixups involving two symbols are when both symbols are defined and withing the same section. In this case evaluateFixup will already have evaluated to the expression before calling recordRelocation. llvm-svn: 369317
* Fix typo. "piont" => "point"Richard Trieu2019-08-202-10/+10
| | | | | | Found by Chris Morris (cwmorris). llvm-svn: 369316
* [SLP][NFC] Avoid repetitive calls to getSameOpcode()Dinar Temirbulatov2019-08-201-120/+176
| | | | | | | | We can avoid repetitive calls getSameOpcode() for already known tree elements by keeping MainOp and AltOp in TreeEntry. Differential Revision: https://reviews.llvm.org/D64700 llvm-svn: 369315
* [TSan] Rename file with libdispatch interceptorsJulian Lettner2019-08-202-2/+2
| | | | llvm-svn: 369314
* [lldb] Fix typo on the BreakpointLocation header and the lldbtest.py (NFC)Med Ismail Bennani2019-08-193-17/+38
| | | | | | | | | | | | | | | Summary: This commit fixes some typo I found while exploring LLDB's codebase. Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com> Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D66452 llvm-svn: 369313
* Provide a meaningful diagnostic when LLVM_PATH doesn't point to a directoryLouis Dionne2019-08-192-0/+6
| | | | llvm-svn: 369312
* [sanitizer_common] Extend test after switch to posix_spawnJulian Lettner2019-08-191-0/+2
| | | | llvm-svn: 369311
* [cmake] Link in LLVMPasses due to dependency by LLVMOrcJIT; NFCHubert Tong2019-08-193-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: rL367756 (f5c40cb) increases the dependency of LLVMOrcJIT on LLVMPasses. In particular, symbols defined in LLVMPasses that are referenced by the destructor of `PassBuilder` are now referenced by LLVMOrcJIT through `Speculation.cpp.o`. We believe that referencing symbols defined in LLVMPasses in the destructor of `PassBuilder` is valid, and that adding to the set of such symbols is legitimate. To support such cases, this patch adds LLVMPasses to the set of libraries being linked when linking in LLVMOrcJIT causes such symbols from LLVMPasses to be referenced. Reviewers: Whitney, anhtuyen, pree-jackie Reviewed By: pree-jackie Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66441 llvm-svn: 369310
* [lit] Check for accidental external command callsJoel E. Denny2019-08-198-0/+48
| | | | | | | | | | | | | | | This patch extends lit's test suite to check that lit's internal shell doesn't accidentally execute internal commands as external commands. It does so by putting fake failing versions of those commands in `PATH` while the entire lit test suite is running. Without the fixes in D65697 but with its tests, this approach catches accidental external `env` calls. Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D66293 llvm-svn: 369309
* [Support][Time profiler] Make FE codegen blocks to be inside frontend blocksAnton Afanasyev2019-08-194-2/+36
| | | | | | | | | | | | | | | | | | | | | | Summary: Add `Frontend` time trace entry to `HandleTranslationUnit()` function. Add test to check all codegen blocks are inside frontend blocks. Also, change `--time-trace-granularity` option a bit to make sure very small time blocks are outputed to json-file when using `--time-trace-granularity=0`. This fixes http://llvm.org/pr41969 Reviewers: russell.gallop, lebedev.ri, thakis Reviewed By: russell.gallop Subscribers: vsapsai, aras-p, lebedev.ri, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D63325 llvm-svn: 369308
* Windows: Include "windows" Instead of "Windows"Saleem Abdulrasool2019-08-195-5/+5
| | | | | | | | | The actual include directory is lldb/Host/windows not lldb/Host/Windows which breaks on case sensitive file systems Patch by Gwen Mittertreiner! llvm-svn: 369307
* [ORC] fix use-after-free detected by -Wreturn-stack-addressMatthias Gehre2019-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: llvm/lib/ExecutionEngine/Orc/Layer.cpp:53:12: warning: returning address of local temporary object [-Wreturn-stack-address] In ``` StringRef IRMaterializationUnit::getName() const { [...] return TSM.withModuleDo( [](const Module &M) { return M.getModuleIdentifier(); }); ``` `getModuleIdentifier()` returns a `const std::string &`, but the implicit return type of the lambda is `std::string` by value, and thus the returned `StringRef` refers to a temporary `std::string`. Detect by annotating `llvm::StringRef` with `[[gsl::Pointer]]`. Reviewers: lhames, sgraenitz Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66440 llvm-svn: 369306
* [CaptureTracker] Let subclasses provide dereferenceability informationJohannes Doerfert2019-08-192-15/+26
| | | | | | | | | | | | | | | | | Summary: CaptureTracker subclasses might have better dereferenceability information which allows null pointer checks to be no-capturing. The first user will be D59922. Reviewers: sanjoy, hfinkel, aykevl, sstefan1, uenoku, xbolva00 Subscribers: hiraditya, bollu, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66371 llvm-svn: 369305
* Fix use-after-freeMatthias Gehre2019-08-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The warning ``` lldb/source/Core/FormatEntity.cpp:2350:25: warning: object backing the pointer will be destroyed at the end of the full-expression [-Wdangling] ``` is emitted after annotating `llvm::StringRef` with `[[gsl::Pointer]]`. The reason is that in ``` size_t FormatEntity::AutoComplete(CompletionRequest &request) { llvm::StringRef str = request.GetCursorArgumentPrefix().str(); ``` the function `GetCursorArgumentPrefix()` returns a `StringRef`, and `StringRef::str()` returns a temporary `std::string`. Reviewers: jingham, JDevlieghere Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D66442 llvm-svn: 369304
* Recommit "[Attributor] Fix: Do not partially resolve returned calls."Johannes Doerfert2019-08-191-11/+28
| | | | | | | | | This reverts commit b1752f670f3d6393306dd5d37546b6e23384d8a2. Fixed the issue with a different commit, reapply this one as it was, afaik, not broken. llvm-svn: 369303
* Recommit "[llvm-objcopy][MachO] Implement a layout algorithm for executables"Seiya Nuta2019-08-192-20/+337
| | | | | | | | | | | | | | | | Summary: The layout algorithm for relocatable objects and for executable are somewhat different. This patch implements the latter one based on the algorithm in LLD (MachOFileLayout). Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap Subscribers: jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65539 llvm-svn: 369301
* Refactor isPointerOffset (NFC).Evgeniy Stepanov2019-08-194-43/+38
| | | | | | | | | | | | | | | | Summary: Simplify the API using Optional<> and address comments in https://reviews.llvm.org/D66165 Reviewers: vitalybuka Subscribers: hiraditya, llvm-commits, ostannard, pcc Tags: #llvm Differential Revision: https://reviews.llvm.org/D66317 llvm-svn: 369300
* Fixed placement of llvm.global_dtors on Windows.Vyacheslav Zakharin2019-08-192-1/+72
| | | | | | Differential revision: https://reviews.llvm.org/D66373 llvm-svn: 369299
* Recommit "[llvm-objcopy][MachO] Support load commands used in ↵Seiya Nuta2019-08-199-210/+560
| | | | | | | | | | | | | | | | | | | | | executables/shared libraries" Summary: This patch implements copying some load commands that appear in executables/shared libraries such as the indirect symbol table. I don't add tests intentionally because this patch is incomplete: we need a layout algorithm for executables/shared libraries. I'll submit it as a separate patch with tests. Reviewers: alexshap, rupprecht, jhenderson, compnerd Reviewed By: alexshap Subscribers: abrachet, mgorny, mgrang, MaskRay, mtrent, jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63395 llvm-svn: 369298
* MemTag: stack initializer merging.Evgeniy Stepanov2019-08-195-6/+611
| | | | | | | | | | | | | | | | | | | | | | Summary: MTE provides instructions to update memory tags and data at the same time. This change makes use of those to generate more compact code for stack variable tagging + initialization. We collect memory store and memset instructions following an alloca or a lifetime.start call, and replace them with the corresponding MTE intrinsics. Since the intrinsics work on 16-byte aligned chunks, the stored values are combined as necessary. Reviewers: pcc, vitalybuka, ostannard Subscribers: srhines, javed.absar, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66167 llvm-svn: 369297
* [lldb-vscode] add `launchCommands` to handle launch specific commandsAlex Langford2019-08-194-19/+110
| | | | | | | | | | | | | | Summary: This can help `lldb-vscode` handle launch commands associate with remote platform attach request have field `attachCommands` to handle attach specific commands add a corresponding one for launch request if no launch command is provided, create a new target and launch; otherwise, execute the launch command Differential Revision: https://reviews.llvm.org/D65363 Patch by Wanyi Ye <kusmour@gmail.com> llvm-svn: 369296
* [Support] Replace sys::Mutex with their standard equivalents.Benjamin Kramer2019-08-193-13/+11
| | | | | | Only use a recursive mutex if it can be locked recursively. llvm-svn: 369295
* Re-apply fixed "[Attributor] Fix: Make sure we set the changed flag"Johannes Doerfert2019-08-191-4/+4
| | | | | | | | | This reverts commit cedd0d9a6e4b433e1cd6585d1d4d152eb5e60b11. Re-apply the original commit but make sure the variables are initialized (even if they are not used) so UBSan is not complaining. llvm-svn: 369294
* [lldb] Make TestIOHandlerCompletion more stable and document itRaphael Isemann2019-08-191-1/+4
| | | | | | | | | | Instead of relying that three tabs show all completions, we should show all remaining completions which will always stop the mode where we show completions. Should fix this test on systems that somehow have more completions that our normal LLDB (as they would end up being stuck in the mode where we show completions). llvm-svn: 369293
* [WebAssembly][MC] Allow empty assembly functionsSam Clegg2019-08-192-9/+23
| | | | | | Differential Revision: https://reviews.llvm.org/D66434 llvm-svn: 369292
* [MemorySSA] Rename uses when inserting memory uses.Alina Sbirlea2019-08-195-17/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When inserting uses from outside the MemorySSA creation, we don't normally need to rename uses, based on the assumption that there will be no inserted Phis (if Def existed that required a Phi, that Phi already exists). However, when dealing with unreachable blocks, MemorySSA will optimize away Phis whose incoming blocks are unreachable, and these Phis end up being re-added when inserting a Use. There are two potential solutions here: 1. Analyze the inserted Phis and clean them up if they are unneeded (current method for cleaning up trivial phis does not cover this) 2. Leave the Phi in place and rename uses, the same way as whe inserting defs. This patch use approach 2. Resolves first test in PR42940. Reviewers: george.burgess.iv Subscribers: Prazek, sanjoy.google, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66033 llvm-svn: 369291
* Build symbolizer runtime with C++14.Peter Collingbourne2019-08-191-1/+1
| | | | | | Should hopefully fix sanitizer-x86_64-linux bot. llvm-svn: 369290
* [TSan] Rename file to make it clear that it defines interceptorsJulian Lettner2019-08-192-2/+2
| | | | | | | Rename file `tsan_libdispatch.cpp -> tsan_libdispatch_interceptors.cpp` to make it clear that it's main purpose is defining interceptors. llvm-svn: 369289
* [X86] Move scheduling tests for CMPXCHG to the corresponding ↵Andrea Di Biagio2019-08-1924-492/+168
| | | | | | | | | | resources-x86_64.s files. NFC In D66424 it has been requested to move all the new tests added by r369278 into resources-x86_64.s. That is because only the 8b/16 ops should be tested by resources-cmpxchg.s. This partially reverts r369278. llvm-svn: 369288
* [X86] Teach lowerV4I32Shuffle to only use broadcasts if the mask has more ↵Craig Topper2019-08-1911-120/+73
| | | | | | | | | | | | | | than one undef element. Prioritize shifts over broadcast in lowerV8I16Shuffle. The motivating case are the changes in vector-reduce-add.ll where we were doing extra work in the scalar domain instead of shuffling. There may be some one use check that needs to be looked into there, but this patch sidesteps the issue by avoiding broadcasts that aren't really broadcasting. Differential Revision: https://reviews.llvm.org/D66071 llvm-svn: 369287
OpenPOWER on IntegriCloud