Commit Graph

302052 Commits

Author SHA1 Message Date
Petr Hosek 54153c3b5e [CMake] When built with LLVM, not use `-Wl,-z,defs`
This matches standalone build behavior. PR28681

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

Patch By: tabloid.adroit

llvm-svn: 345547
2018-10-29 22:16:56 +00:00
Wolfgang Pieb fb6cffca09 [DWARF][NFC] Refactor range list extraction and dumping
The purpose of this patch is twofold: 
- Fold pre-DWARF v5 functionality into v5 to eliminate the need for 2 different 
  versions of range list handling. We get rid of DWARFDebugRangelist{.cpp,.h}.
- Templatize the handling of range list tables so that location list handling
  can take advantage of it as well. Location list and range list tables have the 
  same basic layout.

A non-NFC version of this patch was previously submitted with r342218, but it caused
errors with some TSan tests. This patch has no functional changes. The difference to
the non-NFC patch is that there are no changes to rangelist dumping in this patch.

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

llvm-svn: 345546
2018-10-29 22:16:47 +00:00
Aleksei Sidorin 89c1ac7a05 [ASTImporter] Reorder fields after structure import is finished
There are multiple reasons why field structures can be imported
in wrong order. The simplest is the ability of field initializers
and method bodies to refer fields not in order they are listed in.
Unfortunately, there is no clean solution for that currently
so I'm leaving a FIXME.

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

llvm-svn: 345545
2018-10-29 21:46:18 +00:00
Alexander Shaposhnikov f4e75a5005 [llvm-objcopy] Move elf-specific code into subfolder
In this diff the elf-specific code is moved into the subfolder ELF 
(and factored out from llvm-objcopy.cpp).

Test plan: make check-all

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

llvm-svn: 345544
2018-10-29 21:22:58 +00:00
Erich Keane f1d3061ef8 Add parens to fix incorrect assert check.
&& has higher priority than ||, so this assert works really oddly. Add
parens to match the programmer's intent.

Change-Id: I3abe1361ee0694462190c5015779db664012f3d4
llvm-svn: 345543
2018-10-29 21:21:55 +00:00
Konstantin Zhuravlyov 5cb950200c AMDGPU: Enable code object v3 by default
Differential Revision: https://reviews.llvm.org/D53525

llvm-svn: 345542
2018-10-29 21:07:27 +00:00
Sanjay Patel 33603198f2 [InstSimplify] add tests for abs/nabs+icmp folding; NFC
llvm-svn: 345541
2018-10-29 21:05:41 +00:00
Petr Hosek 4815f72dc9 [Driver] Include missing touch files for sanitized library paths
These were forgotten in r345537 causing test failures on Clang builders.

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

llvm-svn: 345540
2018-10-29 21:04:12 +00:00
Fedor Sergeev f923e86205 [LoopUnroll] NFC. Factor out runtime-loop.ll common test behavior.
Adding COMMON prefix to get common part handled there.
Needed to simplify test changes for D53440.

llvm-svn: 345538
2018-10-29 20:38:23 +00:00
Petr Hosek 4b9940b50a [Driver] Support sanitized libraries on Fuchsia
When using sanitizers, add <resource_dir>/<target>/lib/<sanitizer>
to the list of library paths to support using sanitized version of
runtime libraries if available.

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

llvm-svn: 345537
2018-10-29 20:37:52 +00:00
John McCall d2bfe4b73e In swiftcall, don't merge FP/vector types within a chunk.
llvm-svn: 345536
2018-10-29 20:32:36 +00:00
Jessica Paquette e3932eeea4 [MachineOutliner] Inherit target features from parent function
If a function has target features, it may contain instructions that aren't
represented in the default set of instructions. If the outliner pulls out one
of these instructions, and the function doesn't have the right attributes
attached, we'll run into an LLVM error explaining that the target doesn't
support the necessary feature for the instruction.

This makes outlined functions inherit target features from their parents.

It also updates the machine-outliner.ll test to check that we're properly
inheriting target features.

llvm-svn: 345535
2018-10-29 20:27:07 +00:00
Petr Hosek f503f7fd42 [libc++abi] Provide __cxa_thread_atexit on Fuchsia
Fuchsia already supports this interface.

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

llvm-svn: 345534
2018-10-29 20:20:26 +00:00
Alexey Bataev f07946e101 [OPENMP]Fix PR39372: Does not complain about loop bound variable not
being shared.

According to the standard, the variables with unspecified data-sharing
attributes in presence of `default(none)` clause must be reported to
users. Compiler did not generate error reports for the variables used in
other OpenMP regions. Patch fixes this.

llvm-svn: 345533
2018-10-29 20:17:42 +00:00
Matthias Braun c045c557b0 Relax fast register allocator related test cases; NFC
- Relex hard coded registers and stack frame sizes
- Some test cleanups
- Change phi-dbg.ll to match on mir output after phi elimination instead
  of going through the whole codegen pipeline.

This is in preparation for https://reviews.llvm.org/D52010
I'm committing all the test changes upfront that work before and after
independently.

llvm-svn: 345532
2018-10-29 20:10:42 +00:00
Kristof Umann 49b8ac0a3d [analyzer][NFC] Refactor PlistDiagnostics to use a class instead of passing 9 parameters around
This has been a long time coming. Note the usage of AnalyzerOptions: I'll need
it for D52742, and added it in rC343620. The main motivation for this was that
I'll need to add yet another parameter to every single function, and some
functions would reach their 10th parameter with that change.

llvm-svn: 345531
2018-10-29 20:06:30 +00:00
Konstantin Zhuravlyov f472afd684 AMDGPU: Switch some lld tests to v2
Differential Revision: https://reviews.llvm.org/D53526

llvm-svn: 345530
2018-10-29 19:59:12 +00:00
Eric Fiselier 5d3c5ba7d5 XFAIL test on OS X availability
llvm-svn: 345529
2018-10-29 19:52:22 +00:00
Simon Pilgrim 090a444cb7 [X86] Set isMachineVerifierClean() back to false (PR27481)
Put back the isMachineVerifierClean() override removed at rL345513 to fix Windows ThinLTO tests

llvm-svn: 345528
2018-10-29 19:51:52 +00:00
Gheorghe-Teodor Bercea 9d6341ff51 [OpenMP] Fix condition.
Summary: Iteration variable must be strictly less than the number of iterations. This fixes a bug introduced by previous patch D53448.

Reviewers: ABataev, caomhin

Reviewed By: ABataev

Subscribers: guansong, cfe-commits

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

llvm-svn: 345527
2018-10-29 19:44:25 +00:00
Marshall Clow 8179e5042f Added Phab link for P0927
llvm-svn: 345526
2018-10-29 19:31:35 +00:00
Eric Fiselier 8c40d81d4f Bug 39129: Speeding up partition_point/lower_bound/upper_bound/ by using unsigned division by 2 when possible.
Patch by Denis Yaroshevskiy (denis.yaroshevskij@gmail.com)

The rational and measurements can be found in the bug description: https://bugs.llvm.org/show_bug.cgi?id=39129

Reviewed as https://reviews.llvm.org/D52697

llvm-svn: 345525
2018-10-29 19:25:02 +00:00
Vedant Kumar dd4be53b20 [HotColdSplitting] Allow outlining single-block cold regions
It can be profitable to outline single-block cold regions because they
may be large.

Allow outlining single-block regions if they have over some threshold of
non-debug, non-terminator instructions. I chose 3 as the threshold after
experimenting with several internal frameworks.

In practice, reducing the threshold further did not give much
improvement, whereas increasing it resulted in substantial regressions.

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

llvm-svn: 345524
2018-10-29 19:15:39 +00:00
Samuel Benzaquen 2f628a1030 Fix mismatch between size_t and uint64_t in std::set benchmark.
llvm-svn: 345523
2018-10-29 19:08:31 +00:00
Stephen Kelly a49fe5d878 [clang-query] Add non-exclusive output API
Summary:
Add granular options for AST dumping, text printing and diagnostics.

This makes it possible to

* Have both diag and dump active at once
* Extend the output with other queryable content in the future.

Reviewers: aaron.ballman, pcc, ioeric, ilya-biryukov, klimek, sammccall

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 345522
2018-10-29 18:59:56 +00:00
Thomas Lively eb15d00193 [WebAssembly] Lower away condition truncations for scalar selects
Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 345521
2018-10-29 18:38:12 +00:00
Simon Pilgrim 3a2f3c2c0a [X86][SSE] getFauxShuffleMask - Fix shuffle mask adjustment for multiple inserted subvectors
Part of the issue discovered in PR39483, although its not fully exposed until I reapply rL345395 (by reverting rL345451)

llvm-svn: 345520
2018-10-29 18:25:48 +00:00
Craig Topper 220fd33522 [X86] Add AES to KNL CPUs to match clang.
I believe this was lost from KNL when AES was pushed from Westmere to Skylake recently. KNL used to inherit from IVB.

llvm-svn: 345519
2018-10-29 18:17:01 +00:00
Stanislav Mekhanoshin 6b1c6548bd [AMDGPU] Fixed return value causing warning and regression
llvm-svn: 345518
2018-10-29 17:53:23 +00:00
Erik Pilkington 7d18094813 Revert "Revert "Support for groups of attributes in #pragma clang attribute""
This reverts commit r345487, which reverted r345486. I think the crashes were
caused by an OOM on the builder, trying again to confirm...

llvm-svn: 345517
2018-10-29 17:38:42 +00:00
Louis Dionne e9d85264ac [libc++] Use exclude_from_explicit_instantiation instead of always_inline
Summary:
This commit adopts the exclude_from_explicit_instantiation attribute discussed
at [1] and reviewed in [2] in libc++ to supplant the use of __always_inline__
for visibility purposes.

This change means that users wanting to link together translation units built
with different versions of libc++'s headers into the same final linked image
MUST define the _LIBCPP_HIDE_FROM_ABI_PER_TU macro to 1 when building those
TUs. Doing otherwise will lead to ODR violations and ABI issues.

[1]: http://lists.llvm.org/pipermail/cfe-dev/2018-August/059024.html
[2]: https://reviews.llvm.org/D51789

Reviewers: rsmith, EricWF

Subscribers: dexonsmith, libcxx-commits

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

llvm-svn: 345516
2018-10-29 17:30:04 +00:00
Bryan Chan bfd32d4377 [AArch64] Rename FP16FML instruction format (NFC)
Rename SIMDThreeSameMult (etc.) to SIMDThreeSameVectorFML (etc.) to follow
usual naming convention, and add some comments in the .td files.

llvm-svn: 345515
2018-10-29 17:27:34 +00:00
Stanislav Mekhanoshin 79080ecd82 [AMDGPU] Match v_swap_b32
Differential Revision: https://reviews.llvm.org/D52677

llvm-svn: 345514
2018-10-29 17:26:01 +00:00
Francis Visoiu Mistrih 61c9de7565 [X86] Enable the MachineVerifier by default
The machine verifier was disabled for x86 by default. There are now only
9 tests failing, compared to what previously was between 20 and 30.

This is a good opportunity to file bugs for all the remaining issues,
then explicitly disable the failing tests and enabling the machine
verifier by default.

This allows us to avoid adding new tests that break the verifier.

PR27481

llvm-svn: 345513
2018-10-29 16:57:43 +00:00
Leonard Chan 905abe5b5d [Intrinsic] Signed and Unsigned Saturation Subtraction Intirnsics
Add an intrinsic that takes 2 integers and perform saturation subtraction 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/D53783

llvm-svn: 345512
2018-10-29 16:54:37 +00:00
Luke Cheeseman 71c989ae1f [AArch64] Return address signing B key support
- Add support to generate AUTIBSP, PACIBSP, RETAB instructions for return
  address signing
- The key used to sign the function is controlled by the function attribute
  "sign-return-address-key"

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

llvm-svn: 345511
2018-10-29 16:26:58 +00:00
Bruno Ricci e2806f857b [AST] Only store the needed data in SwitchStmt
Don't store the data for the init statement and condition variable
if not needed. This cuts the size of SwitchStmt by up to 2 pointers.
The order of the children is intentionally kept the same.

Also use the newly available space in the bit-fields of Stmt
to store the bit representing whether all enums have been covered
instead of using a PointerIntPair.

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

Reviewed By: rjmccall

llvm-svn: 345510
2018-10-29 16:12:37 +00:00
Gheorghe-Teodor Bercea e92567601b [OpenMP][NVPTX] Use single loops when generating code for distribute parallel for
Summary: This patch adds a new code generation path for bound sharing directives containing distribute parallel for. The new code generation scheme applies to chunked schedules on distribute and parallel for directives. The scheme simplifies the code that is being generated by eliminating the need for an outer for loop over chunks for both distribute and parallel for directives. In the case of distribute it applies to any sized chunk while in the parallel for case it only applies when chunk size is 1.

Reviewers: ABataev, caomhin

Reviewed By: ABataev

Subscribers: jholewinski, guansong, cfe-commits

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

llvm-svn: 345509
2018-10-29 15:45:47 +00:00
Robert Widmann 98640f8456 [LLVM-C] Add Builder Bindings to Common Memory Intrinsics
Summary: Add IRBuilder bindings for memmove, memcpy, and memset.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: harlanhaskins, llvm-commits

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

llvm-svn: 345508
2018-10-29 15:31:40 +00:00
Gheorghe-Teodor Bercea 669dbde7a5 [OpenMP][NVPTX] Enable default scheduling for parallel for in non-SPMD cases.
Summary: This patch enables the choosing of the default schedule for parallel for loops even in non-SPMD cases.

Reviewers: ABataev, caomhin

Reviewed By: ABataev

Subscribers: jholewinski, guansong, cfe-commits

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

llvm-svn: 345507
2018-10-29 15:23:23 +00:00
Bruno Ricci 635d49e1df [AST] Check that GNU range case statements are correctly imported.
The test for case statements did not cover GNU range case statements.

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

Reviewed By: rjmccall

llvm-svn: 345506
2018-10-29 15:04:19 +00:00
Alexey Bataev 6ab5bb115a [OPENMP] Do not capture private loop counters.
If the loop counter is not declared in the context of the loop and it is
private, such loop counters should not be captured in the outlined
regions.

llvm-svn: 345505
2018-10-29 15:01:58 +00:00
Michael Kruse d7bca00ab0 [git/svn] Ignore Visual Studio's CMakeSettings.json.
When using Visual Studio's built-in support for CMake, the CMakeSettings.json contains the build configurations (build dir, generator, toolchain, cmake variables, etc). It is specific to the build machine, therefore should not be versioned.

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

llvm-svn: 345504
2018-10-29 14:51:02 +00:00
James Henderson c1608c96f6 [llvm-objdump] Don't crash when using `-a` on non-archives
This fixes PR39402. The crash was caused when dereferencing nullptr in
DumpObject and printArchiveChild.

Reviewed By: jhenderson

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

Patch by Xing GUO

llvm-svn: 345503
2018-10-29 14:17:08 +00:00
Aaron Ballman 31f48c50cd Add the isStaticLocal() AST matcher for matching on local static variables.
Patch by Joe Ranieri.

llvm-svn: 345502
2018-10-29 13:47:56 +00:00
Francis Visoiu Mistrih bb1bd9ed79 [X86] Remove outdated test
This test breaks the X86 MachineVerifier. It looks like the MIR part is
completely useless.

The original author suggests that it can be removed.

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

llvm-svn: 345501
2018-10-29 13:41:46 +00:00
Andrea Di Biagio df4d65dda1 [llvm-mca] Lower to mca::Instructon before the pipeline is run.
Before this change, the lowering of instructions from llvm::MCInst to
mca::Instruction was done as part of the first stage of the pipeline (i.e. the
FetchStage).  In particular, FetchStage was responsible for picking the next
instruction from the source sequence, and lower it to an mca::Instruction with
the help of an object of class InstrBuilder.

The dependency on InstrBuilder was problematic for a number of reasons. Class
InstrBuilder only knows how to lower from llvm::MCInst to mca::Instruction.
That means, it is hard to support a different scenario where instructions
in input are not instances of class llvm::MCInst. Even if we managed to
specialize InstrBuilder, and generalize most of its internal logic, the
dependency on InstrBuilder in FetchStage would have caused more troubles (other
than complicating the pipeline logic).

With this patch, the lowering step is done before the pipeline is run. The
pipeline is no longer responsible for lowering from MCInst to mca::Instruction.
As a consequence of this, the FetchStage no longer needs to interact with an
InstrBuilder. The mca::SourceMgr class now simply wraps a reference to a
sequence of mca::Instruction objects.
This simplifies the logic of FetchStage, and increases the usability of it.  As
a result, on a debug build, we see a 7-9% speedup; on a release build, the
speedup is around 3-4%.

llvm-svn: 345500
2018-10-29 13:29:22 +00:00
Greg Bedwell 38a538960b [llvm-mca][UpdateTestChecks] Don't try to align blocks that have already been subject to alignment in update_mca_test_checks.py
This fixes PR39466.

llvm-svn: 345499
2018-10-29 13:24:20 +00:00
George Rimar 3423a6d529 [LLDB] - Fix outdated comment. NFC.
llvm-svn: 345498
2018-10-29 12:33:19 +00:00
Andrew Savonichev 52d674d974 [OpenCL] Fix serialization of OpenCLExtensionDecls
Summary:
I recently discovered that adding the following code into `opencl-c.h` causes
failure of `test/Headers/opencl-c-header.cl`:
```
#pragma OPENCL EXTENSION cl_my_ext : begin
void cl_my_ext_foobarbaz();
#pragma OPENCL EXTENSIOn cl_my_ext : end
```

Clang crashes at the assertion is `ASTReader::getGlobalSubmoduleID()`:
```
assert(I != M.SubmoduleRemap.end() && "Invalid index into submodule index remap");
```

The root cause of the problem that to deserialize `OPENCL_EXTENSION_DECLS`
section `ASTReader` needs to deserialize a Decl contained in it. In turn,
deserializing a Decl requires information about whether this declaration is
part of a (sub)module, but this information is not read yet because it is
located further in a module file.

Reviewers: Anastasia, yaxunl, JDevlieghere

Reviewed By: Anastasia

Subscribers: sidorovd, cfe-commits, asavonic

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

llvm-svn: 345497
2018-10-29 11:14:01 +00:00