Commit Graph

277705 Commits

Author SHA1 Message Date
Dean Michael Berris
c360f41097 [XRay][compiler-rt] Implement logging implementation registration
Summary:
This change allows for registration of multiple logging implementations
through a central mechanism in XRay, mapping an implementation to a
"mode". Modes are strings that are used as keys to determine which
implementation to install through a single API. This mechanism allows
users to choose which implementation to install either from the
environment variable 'XRAY_OPTIONS' with the `xray_mode=` flag, or
programmatically using the `__xray_select_mode(...)` function.

Here, we introduce two API functions for the XRay logging:

__xray_log_register_mode(Mode, Impl): Associates an XRayLogImpl to a
string Mode. We can only have one implementation associated with a given
Mode.

__xray_log_select_mode(Mode): Finds the associated Impl for Mode and
installs it as if by calling `__xray_set_log_impl(...)`.

Along with these changes, we also deprecate the xray_naive_log and
xray_fdr_log flags and encourage users to instead use the xray_mode
flag.

Reviewers: kpw, dblaikie, eizan, pelikan

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D40703

llvm-svn: 319759
2017-12-05 12:08:56 +00:00
Simon Pilgrim
a2b5862641 [X86][AVX512] Cleanup VPCMP scheduler classes
Move hardcoded itinerary out to the instruction declarations. Not sure that IIC_SSE_ALU_F32P is the best schedule for integer comparisons, but I'm not going to change it right now.

llvm-svn: 319758
2017-12-05 12:02:22 +00:00
Simon Pilgrim
54b8aa2bb2 [X86][AVX512] Tag VFIXUPIMM instructions scheduler classes
llvm-svn: 319757
2017-12-05 11:46:57 +00:00
Jonas Paulsson
b5b91cd402 [SystemZ] set 'guessInstructionProperties = 0' and set flags as needed.
This has proven a healthy exercise, as many cases of incorrect instruction
flags were corrected in the process. As part of this, IntrWriteMem was added
to several SystemZ instrinsics.

Furthermore, a bug was exposed in TwoAddress with this change (as incorrect
hasSideEffects flags were removed and instructions could now be sunk), and
the test case for that bugfix (r319646) is included here as
test/CodeGen/SystemZ/twoaddr-sink.ll.

One temporary test regression (one extra copy) which will hopefully go away
in upcoming patches for similar cases:
test/CodeGen/SystemZ/vec-trunc-to-i1.ll

Review: Ulrich Weigand.
https://reviews.llvm.org/D40437

llvm-svn: 319756
2017-12-05 11:24:39 +00:00
Peter Smith
7c40f93f38 [ELF] InX::BssRelRo should check section contents before marking relro
When a linker script is used with a pattern like { *(.bss .bss.*) } the
InX::BssRelRo section will match against .bss.*. By matching on the name
only, in the same way that .data.rel.ro works we prevent this
from happening, but permit scripts that want to explicitly provide
a .bss.rel.ro OutputSection.
    
Differential Revision: https://reviews.llvm.org/D40735

llvm-svn: 319755
2017-12-05 11:15:58 +00:00
Jonas Paulsson
86c40db49d [Regalloc] Generate and store multiple regalloc hints.
MachineRegisterInfo used to allow just one regalloc hint per virtual
register. This patch extends this to a vector of regalloc hints, which is
filled in by common code with sorted copy hints. Such hints will make for
more ID copies that can be removed.

NB! This improvement is currently (and hopefully temporarily) *disabled* by
default, except for SystemZ. The only reason for this is the big impact this
has on tests, which has unfortunately proven unmanageable. It was a long
while since all the tests were updated and just waiting for review (which
didn't happen), but now targets have to enable this themselves
instead. Several targets could get a head-start by downloading the tests
updates from the Phabricator review. Thanks to those who helped, and sorry
you now have to do this step yourselves.

This should be an improvement generally for any target!

The target may still create its own hint, in which case this has highest
priority and is stored first in the vector. If it has target-type, it will
not be recomputed, as per the previous behaviour.

The temporary hook enableMultipleCopyHints() will be removed as soon as all
targets return true.

Review: Quentin Colombet, Ulrich Weigand.
https://reviews.llvm.org/D38128

llvm-svn: 319754
2017-12-05 10:52:24 +00:00
Ilya Biryukov
d3b04e3517 [clangd] Set completion options per-request.
Summary:
Previously, completion options were set per ClangdServer instance.
It will allow to change completion preferences during the lifetime
of a single ClangdServer instance.

Also rewrote ClangdCompletionTest.CompletionOptions to reuse single
ClangdServer instance, the test now runs 2x faster on my machine.

Reviewers: sammccall, ioeric, hokein

Reviewed By: sammccall, ioeric

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D40654

llvm-svn: 319753
2017-12-05 10:42:57 +00:00
George Rimar
08f5986e4d Fix build bot after r319750 "[Support/TarWriter] - Don't allow TarWriter to add the same file more than once."
Error was:
error: comparison of integers of different signs: 'const unsigned long' and 'const int' [-Werror,-Wsign-compare]

http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror/builds/3469/steps/build-unified-tree/logs/stdio
http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/7118/steps/build-stage2-compiler/logs/stdio

llvm-svn: 319752
2017-12-05 10:35:11 +00:00
Pavel Labath
2da3397cdf Re-commit "[cmake] Enable zlib support on windows"
This recommits r319533 which was broken llvm-config --system-libs
output.  The reason was that I used find_libraries for searching for the
z library.  This returns absolute paths, and when these paths made it
into llvm-config, it made it produce nonsensical flags.  To fix this, I
hand-roll a search for the library in the same way that we search for
the terminfo library a couple of lines below.

This is a bit less flexible than the find_library option, as it does not
allow the user to specify the path to the library at configure time
(which is important on windows, as zlib is unlikely to be found in any
of the standard places cmake searches), but I was able to guide the
build to find it with appropriate values of LIB and INCLUDE environment
variables.

Reviewers: compnerd, rnk, beanz, rafael

Subscribers: llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D40779

llvm-svn: 319751
2017-12-05 10:24:15 +00:00
George Rimar
f91f0b0af7 [Support/TarWriter] - Don't allow TarWriter to add the same file more than once.
This is for PR35460.

Currently when LLD adds files to TarWriter it may pass the same file
multiple times. For example it happens for clang reproduce file which specifies
archive (.a) files more than once in command line. 
Patch makes TarWriter to ignore files with the same path, so it will
add only the first one to archive.

Differential revision: https://reviews.llvm.org/D40606

llvm-svn: 319750
2017-12-05 10:09:59 +00:00
George Rimar
fe52e0064b [ELF] - Revert r319747 "[ELF] - Show copy relocated symbols in a --Map file output.".
It broke bots:
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/15570/steps/test_lld/logs/stdio
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/10930/steps/check-lld%20asan/logs/stdio
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/16336/steps/test%20lld/logs/stdio

According to outputs,
.dynstr section has different sizes for some reason.

llvm-svn: 319749
2017-12-05 09:38:05 +00:00
Sylvestre Ledru
c941039bd4 [clang-format] Releasenotes for rL319024 : Add option to group multiple #include blocks when sorting includes
Summary:
This change adds missing releasenotes for commit rL319024
https://reviews.llvm.org/rL319024

Patch by Krzysztof Kapusta

Reviewers: sylvestre.ledru

Reviewed By: sylvestre.ledru

Differential Revision: https://reviews.llvm.org/D40827

llvm-svn: 319748
2017-12-05 09:23:47 +00:00
George Rimar
d9ae97cdb6 [ELF] - Show copy relocated symbols in a --Map file output.
As mentioned in PR35471, copied symbols did not show
in --Map output. Patch fixes that.

Differential revision: https://reviews.llvm.org/D40785

llvm-svn: 319747
2017-12-05 09:13:45 +00:00
Ed Schouten
1382a32a73 Add __WINT_MAX__.
This definition is similar to __WCHAR_MAX__, except that it applies to
wint_t. It's also documented as being supported by GCC 4.5 and later.

llvm-svn: 319746
2017-12-05 09:13:18 +00:00
Guy Blank
f3cefdd350 [X86] Fix a bug in handling GRXX subclasses in Domain Reassignment pass
When trying to determine the correct Mask register class corresponding
to a GPR register class, not all register classes were handled.
This caused an assertion to be raised on some scenarios.

Differential Revision:
https://reviews.llvm.org/D40290

llvm-svn: 319745
2017-12-05 09:08:24 +00:00
Craig Topper
98495291a7 [SelectionDAG] Use WidenTargetBoolean in WidenVecRes_MLOAD and WidenVecOp_MSTORE instead of implementing it manually and incorrectly.
The CONCAT_VECTORS operand get its type from getSetCCResultType, but if the mask type and the setcc have different scalar sizes this creates an illegal CONCAT_VECTORS operation. The concat type should be 2x the mask type, and then an extend should be added if needed.

llvm-svn: 319744
2017-12-05 08:15:03 +00:00
Michael Trent
1854eccaf6 Test commit, as per the LLVM Developer Policy.
Commit message, as per the same policy. I added a blank space to the end
of the file. Excelsior.

llvm-svn: 319743
2017-12-05 07:50:00 +00:00
Sam McCall
93cd99173f [clangd] Remove unused test param. NFC
llvm-svn: 319742
2017-12-05 07:34:35 +00:00
Sam McCall
9aad25f193 [clangd] Split code-completion tests out of ClangdTests. NFC.
Summary:
Common parts are mostly FS related, so pulled out TestFS.h for the common stuff.
Deliberately resisted cleaning up much here, so this is pretty mechanical.

Reviewers: hokein

Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits

Differential Revision: https://reviews.llvm.org/D40784

llvm-svn: 319741
2017-12-05 07:20:26 +00:00
Craig Topper
a404ce955a [X86] Use vector widening to support sign extend from i1 when the dest type is not 512-bits and vlx is not enabled.
Previously we used a wider element type and truncated. But its more efficient to keep the element type and drop unused elements.

If BWI isn't supported and we have a i16 or i8 type, we'll extend it to be i32 and still use a truncate.

llvm-svn: 319740
2017-12-05 06:37:21 +00:00
Daniel Sanders
3c1c4c0ee0 Revert r319691: [globalisel][tablegen] Split atomic load/store into separate opcode and enable for AArch64.
Some concerns were raised with the direction. Revert while we discuss it and look into an alternative

llvm-svn: 319739
2017-12-05 05:52:07 +00:00
Kuba Mracek
04013b704c Disable detect_leaks in the ASanified build of LLVM when using Apple LLVM. The released Apple LLVM versions don't support LSan.
llvm-svn: 319738
2017-12-05 05:22:02 +00:00
Craig Topper
e1ba2450c2 [X86] Fix a crash if avx512bw and xop are both enabled when the IR contrains a v32i8 bitreverse.
llvm-svn: 319737
2017-12-05 04:47:12 +00:00
Marshall Clow
7700912976 Land D28253 which fixes PR28929 (which we mistakenly marked as fixed before)
llvm-svn: 319736
2017-12-05 04:09:49 +00:00
Matt Arsenault
e4f6280a26 AMDGPU: Don't add fp64 feature to r600 subtargets
Should fix test after r319709

llvm-svn: 319735
2017-12-05 03:51:26 +00:00
Marshall Clow
c78e12eaf8 Add issue 2587, which was missed
llvm-svn: 319734
2017-12-05 03:51:16 +00:00
Matt Arsenault
e42b08d96d AMDGPU: Fix missing subtarget feature initializer
llvm-svn: 319733
2017-12-05 03:15:44 +00:00
Matt Arsenault
9a60c3ea36 AMDGPU: Fix crash when scheduling DBG_VALUE
This calls handleMove with a DBG_VALUE instruction,
which isn't tracked by LiveIntervals. I'm not sure
this is the correct place to fix this. The generic
scheduler seems to have more deliberate region
selection that skips dbg_value.

The test is also really hard to reduce. I haven't been able
to figure out what exactly causes this particular case to
try moving the dbg_value.

llvm-svn: 319732
2017-12-05 03:09:23 +00:00
Jim Ingham
ba205c1b76 Add target.process.stop-on-exec setting, and obey it.
Also add a test.  There should also be control for this
in ProcessLaunchInfo and a "target launch" flag, but at least
this will allow you to control it somehow.

<rdar://problem/35842137>

llvm-svn: 319731
2017-12-05 02:50:45 +00:00
Jim Ingham
45816d6b91 Clean up stop hook output in case a hook restarts.
I was warning about the fact that this will abort
further stop hooks, but didn't check that there WAS
a further stop hook.  Also the warning was missing a
newline.

llvm-svn: 319730
2017-12-05 02:34:05 +00:00
Alex Lorenz
80b55ee62d [libclang] Store unsaved file hashes when recording parsing invocations
Storing the contents of unsaved files is too expensive.
Instead a hash is stored with a record invocation. When a reproducer is
generated, Clang will compare the stored hashes to the new hashes to determine
if the contents of a file has changed. This way we'll know when a reproducer was
generated for a different source to the one that triggered the original crash.

rdar://35322543

llvm-svn: 319729
2017-12-05 02:30:43 +00:00
Craig Topper
276c770e57 [X86] Use vector widening to support zero extend from i1 when the dest type is not 512-bits and vlx is not enabled.
Previously we used a wider element type and truncated. But its more efficient to keep the element type and drop unused elements.

If BWI isn't supported and we have a i16 or i8 type, we'll extend it to be i32 and still use a truncate.

llvm-svn: 319728
2017-12-05 01:45:46 +00:00
Richard Smith
891fc7f37a Generalize "static data member instantiated" notification to cover variable templates too.
While here, split the "point of instantiation changed" notification out from
it; these two really are orthogonal changes.

llvm-svn: 319727
2017-12-05 01:31:47 +00:00
Craig Topper
913b42b0e1 [X86] Don't use kunpck for vXi1 concat_vectors if the upper bits are undef.
This can be efficiently selected by a COPY_TO_REGCLASS without the need for an extra instruction.

llvm-svn: 319726
2017-12-05 01:28:06 +00:00
Craig Topper
6302012442 [X86] Use getZeroVector and remove an unnecessary creation of an APInt before calling getConstant. NFCI
The getConstant function can take care of creating the APInt internally.

getZeroVector will take care of using the correct type for the build vector to avoid re-lowering.

The test change here is because execution domain constraints apparently pass through undef inputs of a zeroing xor. So the different ordering of register allocation here caused the dependency to change.

llvm-svn: 319725
2017-12-05 01:28:04 +00:00
Craig Topper
adadaae586 [X86] Rearrange some of the code around AVX512 sign/zero extends. NFCI
Move the AVX512 code out of LowerAVXExtend. LowerAVXExtend has two callers but one of them pre-checks for AVX-512 so the code is only live from the other caller. So move the AVX-512 checks up to that caller for symmetry.

Move all of the i1 input type code in Lower_AVX512ZeroExend together.

llvm-svn: 319724
2017-12-05 01:28:00 +00:00
Shoaib Meenai
3f2ce4bbed [cmake] Modernize some conditionals. NFC
The "x${...}" form was a workaround for CMake versions prior to 3.1,
where the if command would interpret arguments as variables even when
quoted [1]. We can drop the workaround now that our minimum CMake
version is 3.4.

[1] https://cmake.org/cmake/help/v3.1/policy/CMP0054.html

Differential Revision: https://reviews.llvm.org/D40744

llvm-svn: 319723
2017-12-05 01:19:48 +00:00
Matthias Braun
7afbfd0f24 MachineFrameInfo: Cleanup some parameter naming inconsistencies; NFC
Consistently use the same parameter names as the names of the affected
fields. This avoids some unintuitive abbreviations like `isSS`.

llvm-svn: 319722
2017-12-05 01:18:15 +00:00
Matthias Braun
62378bb5ab TwoAddressInstructionPass: Trigger -O0 behavior on optnone
While we cannot skip the whole TwoAddressInstructionPass even for -O0
there are some parts of the pass that are currently skipped at -O0 but
not for optnone. Changing this as there is no reason to have those two
hit different code paths here.

llvm-svn: 319721
2017-12-05 00:56:14 +00:00
Petr Hosek
5a34c34858 [CMake] Don't use comma as an alternate separator
Using comma can break in cases when we're passing flags that already
use comma as a separator.

Fixes PR35504.

Differential Revision: https://reviews.llvm.org/D40762

llvm-svn: 319720
2017-12-05 00:15:20 +00:00
Petr Hosek
6851c0c38e [CMake] Don't use comma as an alternate separator
Using comma can break in cases when we're passing flags that already
use comma as a separator.

Fixes PR35504.

Differential Revision: https://reviews.llvm.org/D40761

llvm-svn: 319719
2017-12-05 00:15:18 +00:00
Siddharth Bhat
c0f5f4deae Update to latest clang-format. [NFC]
Differential Revision: https://reviews.llvm.org/D40791

llvm-svn: 319718
2017-12-05 00:06:09 +00:00
Rui Ueyama
be61cc90c4 Make the behavior of the -v option more closer to GNU linkers.
Previously, lld exited with an error status if the only option given to
the command was -v. GNU linkers gracefully exit in that case. This patch
makes lld behave like GNU.

Note that even with this patch, lld's -v and --version options behave
slightly differently than GNU linkers' counterparts. For example,
if you run `ld.bfd -v -v`, the version string is printed out twice.
But that is an edge case that I don't think we need to take care of.

Fixes https://bugs.llvm.org/show_bug.cgi?id=31582

Differential Revision: https://reviews.llvm.org/D40810

llvm-svn: 319717
2017-12-05 00:03:41 +00:00
Eugene Zelenko
08803f6b7d [Lex] Fix lldb-x86_64-ubuntu-14.04-buildserver build bot broken with r319714 (NFC).
llvm-svn: 319716
2017-12-04 23:38:10 +00:00
Alex Lorenz
8d470918ce Fix record-parsing-invocation.c test on Windows
We should not check for the forward slash '/'

llvm-svn: 319715
2017-12-04 23:21:07 +00:00
Eugene Zelenko
5dc60fe57a [Lex] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 319714
2017-12-04 23:16:21 +00:00
Ben Hamilton
4bf869c87e [libcxxabi] Set up .arcconfig to point to new Diffusion CXXA repository
Summary:
We want to automatically copy the appropriate mailing list
for review requests to the libc++abi repository.

For context, see the proposal and discussion here:

http://lists.llvm.org/pipermail/cfe-dev/2017-November/056032.html

Similar to D40500, I set up a new Diffusion repository with callsign
"CXXA" for libc++abi:

https://reviews.llvm.org/source/libcxxabi/

This explicitly updates libcxxabi's .arcconfig to point to the new
CXX repository in Diffusion, which will let us use Herald rule H268.

Reviewers: phosek, beanz, EricWF, compnerd

Reviewed By: phosek

Subscribers: cfe-commits, klimek, sammccall, dlj, bkramer

Differential Revision: https://reviews.llvm.org/D40501

llvm-svn: 319713
2017-12-04 23:14:03 +00:00
Jan Vesely
39aeab4f30 AMDGPU/EG: Add a new FeatureFMA and use it to selectively enable FMA instruction
Only used by pre-GCN targets
v2: fix predicate setting for FMA_Common

Differential Revision: https://reviews.llvm.org/D40692

llvm-svn: 319712
2017-12-04 23:07:28 +00:00
Marshall Clow
98360946bb Commit tests for changes in revision 319710
llvm-svn: 319711
2017-12-04 23:04:53 +00:00
Marshall Clow
5dd9220974 Implement more of P0600: '[[nodiscard]] in the library' for C++2a
llvm-svn: 319710
2017-12-04 23:03:42 +00:00