summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Modules: Cache PCMs in memory and avoid a use-after-freeDuncan P. N. Exon Smith2017-03-1734-57/+475
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang's internal build system for implicit modules uses lock files to ensure that after a process writes a PCM it will read the same one back in (without contention from other -cc1 commands). Since PCMs are read from disk repeatedly while invalidating, building, and importing, the lock is not released quickly. Furthermore, the LockFileManager is not robust in every environment. Other -cc1 commands can stall until timeout (after about eight minutes). This commit changes the lock file from being necessary for correctness to a (possibly dubious) performance hack. The remaining benefit is to reduce duplicate work in competing -cc1 commands which depend on the same module. Follow-up commits will change the internal build system to continue after a timeout, and reduce the timeout. Perhaps we should reconsider blocking at all. This also fixes a use-after-free, when one part of a compilation validates a PCM and starts using it, and another tries to swap out the PCM for something new. The PCMCache is a new type called MemoryBufferCache, which saves memory buffers based on their filename. Its ownership is shared by the CompilerInstance and ModuleManager. - The ModuleManager stores PCMs there that it loads from disk, never touching the disk if the cache is hot. - When modules fail to validate, they're removed from the cache. - When a CompilerInstance is spawned to build a new module, each already-loaded PCM is assumed to be valid, and is frozen to avoid the use-after-free. - Any newly-built module is written directly to the cache to avoid the round-trip to the filesystem, making lock files unnecessary for correctness. Original patch by Manman Ren; most testcases by Adrian Prantl! llvm-svn: 298165
* [x86] regenerate checks; NFCSanjay Patel2017-03-171-110/+198
| | | | llvm-svn: 298164
* Fix docs-llvm-html build.Evgeniy Stepanov2017-03-171-1/+2
| | | | llvm-svn: 298163
* [Outliner] Add outliner for AArch64Jessica Paquette2017-03-173-11/+346
| | | | | | | | | | | | | | | | | This commit adds the necessary target hooks for outlining in AArch64. It also refactors the switch statement used in `getMemOpBaseRegImmOfsWidth` into a more general function, `getMemOpInfo`. This allows the outliner to share that code without copying and pasting it. The AArch64 outliner can be run using -mllvm -enable-machine-outliner, as with the X86-64 outliner. The test for this pass verifies that the outliner does, in fact outline functions, fixes up the stack accesses properly, and can correctly generate a tail call. In the future, this test should be replaced with a MIR test, so that we can properly test immediate offset overflows in fixed-up instructions. llvm-svn: 298162
* [SCEV] Use const Loop *L instead of Loop *L. NFCEli Friedman2017-03-172-12/+14
| | | | | | | | Use const pointer in the trip count and trip multiple calculations. Patch by Huihui Zhang <huihuiz@codeaurora.org> llvm-svn: 298161
* [Sema] Unbreak GCC -Werror build (enum compare).Davide Italiano2017-03-171-2/+2
| | | | llvm-svn: 298160
* [asan] Fix dead stripping of globals on Linux (compiler-rt)Evgeniy Stepanov2017-03-178-5/+90
| | | | | | | | Runtime support for the new instrumentation of globals based on !associated, and a bunch of tests. Differential Revision: https://reviews.llvm.org/D30120 llvm-svn: 298159
* [asan] Fix dead stripping of globals on Linux.Evgeniy Stepanov2017-03-177-57/+162
| | | | | | | | | | | | | | | | | | | | | Use a combination of !associated, comdat, @llvm.compiler.used and custom sections to allow dead stripping of globals and their asan metadata. Sometimes. Currently this works on LLD, which supports SHF_LINK_ORDER with sh_link pointing to the associated section. This also works on BFD, which seems to treat comdats as all-or-nothing with respect to linker GC. There is a weird quirk where the "first" global in each link is never GC-ed because of the section symbols. At this moment it does not work on Gold (as in the globals are never stripped). Differential Revision: https://reviews.llvm.org/D30121 llvm-svn: 298158
* Add !associated metadata.Evgeniy Stepanov2017-03-176-16/+119
| | | | | | | | | | | | | | | | This is an ELF-specific thing that adds SHF_LINK_ORDER to the global's section pointing to the metadata argument's section. The effect of that is a reverse dependency between sections for the linker GC. !associated does not change the behavior of global-dce. The global may also need to be added to llvm.compiler.used. Since SHF_LINK_ORDER is per-section, !associated effectively enables fdata-sections for the affected globals, the same as comdats do. Differential Revision: https://reviews.llvm.org/D29104 llvm-svn: 298157
* [SelectionDAG] Remove redundant stores more aggressively.Eli Friedman2017-03-172-9/+26
| | | | | | | | | | | | | | | | Handle TokenFactors more aggressively in SDValue::reachesChainWithoutSideEffects. This isn't really a very effective change anymore because of other changes to chain handling, but it's a cheap check, and the expanded comments are still useful. It might be possible to loosen the hasOneUse() requirement with a deeper analysis, but a naive implementation of that check would be expensive. Differential Revision: https://reviews.llvm.org/D29845 llvm-svn: 298156
* ELF: Change check(Expected<T>, const Twine &) to call toString instead of ↵Peter Collingbourne2017-03-172-2/+2
| | | | | | converting to an error code. llvm-svn: 298155
* [ELF] Restore GC handling of LINK_ORDER, C-named sections.Evgeniy Stepanov2017-03-172-3/+35
| | | | | | | | | | | | | __start_xxx symbol keeps section xxx alive only if it is not SHF_LINK_ORDER. Such sections can be used for user metadata, when __start_xxx is used to iterate over section contents at runtime, and the liveness is determined solely by the linked (associated) section. This was earlier implemented in r294592, and broken in r296723. Differential Revision: https://reviews.llvm.org/D30964 llvm-svn: 298154
* LTO: Work around libstdc++ version mismatch bug, see D31063 review thread.Peter Collingbourne2017-03-171-1/+4
| | | | llvm-svn: 298127
* Implement DR 373 "Lookup on namespace qualified name in using-directive"Matthias Gehre2017-03-177-32/+66
| | | | | | | | | | | | | | Summary: 3.4.6 [basic.lookup.udir] paragraph 1: In a using-directive or namespace-alias-definition, during the lookup for a namespace-name or for a name in a nested-name-specifier, only namespace names are considered. Reviewers: rsmith, aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30848 llvm-svn: 298126
* AMDGPU: Fix broken condition in hazard recognizerMatt Arsenault2017-03-173-17/+25
| | | | | | Fixes bug 32248. llvm-svn: 298125
* recommend using llvm-ar when finding undefined references and empty archivesBob Haarman2017-03-173-3/+19
| | | | | | | | | | | | | | | | | | | | | | Summary: When we perform LTO builds with a version of ar that does not understand LLVM bitcode objects, we end up with undefined references, because our archive files do not list the bitcode symbols in their indices. The error messages do not make it clear what the real problem is. This change adds a note that points out the likely problem and solution. It is similar in spirit to r282633, but aims to avoid false positives by only triggering when we see both undefined references and archives without symbols in their indices. Fixes PR32281. Reviewers: davide, ruiu, tejohnson Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31011 llvm-svn: 298124
* allow for specification of compiler/lldb executables basenameTim Hammerquist2017-03-171-0/+4
| | | | llvm-svn: 298123
* [coverity] Fix uninit variable.Vassil Vassilev2017-03-171-1/+1
| | | | | | Patch by John Harvey! llvm-svn: 298122
* AMDGPU: Fix handling of constant phi input loop conditionsMatt Arsenault2017-03-172-5/+266
| | | | | | | | If the loop condition was an i1 phi with a constantexpr input, this would add a loop intrinsic fed by a phi dependent on a call to if.break in the same block. Insert the call in the loop header. llvm-svn: 298121
* [PGO] Change the internal options description. nfc.Rong Xu2017-03-171-3/+5
| | | | llvm-svn: 298120
* AMDGPU: Cleanup control flow intrinsicsMatt Arsenault2017-03-1711-106/+116
| | | | | | | | | | | | | | | | Move backend internal intrinsics along with the rest of the normal intrinsics, and use the Intrinsic::getDeclaration API instead of manually constructing the type list. It's surprising this was working before. fdiv.fast had the wrong number of parameters. The control flow intrinsic declaration attributes were not being applied, and their types were inconsistent. The actual IR use types did not match the declaration, and were closer to the types used for the patterns. The brcond lowering was changing the types, so introduce new nodes for those. llvm-svn: 298119
* [x86] clean up setcc with negated operand transform and add missing test; NFCISanjay Patel2017-03-172-23/+52
| | | | llvm-svn: 298118
* [ubsan] Add e2e test for -fsanitize=nullabilityVedant Kumar2017-03-171-0/+64
| | | | llvm-svn: 298117
* [X86] Emit fewer instructions to allocate >16GB stack framesReid Kleckner2017-03-172-37/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Use this code pattern when RAX is live, instead of emitting up to 2 billion adjustments: pushq %rax movabsq +-$Offset+-8, %rax addq %rsp, %rax xchg %rax, (%rsp) movq (%rsp), %rsp Try to clean this code up a bit while I'm here. In particular, hoist the logic that handles the entire adjustment with `movabsq $imm, %rax` out of the loop. This negates the offset in the prologue and uses ADD because X86 only has a two operand subtract which always subtracts from the destination register, which can no longer be RSP. Fixes PR31962 Reviewers: majnemer, sdardis Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D30052 llvm-svn: 298116
* [PGO] Add omitted test cases.Rong Xu2017-03-172-0/+158
| | | | llvm-svn: 298115
* [CodeGenPrep]Restructure promoting Ext to form ExtLoadJun Bum Lim2017-03-173-108/+137
| | | | | | | | | | | | | | | | Summary: Instead of just looking for a load which is mergable with Ext to form ExtLoad, trying to promote Exts as long as the cost is acceptable. This change is not a NFC as it continue promoting Exts even after finding a load during promotions; the change in arm64-codegen-prepare-extload.ll described in 2.b might show the case. This change was motivated from D26524. Based on this change, I will move the transformation performed in aarch64-type-promotion into CGP. Reviewers: jmolloy, qcolombet, mcrosier, javed.absar Reviewed By: qcolombet Subscribers: rengolin, llvm-commits, aemerson Differential Revision: https://reviews.llvm.org/D27853 llvm-svn: 298114
* Resubmit r295469 [PGO] Suspend SIGKILL for PR_SET_PDEATHSIG in profile-writeRong Xu2017-03-173-0/+40
| | | | | | | | And also r295364 [PGO] remove unintended debug trace. NFC I removed the test case: it's hard to write synchronized test b/w processes in this framework. I will revisit the test-case later. llvm-svn: 298113
* executables should be validated before spawning subprocessesTim Hammerquist2017-03-171-2/+14
| | | | | | | | | | | | | | dotest.py script doesn't validate executables passed on the command line before spawning dozens of subprocesses, all of which fail silently, leaving an empty results file. We should validate the lldb and compiler executables on configuration, aborting when given invalid paths, to prevent numerous, cryptic, and spurious failures. <rdar://problem/31117272> llvm-svn: 298111
* [PGO] Value profile for size of memory intrinsic callsRong Xu2017-03-173-5/+108
| | | | | | | | This patch annotates the valuesites profile to memory intrinsics. Differential Revision: http://reviews.llvm.org/D31002 llvm-svn: 298110
* [Bitcode] Add compatibility test for the 4.0 releaseVedant Kumar2017-03-172-0/+1689
| | | | | | | Fork off compatibility.ll for the 4.0 release. The *.bc file in this commit was produced using a Release build of the release_40 branch. llvm-svn: 298109
* [SelectionDAG] Add SelectionDAG.computeKnownBits test support for ISD::ABSSimon Pilgrim2017-03-172-10/+22
| | | | llvm-svn: 298108
* [x86] avoid adc/sbb assert when both sides of add are zexted (PR32316)Sanjay Patel2017-03-172-2/+33
| | | | | | | | | | | | | | As noted in the comment, we might want to account for this case, but I didn't look at what that would mean for the asm. I'm also not sure why this only reproduces with avx512, but I'm putting a conservative fix in for now to avoid the crash. Also, if both sides of an add are zexted, shouldn't we shrink that add? https://bugs.llvm.org/show_bug.cgi?id=32316 llvm-svn: 298107
* Fix wasm build after arg_begin iterator type changeReid Kleckner2017-03-171-1/+1
| | | | llvm-svn: 298106
* Store Arguments in a flat array instead of an iplistReid Kleckner2017-03-174-43/+72
| | | | | | | | | | | | | | | | | | | | This saves two pointers from Argument and eliminates some extra allocations. Arguments cannot be inserted or removed from a Function because that would require changing its Type, which LLVM does not allow. Instead, passes that change prototypes, like DeadArgElim, create a new Function and copy over argument names and attributes. The primary benefit of iplist is O(1) random insertion and removal. We just don't need that for arguments, so don't use it. Reviewed By: chandlerc Subscribers: dlj, inglorion, llvm-commits Differential Revision: https://reviews.llvm.org/D31058 llvm-svn: 298105
* Only unswitch loops with uniform conditionsStanislav Mekhanoshin2017-03-177-7/+114
| | | | | | | | | | | | | | | | | | Loop unswitching can be extremely harmful for a SIMT target. In case if hoisted condition is not uniform a SIMT machine will execute both clones of a loop sequentially. Therefor LoopUnswitch checks if the condition is non-divergent. Since DivergenceAnalysis adds an expensive PostDominatorTree analysis not needed for non-SIMT targets a new option is added to avoid unneded analysis initialization. The method getAnalysisUsage is called when TargetTransformInfo is not yet available and we cannot use it here. For that reason a new field DivergentTarget is added to PassManagerBuilder to control the behavior and set this field from a target. Differential Revision: https://reviews.llvm.org/D30796 llvm-svn: 298104
* [X86] Add SelectionDAG.computeKnownBits test showing inability to handle ↵Simon Pilgrim2017-03-171-0/+61
| | | | | | | | ISD::ABS We have to be careful as abs(INT_MIN) == INT_MIN. llvm-svn: 298103
* [ELF] - Move template instantiations to the end of file. NFC.George Rimar2017-03-171-9/+5
| | | | | | | To be consistent with other code, addresses post commit review comments. llvm-svn: 298102
* [Clang-tidy] Fix for misc-noexcept-move-constructor false triggers on ↵Alexander Kornienko2017-03-172-0/+14
| | | | | | | | | | | | | | | | | | | | | | | defaulted declarations Summary: There is no need for triggering warning when noexcept specifier in move constructor or move-assignment operator is neither evaluated nor uninstantiated. This fixes bug reported here: bugs.llvm.org/show_bug.cgi?id=24712 Reviewers: alexfh Reviewed By: alexfh Subscribers: JonasToth, JDevlieghere, cfe-commits Tags: #clang-tools-extra Patch by Marek Jenda! Differential Revision: https://reviews.llvm.org/D31049 llvm-svn: 298101
* CMake requires normalized paths when appending.Zachary Turner2017-03-171-0/+1
| | | | | | | Patch by Hugh Bellamy Differential Revision: https://reviews.llvm.org/D30927 llvm-svn: 298100
* Fix some signed/unsigned comparison warnings.Zachary Turner2017-03-171-4/+4
| | | | | | | Patch by Hugh Bellamy Differential Revision: https://reviews.llvm.org/D30926 llvm-svn: 298099
* [clang-cl] Fix cross-compilation with MSVC 2017.Zachary Turner2017-03-173-8/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang-cl works best when the user runs vcvarsall to set up an environment before running, but even this is not enough on VC 2017 when cross compiling (e.g. using an x64 toolchain to target x86, or vice versa). The reason is that although clang-cl itself will have a valid environment, it will shell out to other tools (such as link.exe) which may not. Generally we solve this through adding the appropriate linker flags, but this is not enough in VC 2017. The cross-linker and the regular linker both link against some common DLLs, but these DLLs live in the binary directory of the native linker. When setting up a cross-compilation environment through vcvarsall, it will add *both* directories to %PATH%, so that when cl shells out to any of the associated tools, those tools will be able to find all of the dependencies that it links against. If you don't do this, link.exe will fail to run because the loader won't be able to find all of the required DLLs that it links against. To solve this we teach the driver how to spawn a process with an explicitly specified environment. Then we modify the PATH before shelling out to subtools and run with the modified PATH. Patch by Hamza Sood Differential Revision: https://reviews.llvm.org/D30991 llvm-svn: 298098
* Test commit.David Green2017-03-171-1/+1
| | | | llvm-svn: 298097
* Handle & and | of non abs values.Rafael Espindola2017-03-173-33/+37
| | | | | | | Handling & in particular is probably important because of its use in aligning addresses. llvm-svn: 298096
* [ScheduleOptimiser] fix typos in top comment [NFC]Siddharth Bhat2017-03-171-2/+2
| | | | | | | coice -> choice Transations -> Transactions llvm-svn: 298095
* Refuse to add two non absolute symbols.Rafael Espindola2017-03-172-0/+8
| | | | | | | Since there is no way to produce the correct answer at runtime, it is probably better to just err. llvm-svn: 298094
* [ELF][MIPS] Always collect .reginfo, .MIPS.options, and .MIPS.abiflags input ↵Simon Atanasyan2017-03-174-6/+6
| | | | | | | | | | | sections Do not take in account the `Live` flag while collecting .reginfo, .MIPS.options, and .MIPS.abiflags input sections to produce corresponding output sections. These sections have information purpose and should be always produced per ABI requirements. llvm-svn: 298093
* [AArch64] Use alias analysis in the load/store optimization pass.Chad Rosier2017-03-172-7/+44
| | | | | | | | This allows the optimization to rearrange loads and stores more aggressively. Differential Revision: http://reviews.llvm.org/D30903 llvm-svn: 298092
* [ELF] - Detemplate SymbolBody::getGotOffset(). NFC.George Rimar2017-03-174-15/+9
| | | | llvm-svn: 298091
* [change-namespace] do not rename specialized template parameters.Eric Liu2017-03-172-0/+57
| | | | | | | | | | Reviewers: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31076 llvm-svn: 298090
* Revert "Remove references to AssumptionCache. NFC."Michael Kruse2017-03-174-79/+82
| | | | | | | | | | The AssumptionCache removal of r289756 has been reverted in r290086/r290087. A different solution has been implemented in r291671 which keeps the AssumptionCache. We can therefore use it again in Polly. This reverts r289791. llvm-svn: 298089
OpenPOWER on IntegriCloud