Julian Lettner [Thu, 4 Apr 2019 00:28:09 +0000 (00:28 +0000)]
[TSan][libdispatch] Add Cmake option for libdispatch install path
llvm-svn: 357657
Reid Kleckner [Thu, 4 Apr 2019 00:13:16 +0000 (00:13 +0000)]
Fix minor innaccuracy in previous comment on ManagedStaticBase
llvm-svn: 357656
Reid Kleckner [Thu, 4 Apr 2019 00:11:21 +0000 (00:11 +0000)]
Make ManagedStatic constexpr constructible
Apparently it needs member initializers so that it can be constructed in
a constexpr context. I explained my investigation of this in PR41367.
llvm-svn: 357655
Nico Weber [Thu, 4 Apr 2019 00:05:53 +0000 (00:05 +0000)]
Make clangd-fuzzer use the normal add_llvm_fuzzer() machinery
This allows building it even if no fuzzer is enabled. (Sadly, it only
builds on Linux at the moment.)
Differential Revision: https://reviews.llvm.org/D60201
llvm-svn: 357654
Nico Weber [Wed, 3 Apr 2019 23:29:05 +0000 (23:29 +0000)]
llvm-undname: Name a pair. No behavior change.
Differential Revision: https://reviews.llvm.org/D60210
llvm-svn: 357653
Craig Topper [Wed, 3 Apr 2019 23:28:30 +0000 (23:28 +0000)]
[X86] Remove CustomInserter pseudos for MONITOR/MONITORX/CLZERO. Use custom instruction selection instead.
This custom inserter existed so we could do a weird thing where we pretended that the instructions support
a full address mode instead of taking a pointer in EAX/RAX. I think was largely so we could be pointer
size agnostic in the isel pattern.
To make this work we would then put the address into an LEA into EAX/RAX in front of the instruction after
isel. But the LEA is overkill when we just have a base pointer. So we end up using the LEA as a slower MOV
instruction.
With this change we now just do custom selection during isel instead and just assign the incoming address
of the intrinsic into EAX/RAX based on its size. After the intrinsic is selected, we can let isel take
care of selecting an LEA or other operation to do any address computation needed in this basic block.
I've also split the instruction into a 32-bit mode version and a 64-bit mode version so the implicit
use is properly sized based on the pointer. Without this we get comments in the assembly output about
killing eax and defing rax or vice versa depending on whether we define the instruction to use EAX/RAX.
llvm-svn: 357652
Craig Topper [Wed, 3 Apr 2019 23:28:18 +0000 (23:28 +0000)]
[X86] Remove dead CHECK lines for a test. NFC
llvm-svn: 357651
Craig Topper [Wed, 3 Apr 2019 23:28:11 +0000 (23:28 +0000)]
[X86] Autogenerate checks. NFC
llvm-svn: 357650
Nico Weber [Wed, 3 Apr 2019 23:27:18 +0000 (23:27 +0000)]
llvm-undname: Fix a crash-on-invalid
Found by oss-fuzz, fixes issue 13260 on oss-fuzz.
Differential Revision: https://reviews.llvm.org/D60207
llvm-svn: 357649
Nico Weber [Wed, 3 Apr 2019 23:23:32 +0000 (23:23 +0000)]
llvm-undame: Fix an assert-on-invalid
Found by oss-fuzz, fixes issue 12432 on os-fuzz.
Differential Revision: https://reviews.llvm.org/D60206
llvm-svn: 357648
Nico Weber [Wed, 3 Apr 2019 23:19:39 +0000 (23:19 +0000)]
llvm-undname: Fix an assert-on-invalid
Found by oss-fuzz, fixes issues 12428 and 12429 on oss-fuzz.
Differential Revision: https://reviews.llvm.org/D60204
llvm-svn: 357647
Nico Weber [Wed, 3 Apr 2019 23:15:56 +0000 (23:15 +0000)]
llvm-undname: Fix a crash-on-invalid
Found by oss-fuzz, fixes issues 12435 and 12438 on oss-fuzz.
Differential Revision: https://reviews.llvm.org/D60202
llvm-svn: 357646
Nico Weber [Wed, 3 Apr 2019 23:14:33 +0000 (23:14 +0000)]
llvm-cxxfilt: Demangle gcc "old-style unified" ctors and dtors
These are variant 4, cf
https://github.com/gcc-mirror/gcc/blob/master/gcc/cp/mangle.c#L1851
https://github.com/gcc-mirror/gcc/blob/master/gcc/cp/mangle.c#L1880
and gcc seems to sometimes emit them still.
Differential Revision: https://reviews.llvm.org/D60229
llvm-svn: 357645
Sanjay Patel [Wed, 3 Apr 2019 22:40:35 +0000 (22:40 +0000)]
[x86] fold shuffles of h-ops that have an undef operand
If an operand is undef, we can assume it's the same as the
other operand.
llvm-svn: 357644
Amy Huang [Wed, 3 Apr 2019 22:19:07 +0000 (22:19 +0000)]
add periods
llvm-svn: 357643
Sanjay Patel [Wed, 3 Apr 2019 22:15:29 +0000 (22:15 +0000)]
[x86] eliminate movddup of horizontal op
This pattern would show up as a regression if we more
aggressively convert vector FP ops to scalar ops.
There's still a missed optimization for the v4f64 legal
case (AVX) because we create that h-op with an undef operand.
We should probably just duplicate the operands for that
pattern to avoid trouble.
llvm-svn: 357642
Stella Stamenova [Wed, 3 Apr 2019 21:57:41 +0000 (21:57 +0000)]
Un-xfail one of the TestMiniDumpUUID tests on Windows
The test is passing on Windows and the windows bot is failing because of the unexpected pass
llvm-svn: 357641
Petr Hosek [Wed, 3 Apr 2019 21:50:03 +0000 (21:50 +0000)]
[libunwind] Export the unw_* symbols as weak symbols
libunwind defines the _Unwind_* ABI used by libc++abi. This ABI is a
stable quasi-standard common between multiple implementations such as
LLVM and GNU. The _U* symbol name space is also safely within the symbol
name space that standard C & C++ reserve for the implementation.
Futhermore, libunwind also defines several unw_* symbols, and references
these from the _Unwind_* entry points so the standard/reserved part of
the ABI is dependent on the unw_* part of the ABI. This is not OK for a
C or C++ implementation. The unw_* symbols are reserved for C and extern
"C" used by application code.
This change renames each unw_* function to __unw* and adds a weak alias
unw_* to keep the public <libunwind.h> ABI unchanged for backwards
compatibility. Every reference to unw_* in the implementation has been
changed to use __unw* so that if other unw_* definitions are in force
because nothing uses <libunwind.h> in a particular program, no _Unwind*
code path depends on any unw_* symbol. Furthemore, __unw_* symbols are
hidden, which saves PLT overhead in the shared library case.
In the future, we should cconsider untangling the unw_* API/ABI from the
_Unwind_* API/ABI. The internal API backing the _Unwind_* ABI
implementation should not rely on any nonstandard symbols not in the
implementation-reserved name space. This would then allow separating the
_Unwind_* API/ABI from unw_* entirely, but that's a more substantial
change that's going to require more significant refactoring.
Differential Revision: https://reviews.llvm.org/D59921
llvm-svn: 357640
Jonas Devlieghere [Wed, 3 Apr 2019 21:31:22 +0000 (21:31 +0000)]
[Reproducers] Capture return values of functions returning by ptr/ref
For some reason I had convinced myself that functions returning by
pointer or reference do not require recording their result. However,
after further considering I don't see how that could work, at least not
with the current implementation. Interestingly enough, the reproducer
instrumentation already (mostly) accounts for this, though the
lldb-instr tool did not.
This patch adds the missing macros and updates the lldb-instr tool.
Differential revision: https://reviews.llvm.org/D60178
llvm-svn: 357639
Evandro Menezes [Wed, 3 Apr 2019 21:27:03 +0000 (21:27 +0000)]
[IR] Create new method in `Function` class (NFC)
Create method `optForNone()` testing for the function level equivalent of
`-O0` and refactor appropriately.
Differential revision: https://reviews.llvm.org/D59852
llvm-svn: 357638
Eric Fiselier [Wed, 3 Apr 2019 21:17:34 +0000 (21:17 +0000)]
Cleanup test failures in no discard tests.
llvm-svn: 357637
Sanjay Patel [Wed, 3 Apr 2019 21:10:55 +0000 (21:10 +0000)]
[x86] add another test for disguised h-op; NFC
llvm-svn: 357636
Petr Hosek [Wed, 3 Apr 2019 20:59:28 +0000 (20:59 +0000)]
[libc++abi] Do not share an object library to create the static/shared libraries
This change is similar to r356150, with the same motivation. The
only difference is that the method used to merge libunwind.a and
libc++abi.a had to be changed to use the same approach as libc++
since we no longer produce object libraries that could be linked
together as we did before. We reuse the libc++ script for merging
archives to avoid duplication between the two projects.
Differential Revision: https://reviews.llvm.org/D60173
llvm-svn: 357635
Matt Arsenault [Wed, 3 Apr 2019 20:53:20 +0000 (20:53 +0000)]
AMDGPU: Split block for si_end_cf
Relying on no spill or other code being inserted before this was
precarious. It relied on code diligently checking isBasicBlockPrologue
which is likely to be forgotten.
Ideally this could be done earlier, but this doesn't work because of
phis. Any other instruction can't be placed before them, so we have to
accept the position being incorrect during SSA.
This avoids regressions in the fast register allocator rewrite from
inverting the direction.
llvm-svn: 357634
Jorge Gorbe Moya [Wed, 3 Apr 2019 20:43:20 +0000 (20:43 +0000)]
Re-enable most lldb-vscode tests on Linux.
Summary:
After https://reviews.llvm.org/D59828 and https://reviews.llvm.org/D59849,
I believe the problems with these tests hanging have been solved.
I tried enabling all of them on my machine, and got two failures:
- One of them was spawning a child process that lives for 5 seconds, waited
for 5 seconds to attach to the child, and failed because the child wasn't
there.
- The other one was a legit failure because shell expansion of arguments doesn't
work on Linux.
This tests enables all lldb-vscode tests on Linux except for "launch process
with shell expansion of args" (which doesn't work), and fixes the other broken
test by reducing the time it waits before attaching to its child process.
Reviewers: zturner, clayborg
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D60153
llvm-svn: 357633
Eric Fiselier [Wed, 3 Apr 2019 20:40:01 +0000 (20:40 +0000)]
Attempt to upgrade compiler used by appveyor builds
llvm-svn: 357632
Eric Fiselier [Wed, 3 Apr 2019 20:36:51 +0000 (20:36 +0000)]
disable appveyor config for MSVC 2015
llvm-svn: 357631
Sanjay Patel [Wed, 3 Apr 2019 20:34:22 +0000 (20:34 +0000)]
[x86] add test for disguised horizontal op; NFC
llvm-svn: 357630
Alexey Bataev [Wed, 3 Apr 2019 19:59:09 +0000 (19:59 +0000)]
[OPENMP]Add codegen for reduction vars with allocate clause, NFC.
Added test for the reduction variables with the allocate clause.
llvm-svn: 357629
Jonas Devlieghere [Wed, 3 Apr 2019 19:57:13 +0000 (19:57 +0000)]
[dwarfdump] Remove bogus verifier error
The standard doesn't require a DW_TAG_variable, DW_TAG_formal_parameter
or DW_TAG_constant to A DW_AT_type attribute describing the type of the
variable. It only specifies that it *can* have one.
llvm-svn: 357628
Taewook Oh [Wed, 3 Apr 2019 19:54:43 +0000 (19:54 +0000)]
[ProfileSummary] Count callsite samples when computing total samples.
Summary: Currently ProfileSummaryBuilder doesn't count into callsite samples when computing total samples. Considering that ProfileSummaryInfo is used to checked the hotness of not only body samples but also callsite samples (from SampleProfileLoader), I think the callsite sample counts should be considered when computing total samples.
Reviewers: eraman, danielcdh, wmi
Subscribers: hiraditya, jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59835
llvm-svn: 357627
Adrian McCarthy [Wed, 3 Apr 2019 19:49:14 +0000 (19:49 +0000)]
Fix and simplify PrepareCommandsForSourcing
Spotted some problems in the Driver's PrepareCommandsForSourcing while
helping a colleague track another problem.
1. One error case was not handled because there was no else clause.
Fixed by switching to llvm's early-out style instead of nested
`if (succes) { } else { }` cases. This keeps error handling close
to the actual error.
2. One call-site failed to call the clean-up function. I solved this
by simplifying the API. PrepareCommandsForSourcing no longer requires
the caller to provide a buffer for the pipe's file descriptors and to
call a separate clean-up function later. PrepareCommandsForSourcing
now ensures the file descriptors are handled before returning.
(The read end of the pipe is held open by the returned FILE * as
before.)
I also eliminated an unnecessary local, shorted the lifetime of another,
and tried to improve the comments.
I wrapped the call to open the pipe to get the `#ifdef`s out of the
mainline. I replaced the `close`/`_close` calls with a platform-neutral
helper from `llvm::sys` for the same reason. Per discussion on the
review, I'm leaving the `fdopen` call to use the spelling that Windows
has officially deprecated because it still works it avoids more `#ifdef`s.
Differential Revision: https://reviews.llvm.org/D60152
llvm-svn: 357626
Alexey Bataev [Wed, 3 Apr 2019 19:12:47 +0000 (19:12 +0000)]
[OPENMP]Add codegen for lastprivate vars with allocate clause, NFC.
Added test for the lastprivatized variables with the allocate clause.
llvm-svn: 357625
Nico Weber [Wed, 3 Apr 2019 19:09:15 +0000 (19:09 +0000)]
gn build: Add build file for dexp
None of check-clang-tools's tests run this, but the CMake
check-clang-tools depends on the binary, so add it for consistency.
Differential Revision: https://reviews.llvm.org/D60222
llvm-svn: 357624
Konstantin Zhuravlyov [Wed, 3 Apr 2019 19:07:29 +0000 (19:07 +0000)]
AMDGPU/NFC: Add offset field to arg metadata (required for code object v3)
llvm-svn: 357623
Jonathan Peyton [Wed, 3 Apr 2019 18:53:26 +0000 (18:53 +0000)]
[OpenMP][Stats] Fix stats gathering for distribute and team clause
The distribute clause needs an explicit push of a timer. The teams
clause needs a timer added and also, similarly to parallel, exchanged
with the serial timer when encountered so that serial regions are
counted properly.
Differential Revision: https://reviews.llvm.org/D59801
llvm-svn: 357621
Artem Dergachev [Wed, 3 Apr 2019 18:21:16 +0000 (18:21 +0000)]
Revert "[analyzer] Toning down invalidation a bit".
This reverts commit r352473.
The overall idea is great, but it seems to cause unintented consequences
when not only Region Store invalidation but also pointer escape mechanism
was accidentally affected.
Based on discussions in https://reviews.llvm.org/D58121#1452483
and https://reviews.llvm.org/D57230#1434161
Differential Revision: https://reviews.llvm.org/D57230
llvm-svn: 357620
Nico Weber [Wed, 3 Apr 2019 18:13:08 +0000 (18:13 +0000)]
libcxx: Add _LIBCPP_NODISCARD_EXT to 38 more functions
This builds on the work done in r342808 and adds _LIBCPP_NODISCARD_EXT
to 37 more functions, namely:
adjacent_find, all_of, any_of, binary_search, clamp, count_if, count,
equal_range, equal, find_end, find_first_not_of, find_first_of, find_if,
find, includes, is_heap_until, is_heap, is_partitioned, is_permutation,
is_sorted_until, is_sorted, lexicographical_compare, lower_bound,
max_element, max, min_element, min, minmax_element, minmax, mismatch,
none_of, remove_if, remove, search_n, search, unique, upper_bound
The motivation here is that we noticed that find_if is nodiscard with
Visual Studio's standard library, and we deemed that useful
(https://crbug.com/948122).
https://devblogs.microsoft.com/cppblog/c17-progress-in-vs-2017-15-5-and-15-6/
says "Our criteria for emitting the warning are: discarding the return
value is a guaranteed leak [...], discarding the return value is
near-guaranteed to be incorrect (e.g. remove()/remove_if()/unique()), or
the function is essentially a pure observer (e.g. vector::empty() and
std::is_sorted())." so I went through algorithm and tried to apply these
criteria.
Some of these, like vector::empty() are already nodiscard per C++
standard and didn't need changing.
I didn't (yet?) go over std::string::find* methods which should probably
have _LIBCPP_NODISCARD_EXT too (but not as part of this change).
Differential Revision: https://reviews.llvm.org/D60145
llvm-svn: 357619
Dimitry Andric [Wed, 3 Apr 2019 18:11:36 +0000 (18:11 +0000)]
Ensure correct pthread flags and libraries are used
On most platforms, certain compiler and linker flags have to be passed
when using pthreads, otherwise linking against libomp.so might fail with
undefined references to several pthread functions.
Use CMake's `find_package(Threads)` to determine these for standalone
builds, or take them (and optionally modify them) from the top-level
LLVM cmake files.
Also, On FreeBSD, ensure that libomp.so is linked against libm.so,
similar to NetBSD.
Adjust test cases with hardcoded `-lpthread` flag to use the common
build flags, which should now have the required pthread flags.
Reviewers: emaste, jlpeyton, krytarowski, mgorny, protze.joachim, Hahnfeld
Reviewed By: Hahnfeld
Subscribers: AndreyChurbanov, tra, EricWF, Hahnfeld, jfb, jdoerfert, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D59451
llvm-svn: 357618
Alexey Bataev [Wed, 3 Apr 2019 17:57:06 +0000 (17:57 +0000)]
[OPENMP]Add codegen for firstprivate vars with allocate clause.
Added codegen/test for the firstprivatized variables with the allocate
clause.
llvm-svn: 357617
Louis Dionne [Wed, 3 Apr 2019 17:54:37 +0000 (17:54 +0000)]
[libc++] Use std::is_nothrow_callable for std::invoke according to LWG 2807
Thanks to Zoe Carver for the patch.
Differential Revision: https://reviews.llvm.org/D58097
llvm-svn: 357616
Krzysztof Parzyszek [Wed, 3 Apr 2019 17:43:14 +0000 (17:43 +0000)]
[X86] Extend boolean arguments to inline-asm according to getBooleanType
Differential Revision: https://reviews.llvm.org/D60208
llvm-svn: 357615
Samuel Benzaquen [Wed, 3 Apr 2019 17:40:51 +0000 (17:40 +0000)]
Add more benchmarks for literal strings.
Summary:
Comparing against the empty string should generate much better code that
what it does today.
We can also generate better code when comparing against literals that
are larger than the SSO space.
Reviewers: EricWF
Subscribers: christof, jdoerfert, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D59781
llvm-svn: 357614
Louis Dionne [Wed, 3 Apr 2019 17:34:57 +0000 (17:34 +0000)]
[pstl] Improve the parallel version of std::equal
When an execution policy is provided, we attempt to run std::equal in
parallel instead of always doing it serially.
Thanks to Mikhail Dvorskiy for the patch.
Differential Revision: https://reviews.llvm.org/D59813
llvm-svn: 357613
Alexey Bataev [Wed, 3 Apr 2019 17:34:04 +0000 (17:34 +0000)]
Revert "[LibTooling] Add Transformer, a library for source-to-source transformations."
This reverts commit r357576 to fix the problem with the cyclic
dependencies between libTooling and libToolingRefactor.
llvm-svn: 357612
Simon Pilgrim [Wed, 3 Apr 2019 17:28:34 +0000 (17:28 +0000)]
[X86][AVX] combineHorizontalPredicateResult - split any/allof v16i16/v32i8 reduction on AVX1
Perform the 2 x 128-bit lo/hi OR/AND on the vectors before calling PMOVMSKB on the 128-bit result.
llvm-svn: 357611
Jennifer Yu [Wed, 3 Apr 2019 17:21:40 +0000 (17:21 +0000)]
Bug-40323: MS ABI adding template static member in the linker directive section to make sure init function can be called before main.
llvm-svn: 357610
Louis Dionne [Wed, 3 Apr 2019 17:17:40 +0000 (17:17 +0000)]
[pstl] Require C++17 when linking against pstl
llvm-svn: 357609
Simon Pilgrim [Wed, 3 Apr 2019 17:17:13 +0000 (17:17 +0000)]
[X86][AVX] combineHorizontalPredicateResult - support v16i16/v32i8 reduction on AVX1
Use getPMOVMSKB helper which splits v32i8 MOVMSK calls on pre-AVX2 targets.
llvm-svn: 357608
Paul Semel [Wed, 3 Apr 2019 17:13:45 +0000 (17:13 +0000)]
[DWARF] check whether the DIE is valid before querying for information
Differential Revision: https://reviews.llvm.org/D60147
llvm-svn: 357607
Petr Hosek [Wed, 3 Apr 2019 16:59:33 +0000 (16:59 +0000)]
[libunwind] Do not share an object library to create the static/shared libraries
This change is similar to r356150, with the same motivation.
llvm-svn: 357606
Jessica Paquette [Wed, 3 Apr 2019 16:58:32 +0000 (16:58 +0000)]
[AArch64][GlobalISel] Legalize G_FEXP2
Same as G_EXP. Add a test, and update legalizer-info-validation.mir and
f16-instructions.ll.
Differential Revision: https://reviews.llvm.org/D60165
llvm-svn: 357605
Sanjay Patel [Wed, 3 Apr 2019 16:33:24 +0000 (16:33 +0000)]
[x86] make stack folding tests immune to unrelated transforms; NFC
llvm-svn: 357604
Greg Clayton [Wed, 3 Apr 2019 16:30:44 +0000 (16:30 +0000)]
Attempt #2 to get this patch working. I will watch the build bots carefully today.
Allow partial UUID matching in Minidump core file plug-in
Breakpad had bugs in earlier versions where it would take a 20 byte ELF build ID and put it into the minidump file as a 16 byte PDB70 UUID with an age of zero. This would make it impossible to do postmortem debugging with one of these older minidump files.
This fix allows partial matching of UUIDs. To do this we first try and match with the full UUID value, and then fall back to removing the original directory path from the module specification and we remove the UUID requirement, and then manually do the matching ourselves. This allows scripts to find symbols files using a symbol server, place them all in a directory, use the "setting set target.exec-search-paths" setting to specify the directory, and then load the core file. The Target::GetSharedModule() can then find the correct file without doing any other matching and load it.
Tests were added to cover a partial UUID match where the breakpad file has a 16 byte UUID and the actual file on disk has a 20 byte UUID, both where the first 16 bytes match, and don't match.
Differential Revision: https://reviews.llvm.org/D60001
llvm-svn: 357603
Simon Pilgrim [Wed, 3 Apr 2019 16:00:59 +0000 (16:00 +0000)]
[DAGCombiner] Rename variables Demanded -> DemandedBits/DemandedElts. NFCI.
Use consistent variable names down the SimplifyDemanded* call stack so debugging isn't such a annoyance.
llvm-svn: 357602
Lewis Revill [Wed, 3 Apr 2019 15:54:30 +0000 (15:54 +0000)]
Test commit: Remove double variable assignment
llvm-svn: 357601
George Rimar [Wed, 3 Apr 2019 15:28:35 +0000 (15:28 +0000)]
[LLDB] - Update the test cases after yaml2obj change.
https://reviews.llvm.org/D60122 (r357595) changed the
symbols description format in yaml2obj.
This change updates the LLDB tests.
llvm-svn: 357600
Krasimir Georgiev [Wed, 3 Apr 2019 15:16:04 +0000 (15:16 +0000)]
[clang-format] Do not emit replacements while regrouping if Cpp includes are OK
Summary:
Currently clang-format would always emit a replacement for multi-block #include
sections if `IBS_Regroup`, even if the sections are correct:
```
% cat ~/test.h
#include <a.h>
#include "b.h"
% bin/clang-format --output-replacements-xml -style=google ~/test.h
<?xml version='1.0'?>
<replacements xml:space='preserve' incomplete_format='false'>
<replacement offset='0' length='30'>#include <a.h> #include "b.h"</replacement>
</replacements>
%
```
This change makes clang-format not emit replacements in this case.
The logic is similar to the one implemented for Java in r354452.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60199
llvm-svn: 357599
George Rimar [Wed, 3 Apr 2019 15:11:19 +0000 (15:11 +0000)]
[llvm-readobj] - Fix 2 test cases.
https://reviews.llvm.org/D60122 (r357595) changed the
symbols description format.
This change fix two more new test cases to fix BB:
http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/16205/steps/test-stage1-compiler/logs/stdio
llvm-svn: 357598
Ulrich Weigand [Wed, 3 Apr 2019 15:09:19 +0000 (15:09 +0000)]
[SystemZ] Improve codegen for certain SADDO-immediate cases
When performing an add-with-overflow with an immediate in the
range -2G ... -4G, code currently loads the immediate into a
register, which generally takes two instructions.
In this particular case, it is preferable to load the negated
immediate into a register instead, which always only requires
one instruction, and then perform a subtract.
llvm-svn: 357597
George Rimar [Wed, 3 Apr 2019 14:54:22 +0000 (14:54 +0000)]
[LLD] - Update the test cases after yaml2obj change.
https://reviews.llvm.org/D60122 (r357595) changed the
symbols description format.
This change updates the LLD tests.
llvm-svn: 357596
George Rimar [Wed, 3 Apr 2019 14:53:42 +0000 (14:53 +0000)]
[yaml2obj][obj2yaml] - Change how symbol's binding is descibed when parsing/dumping.
Currently, YAML has the following syntax for describing the symbols:
Symbols:
Local:
LocalSymbol1:
...
LocalSymbol2:
...
...
Global:
GlobalSymbol1:
...
Weak:
...
GNUUnique:
I.e. symbols are grouped by their bindings. That is not very convenient,
because:
It does not allow to set a custom binding, what can be useful for producing
broken/special outputs for test cases. Adding a new binding would require to
change a syntax (what we observed when added GNUUnique recently).
It does not allow to change the order of the symbols in .symtab/.dynsym,
i.e. currently all Local symbols are placed first, then Global, Weak and GNUUnique
are following, but we are not able to change the order.
It is not consistent. Binding is just one of the properties of the symbol,
we do not group them by other properties.
It makes the code more complex that it can be. This patch shows it can be simplified
with the change performed.
The patch changes the syntax to just:
Symbols:
Symbol1:
...
Symbol2:
...
...
With that, we are able to work with the binding field just like with any other symbol property.
Differential revision: https://reviews.llvm.org/D60122
llvm-svn: 357595
James Henderson [Wed, 3 Apr 2019 14:50:50 +0000 (14:50 +0000)]
[NFC] Address missed review comment for test
Reviewed by: grimar
Differential Revision: https://reviews.llvm.org/D60200
llvm-svn: 357594
Sanjay Patel [Wed, 3 Apr 2019 14:45:45 +0000 (14:45 +0000)]
[x86] remove duplicate tests
Accidentally double-committed these.
llvm-svn: 357593
Sanjay Patel [Wed, 3 Apr 2019 14:41:28 +0000 (14:41 +0000)]
[x86] add negative tests for FP scalarization; NFC
These go with the proposal in D60150.
llvm-svn: 357592
Sanjay Patel [Wed, 3 Apr 2019 14:41:24 +0000 (14:41 +0000)]
[x86] add tests with constants for FP scalarization; NFC
llvm-svn: 357591
James Henderson [Wed, 3 Apr 2019 14:40:27 +0000 (14:40 +0000)]
[llvm-objcopy] Make section rename/set flags case-insensitive
This fixes https://bugs.llvm.org/show_bug.cgi?id=41305. GNU objcopy
--set-section-flags/--rename-section flags are case-insensitive, so this
patch updates llvm-objcopy to match.
Reviewed by: grimar
Differential Revision: https://reviews.llvm.org/D60200
llvm-svn: 357590
Aaron Ballman [Wed, 3 Apr 2019 14:40:00 +0000 (14:40 +0000)]
Whitespace and formatting changes; NFC.
llvm-svn: 357589
Louis Dionne [Wed, 3 Apr 2019 14:38:28 +0000 (14:38 +0000)]
[libc++][NFC] Rename test file according to the libc++ convention
llvm-svn: 357588
Sanjay Patel [Wed, 3 Apr 2019 14:36:47 +0000 (14:36 +0000)]
[x86] add tests with constants for FP scalarization; NFC
llvm-svn: 357587
Louis Dionne [Wed, 3 Apr 2019 14:29:52 +0000 (14:29 +0000)]
[libc++] (Take 2) Correctly handle Objective-C++ ARC qualifiers in std::is_pointer
Summary:
Otherwise, std::is_pointer<id __strong> works, but std::is_pointer<id __weak>
(and others) don't work as expected.
The previous patch (r357517) had to be reverted in r357569 because it
broke the Chromium build. This patch shouldn't have the same problem.
rdar://problem/
49126333
Reviewers: ahatanak, EricWF
Subscribers: christof, jkorous, dexonsmith, libcxx-commits
Differential Revision: https://reviews.llvm.org/D60087
llvm-svn: 357586
Aaron Ballman [Wed, 3 Apr 2019 14:26:32 +0000 (14:26 +0000)]
Add a new attribute documentation category for declarations.
This moves documentation for some attributes into new categories that are hopefully a bit more clear. In general, "Type" documentation should be for attributes that appertain to types while "Declaration" documentation should be for attributes that appertain to declarations other than functions or variables.
llvm-svn: 357585
Petar Avramovic [Wed, 3 Apr 2019 14:12:59 +0000 (14:12 +0000)]
[MIPS GlobalISel] Select floating point arithmetic operations
Select 32 and 64 bit floating point add, sub, mul and div for MIPS32.
Differential Revision: https://reviews.llvm.org/D60191
llvm-svn: 357584
Javed Absar [Wed, 3 Apr 2019 14:12:13 +0000 (14:12 +0000)]
[AArch64] Update v8.5a MTE LDG/STG instructions
The latest MTE specification adds register Xt to the STG instruction family:
STG [Xn, #offset] -> STG Xt, [Xn, #offset]
The tag written to memory is taken from Xt rather than Xn.
Also, the LDG instruction also was changed to read return address from Xt:
LDG Xt, [Xn, #offset].
This patch includes those changes and tests.
Specification is at: https://developer.arm.com/docs/ddi0596/c
Differential Revision: https://reviews.llvm.org/D60188
llvm-svn: 357583
Alexander Kornienko [Wed, 3 Apr 2019 14:03:43 +0000 (14:03 +0000)]
[clang-tidy] Remove the old ClangTidyCheck::registerPPCallbacks method
Summary:
All in-tree clang-tidy checks have been migrated to the new
ClangTidyCheck::registerPPCallbacks method. Time to drop the old one.
Reviewers: sammccall, hokein
Reviewed By: hokein
Subscribers: xazax.hun, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60197
llvm-svn: 357582
Matt Arsenault [Wed, 3 Apr 2019 13:56:36 +0000 (13:56 +0000)]
AMDGPU: Fix copy/paste error in intrnsic comment
llvm-svn: 357581
Sanjay Patel [Wed, 3 Apr 2019 13:42:06 +0000 (13:42 +0000)]
[DAGCombiner] loosen restrictions for moving shuffles after vector binop
There are 3 changes to make this correspond to the same transform in instcombine:
1. Remove the legality check - we can't create anything less legal than we started with.
2. Ease the use restriction, so we only bail out if both operands have >1 use.
3. Ease the use restriction for binops with a repeated operand (eg, mul x, x).
As discussed in D60150, there's a scalarization opportunity that will be made
easier by allowing this transform more generally.
llvm-svn: 357580
Aaron Ballman [Wed, 3 Apr 2019 13:37:56 +0000 (13:37 +0000)]
Fixing a typo; NFC.
llvm-svn: 357579
Xing GUO [Wed, 3 Apr 2019 13:32:49 +0000 (13:32 +0000)]
[llvm-readobj] Add GNU style dumper for .gnu.version section
Summary: Currently, `llvm-readobj` do not support GNU style dumper for symbol versioning sections. In this patch, I would like to implement dumper for `.gnu.version` section
Reviewers: jhenderson, rupprecht, grimar
Reviewed By: jhenderson, rupprecht
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59877
llvm-svn: 357578
Xing GUO [Wed, 3 Apr 2019 13:15:09 +0000 (13:15 +0000)]
Fix typos in tests. NFC.
Reviewers: Higuoxing
Reviewed By: Higuoxing
Subscribers: kubamracek, cfe-commits, #sanitizers, llvm-commits
Tags: #clang, #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D60183
llvm-svn: 357577
Yitzhak Mandelbaum [Wed, 3 Apr 2019 13:05:19 +0000 (13:05 +0000)]
[LibTooling] Add Transformer, a library for source-to-source transformations.
Summary: Adds a basic version of Transformer, a library supporting the concise specification of clang-based source-to-source transformations. A full discussion of the end goal can be found on the cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling".
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: mgorny, jfb, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59376
llvm-svn: 357576
James Henderson [Wed, 3 Apr 2019 12:57:46 +0000 (12:57 +0000)]
[llvm-nm]Add support for --no-demangle
GNU nm has --no-demangle, so llvm-nm should too. It disables the
--demangle switch. The patch also allows --demangle to be specified
multiple times (the last of all --no-demangle/--demangle switches
takes precedence).
Reviewed by: grimar, rupprecht, mattd
Differential Revision: https://reviews.llvm.org/D60134
llvm-svn: 357575
Nico Weber [Wed, 3 Apr 2019 12:33:19 +0000 (12:33 +0000)]
gn build: Add build files for clangd xpc framework code
This is a bit of a larger change since this is the first (and as far as
I can tell only) place where the LLVM build produces macOS framework
bundles.
GN has some built-in support for this, so use that.
`gn help create_bundle` has a terse description (but it's a bit
outdated: `deps` must be `public_deps` and the conditionals in the
example in the help aren't quite right on non-iOS).
We need a new 'copy_bundle_data' tool, and since we copy the clangd.xpc
bundle as bundle_data into ClangdXPC.framework it needs to be able to
handle directories in addition to files.
GN also insists we have a compile_xcassets tool even though it's not
used. I just made that run `false`.
Despite GN's support for bundles, we still need to manually create the
expected symlink structure in the .framework bundle. Since this code
never runs on Windows, it's safe to create the symlinks before the
symlink targets exist, so we can just make the bundle depend on the
steps that create the symlinks. For this to work, change the symlink
script to create the symlink's containing directory if it doesn't yet
exist.
I locally verified that CMake and GN build create the same bundle
structure. (I noticed that both builds set LC_ID_DYLIB to the pre-copy
libClangdXPCLib.dylib name, but that seems to not cause any issues and
it happens in the CMake build too.)
(Also add an error message to clangd-xpc-test-client for when loading
the dylib fails – this was useful while locally debugging this.)
Differential Revision: https://reviews.llvm.org/D60130
llvm-svn: 357574
Simon Pilgrim [Wed, 3 Apr 2019 12:33:16 +0000 (12:33 +0000)]
[X86] Regenerate LEA codegen tests
llvm-svn: 357573
Pavel Labath [Wed, 3 Apr 2019 11:48:38 +0000 (11:48 +0000)]
modify-python-lldb.py: clean up __iter__ and __len__ support
Summary:
Instead of modifying the swig-generated code, just add the appropriate
methods to the interface files in order to get the swig to do the
generation for us.
This is a straight-forward move from the python script to the interface
files. The single class which has nontrivial handling in the script
(SBModule) has been left for a separate patch.
For the cases where I did not find any tests exercising the
iteration/length methods (i.e., no tests failed after I stopped emitting
them), I tried to add basic tests for that functionality.
Reviewers: zturner, jingham, amccarth
Subscribers: jdoerfert, lldb-commits
Differential Revision: https://reviews.llvm.org/D60119
llvm-svn: 357572
Simon Pilgrim [Wed, 3 Apr 2019 11:00:55 +0000 (11:00 +0000)]
[DAGCombine] Don't use getZExtValue() until we know the constant is in range.
Noticed during prep for a patch for PR40758.
llvm-svn: 357571
Simon Atanasyan [Wed, 3 Apr 2019 10:08:27 +0000 (10:08 +0000)]
[mips] Remove unused FGRH32 register class. NFC
If we need this class in the future we will easily restore it.
Differential Revision: http://reviews.llvm.org/D60132
llvm-svn: 357570
Hans Wennborg [Wed, 3 Apr 2019 10:07:37 +0000 (10:07 +0000)]
Revert "[libc++] Correctly handle Objective-C++ ARC qualifiers in std::is_pointer"
This broke the Chromium build on Mac, see https://crbug.com/949071
> Summary:
> Otherwise, std::is_pointer<id __strong> works, but std::is_pointer<id __weak>
> (and others) don't work as expected.
>
> rdar://problem/
49126333
>
> Reviewers: ahatanak, EricWF
>
> Subscribers: christof, jkorous, dexonsmith, libcxx-commits
>
> Differential Revision: https://reviews.llvm.org/D60087
llvm-svn: 357569
Clement Courbet [Wed, 3 Apr 2019 09:37:30 +0000 (09:37 +0000)]
[X86] Make the post machine scheduler macrofusion-aware.
Summary:
Given that X86 does not use this currently, this is an NFC. I'll
experiment with enabling and will report numbers.
Reviewers: andreadb, lebedev.ri
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60185
llvm-svn: 357568
Eric Liu [Wed, 3 Apr 2019 09:25:16 +0000 (09:25 +0000)]
[clang-format] Regroup #includes into blocks for Google style
Summary:
Regrouping #includes in blocks separated by blank lines when sorting C++ #include
headers was implemented recently, and it has been preferred in Google's C++ style guide:
https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
Reviewers: sammccall, klimek
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60116
llvm-svn: 357567
Sylvestre Ledru [Wed, 3 Apr 2019 08:56:30 +0000 (08:56 +0000)]
Adding 'CLion integration' to clang-format doc
Summary:
This commit adds a chapter 'CLion integration' to ClangFormat.rst.
The official announcement of clang-format support in CLion 2019.1: https://blog.jetbrains.com/clion/2019/03/clion-2019-1-embedded-dev-clangformat-memory-view/
Patch by Marina Kalashina
Reviewers: djasper, sylvestre.ledru, krasimir
Reviewed By: sylvestre.ledru
Subscribers: jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60115
llvm-svn: 357566
Clement Courbet [Wed, 3 Apr 2019 08:21:54 +0000 (08:21 +0000)]
[X86][NFC] Add tests for misched macro-fusion.
llvm-svn: 357565
David Bolvansky [Wed, 3 Apr 2019 08:08:44 +0000 (08:08 +0000)]
[InstCombine] Simplify ctpop with bitreverse/bswap
Summary: Fixes PR41337
Reviewers: spatel
Reviewed By: spatel
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60148
llvm-svn: 357564
Hans Wennborg [Wed, 3 Apr 2019 07:41:58 +0000 (07:41 +0000)]
Revert r357256 "[DAGCombine] Improve Lifetime node chains."
As it caused a pathological compile-time regressionin V8, see PR41352.
> Improve both start and end lifetime nodes chain dependencies.
>
> Reviewers: courbet
>
> Reviewed By: courbet
>
> Subscribers: hiraditya, llvm-commits
>
> Tags: #llvm
>
> Differential Revision: https://reviews.llvm.org/D59795
This also reverts the follow-up r357309:
> [DAGCombiner] Rewrite ImproveLifetimeNodeChain to avoid DAG loop.
>
> Avoid EXPENSIVE_CHECK failure. NFCI.
llvm-svn: 357563
Fangrui Song [Wed, 3 Apr 2019 07:25:04 +0000 (07:25 +0000)]
[libclang][test] Suppress annoying 'LIBCLANG TOOLING ERROR' output
check-all invokes check-clang-python which prints the annoying message:
LIBCLANG TOOLING ERROR: fixed-compilation-database: Error while opening fixed database: No such file or directory
json-compilation-database: Error while opening JSON database: No such file or directory
Let's fix it now with os.dup os.dup2 trick.
llvm-svn: 357562
Ilya Biryukov [Wed, 3 Apr 2019 07:18:43 +0000 (07:18 +0000)]
[clangd] Return clangd::TextEdit in ClangdServer::rename. NFC
Summary:
Instead of tooling::Replacement. To avoid the need to have contents of
the file at the caller site. This also aligns better with other methods
in ClangdServer, majority of those already return LSP-specific data
types.
Reviewers: hokein, ioeric, sammccall
Reviewed By: sammccall
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60179
llvm-svn: 357561
Chen Zheng [Wed, 3 Apr 2019 03:11:34 +0000 (03:11 +0000)]
[PowerPC]add testcase for ppcctrloops pass shortloop check
llvm-svn: 357560
Sam Clegg [Wed, 3 Apr 2019 02:30:35 +0000 (02:30 +0000)]
Fix TargetLibraryInfoTest.ValidProto after rL357552
llvm-svn: 357559
Matt Arsenault [Wed, 3 Apr 2019 01:58:57 +0000 (01:58 +0000)]
AMDGPU: Assume ECC is enabled by default if supported
The test should really be checking for the property directly in the
code object headers, but there are problems with this. I don't see
this directly represented in the text form, and for the binary
emission this is depending on a function level subtarget feature to
emit a global flag.
llvm-svn: 357558
Artem Dergachev [Wed, 3 Apr 2019 01:53:40 +0000 (01:53 +0000)]
[analyzer] When failing to evaluate a __builtin_constant_p, presume it's false.
__builtin_constant_p(x) is a compiler builtin that evaluates to 1 when
its argument x is a compile-time constant and to 0 otherwise. In CodeGen
it is simply lowered to the respective LLVM intrinsic. In the Analyzer
we've been trying to delegate modeling to Expr::EvaluateAsInt, which is
allowed to sometimes fail for no apparent reason.
When it fails, let's conservatively return false. Modeling it as false
is pretty much never wrong, and it is only required to return true
on a best-effort basis, which every user should expect.
Fixes VLAChecker false positives on code that tries to emulate
static asserts in C by constructing a VLA of dynamic size -1 under the
assumption that this dynamic size is actually a constant
in the sense of __builtin_constant_p.
Differential Revision: https://reviews.llvm.org/D60110
llvm-svn: 357557