platform/upstream/llvm.git
5 years ago[clang-tidy] Added a test -export-fixes with relative paths.
Ilya Biryukov [Wed, 28 Nov 2018 14:43:26 +0000 (14:43 +0000)]
[clang-tidy] Added a test -export-fixes with relative paths.

Summary: A test for D51864.

Reviewers: ioeric, steveire

Reviewed By: steveire

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 347760

5 years ago[SLP]Fix PR39774: Set ReductionRoot if the original instruction is vectorized.
Alexey Bataev [Wed, 28 Nov 2018 14:34:11 +0000 (14:34 +0000)]
[SLP]Fix PR39774: Set ReductionRoot if the original instruction is vectorized.

Summary:
If the original reduction root instruction was vectorized, it might be
removed from the tree. It means that the insertion point may become
invalidated and the whole vectorization of the reduction leads to the
incorrect output result.
The ReductionRoot instruction must be marked as externally used so it
could not be removed. Otherwise it might cause inconsistency with the
cost model and we may end up with too optimistic optimization.

Reviewers: RKSimon, spatel, hfinkel, mkuper

Subscribers: llvm-commits

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

llvm-svn: 347759

5 years agoRevert r347673 "Catch up with EvaluateAsInt() clang API change."
Hans Wennborg [Wed, 28 Nov 2018 14:30:18 +0000 (14:30 +0000)]
Revert r347673 "Catch up with EvaluateAsInt() clang API change."

r347417 was re-committed in Clang.

llvm-svn: 347758

5 years agoRe-commit r347419 "Update call to EvaluateAsInt() to the new syntax."
Hans Wennborg [Wed, 28 Nov 2018 14:04:26 +0000 (14:04 +0000)]
Re-commit r347419 "Update call to EvaluateAsInt() to the new syntax."

llvm-svn: 347757

5 years agoRe-commit r347417 "Re-Reinstate 347294 with a fix for the failures."
Hans Wennborg [Wed, 28 Nov 2018 14:04:12 +0000 (14:04 +0000)]
Re-commit r347417 "Re-Reinstate 347294 with a fix for the failures."

This was reverted in r347656 due to me thinking it caused a miscompile of
Chromium. Turns out it was the Chromium code that was broken.

llvm-svn: 347756

5 years ago[clangd] Fix test broken in r347754.
Eric Liu [Wed, 28 Nov 2018 14:00:09 +0000 (14:00 +0000)]
[clangd] Fix test broken in r347754.

llvm-svn: 347755

5 years ago[clangd] Less penalty for cross-namespace completions.
Eric Liu [Wed, 28 Nov 2018 13:45:25 +0000 (13:45 +0000)]
[clangd] Less penalty for cross-namespace completions.

llvm-svn: 347754

5 years ago[clangd] Build and test IndexBenchmark in check-clangd
Haojian Wu [Wed, 28 Nov 2018 13:31:05 +0000 (13:31 +0000)]
[clangd] Build and test IndexBenchmark in check-clangd

Summary:
Include IndexBenchmark in check-clangd to make sure we won't forget to update
it when doing breaking changes; also fix an out-of-date test input.

Reviewers: ilya-biryukov

Subscribers: mgorny, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 347753

5 years ago[ASTImporter] Changed use of Import to Import_New in ASTImporter.
Balazs Keri [Wed, 28 Nov 2018 13:21:26 +0000 (13:21 +0000)]
[ASTImporter] Changed use of Import to Import_New in ASTImporter.

Reviewers: a.sidorin, shafik, a_sidorin

Reviewed By: a_sidorin

Subscribers: gamesh411, a_sidorin, dkrupp, martong, Szelethus, cfe-commits

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

llvm-svn: 347752

5 years agoFix a typo.
Haojian Wu [Wed, 28 Nov 2018 13:20:39 +0000 (13:20 +0000)]
Fix a typo.

llvm-svn: 347751

5 years agoFix build error.
Haojian Wu [Wed, 28 Nov 2018 13:15:06 +0000 (13:15 +0000)]
Fix build error.

llvm-svn: 347750

5 years agoFix -Winfinite-recursion compile error.
Haojian Wu [Wed, 28 Nov 2018 12:32:53 +0000 (12:32 +0000)]
Fix -Winfinite-recursion compile error.

llvm-svn: 347749

5 years agoFix build of r347741 by adding missing vector
David Spickett [Wed, 28 Nov 2018 12:05:36 +0000 (12:05 +0000)]
Fix build of r347741 by adding missing vector
include to ARMTargetParser.h.

llvm-svn: 347748

5 years ago[MachineScheduler] Add support for clustering mem ops with FI base operands
Francis Visoiu Mistrih [Wed, 28 Nov 2018 12:00:28 +0000 (12:00 +0000)]
[MachineScheduler] Add support for clustering mem ops with FI base operands

Before this patch, the following stores in `merge_fail` would fail to be
merged, while they would get merged in `merge_ok`:

```
void use(unsigned long long *);
void merge_fail(unsigned key, unsigned index)
{
  unsigned long long args[8];
  args[0] = key;
  args[1] = index;
  use(args);
}
void merge_ok(unsigned long long *dst, unsigned a, unsigned b)
{
  dst[0] = a;
  dst[1] = b;
}
```

The reason is that `getMemOpBaseImmOfs` would return false for FI base
operands.

This adds support for this.

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

llvm-svn: 347747

5 years ago[CodeGen][NFC] Make `TII::getMemOpBaseImmOfs` return a base operand
Francis Visoiu Mistrih [Wed, 28 Nov 2018 12:00:20 +0000 (12:00 +0000)]
[CodeGen][NFC] Make `TII::getMemOpBaseImmOfs` return a base operand

Currently, instructions doing memory accesses through a base operand that is
not a register can not be analyzed using `TII::getMemOpBaseRegImmOfs`.

This means that functions such as `TII::shouldClusterMemOps` will bail
out on instructions using an FI as a base instead of a register.

The goal of this patch is to refactor all this to return a base
operand instead of a base register.

Then in a separate patch, I will add FI support to the mem op clustering
in the MachineScheduler.

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

llvm-svn: 347746

5 years agoFix a false-positive with cert-err58-cpp.
Aaron Ballman [Wed, 28 Nov 2018 11:57:13 +0000 (11:57 +0000)]
Fix a false-positive with cert-err58-cpp.

If a variable is declared constexpr then its initializer needs to be a constant expression, and thus, cannot throw. This check is about not throwing exceptions before main() runs, and so it doesn't apply if the initializer cannot throw. This silences the diagnostic when initializing a constexpr variable and fixes PR35457.

llvm-svn: 347745

5 years ago[DebugInfo] Rename EmitDebugThreadLocal back to EmitDebugValue. NFC
Simon Atanasyan [Wed, 28 Nov 2018 11:48:07 +0000 (11:48 +0000)]
[DebugInfo] Rename EmitDebugThreadLocal back to EmitDebugValue. NFC

This reverts r294500. DwarfCompileUnit::addAddressExpr uses DIEExpr
for PCOffset. In that case the expression is unrelated to thread locals
and so emitting a value of the DIEExpr does not have to always mean
emit-debug-thread-local.

llvm-svn: 347744

5 years ago[TableGen] Better error checking for TIED_TO constraints.
Simon Tatham [Wed, 28 Nov 2018 11:43:49 +0000 (11:43 +0000)]
[TableGen] Better error checking for TIED_TO constraints.

There are quite strong constraints on how you can use the TIED_TO
constraint between MC operands, many of which are currently not
checked until compiler run time.

MachineVerifier enforces that operands can only be tied together in
pairs (no three-way ties), and MachineInstr::tieOperands enforces that
one of the tied operands must be an output operand (def) and the other
must be an input operand (use).

Now we check these at TableGen time, so that if you violate any of
them in a new instruction definition, you find out immediately,
instead of having to wait until you compile something that makes code
generation hit one of those assertions.

Also in this commit, all the error reports in ParseConstraint now
include the name and source location of the def where the problem
happened, so that if you do trigger any of these errors, it's easier
to find the part of your TableGen input where you made the mistake.

The trunk sources already build successfully with this additional
error check, so I think no in-tree target has any of these problems.

Reviewers: fhahn, lhames, nhaehnle, MatzeB

Reviewed By: MatzeB

Subscribers: llvm-commits

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

llvm-svn: 347743

5 years ago[ELF][MIPS] Handle mips in the OUTPUT_FORMAT directive
Simon Atanasyan [Wed, 28 Nov 2018 11:41:20 +0000 (11:41 +0000)]
[ELF][MIPS] Handle mips in the OUTPUT_FORMAT directive

Differential Revision: http://reviews.llvm.org/D54920

llvm-svn: 347742

5 years ago[ARM, AArch64] Move ARM/AArch64 target parsers into
David Spickett [Wed, 28 Nov 2018 11:38:10 +0000 (11:38 +0000)]
[ARM, AArch64] Move ARM/AArch64 target parsers into
separate files to enable future changes.

This moves ARM and AArch64 target parsing into their
own files. They are still accessible through
TargetParser.h as before.

Several functions in AArch64 which were just forwarders to ARM
have been removed. All except AArch64::getFPUName were unused,
and that was only used in a test. Which itself was overlapping
one in ARM, so it has also been removed.

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

llvm-svn: 347741

5 years ago[clangd] Canonicalize file path in URIForFile.
Eric Liu [Wed, 28 Nov 2018 10:30:42 +0000 (10:30 +0000)]
[clangd] Canonicalize file path in URIForFile.

Summary:
File paths in URIForFile can come from index or local AST. Path from
index goes through URI transformation and the final path is resolved by URI
scheme and could be potentially different from the original path. Hence, we
should do the same transformation for all paths. We do this in URIForFile, which
now converts a path to URI and back to a canonicalized path.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 347739

5 years ago[clangd] Fix backward-compatibility - follow-up to textDocument/SymbolInfo
Jan Korous [Wed, 28 Nov 2018 10:24:07 +0000 (10:24 +0000)]
[clangd] Fix backward-compatibility - follow-up to textDocument/SymbolInfo

Apparently clang 3.6 couldn't build the preceding patch.

llvm-svn: 347738

5 years ago[clangd] Bump vscode-clangd v0.0.7
Haojian Wu [Wed, 28 Nov 2018 10:23:15 +0000 (10:23 +0000)]
[clangd] Bump vscode-clangd v0.0.7

llvm-svn: 347737

5 years ago[ELF] Use more specific method to calculate DT_PLTRELSZ
Peter Smith [Wed, 28 Nov 2018 10:04:55 +0000 (10:04 +0000)]
[ELF] Use more specific method to calculate DT_PLTRELSZ

The DT_PLTRELSZ dynamic tag is calculated using the size of the
OutputSection containing the In.RelaPlt InputSection. This will work for the
default no linker script case and the majority of linker scripts.
Unfortunately it doesn't work for some 'almost' sensible linker scripts. It
is permitted by ELF to have a single OutputSection containing both
In.RelaDyn, In.RelaPlt and In.RelaIPlt. It is also permissible for the range
of memory [DT_RELA, DT_RELA + DT_RELASZ) and the range
[DT_JMPREL, DT_JMPREL + DT_JMPRELSZ) to overlap as long as the the latter
range is at the end.

To support this type of linker script use the specific InputSection sizes.

Fixes pr39678

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

llvm-svn: 347736

5 years ago[SystemZ::TTI] Improve cost for compare of i64 with extended i32 load
Jonas Paulsson [Wed, 28 Nov 2018 08:58:27 +0000 (08:58 +0000)]
[SystemZ::TTI]  Improve cost for compare of i64 with extended i32 load

CGF/CLGF compares an i64 register with a sign/zero extended loaded i32 value
in memory.

This patch makes such a load considered foldable and so gets a 0 cost.

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

llvm-svn: 347735

5 years ago[SystemZ::TTI] Improve costs for i16 add, sub and mul against memory.
Jonas Paulsson [Wed, 28 Nov 2018 08:31:50 +0000 (08:31 +0000)]
[SystemZ::TTI]  Improve costs for i16 add, sub and mul against memory.

AH, SH and MH costs are already covered in the cases where LHS is 32 bits and
RHS is 16 bits of memory sign-extended to i32.

As these instructions are also used when LHS is i16, this patch recognizes
that the loads will get folded then as well.

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

llvm-svn: 347734

5 years ago[SystemZ::TTI] Improved cost values for comparison against memory.
Jonas Paulsson [Wed, 28 Nov 2018 08:08:05 +0000 (08:08 +0000)]
[SystemZ::TTI] Improved cost values for comparison against memory.

Single instructions exist for i8 and i16 comparisons of memory against a
small immediate.

This patch makes sure that if the load in these cases has a single user (the
ICmp), it gets a 0 cost (folded), and also that the ICmp gets a cost of 1.

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

llvm-svn: 347733

5 years ago[SystemZ::TTI] Return zero cost for scalar load/store connected with a bswap.
Jonas Paulsson [Wed, 28 Nov 2018 07:52:34 +0000 (07:52 +0000)]
[SystemZ::TTI]  Return zero cost for scalar load/store connected with a bswap.

Since byte-swapping loads and stores are supported, a 'load -> bswap' or
'bswap -> store' sequence should have the cost of one.

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

llvm-svn: 347732

5 years ago[llvm-objcopy] Hook up the -V alias to --version, output "GNU strip"
Martin Storsjo [Wed, 28 Nov 2018 06:51:50 +0000 (06:51 +0000)]
[llvm-objcopy] Hook up the -V alias to --version, output "GNU strip"

This allows libtool to detect the presence of llvm-strip and use
it with the options --strip-debug and --strip-unneeded.

Also hook up the -V alias for objcopy.

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

llvm-svn: 347731

5 years agoPR39809: (const void*)0 is not a null pointer constant in C.
Richard Smith [Wed, 28 Nov 2018 06:25:06 +0000 (06:25 +0000)]
PR39809: (const void*)0 is not a null pointer constant in C.

llvm-svn: 347730

5 years agoPR12884: Add test (bug is already fixed).
Richard Smith [Wed, 28 Nov 2018 05:15:46 +0000 (05:15 +0000)]
PR12884: Add test (bug is already fixed).

llvm-svn: 347729

5 years agoMove LoopHint.h from Sema to Parse
Richard Trieu [Wed, 28 Nov 2018 04:36:31 +0000 (04:36 +0000)]
Move LoopHint.h from Sema to Parse

struct LoopHint was only used within Parse and not in any of the Sema or
Codegen files.  In the non-Parse files where it was included, it either wasn't
used or LoopHintAttr was used, so its inclusion did nothing.

llvm-svn: 347728

5 years ago[CodeGen] Fix included headers.
Richard Trieu [Wed, 28 Nov 2018 04:14:29 +0000 (04:14 +0000)]
[CodeGen] Fix included headers.

Remove the included Parse header because CodeGen should not depend on Parse.
Instead, include the Lex headers that it needs instead.

llvm-svn: 347727

5 years ago[diagtool] Remove unneeded header includes.
Richard Trieu [Wed, 28 Nov 2018 03:59:35 +0000 (03:59 +0000)]
[diagtool] Remove unneeded header includes.

llvm-svn: 347726

5 years ago[unittest] Fix the FileSystem test on Windows. (Attempt #2)
Jonas Devlieghere [Wed, 28 Nov 2018 01:18:10 +0000 (01:18 +0000)]
[unittest] Fix the FileSystem test on Windows. (Attempt #2)

This fixes the double escaping and compares FileSpecs instead of
strings.

llvm-svn: 347725

5 years agoDo not insert prefetches with unsupported memory operands.
Mircea Trofin [Wed, 28 Nov 2018 01:08:45 +0000 (01:08 +0000)]
Do not insert prefetches with unsupported memory operands.

Summary:
Ignore advices where the memory operand of the 'anchor' instruction
uses unsupported register types.

Reviewers: davidxl

Subscribers: llvm-commits

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

llvm-svn: 347724

5 years ago[OPENMP] remove redundant ColonExpected flag in ParseOpenMP.cpp (NFC)
Kelvin Li [Wed, 28 Nov 2018 00:51:08 +0000 (00:51 +0000)]
[OPENMP] remove redundant ColonExpected flag in ParseOpenMP.cpp (NFC)

The flag ColonExpected is not changed after being initialized to
false at declaration.

Patch by Ahsan Saghir

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

llvm-svn: 347723

5 years ago[X86] Add test cases to show that we don't properly take -mprefer-vector-width=256...
Craig Topper [Wed, 28 Nov 2018 00:33:34 +0000 (00:33 +0000)]
[X86] Add test cases to show that we don't properly take -mprefer-vector-width=256 and -min-legal-vector-width=256 into account when costing sext/zext.

The check lines marked AVX256 in the zext256/sext256 functions should be closer to the AVX values which would take into account a splitting cost.

llvm-svn: 347722

5 years agoRemove dead code from IOHandler
Alex Langford [Tue, 27 Nov 2018 23:37:47 +0000 (23:37 +0000)]
Remove dead code from IOHandler

This has been dead since 2014 according to the blame

llvm-svn: 347721

5 years ago[RISCV] Mark unit tests as "requires: riscv-registered-target"
Mandeep Singh Grang [Tue, 27 Nov 2018 22:53:57 +0000 (22:53 +0000)]
[RISCV] Mark unit tests as "requires: riscv-registered-target"

Some of these tests break if the RISCV backend has not been built.

Reland D54816.

llvm-svn: 347720

5 years ago[X86] Add exhaustive cost model testing for sext/zext for all vector types we reasona...
Craig Topper [Tue, 27 Nov 2018 22:46:05 +0000 (22:46 +0000)]
[X86] Add exhaustive cost model testing for sext/zext for all vector types we reasonably support. Add cost model tests for truncating to vXi1.

Our sext/zext cost modeling was somewhat incomplete. And had no coverage for the fact that avx512bw v32i16/v64i8 types return a scalarization cost.

Truncates are a whole different mess because isTruncateFree is returning true for vectors when it shouldn't and that's the fall back for anything not in the tables.

llvm-svn: 347719

5 years agoFix typo in "[clang][ARC] Fix test for commit r347699"
Tatyana Krasnukha [Tue, 27 Nov 2018 22:22:33 +0000 (22:22 +0000)]
Fix typo in "[clang][ARC] Fix test for commit r347699"

llvm-svn: 347718

5 years ago[lldbsuite] Each lldb suite test must have a unique class name
Stella Stamenova [Tue, 27 Nov 2018 22:18:02 +0000 (22:18 +0000)]
[lldbsuite] Each lldb suite test must have a unique class name

A couple of new tests have been added that use existing class names. This causes failures on Windows if the tests run at the same time and on any platform it results in the logs being overwritten.

llvm-svn: 347717

5 years ago[Reproducers] Improve reproducer API and add unit tests.
Jonas Devlieghere [Tue, 27 Nov 2018 22:11:02 +0000 (22:11 +0000)]
[Reproducers] Improve reproducer API and add unit tests.

When I landed the initial reproducer framework I knew there were some
things that needed improvement. Rather than bundling it with a patch
that adds more functionality I split it off into this patch. I also
think the API is stable enough to add unit testing, which is included in
this patch as well.

Other improvements include:

 - Refactor how we initialize the loader and generator.
 - Improve naming consistency: capture and replay seems the least ambiguous.
 - Index providers by name and make sure there's only one of each.
 - Add convenience methods for creating and accessing providers.

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

llvm-svn: 347716

5 years ago[OPENMP][NVPTX]Basic support for reductions across the teams.
Alexey Bataev [Tue, 27 Nov 2018 21:24:54 +0000 (21:24 +0000)]
[OPENMP][NVPTX]Basic support for reductions across the teams.

Added basic codegen support for the reductions across the teams.

llvm-svn: 347715

5 years ago[OpenMP][libomptarget] Add new version of SPMD deinit kernel function with argument
Gheorghe-Teodor Bercea [Tue, 27 Nov 2018 21:23:40 +0000 (21:23 +0000)]
[OpenMP][libomptarget] Add new version of SPMD deinit kernel function with argument

Summary: To enable the compiler to optimize parts of the function that are not needed when runtime can be omitted, a new version of the SPMD deinit kernel function is needed. This function takes the runtime required flag as an argument.

Reviewers: ABataev, kkwli0, caomhin

Reviewed By: ABataev

Subscribers: guansong, openmp-commits

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

llvm-svn: 347714

5 years ago[MS] Push outermost class DeclContexts only in -fdelayed-template-parsing
Reid Kleckner [Tue, 27 Nov 2018 21:20:42 +0000 (21:20 +0000)]
[MS] Push outermost class DeclContexts only in -fdelayed-template-parsing

This is more or less a complete rewrite of r347627, and it fixes PR38460
I added a reduced test case to DelayedTemplateParsing.cpp.

llvm-svn: 347713

5 years ago[unittest] Fix the FileSystem test on Windows.
Jonas Devlieghere [Tue, 27 Nov 2018 21:20:35 +0000 (21:20 +0000)]
[unittest] Fix the FileSystem test on Windows.

On Windows, when using the VFS without going through FileSpec, the
absolute path to `/foo` is `\\foo`. This updates the unittest to expect
that.

llvm-svn: 347712

5 years ago[libcxx] Make sure the re-export logic works when paths contain spaces
Louis Dionne [Tue, 27 Nov 2018 21:13:31 +0000 (21:13 +0000)]
[libcxx] Make sure the re-export logic works when paths contain spaces

llvm-svn: 347711

5 years ago[OPENMP][NVPTX]Basic support for reductions across the teams.
Alexey Bataev [Tue, 27 Nov 2018 21:06:09 +0000 (21:06 +0000)]
[OPENMP][NVPTX]Basic support for reductions across the teams.

Summary:
Added functions __kmpc_nvptx_teams_reduce_nowait_simple and
__kmpc_nvptx_teams_end_reduce_nowait_simple to implement basic support
for reductions across the teams.

Reviewers: gtbercea, kkwli0

Subscribers: guansong, jfb, caomhin, openmp-commits

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

llvm-svn: 347710

5 years ago[Driver] Use libOption with tablegen.
Jonas Devlieghere [Tue, 27 Nov 2018 21:00:32 +0000 (21:00 +0000)]
[Driver] Use libOption with tablegen.

This patch modifies the lldb driver to use libOption for option parsing.
It allows us to decouple option parsing from option processing which is
important when arguments affect initialization. This was previously not
possible because the debugger need to be initialized as some option
interpretation (like the scripting language etc) was handled by the
debugger, rather than in the driver.

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

llvm-svn: 347709

5 years ago[libcxx] Fix libc++ re-exporting logic when Command Line Tools are not installed
Louis Dionne [Tue, 27 Nov 2018 20:59:47 +0000 (20:59 +0000)]
[libcxx] Fix libc++ re-exporting logic when Command Line Tools are not installed

Summary:
When the Xcode Command Line tools are not installed but CMAKE_OSX_SYSROOT is
set, we would try to re-export symbols from the libc++abi.dylib shipped in
the sysroot, which does not exist. This commit changes the build on OS X to
always re-export symbols from the explicit re-export lists, which doesn't
change depending on what system you're building on, and is therefore much
less flaky.

Reviewers: EricWF, mclow.lists

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

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

llvm-svn: 347708

5 years ago[TableGen] Improve readability of generated code (NFC)
Evandro Menezes [Tue, 27 Nov 2018 20:59:01 +0000 (20:59 +0000)]
[TableGen] Improve readability of generated code (NFC)

Improve the readability of the generated code for `MCOpcodeSwitchStatement`.

llvm-svn: 347707

5 years ago[TableGen] Refactor macro names (NFC)
Evandro Menezes [Tue, 27 Nov 2018 20:58:27 +0000 (20:58 +0000)]
[TableGen] Refactor macro names (NFC)

Make the names for the macros for `TargetInstrInfo` uniform.

llvm-svn: 347706

5 years ago[clang][ARC] Fix test for commit r347699
Tatyana Krasnukha [Tue, 27 Nov 2018 20:56:30 +0000 (20:56 +0000)]
[clang][ARC] Fix test for commit r347699

llvm-svn: 347705

5 years ago[COFF] Remove empty sections before calculating the size of section headers
Martin Storsjo [Tue, 27 Nov 2018 20:48:09 +0000 (20:48 +0000)]
[COFF] Remove empty sections before calculating the size of section headers

The number of sections is used in assignAddresses (in
finalizeAddresses) and the space for all sections is permanent from
that point on, even if we later decide we won't write some of them.

The VirtualSize field also gets calculated in assignAddresses, so we
need to manually check whether the section is empty here instead.

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

llvm-svn: 347704

5 years ago[yaml2obj] Treat COFF/ARM64 as a 64 bit architecture
Martin Storsjo [Tue, 27 Nov 2018 20:47:38 +0000 (20:47 +0000)]
[yaml2obj] Treat COFF/ARM64 as a 64 bit architecture

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

llvm-svn: 347703

5 years ago[gn build] Add enough build files to be able to build llvm-tblgen.
Nico Weber [Tue, 27 Nov 2018 20:10:26 +0000 (20:10 +0000)]
[gn build] Add enough build files to be able to build llvm-tblgen.

Adds build files for:

- llvm/lib/DebugInfo/CodeView
- llvm/lib/DebugInfo/MSF
- llvm/lib/MC
- llvm/lib/TableGen
- llvm/utils/TableGen

All the build files just list sources and deps and are uninteresting.

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

llvm-svn: 347702

5 years ago[clang][slh] add attribute for speculative load hardening
Zola Bridges [Tue, 27 Nov 2018 19:56:46 +0000 (19:56 +0000)]
[clang][slh] add attribute for speculative load hardening

Summary:
Resubmit this with no changes because I think the build was broken
by a different diff.
-----
The prior diff had to be reverted because there were two tests
that failed. I updated the two tests in this diff

clang/test/Misc/pragma-attribute-supported-attributes-list.test
clang/test/SemaCXX/attr-speculative-load-hardening.cpp

----- Summary from Previous Diff (Still Accurate) -----

LLVM IR already has an attribute for speculative_load_hardening. Before
this commit, when a user passed the -mspeculative-load-hardening flag to
Clang, every function would have this attribute added to it. This Clang
attribute will allow users to opt into SLH on a function by function basis.

This can be applied to functions and Objective C methods.

Reviewers: chandlerc, echristo, kristof.beyls, aaron.ballman

Subscribers: llvm-commits

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

llvm-svn: 347701

5 years ago[InstCombine] Add tests for saturating add/sub; NFC
Nikita Popov [Tue, 27 Nov 2018 19:52:56 +0000 (19:52 +0000)]
[InstCombine] Add tests for saturating add/sub; NFC

These are baseline tests for D54534.

llvm-svn: 347700

5 years ago[clang][ARC] Add ARCTargetInfo
Tatyana Krasnukha [Tue, 27 Nov 2018 19:52:10 +0000 (19:52 +0000)]
[clang][ARC] Add ARCTargetInfo

Based-on-patch-by: Pete Couperus <petecoup@synopsys.com>
Differential Revision: https://reviews.llvm.org/D53100

llvm-svn: 347699

5 years ago[OpenMP][libomptarget] Refactor SPMD and runtime requirement checking
Gheorghe-Teodor Bercea [Tue, 27 Nov 2018 19:45:10 +0000 (19:45 +0000)]
[OpenMP][libomptarget] Refactor SPMD and runtime requirement checking

Summary: Refactor the checking for SPMD mode and whether the runtime is initialized or not. This uses constant flags which enables the runtime to optimize out unused sections of code that depend on these flags.

Reviewers: ABataev, caomhin

Reviewed By: ABataev

Subscribers: guansong, jfb, openmp-commits

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

llvm-svn: 347698

5 years ago[X86] Add cost model tests for experimental.vector.reduce.* with -x86-experimental...
Craig Topper [Tue, 27 Nov 2018 19:44:40 +0000 (19:44 +0000)]
[X86] Add cost model tests for experimental.vector.reduce.* with -x86-experimental-vector-widening-legalization

llvm-svn: 347697

5 years ago[X86] Add cost model test for masked load an store with -x86-experimental-vector...
Craig Topper [Tue, 27 Nov 2018 19:44:36 +0000 (19:44 +0000)]
[X86] Add cost model test for masked load an store with -x86-experimental-vector-widening-legalization

llvm-svn: 347696

5 years ago[X86] Add cost model tests for fp_to_int/int_to_fp with -x86-experimental-vector...
Craig Topper [Tue, 27 Nov 2018 19:44:34 +0000 (19:44 +0000)]
[X86] Add cost model tests for fp_to_int/int_to_fp with -x86-experimental-vector-widening-legalization

llvm-svn: 347695

5 years ago[X86] Add cost model tests for shifts with -x86-experimental-vector-widening-legaliza...
Craig Topper [Tue, 27 Nov 2018 19:44:30 +0000 (19:44 +0000)]
[X86] Add cost model tests for shifts with -x86-experimental-vector-widening-legalization.

llvm-svn: 347694

5 years ago[CMake] Pass full libedit path to linker
Tatyana Krasnukha [Tue, 27 Nov 2018 19:41:30 +0000 (19:41 +0000)]
[CMake] Pass full libedit path to linker

Otherwise, linker fails with "cannot find -ledit" in case of custom libedit installation.

llvm-svn: 347693

5 years agoDon't speculatively emit VTTs for classes unless we are able to correctly emit refere...
Richard Smith [Tue, 27 Nov 2018 19:33:49 +0000 (19:33 +0000)]
Don't speculatively emit VTTs for classes unless we are able to correctly emit references to all the functions they will (directly or indirectly) reference.

Summary:
This fixes a miscompile where we'd emit a VTT for a class that ends up
referencing an inline virtual member function that we can't actually
emit a body for (because we never instantiated it in the current TU),
which in a corner case of a corner case can lead to link errors.

Reviewers: rjmccall

Subscribers: cfe-commits

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

llvm-svn: 347692

5 years ago[lit] Pass more environment variables through to child processes.
Zachary Turner [Tue, 27 Nov 2018 19:29:12 +0000 (19:29 +0000)]
[lit] Pass more environment variables through to child processes.

This arose when I was trying to have a substitution which invoked a
python script P, and that python script tried to invoke clang-cl (or
even cl). Since we invoke P with a custom environment, it doesn't
inherit the environment of the parent, and then when we go to invoke
clang-cl, it's unable to find the MSVC installation directory. There
were many more I could have passed through which are set by vcvarsall,
but I tried to keep it simple and only pass through the important ones.

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

llvm-svn: 347691

5 years agoAdd missing error checking code intended for r347687
Reid Kleckner [Tue, 27 Nov 2018 19:14:11 +0000 (19:14 +0000)]
Add missing error checking code intended for r347687

llvm-svn: 347690

5 years agoRevert "[RISCV] Mark unit tests as "requires: riscv-registered-target""
Mandeep Singh Grang [Tue, 27 Nov 2018 19:13:52 +0000 (19:13 +0000)]
Revert "[RISCV] Mark unit tests as "requires: riscv-registered-target""

This reverts commit 1a6a0c9ea2716378d55858c11adf5941608531f8.

llvm-svn: 347689

5 years ago[RISCV] Mark unit tests as "requires: riscv-registered-target"
Mandeep Singh Grang [Tue, 27 Nov 2018 19:13:13 +0000 (19:13 +0000)]
[RISCV] Mark unit tests as "requires: riscv-registered-target"

Summary: Some of these tests break if the RISCV backend has not been built.

Reviewers: asb, apazos, sabuasal

Reviewed By: sabuasal

Subscribers: rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, cfe-commits

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

llvm-svn: 347688

5 years ago[PDB] Add symbol records in bulk
Reid Kleckner [Tue, 27 Nov 2018 19:00:23 +0000 (19:00 +0000)]
[PDB] Add symbol records in bulk

Summary:
This speeds up linking clang.exe/pdb with /DEBUG:GHASH by 31%, from
12.9s to 9.8s.

Symbol records are typically small (16.7 bytes on average), but we
processed them one at a time. CVSymbol is a relatively "large" type. It
wraps an ArrayRef<uint8_t> with a kind an optional 32-bit hash, which we
don't need. Before this change, each DbiModuleDescriptorBuilder would
maintain an array of CVSymbols, and would write them individually with a
BinaryItemStream.

With this change, we now add symbols that happen to appear contiguously
in bulk. For each .debug$S section (roughly one per function), we
allocate two copies, one for relocation, and one for realignment
purposes. For runs of symbols that go in the module stream, which is
most symbols, we now add them as a single ArrayRef<uint8_t>, so the
vector DbiModuleDescriptorBuilder is roughly linear in the number of
.debug$S sections (O(# funcs)) instead of the number of symbol records
(very large).

Some stats on symbol sizes for the curious:
  PDB size: 507M
  sym bytes: 316,508,016
  sym count:  18,954,971
  sym byte avg: 16.7

As future work, we may be able to skip copying symbol records in the
linker for realignment purposes if we make LLVM write them aligned into
the object file. We need to double check that such symbol records are
still compatible with link.exe, but if so, it's definitely worth doing,
since my profile shows we spend 500ms in memcpy in the symbol merging
code. We could potentially cut that in half by saving a copy.
Alternatively, we could apply the relocations *after* we iterate the
symbols. This would require some careful re-engineering of the
relocation processing code, though.

Reviewers: zturner, aganea, ruiu

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 347687

5 years ago[TableGen] Preprocessing support
Vyacheslav Zakharin [Tue, 27 Nov 2018 18:57:43 +0000 (18:57 +0000)]
[TableGen] Preprocessing support

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

llvm-svn: 347686

5 years ago[ASTImporter] Added Import functions for transition to new API.
Balazs Keri [Tue, 27 Nov 2018 18:36:31 +0000 (18:36 +0000)]
[ASTImporter] Added Import functions for transition to new API.

Summary:
These Import_New functions should be used in the ASTImporter,
and the old Import functions should not be used. Later the
Import_New should be renamed to Import again and the old Import
functions must be removed. But this can happen only after LLDB
was updated to use the new Import interface.

This commit is only about introducing the new Import_New
functions. These are not implemented now, only calling the old
Import ones.

Reviewers: shafik, rsmith, a_sidorin, a.sidorin

Reviewed By: a_sidorin

Subscribers: spyffe, a_sidorin, gamesh411, shafik, rsmith, dkrupp, martong, Szelethus, cfe-commits

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

llvm-svn: 347685

5 years ago[X86] Replace an APInt that is guaranteed to be 8-bits with just an 'unsigned'
Craig Topper [Tue, 27 Nov 2018 18:24:56 +0000 (18:24 +0000)]
[X86] Replace an APInt that is guaranteed to be 8-bits with just an 'unsigned'

We're already mixing this APInt with other 'unsigned' variables. This allows us to use regular comparison operators instead of needing to use APInt::ult or APInt::uge. And it removes a later conversion from APInt to unsigned.

I might be adding another combine to this function and this will probably simplify the logic required for that.

llvm-svn: 347684

5 years ago[PartialInliner] Make PHIs free in cost computation.
Florian Hahn [Tue, 27 Nov 2018 18:17:27 +0000 (18:17 +0000)]
[PartialInliner] Make PHIs free in cost computation.

InlineCost also treats them as free and the current implementation
can cause assertion failures if PHI nodes are moved outside the region
from entry BBs to the region.

It also updates the code to use the instructionsWithoutDebug iterator.

Reviewers: davidxl, davide, vsk, graham-yiu-huawei

Reviewed By: davidxl

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

llvm-svn: 347683

5 years ago[X86] Add -march=cascadelake support in clang.
Craig Topper [Tue, 27 Nov 2018 18:05:14 +0000 (18:05 +0000)]
[X86] Add -march=cascadelake support in clang.

This is skylake-avx512 with the addition of avx512vnni ISA.

Patch by Jianping Chen

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

llvm-svn: 347682

5 years ago[X86] Add cascade lake arch in X86 target.
Craig Topper [Tue, 27 Nov 2018 18:05:00 +0000 (18:05 +0000)]
[X86] Add cascade lake arch in X86 target.

This is skylake-avx512 with the addition of avx512vnni ISA.

Patch by Jianping Chen

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

llvm-svn: 347681

5 years agoRemove SaveAndRestore and SmallVectorImpl from lld/Common/LLVM.h. NFC.
Rui Ueyama [Tue, 27 Nov 2018 17:54:15 +0000 (17:54 +0000)]
Remove SaveAndRestore and SmallVectorImpl from lld/Common/LLVM.h. NFC.

llvm-svn: 347680

5 years agoDocumentation: add \file markup as needed.
James Dennett [Tue, 27 Nov 2018 17:53:03 +0000 (17:53 +0000)]
Documentation: add \file markup as needed.

This makes Doxygen correctly associate the doc comment with the current
file rather than adding to the documentation for namespace llvm.

llvm-svn: 347679

5 years agoMake a member function non-member. NFC.
Rui Ueyama [Tue, 27 Nov 2018 17:47:24 +0000 (17:47 +0000)]
Make a member function non-member. NFC.

llvm-svn: 347678

5 years agoFix linker option for -fprofile-arcs -ftest-coverage
Marco Castelluccio [Tue, 27 Nov 2018 17:31:08 +0000 (17:31 +0000)]
Fix linker option for -fprofile-arcs -ftest-coverage

Summary:
Linux toolchain accidentally added "-u__llvm_runtime_variable" when "-fprofile-arcs -ftest-coverage", this is not added when "--coverage" option is used.
Using "-u__llvm_runtime_variable" generates an empty default.profraw file while an application built with  "-fprofile-arcs -ftest-coverage" is running.

Reviewers: calixte, marco-c, sylvestre.ledru

Reviewed By: marco-c

Subscribers: vsk, cfe-commits

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

llvm-svn: 347677

5 years agoRevert "[clang] - Simplify tools::SplitDebugName."
Jonas Toth [Tue, 27 Nov 2018 17:28:38 +0000 (17:28 +0000)]
Revert "[clang] - Simplify tools::SplitDebugName."

This reverts commit r347035 as it introduced assertion failures under
certain conditions. More information can be found here:
https://reviews.llvm.org/rL347035

llvm-svn: 347676

5 years ago[clangd] textDocument/SymbolInfo extension
Jan Korous [Tue, 27 Nov 2018 16:40:46 +0000 (16:40 +0000)]
[clangd] textDocument/SymbolInfo extension

New method returning symbol info for given source position.

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

rdar://problem/46050281

llvm-svn: 347675

5 years ago[clangd][NFC] Move SymbolID to a separate file
Jan Korous [Tue, 27 Nov 2018 16:40:34 +0000 (16:40 +0000)]
[clangd][NFC] Move SymbolID to a separate file

Prerequisity for textDocument/SymbolInfo

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

llvm-svn: 347674

5 years agoCatch up with EvaluateAsInt() clang API change.
Davide Italiano [Tue, 27 Nov 2018 16:40:21 +0000 (16:40 +0000)]
Catch up with EvaluateAsInt() clang API change.

llvm-svn: 347673

5 years agoImplement P1085R2 - Should Span be Regular?. This consists entirely of deletions
Marshall Clow [Tue, 27 Nov 2018 16:35:41 +0000 (16:35 +0000)]
Implement P1085R2 - Should Span be Regular?. This consists entirely of deletions

llvm-svn: 347672

5 years ago[clang-tidy] Ignore bool -> single bit bitfield conversion in readability-implicit...
Malcolm Parsons [Tue, 27 Nov 2018 16:23:39 +0000 (16:23 +0000)]
[clang-tidy] Ignore bool -> single bit bitfield conversion in readability-implicit-bool-conversion

Summary: There is no ambiguity / information loss in this conversion

Reviewers: alexfh, aaron.ballman, hokein

Reviewed By: alexfh

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 347671

5 years ago[Demangle] remove itaniumFindTypesInMangledName
Pavel Labath [Tue, 27 Nov 2018 16:11:24 +0000 (16:11 +0000)]
[Demangle] remove itaniumFindTypesInMangledName

Summary:
This (very specialized) function was added to enable an LLDB use case.
Now that a more generic interface (overriding of parser functions -
D52992)  is available, and LLDB has been converted to use that (D54074),
the function is unused and can be removed.

Reviewers: erik.pilkington, sgraenitz, rsmith

Subscribers: mgorny, hiraditya, christof, libcxx-commits, llvm-commits

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

llvm-svn: 347670

5 years ago[clangd] Put direct headers into srcs section.
Kadir Cetinkaya [Tue, 27 Nov 2018 16:08:53 +0000 (16:08 +0000)]
[clangd] Put direct headers into srcs section.

Summary:
Currently, there's no way of knowing about header files
using compilation database, since it doesn't contain header files as entries.

Using this information, restoring from cache using compile commands becomes
possible instead of doing directory traversal. Also, we can issue indexing
actions for out-of-date headers even if source files depending on them haven't
changed.

Reviewers: sammccall

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 347669

5 years agotravis: Add cmake build
Jan Vesely [Tue, 27 Nov 2018 16:07:21 +0000 (16:07 +0000)]
travis: Add cmake build

Reviewer: Aaron Watry

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 347668

5 years agoAdd cmake build system
Jan Vesely [Tue, 27 Nov 2018 16:07:19 +0000 (16:07 +0000)]
Add cmake build system

Add cmake support for CLC and ll asm language,
the latter includes clang preprocessing stage.
Add ctests to check for external function calls.

v2: fix typos, style

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Aaron Watry <awatry@gmail.com>
Tested-by: Aaron Watry <awatry@gmail.com>
Acked-by: Vedran Miletić <vedran@miletic.net>
llvm-svn: 347667

5 years agor600: Remove empty OVERRIDES file
Jan Vesely [Tue, 27 Nov 2018 16:01:16 +0000 (16:01 +0000)]
r600: Remove empty OVERRIDES file

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry
llvm-svn: 347666

5 years agoamdgcn: Consolidate atomic minmax helpers
Jan Vesely [Tue, 27 Nov 2018 16:01:13 +0000 (16:01 +0000)]
amdgcn: Consolidate atomic minmax helpers

Removes most overrides
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry

llvm-svn: 347665

5 years agoconfigure: Add target specific asm rule.
Jan Vesely [Tue, 27 Nov 2018 16:01:10 +0000 (16:01 +0000)]
configure: Add target specific asm rule.

Run the file through target specific preprocessing stage.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry

llvm-svn: 347664

5 years agoconfigure: provide llvm_as helper variable
Jan Vesely [Tue, 27 Nov 2018 16:01:01 +0000 (16:01 +0000)]
configure: provide llvm_as helper variable

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Aaron Watry
llvm-svn: 347663

5 years ago[llvm-mca] pass -dispatch-stats flag to a couple of tests. NFC
Andrea Di Biagio [Tue, 27 Nov 2018 15:56:00 +0000 (15:56 +0000)]
[llvm-mca] pass -dispatch-stats flag to a couple of tests. NFC

This change is in preparation for a patch that fixes PR36666.

llvm-mca currently doesn't know if a buffered processor resource describes a
load or store queue. So, any dynamic dispatch stall caused by the lack of
load/store queue entries is normally reported as a generic SCHEDULER stall. See for
example the -dispatch-stats output from the two tests modified by this patch.

In future, processor models will be able to tag processor resources that are
used to describe load/store queues. That information would then be used by
llvm-mca to correctly classify dynamic dispatch stalls caused by the lack of
tokens in the LS.

llvm-svn: 347662

5 years ago[x86] regenerate checks; NFC
Sanjay Patel [Tue, 27 Nov 2018 15:52:17 +0000 (15:52 +0000)]
[x86] regenerate checks; NFC

llvm-svn: 347661

5 years agoMove time cast to SymbolFileDWARFDebugMap
Jonas Devlieghere [Tue, 27 Nov 2018 15:25:58 +0000 (15:25 +0000)]
Move time cast to SymbolFileDWARFDebugMap

When trying to fix the bots we expected that the cast would be needed in
different places. Ultimately it turned out only the
SymbolFileDWARFDebugMap was affected so, as Pavel correctly notes, it
makes more sense to do the cast just there instead of in teh FS.

llvm-svn: 347660