Haojian Wu [Thu, 18 Oct 2018 09:13:34 +0000 (09:13 +0000)]
[clang-tidy] Ignore a case where the fix of make_unique check introduces side effect.
Summary:
Previously, ptr.reset(new char[5]) will be replaced with `p =
make_unique<char[]>(5)`, the fix has side effect -- doing
default initialization, it may cause performace regression (we are
bitten by this rececntly)
The check should be conservative for these cases.
Reviewers: alexfh
Subscribers: xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D53377
llvm-svn: 344733
Sam McCall [Thu, 18 Oct 2018 08:47:24 +0000 (08:47 +0000)]
[Support] json::Value construction from std::vector<T> and std::map<string,T>.
Summary: Previously this required a conversion to json::Array/json::Object first.
Reviewers: ioeric
Subscribers: kristina, llvm-commits
Differential Revision: https://reviews.llvm.org/D53385
llvm-svn: 344732
Guillaume Chatelet [Thu, 18 Oct 2018 08:20:50 +0000 (08:20 +0000)]
[llvm-exegesis] Fix off by one error
llvm-svn: 344731
Chandler Carruth [Thu, 18 Oct 2018 08:16:20 +0000 (08:16 +0000)]
[TI removal] Test predicate rather than casting to detect a terminator
and use the range based successor API.
llvm-svn: 344730
Aleksandr Urakov [Thu, 18 Oct 2018 07:52:56 +0000 (07:52 +0000)]
[Windows] Fix threads comparison on Windows
Summary:
This patch makes Windows threads to compare by a thread ID, not by a handle.
It's because the same thread can have different handles on Windows
(for example, `GetCurrentThread` always returns the fake handle `-2`).
This leads to some incorrect behavior. For example, in `Process::GetRunLock`
always `m_public_run_lock` is returned without this patch.
Reviewers: zturner, clayborg, stella.stamenova
Reviewed By: stella.stamenova
Subscribers: stella.stamenova, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D53357
llvm-svn: 344729
Chandler Carruth [Thu, 18 Oct 2018 07:43:30 +0000 (07:43 +0000)]
[TI removal] Generically discuss terminators rather than use the soon to
vanish subclass name.
llvm-svn: 344728
Chandler Carruth [Thu, 18 Oct 2018 07:40:24 +0000 (07:40 +0000)]
[TI removal] Remove discussion of `TerminatorInst` from the LLVM
documentation.
llvm-svn: 344727
Chandler Carruth [Thu, 18 Oct 2018 07:40:03 +0000 (07:40 +0000)]
[TI removal] Remove TerminatorInst references from bindings.
For the Go bindings, this just removes the no longer useful "isa"-style
wrapper. If there is a user that is interested, they can add a wrapper
for `Instruction::isTerminator`.
For the OCaml bindings, this is just a documentation update.
llvm-svn: 344726
Mikael Holmen [Thu, 18 Oct 2018 06:27:53 +0000 (06:27 +0000)]
Add a emitUnaryFloatFnCall version that fetches the function name from TLI
Summary:
In several places in the code we use the following pattern:
if (hasUnaryFloatFn(&TLI, Ty, LibFunc_tan, LibFunc_tanf, LibFunc_tanl)) {
[...]
Value *Res = emitUnaryFloatFnCall(X, TLI.getName(LibFunc_tan), B, Attrs);
[...]
}
In short, we check if there is a lib-function for a certain type, and then
we _always_ fetch the name of the "double" version of the lib function and
construct a call to the appropriate function, that we just checked exists,
using that "double" name as a basis.
This is of course a problem in cases where the target doesn't support the
"double" version, but e.g. only the "float" version.
In that case TLI.getName(LibFunc_tan) returns "", and
emitUnaryFloatFnCall happily appends an "f" to "", and we erroneously end
up with a call to a function called "f".
To solve this, the above pattern is changed to
if (hasUnaryFloatFn(&TLI, Ty, LibFunc_tan, LibFunc_tanf, LibFunc_tanl)) {
[...]
Value *Res = emitUnaryFloatFnCall(X, &TLI, LibFunc_tan, LibFunc_tanf,
LibFunc_tanl, B, Attrs);
[...]
}
I.e instead of first fetching the name of the "double" version and then
letting emitUnaryFloatFnCall() add the final "f" or "l", we let
emitUnaryFloatFnCall() fetch the right name from TLI.
Reviewers: eli.friedman, efriedma
Reviewed By: efriedma
Subscribers: efriedma, bjope, llvm-commits
Differential Revision: https://reviews.llvm.org/D53370
llvm-svn: 344725
Mikael Holmen [Thu, 18 Oct 2018 06:00:39 +0000 (06:00 +0000)]
Fix warning about unused variable [NFC]
llvm-svn: 344724
Kristina Brooks [Thu, 18 Oct 2018 03:14:37 +0000 (03:14 +0000)]
[X86] Support for the mno-tls-direct-seg-refs flag
Allows to disable direct TLS segment access (%fs or %gs). GCC supports
a similar flag, it can be useful in some circumstances, e.g. when a thread
context block needs to be updated directly from user space. More info
and specific use cases: https://bugs.llvm.org/show_bug.cgi?id=16145
There is another revision for clang as well.
Related: D53102
All X86 CodeGen tests appear to pass:
```
[46/47] Running lit suite /SourceCache/llvm-trunk-8.0/test/CodeGen
Testing Time: 23.17s
Expected Passes : 3801
Expected Failures : 15
Unsupported Tests : 8021
```
Reviewed by: Craig Topper.
Patch by nruslan (Ruslan Nikolaev).
Differential Revision: https://reviews.llvm.org/D53103
llvm-svn: 344723
Krasimir Georgiev [Thu, 18 Oct 2018 03:10:43 +0000 (03:10 +0000)]
Revert "Return a named error in the result object of an expression with no result"
This reverts commit r344647.
This causes build failures with [-Werror, -Wswitch]. Some cases where the newly
introduced enum value is not handled in particular are in:
lldb/source/Expression/REPL.cpp:350
lldb/source/Interpreter/CommandInterpreter.cpp:1529
(maybe there could be more)
As I don't understand lldb to make sure the likely trivial fixes are
correct and also as they might need additional tests, leaving to the
author to resolve.
llvm-svn: 344722
Krasimir Georgiev [Thu, 18 Oct 2018 02:06:16 +0000 (02:06 +0000)]
[llvm-exegesis] Mark destructor virtual after r344695
This was causing a -Wnon-virtual-dtor warning.
llvm-svn: 344721
Lang Hames [Thu, 18 Oct 2018 00:51:38 +0000 (00:51 +0000)]
[BuildingAJIT] Update the Ch1 KaleidoscopeJIT class to expose errors to clients.
Returning the error to clients provides an opportunity to introduce readers to
the Expected and Error APIs and makes the tutorial more useful as a starting
point for a real JIT class, while only slightly complicating the code.
llvm-svn: 344720
Chandler Carruth [Thu, 18 Oct 2018 00:40:26 +0000 (00:40 +0000)]
[TI removal] Switch simple loop unswitch to `Instruction`.
llvm-svn: 344719
Chandler Carruth [Thu, 18 Oct 2018 00:39:46 +0000 (00:39 +0000)]
[TI removal] Switch NewGVN to directly use `Instruction`.
llvm-svn: 344718
Chandler Carruth [Thu, 18 Oct 2018 00:39:18 +0000 (00:39 +0000)]
[TI removal] Use `Instruction` instead of `TerminatorInst` for
a variable's type.
llvm-svn: 344717
Chandler Carruth [Thu, 18 Oct 2018 00:38:54 +0000 (00:38 +0000)]
[TI removal] Update CodeExtractor to use Instruction directly.
llvm-svn: 344716
Chandler Carruth [Thu, 18 Oct 2018 00:38:34 +0000 (00:38 +0000)]
[TI removal] Switch ObjCARC code to directly use the nice range-based
successors API or directly build the iterators out of the terminator
instruction and avoid requiring a TerminatorInst variable.
llvm-svn: 344715
Chandler Carruth [Thu, 18 Oct 2018 00:37:37 +0000 (00:37 +0000)]
[TI removal] Switch MergeFunctions to directly use Instruction API.
llvm-svn: 344714
Chandler Carruth [Thu, 18 Oct 2018 00:36:15 +0000 (00:36 +0000)]
[TI removal] Switch an analysis to just use Instruction.
llvm-svn: 344713
Lang Hames [Wed, 17 Oct 2018 22:27:09 +0000 (22:27 +0000)]
[BuildingAJIT] Simplify a tutorial example and fix a syntax error.
llvm-svn: 344712
Konstantin Zhuravlyov [Wed, 17 Oct 2018 21:39:12 +0000 (21:39 +0000)]
AMDGPU: Add options to enable/disable code object v3
Differential Revision: https://reviews.llvm.org/D53386
llvm-svn: 344711
Eli Friedman [Wed, 17 Oct 2018 21:07:11 +0000 (21:07 +0000)]
[AArch64] Define __ELF__ for aarch64-none-elf and other similar triples.
"aarch64-none-elf" is commonly used for AArch64 baremetal toolchains.
Differential Revision: https://reviews.llvm.org/D53348
llvm-svn: 344710
Julie Hockett [Wed, 17 Oct 2018 20:16:05 +0000 (20:16 +0000)]
[clang-doc] Bringing bitcode tests in line
Makes bitcode tests line up with what's actually called in the tool.
Should fix the failing bot.
Also fixes a warning that was being thrown about initialization braces.
Differential Revision: https://reviews.llvm.org/D53381
llvm-svn: 344707
Lang Hames [Wed, 17 Oct 2018 19:35:38 +0000 (19:35 +0000)]
[BuildingAJIT] Fix a function signature in the documentation.
llvm-svn: 344705
Pavel Labath [Wed, 17 Oct 2018 18:50:25 +0000 (18:50 +0000)]
Port libcxxabi r344607 into llvm
Summary:
The original commit message was:
This uses CRTP (for performance reasons) to allow a user the override
demangler functions to implement custom parsing logic. The motivation
for this is LLDB, which needs to occasionaly modify the mangled names.
One such instance is already implemented via the TypeCallback member,
but this is very specific functionality which does not help with any
other use case. Currently we have a use case for modifying the
constructor flavours, which would require adding another callback. This
approach does not scale.
With CRTP, the user (LLDB) can override any function it needs without
any special support from the demangler library. After LLDB is ported to
use this instead of the TypeCallback mechanism, the callback can be
removed.
The only difference here is the addition of a unit test which exercises
the CRTP mechanism to override a function in the parser.
Reviewers: erik.pilkington, rsmith, EricWF
Subscribers: mgorny, kristina, llvm-commits
Differential Revision: https://reviews.llvm.org/D53300
llvm-svn: 344703
Leonard Chan [Wed, 17 Oct 2018 18:12:18 +0000 (18:12 +0000)]
Fix for arm bots afternew PM pass port. Prevent cross compiling on arm.
llvm-svn: 344702
Leonard Chan [Wed, 17 Oct 2018 16:21:19 +0000 (16:21 +0000)]
Fix for failing unit tests on some bots after r344696.
llvm-svn: 344701
Louis Dionne [Wed, 17 Oct 2018 16:12:04 +0000 (16:12 +0000)]
[libcxx] Improve reporting when running the lit test suite
Summary:
Running the test suite with -a will now properly show all the executed
commands. The reports also include the environment under which the test
is being executed, which is helpful for reproducing issues.
Reviewers: EricWF
Subscribers: christof, dexonsmith, libcxx-commits
Differential Revision: https://reviews.llvm.org/D53215
llvm-svn: 344700
Leonard Chan [Wed, 17 Oct 2018 15:38:22 +0000 (15:38 +0000)]
[PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitize=address
Enable usage of `AddressSanitizer` and `AddressModuleSanitizer` ported from the
legacy to the new PassManager.
This patch depends on https://reviews.llvm.org/D52739.
Differential Revision: https://reviews.llvm.org/D52814
llvm-svn: 344699
Nicolai Haehnle [Wed, 17 Oct 2018 15:37:48 +0000 (15:37 +0000)]
AMDGPU: Avoid selecting ds_{read,write}2_b32 on SI
Summary:
To workaround a hardware issue in the (base + offset) calculation
when base is negative. The impact on code quality should be limited
since SILoadStoreOptimizer still runs afterwards and is able to
combine loads/stores based on known sign information.
This fixes visible corruption in Hitman on SI (easily reproducible
by running benchmark mode).
Change-Id: Ia178d207a5e2ac38ae7cd98b532ea2ae74704e5f
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99923
Reviewers: arsenm, mareko
Subscribers: jholewinski, kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D53160
llvm-svn: 344698
Nicolai Haehnle [Wed, 17 Oct 2018 15:37:41 +0000 (15:37 +0000)]
StructurizeCFG: Simplify inserted PHI nodes
Summary:
This improves subsequent divergence analysis in some cases.
Change-Id: I5e95e7ec7fd3fa80d414d1a53a02fea23e3d67d3
Reviewers: arsenm, rampitec
Subscribers: jvesely, wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D53316
llvm-svn: 344697
Nicolai Haehnle [Wed, 17 Oct 2018 15:37:30 +0000 (15:37 +0000)]
AMDGPU: Divergence-driven selection of scalar buffer load intrinsics
Summary:
Moving SMRD to VMEM in SIFixSGPRCopies is rather bad for performance if
the load is really uniform. So select the scalar load intrinsics directly
to either VMEM or SMRD buffer loads based on divergence analysis.
If an offset happens to end up in a VGPR -- either because a floating
point calculation was involved, or due to other remaining deficiencies
in SIFixSGPRCopies -- we use v_readfirstlane.
There is some unrelated churn in tests since we now select MUBUF offsets
in a unified way with non-scalar buffer loads.
Change-Id: I170e6816323beb1348677b358c9d380865cd1a19
Reviewers: arsenm, alex-t, rampitec, tpr
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D53283
llvm-svn: 344696
Clement Courbet [Wed, 17 Oct 2018 15:04:15 +0000 (15:04 +0000)]
[llvm-exegesis] Allow measuring several instructions in a single run.
Summary:
We try to recover gracefully on instructions that would crash the
program.
This includes some refactoring of runMeasurement() implementations.
Reviewers: gchatelet
Subscribers: tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D53371
llvm-svn: 344695
Theodoros Theodoridis [Wed, 17 Oct 2018 15:01:18 +0000 (15:01 +0000)]
Fix broken formatting caused by test commit
llvm-svn: 344694
Sam Parker [Wed, 17 Oct 2018 13:02:48 +0000 (13:02 +0000)]
[ARM] bottom-top mul support in ARMParallelDSP
Previously reverted in rL343082.
Original commit message:
On failing to find sequences that can be converted into dual macs,
try to find sequential 16-bit loads that are used by muls which we
can then use smultb, smulbt, smultt with a wide load.
Differential Revision: https://reviews.llvm.org/D51983
llvm-svn: 344693
Guillaume Chatelet [Wed, 17 Oct 2018 12:27:46 +0000 (12:27 +0000)]
Fix uninitialized variable
llvm-svn: 344692
Nicolai Haehnle [Wed, 17 Oct 2018 12:14:26 +0000 (12:14 +0000)]
AMDGPU: Remove dead TableGen code
Summary: Change-Id: Ic1f2c1d0cf9e90a0baa9fc6bacd0d3c386069fb0
Reviewers: tpr
Subscribers: arsenm, kzhuravl, jvesely, wdng, yaxunl, dstuttard, t-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D53318
Change-Id: Ib4d143c898801e5cf6cb9999a495d62c91ae77fb
llvm-svn: 344691
Guillaume Chatelet [Wed, 17 Oct 2018 12:09:21 +0000 (12:09 +0000)]
BuildBot fix, compiler complains about array decay to pointer
llvm-svn: 344690
Guillaume Chatelet [Wed, 17 Oct 2018 11:37:28 +0000 (11:37 +0000)]
[llvm-exegeis] Computing Latency configuration upfront so we can generate many CodeTemplates at once.
Summary: LatencyGenerator now computes all possible mode of serial execution for an Instruction upfront and generates CodeTemplate for the ones that give the best results (e.g. no need to generate a two instructions snippet when repeating a single one would do). The next step is to generate even more configurations for cases (e.g. for XOR we should generate "XOR EAX, EAX, EAX" and "XOR EAX, EAX, EBX")
Reviewers: courbet
Reviewed By: courbet
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53320
llvm-svn: 344689
Eric Liu [Wed, 17 Oct 2018 11:19:02 +0000 (11:19 +0000)]
[clangd] Support scope proximity in code completion.
Summary:
This should make all-scope completion more usable. Scope proximity for
indexes will be added in followup patch.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53131
llvm-svn: 344688
Max Kazantsev [Wed, 17 Oct 2018 11:16:25 +0000 (11:16 +0000)]
[NFC] Remove GOTO from SCEV
llvm-svn: 344687
Fedor Sergeev [Wed, 17 Oct 2018 11:01:15 +0000 (11:01 +0000)]
[NewPM] Fixing test failure on Windows - removed opt binary name from pattern
llvm-svn: 344686
Fedor Sergeev [Wed, 17 Oct 2018 10:36:23 +0000 (10:36 +0000)]
[NewPM] teach -passes= to emit meaningful error messages
All the PassBuilder::parse interfaces now return descriptive StringError
instead of a plain bool. It allows to make -passes/aa-pipeline parsing
errors context-specific and thus less confusing.
TODO: ideally we should also make suggestions for misspelled pass names,
but that requires some extensions to PassBuilder.
Reviewed By: philip.pfaffe, chandlerc
Differential Revision: https://reviews.llvm.org/D53246
llvm-svn: 344685
Petar Jovanovic [Wed, 17 Oct 2018 10:30:03 +0000 (10:30 +0000)]
[MIPS GlobalISel] Legalize constants
Legalize s1, s8, s16 and s64 G_CONSTANT for MIPS32.
Patch by Petar Avramovic.
Differential Revision: https://reviews.llvm.org/D53077
llvm-svn: 344684
Sjoerd Meijer [Wed, 17 Oct 2018 10:05:44 +0000 (10:05 +0000)]
[ARM] Do not fuse VADD and VMUL, continued (2/2)
This is patch 2/2, following up on D53314, and is the functional change
to prevent fusing mul + add sequences into VFMAs.
Differential revision: https://reviews.llvm.org/D53315
llvm-svn: 344683
Theodoros Theodoridis [Wed, 17 Oct 2018 09:59:41 +0000 (09:59 +0000)]
Test commit
llvm-svn: 344682
Fedor Sergeev [Wed, 17 Oct 2018 09:02:54 +0000 (09:02 +0000)]
[LoopPredication] add some simple stats
Just adding some useful statistics to LoopPredication pass
which was lacking any of these.
llvm-svn: 344681
Haojian Wu [Wed, 17 Oct 2018 08:54:48 +0000 (08:54 +0000)]
[clangd] Fix buildbot failure.
llvm-svn: 344680
Haojian Wu [Wed, 17 Oct 2018 08:48:04 +0000 (08:48 +0000)]
[clangd] Print numbers of symbols and refs as well when loading the
index.
llvm-svn: 344679
Haojian Wu [Wed, 17 Oct 2018 08:38:36 +0000 (08:38 +0000)]
[clangd] Collect refs from headers.
Summary:
Add a flag to SymbolCollector to collect refs fdrom headers.
Note that we collect refs from headers in static index, and we don't do it for
dynamic index because of the preamble (we skip function body in preamble,
collecting it will result incomplete results).
Reviewers: sammccall
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53322
llvm-svn: 344678
Sjoerd Meijer [Wed, 17 Oct 2018 07:51:24 +0000 (07:51 +0000)]
[ARM] Follow up of rL344671, attempt to pacify a buildbot
It was rightfully complaining about an unpretty logical expression.
llvm-svn: 344677
Sam McCall [Wed, 17 Oct 2018 07:41:53 +0000 (07:41 +0000)]
[clangd] Hide unused function. NFC
llvm-svn: 344676
Sam McCall [Wed, 17 Oct 2018 07:39:32 +0000 (07:39 +0000)]
[clangd] Rename and move trivial logger to Logger.cpp. NFC
llvm-svn: 344675
George Rimar [Wed, 17 Oct 2018 07:37:26 +0000 (07:37 +0000)]
[LLDB] - Add support for DW_RLE_start_end entries (.debug_rnglists)
DWARF5 describes DW_RLE_start_end as:
This is a form of bounded range entry that has two target address operands.
Each operand is the same size as used in DW_FORM_addr. These indicate
the starting and ending addresses, respectively, that define the address range
for which the following location is valid.
The patch implements the support.
Differential revision: https://reviews.llvm.org/D53193
llvm-svn: 344674
Sam McCall [Wed, 17 Oct 2018 07:33:42 +0000 (07:33 +0000)]
[clangd] Simplify client capabilities parsing.
Summary:
Instead of parsing into structs that mirror LSP, simply parse into a flat struct
that contains the info we need.
This is an exception to our strategy with Protocol.h, which seems justified:
- the structure here is very large and deeply nested
- we care about almost none of it
- we should never have to serialize client capabilities
Reviewers: kadircet
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D53266
llvm-svn: 344673
Sam McCall [Wed, 17 Oct 2018 07:32:05 +0000 (07:32 +0000)]
[clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction. (re-land r344620)
Summary:
This paves the way for alternative transports (mac XPC, maybe messagepack?),
and also generally improves layering: testing ClangdLSPServer becomes less of
a pipe dream, we split up the JSONOutput monolith, etc.
This isn't a final state, much of what remains in JSONRPCDispatcher can go away,
handlers can call reply() on the transport directly, JSONOutput can be renamed
to StreamLogger and removed, etc. But this patch is sprawling already.
The main observable change (see tests) is that hitting EOF on input is now an
error: the client should send the 'exit' notification.
This is defensible: the protocol doesn't spell this case out. Reproducing the
current behavior for all combinations of shutdown/exit/EOF clutters interfaces.
We can iterate on this if desired.
Reviewers: jkorous, ioeric, hokein
Subscribers: mgorny, ilya-biryukov, MaskRay, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53286
llvm-svn: 344672
Sjoerd Meijer [Wed, 17 Oct 2018 07:26:35 +0000 (07:26 +0000)]
[ARM][NFCI] Do not fuse VADD and VMUL, continued (1/2)
This is a follow up of rL342874, which stopped fusing muls and adds into VMLAs
for performance reasons on the Cortex-M4 and Cortex-M33. This is a serie of 2
patches, that is trying to achieve the same for VFMA. The second column in the
table below shows what we were generating before rL342874, the third column
what changed with rL342874, and the last column what we want to achieve with
these 2 patches:
--------------------------------------------------------
| Opt | < rL342874 | >= rL342874 | |
|------------------------------------------------------|
|-O3 | vmla | vmul | vmul |
| | | vadd | vadd |
|------------------------------------------------------|
|-Ofast | vfma | vfma | vmul |
| | | | vadd |
|------------------------------------------------------|
|-Oz | vmla | vmla | vmla |
--------------------------------------------------------
This patch 1/2, is a cleanup of the spaghetti predicate logic on the different
VMLA and VFMA codegen rules, so that we can make the final functional change in
patch 2/2. This also fixes a typo in the regression test added in rL342874.
Differential revision: https://reviews.llvm.org/D53314
llvm-svn: 344671
Dean Michael Berris [Wed, 17 Oct 2018 06:57:50 +0000 (06:57 +0000)]
[XRay][compiler-rt] Generational Buffer Management
Summary:
This change updates the buffer queue implementation to support using a
generation number to identify the lifetime of buffers. This first part
introduces the notion of the generation number, without changing the way
we handle the buffers yet.
What's missing here is the cleanup of the buffers. Ideally we'll keep
the two most recent generations. We need to ensure that before we do any
writes to the buffers, that we check the generation number(s) first.
Those changes will follow-on from this change.
Depends on D52588.
Reviewers: mboerger, eizan
Subscribers: llvm-commits, jfb
Differential Revision: https://reviews.llvm.org/D52974
llvm-svn: 344670
Sylvestre Ledru [Wed, 17 Oct 2018 06:35:10 +0000 (06:35 +0000)]
Document the behavior of option passing when using -DCLANG_ENABLE_BOOTSTRAP=On
Also document -DCLANG_BOOTSTRAP_PASSTHROUGH
Reviewers: ecbeckmann
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53018
llvm-svn: 344669
Takuto Ikuta [Wed, 17 Oct 2018 04:29:56 +0000 (04:29 +0000)]
NFC: Remove trailing space from CodeGenModule.cpp
llvm-svn: 344668
Lang Hames [Wed, 17 Oct 2018 03:34:09 +0000 (03:34 +0000)]
[BuildingAJIT] Update chapter 1 to use the ORCv2 APIs.
llvm-svn: 344667
Michal Gorny [Wed, 17 Oct 2018 03:05:39 +0000 (03:05 +0000)]
[python] [tests] Disable on known-broken arches
Disable the Python binding tests on AArch64, Hexagon and SystemZ
following reports on test failures. The first two yield different
results, possibly indicating test case problems. The last one seems
to have broken FFI in Python.
While at it, refactor the code to make adding future test restrictions
easier.
Differential Revision: https://reviews.llvm.org/D53326
llvm-svn: 344666
Yaxun Liu [Wed, 17 Oct 2018 02:32:26 +0000 (02:32 +0000)]
AMDGPU: add __builtin_amdgcn_update_dpp
Emit llvm.amdgcn.update.dpp for both __builtin_amdgcn_mov_dpp and
__builtin_amdgcn_update_dpp. The first argument to
llvm.amdgcn.update.dpp will be undef for __builtin_amdgcn_mov_dpp.
Differential Revision: https://reviews.llvm.org/D52320
llvm-svn: 344665
George Karpenkov [Wed, 17 Oct 2018 01:15:53 +0000 (01:15 +0000)]
[analyzer] [www] Minor improvements to the text in open_projects
llvm-svn: 344664
George Karpenkov [Wed, 17 Oct 2018 01:06:20 +0000 (01:06 +0000)]
[analyzer] [www] Updated a list of open projects
Differential Revision: https://reviews.llvm.org/D53024
llvm-svn: 344663
Teresa Johnson [Wed, 17 Oct 2018 00:59:14 +0000 (00:59 +0000)]
New test requires x86-registered-target
New test added in r344658 also requires x86-registered-target.
llvm-svn: 344662
Louis Dionne [Wed, 17 Oct 2018 00:34:13 +0000 (00:34 +0000)]
[libcxx] Mark chrono literal unit tests as being unsupported on AppleClang 10
llvm-svn: 344661
Teresa Johnson [Wed, 17 Oct 2018 00:19:21 +0000 (00:19 +0000)]
[ThinLTO] Fix test to require asserts
New test added in r344658 requires asserts due to -stats.
While here, augment it to test new global variable importing
message as well.
llvm-svn: 344660
Leonard Chan [Wed, 17 Oct 2018 00:16:07 +0000 (00:16 +0000)]
[Sanitizer][PassManager] Fix for failing ASan tests on arm-linux-gnueabihf
Forgot to initialize the legacy pass in it's constructor.
Differential Revision: https://reviews.llvm.org/D53350
llvm-svn: 344659
Teresa Johnson [Tue, 16 Oct 2018 23:49:50 +0000 (23:49 +0000)]
[ThinLTO] Add importing stats to thin link
Summary:
Previously we could only get the number of imported functions and
variables from the backend. This adds stats to the thin link where the
importing is decided.
Reviewers: wmi
Subscribers: inglorion, dexonsmith, llvm-commits
Differential Revision: https://reviews.llvm.org/D53337
llvm-svn: 344658
Jonathan Metzman [Tue, 16 Oct 2018 23:43:57 +0000 (23:43 +0000)]
[SanitizerCoverage] Don't duplicate code to get section pointers
Summary:
Merge code used to get section start and section end pointers
for SanitizerCoverage constructors. This includes code that handles
getting the start pointers when targeting MSVC.
Reviewers: kcc, morehouse
Reviewed By: morehouse
Subscribers: kcc, hiraditya
Differential Revision: https://reviews.llvm.org/D53211
llvm-svn: 344657
Julie Hockett [Tue, 16 Oct 2018 23:07:37 +0000 (23:07 +0000)]
[clang-doc] Limit integration tests
Now that the clang-doc libraries are covered by unit tests, we don't
need to have extensive (and unmaintainable) integration tests. This
replaces the integration test suite with a smaller one that just tests
the tool itself and removes extraneous dumping logic from the tool
itself.
Includes tests that cover the parse->serialize->merge->generate
pipeline, as well as tests for the --public, --format, --doxygen, and
--output flags.
Differential Revision: https://reviews.llvm.org/D53150
llvm-svn: 344655
Julie Hockett [Tue, 16 Oct 2018 23:07:26 +0000 (23:07 +0000)]
[clang-doc] Add unit tests for Markdown generation
Add unit tests for Markdown generation.
This is part of a move to convert clang-doc's tests to a more
maintainable unit test framework, with a smaller number of integration
tests to maintain and more granular failure feedback.
Differential Revision: https://reviews.llvm.org/D53085
llvm-svn: 344654
Julie Hockett [Tue, 16 Oct 2018 23:07:16 +0000 (23:07 +0000)]
[clang-doc] Add unit tests for YAML generation
Adds unit tests for the YAML generator library.
This is part of a move to convert clang-doc's tests to a more
maintainable unit test framework, with a smaller number of integration
tests to maintain and more granular failure feedback.
Differential Revision: https://reviews.llvm.org/D53084
llvm-svn: 344653
Julie Hockett [Tue, 16 Oct 2018 23:07:04 +0000 (23:07 +0000)]
[clang-doc] Add unit tests for merging
Adds unit tests for the merging logic in Respresentation.cpp.
This is part of a move to convert clang-doc's tests to a more
maintainable unit test framework, with a smaller number of integration
tests to maintain and more granular failure feedback.
Differential Revision: https://reviews.llvm.org/D53083
llvm-svn: 344652
Julie Hockett [Tue, 16 Oct 2018 23:06:53 +0000 (23:06 +0000)]
[clang-doc] Add unit tests for bitcode
Adds unit tests for the BitcodeWriter and BitcodeReader libraries.
This is part of a move to convert clang-doc's tests to a more
maintainable unit test framework, with a smaller number of integration
tests to maintain and more granular failure feedback.
Differential Revision: https://reviews.llvm.org/D53082
llvm-svn: 344651
Julie Hockett [Tue, 16 Oct 2018 23:06:42 +0000 (23:06 +0000)]
[clang-doc] Add unit tests for serialization
Adds unit tests for the Serialize library.
This is part of a move to convert clang-doc's tests to a more
maintainable unit test framework, with a smaller number of integration
tests to maintain and more granular failure feedback.
Differential Revision: https://reviews.llvm.org/D53081
llvm-svn: 344650
Craig Topper [Tue, 16 Oct 2018 22:29:36 +0000 (22:29 +0000)]
[X86] Match (cmp (and (shr X, C), mask), 0) to BEXTR+TEST.
Without this we match the CMP+AND to a TEST and then match the SHR separately. I'm trusting analyzeCompare to remove the TEST during the peephole pass. Otherwise we need to check the flag users to see if they only use the Z flag.
This recovers a case lost by r344270.
Differential Revision: https://reviews.llvm.org/D53310
llvm-svn: 344649
Adrian Prantl [Tue, 16 Oct 2018 22:01:49 +0000 (22:01 +0000)]
Delete commented-out code.
llvm-svn: 344648
Jim Ingham [Tue, 16 Oct 2018 21:58:40 +0000 (21:58 +0000)]
Return a named error in the result object of an expression with no result
Before we returned an error that was not exposed in the SB API and no useful
error message. This change returns eExpressionProducedNoResult and an
appropriate error string.
<rdar://problem/
44539514>
Differential Revision: https://reviews.llvm.org/D53309
llvm-svn: 344647
Jason Molenda [Tue, 16 Oct 2018 21:49:31 +0000 (21:49 +0000)]
Fixed an issue that a bot found with my changes
in r344626 & recommitting. Original commit msg:
Simplify LocateDSYMInVincinityOfExecutable by moving
some redundant code into a separate function,
LookForDsymNextToExecutablePath, and having that function
also look for .dSYM.yaa files in addition to .dSYM
bundles.
Differential Revision: https://reviews.llvm.org/D53305
<rdar://problem/
40406580>
llvm-svn: 344646
David Bolvansky [Tue, 16 Oct 2018 21:18:31 +0000 (21:18 +0000)]
[InstCombine] Cleanup libfunc attribute inferring
Reviewers: efriedma
Reviewed By: efriedma
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53338
llvm-svn: 344645
Jan Kratochvil [Tue, 16 Oct 2018 20:49:15 +0000 (20:49 +0000)]
Code cleanup: Remove DWARFDebugInfoEntry::m_empty_children
It merges DWARFDebugInfoEntry's m_empty_children into m_has_children.
m_empty_children was implemented by rL144983.
As Greg confirmed m_has_children was used to represent what was in the DWARF in
the byte that follows the DW_TAG. m_empty_children was used for DIEs that said
they had children but actually only contain a single NULL tag. It is fine to
not differentiate between the two.
Also changed assert()->lldbassert() for m_abbr_idx 16-bit overflow check as
that could be a tough bug to catch if it ever happens.
I have checked all calls of HasChildren() that this change should not matter to
them. The code even wants to know if there are any children - it does not
matter how the children presence is coded in the binary.
Patch written based on suggestions by Greg Clayton.
Differential Revision: https://reviews.llvm.org/D53321
llvm-svn: 344644
Lang Hames [Tue, 16 Oct 2018 20:13:06 +0000 (20:13 +0000)]
[ORC] Make the VModuleKey optional, propagate it via MaterializationUnit and
MaterializationResponsibility.
VModuleKeys are intended to enable selective removal of modules from a JIT
session, however for a wide variety of use cases selective removal is not
needed and introduces unnecessary overhead. As of this commit, the default
constructed VModuleKey value is reserved as a "do not track" value, and
becomes the default when adding a new module to the JIT.
This commit also changes the propagation of VModuleKeys. They were passed
alongside the MaterializationResponsibity instance in XXLayer::emit methods,
but are now propagated as part of the MaterializationResponsibility instance
itself (and as part of MaterializationUnit when stored in a JITDylib).
Associating VModuleKeys with MaterializationUnits in this way should allow
for a thread-safe module removal mechanism in the future, even when a module
is in the process of being compiled, by having the
MaterializationResponsibility object check in on its VModuleKey's state
before commiting its results to the JITDylib.
llvm-svn: 344643
Louis Dionne [Tue, 16 Oct 2018 20:02:59 +0000 (20:02 +0000)]
[libcxx] Avoid repeating the definition of std:: namespaces
This reduces code duplication a tiny bit.
llvm-svn: 344642
Louis Dionne [Tue, 16 Oct 2018 19:26:23 +0000 (19:26 +0000)]
[libcxx] Remove _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
That macro has been defined to _LIBCPP_HIDE_FROM_ABI_AFTER_V1 for many
weeks now, so we're actually replacing uses of it for uses of
_LIBCPP_HIDE_FROM_ABI_AFTER_V1 directly.
This should not change or break anything since the two macros are
100% equivalent, unless somebody is (incorrectly!) relying on
_LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY being defined.
llvm-svn: 344641
Krasimir Georgiev [Tue, 16 Oct 2018 18:50:09 +0000 (18:50 +0000)]
Revert "[WebAssembly] LSDA info generation"
This reverts commit r344575.
Newly introduced test eh-lsda.ll.test fails with use-after-free under
ASAN build.
llvm-svn: 344639
Krasimir Georgiev [Tue, 16 Oct 2018 18:44:41 +0000 (18:44 +0000)]
Revert "[clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction."
This reverts commit r344620.
Breaks upstream bots.
llvm-svn: 344637
Jason Molenda [Tue, 16 Oct 2018 18:25:46 +0000 (18:25 +0000)]
Revert r344626 while I address a testsuite failure from a bot.
llvm-svn: 344636
Jason Molenda [Tue, 16 Oct 2018 18:14:30 +0000 (18:14 +0000)]
Tiny testsuite tweaks. Don't run the apple simulator
tests when targetting a device. Add an include to
safe-to-call-func to work around a modules issue with
a certain combination of header files. Add rules for
Darwin systems to ad-hoc codesign binaries that the
testsuite builds.
llvm-svn: 344635
Vedant Kumar [Tue, 16 Oct 2018 18:13:42 +0000 (18:13 +0000)]
Use a relaxed substring check for function names in a test
The TestTailCallFrameSBAPI.py test checks that function names in a
backtrace are equal to an expected value.
Use a relaxed substring check because function dislpay names are
platform-dependent. E.g we see "void sink(void)" on Windows, but "sink()" on
Darwin. This seems like a bug -- just work around it for now.
llvm-svn: 344634
Jason Molenda [Tue, 16 Oct 2018 18:11:17 +0000 (18:11 +0000)]
Don't run TestBreakpointIt.py on arm64 devices;
it is armv7 specific.
llvm-svn: 344633
Evandro Menezes [Tue, 16 Oct 2018 17:41:45 +0000 (17:41 +0000)]
[PATCH] [NFC][AArch64] Fix refactoring of macro fusion
Fix compiler error.
llvm-svn: 344632
Teresa Johnson [Tue, 16 Oct 2018 17:37:45 +0000 (17:37 +0000)]
[LTO] Call InitLLVM from llvm-lto2
Summary:
D45602 added this to most tools, including llvm-lto, but not to
llvm-lto2. Add it there and test that it works in both lto tools.
Reviewers: ruiu
Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits
Differential Revision: https://reviews.llvm.org/D53330
llvm-svn: 344631
Yaxun Liu [Tue, 16 Oct 2018 17:36:23 +0000 (17:36 +0000)]
Disable code object version 3 for HIP toolchain
AMDGPU backend will switch to code object version 3 by default.
Since HIP runtime is not ready, disable it until the runtime is ready.
Differential Revision: https://reviews.llvm.org/D53325
llvm-svn: 344630
Leonard Chan [Tue, 16 Oct 2018 17:35:41 +0000 (17:35 +0000)]
[Intrinsic] Signed Saturation Addition Intrinsic
Add an intrinsic that takes 2 integers and perform saturation addition on them.
This is a part of implementing fixed point arithmetic in clang where some of
the more complex operations will be implemented as intrinsics.
Differential Revision: https://reviews.llvm.org/D53053
llvm-svn: 344629
Jason Molenda [Tue, 16 Oct 2018 17:31:33 +0000 (17:31 +0000)]
For a built & test bot, add an environment variable PLATFORM_SDK_DIRECTORY,
which PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded
which examine for any additional SDK directories when it is
constructing its list.
<rdar://problem/
42984340>
<rdar://problem/
41351223>
llvm-svn: 344628
Marshall Clow [Tue, 16 Oct 2018 17:27:54 +0000 (17:27 +0000)]
Recommit <chrono> changes with a couple xtra tests marked to fail on apple's clang. Reviewed as D51762
llvm-svn: 344627