platform/upstream/llvm.git
5 years ago[BPF] [BTF] Process FileName with absolute path correctly
Yonghong Song [Sat, 2 Feb 2019 05:54:59 +0000 (05:54 +0000)]
[BPF] [BTF] Process FileName with absolute path correctly

In IR, sometimes the following attributes for DIFile may be
generated:
  filename: /home/yhs/test.c
  directory: /tmp
The /tmp may represent the working directory of the compilation
process.

In such cases, since filename is with absolute path,
the directory should be ignored by BTF. The filename alone is
enough to get the source.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 352952

5 years agoBump minimum toolchain version
JF Bastien [Sat, 2 Feb 2019 05:15:34 +0000 (05:15 +0000)]
Bump minimum toolchain version

Summary:
The RFC on moving past C++11 got good traction:
  http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html

This patch therefore bumps the toolchain versions according to our policy:
  llvm.org/docs/DeveloperPolicy.html#toolchain

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane

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

llvm-svn: 352951

5 years ago[llvm-objcopy] Temporarily limit one test to darwin
Alexander Shaposhnikov [Sat, 2 Feb 2019 05:01:00 +0000 (05:01 +0000)]
[llvm-objcopy] Temporarily limit one test to darwin

Some triples in llvm-mc appear to be unavailable on some buildbots.
To please those buildbots we temporarily limit the test to darwin
(where the required triple is guranteed to be available)
until we find the right solution.

llvm-svn: 352950

5 years ago[Sema][ObjC] Allow declaring ObjC pointer members with non-trivial
Akira Hatanaka [Sat, 2 Feb 2019 02:23:40 +0000 (02:23 +0000)]
[Sema][ObjC] Allow declaring ObjC pointer members with non-trivial
ownership qualifications in C++ unions under ARC.

An ObjC pointer member with non-trivial ownership qualifications causes
all of the defaulted special functions of the enclosing union to be
defined as deleted, except when the member has an in-class initializer,
the default constructor isn't defined as deleted.

rdar://problem/34213306

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

llvm-svn: 352949

5 years ago[ASan] Do not instrument other runtime functions with `__asan_handle_no_return`
Julian Lettner [Sat, 2 Feb 2019 02:05:16 +0000 (02:05 +0000)]
[ASan] Do not instrument other runtime functions with `__asan_handle_no_return`

Summary:
Currently, ASan inserts a call to `__asan_handle_no_return` before every
`noreturn` function call/invoke. This is unnecessary for calls to other
runtime funtions. This patch changes ASan to skip instrumentation for
functions calls marked with `!nosanitize` metadata.

Reviewers: TODO

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

llvm-svn: 352948

5 years ago[llvm-objcopy] Fix triples in macho tests.
Alexander Shaposhnikov [Sat, 2 Feb 2019 02:04:09 +0000 (02:04 +0000)]
[llvm-objcopy] Fix triples in macho tests.

Update triples used by the macho tests to fix some buildbots.

llvm-svn: 352947

5 years agoRemove redundant FunctionDecl argument from a couple functions.
James Y Knight [Sat, 2 Feb 2019 01:48:23 +0000 (01:48 +0000)]
Remove redundant FunctionDecl argument from a couple functions.

This argument was added in r254554 in order to support the
pass_object_size attribute. However, in r296076, the attribute's
presence is now also represented in FunctionProtoType's
ExtParameterInfo, and thus it's unnecessary to pass along a separate
FunctionDecl.

The functions modified are:
 RequiredArgs::forPrototype{,Plus}, and
 CodeGenTypes::ConvertFunctionType.

After this, it's also (again) unnecessary to have a separate
ConvertFunctionType function ConvertType, so convert callers back to
the latter, leaving the former as an internal helper function.

llvm-svn: 352946

5 years ago[AutoUpgrade] Fix AutoUpgrade for x86.seh.recoverfp
Mandeep Singh Grang [Sat, 2 Feb 2019 01:32:48 +0000 (01:32 +0000)]
[AutoUpgrade] Fix AutoUpgrade for x86.seh.recoverfp

Summary: This fixes the bug in https://reviews.llvm.org/D56747#inline-502711.

Reviewers: efriedma

Reviewed By: efriedma

Subscribers: javed.absar, llvm-commits

Tags: #llvm

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

llvm-svn: 352945

5 years ago[llvm-objcopy] Add ability to copy MachO object files
Alexander Shaposhnikov [Sat, 2 Feb 2019 00:38:07 +0000 (00:38 +0000)]
[llvm-objcopy] Add ability to copy MachO object files

This diff implements first bits for copying (without modification) MachO object files.

Test plan: make check-all

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

llvm-svn: 352944

5 years ago[ELF] Default to --no-allow-shlib-undefined for executables
Fangrui Song [Sat, 2 Feb 2019 00:34:28 +0000 (00:34 +0000)]
[ELF] Default to --no-allow-shlib-undefined for executables

Summary:
This follows the ld.bfd/gold behavior.

The error check is useful as it captures a common type of ld.so undefined symbol errors as link-time errors:

    // a.cc => a.so (not linked with -z defs)
    void f(); // f is undefined
    void g() { f(); }

    // b.cc => executable with a DT_NEEDED entry on a.so
    void g();
    int main() { g(); }

    // ld.so errors when g() is executed (lazy binding) or when the program is started (-z now)
    // symbol lookup error: ... undefined symbol: f

Reviewers: ruiu, grimar, pcc, espindola

Reviewed By: ruiu

Subscribers: llvm-commits, emaste, arichardson

Tags: #llvm

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

llvm-svn: 352943

5 years agoHandle cases where the dirent::d_type macros aren't defined
Eric Fiselier [Fri, 1 Feb 2019 23:52:17 +0000 (23:52 +0000)]
Handle cases where the dirent::d_type macros aren't defined

llvm-svn: 352942

5 years agoRevert "[BPF] [BTF] Process FileName with absolute path correctly"
Yonghong Song [Fri, 1 Feb 2019 23:49:52 +0000 (23:49 +0000)]
Revert "[BPF] [BTF] Process FileName with absolute path correctly"

This reverts commit r352939.

Some tests failed. Revert to unblock others.

llvm-svn: 352941

5 years ago[AArch64] Fix unused variable [NFC]
Mandeep Singh Grang [Fri, 1 Feb 2019 23:42:34 +0000 (23:42 +0000)]
[AArch64] Fix unused variable [NFC]

llvm-svn: 352940

5 years ago[BPF] [BTF] Process FileName with absolute path correctly
Yonghong Song [Fri, 1 Feb 2019 23:23:17 +0000 (23:23 +0000)]
[BPF] [BTF] Process FileName with absolute path correctly

In IR, sometimes the following attributes for DIFile may be
generated:
  filename: /home/yhs/test.c
  directory: /tmp
The /tmp may represent the working directory of the compilation
process.

In such cases, since filename is with absolute path,
the directory should be ignored by BTF. The filename alone is
enough to get the source.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 352939

5 years ago[analyzer] Hotfix for RetainCountChecker: assert was too strong.
George Karpenkov [Fri, 1 Feb 2019 23:06:44 +0000 (23:06 +0000)]
[analyzer] Hotfix for RetainCountChecker: assert was too strong.

Bridged casts can happen to non-CF objects as well.

llvm-svn: 352938

5 years ago[CodeGen] Be as conservative about atomic accesses as for volatile
Philip Reames [Fri, 1 Feb 2019 22:58:52 +0000 (22:58 +0000)]
[CodeGen] Be as conservative about atomic accesses as for volatile

Background: At the moment, we record the AtomicOrdering of an access in the MMO, but also mark any atomic access as volatile in SelectionDAG. I'm working towards separating that. See https://reviews.llvm.org/D57601 for context.

Update all usages of isVolatile in lib/CodeGen to preserve behaviour once atomic MMOs stop being also volatile. This is NFC in it's current form, but is essential for correctness once we make that final change.

It useful to keep in mind that AtomicSDNode is not a parent of LoadSDNode, StoreSDNode, or LSBaseSDNode. As a result, any call to isVolatile on one of those static types doesn't need a companion isAtomic check.  We should probably adjust that class hierarchy long term, but for now, that seperation is useful.

I'm deliberately being conservative about handling. I want the change to stop adding volatile to be NFC itself, and then will work through places where we can be less conservative for atomics one by one in separate changes w/tests.

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

llvm-svn: 352937

5 years ago[WebAssembly] Fix ImportName's position in this test.
Dan Gohman [Fri, 1 Feb 2019 22:52:29 +0000 (22:52 +0000)]
[WebAssembly] Fix ImportName's position in this test.

This is a follow-up to r352930.

llvm-svn: 352936

5 years ago[InstCombine] Refactor test checks (NFC)
Evandro Menezes [Fri, 1 Feb 2019 22:52:05 +0000 (22:52 +0000)]
[InstCombine] Refactor test checks (NFC)

llvm-svn: 352935

5 years agoRevert "[AST][OpenMP] OpenMP Sections / Section constructs contain Structured blocks"
Roman Lebedev [Fri, 1 Feb 2019 22:43:08 +0000 (22:43 +0000)]
Revert "[AST][OpenMP] OpenMP Sections / Section constructs contain Structured blocks"

Further reviews (D57594, D57615) have revealed that this was not reviewed,
and that the differential's description was not read during the review,
thus rendering this commit invalid.

This reverts commit r352882.

llvm-svn: 352933

5 years ago[Test] Update file w/update_test_checks.py to make a follow on change obvious
Philip Reames [Fri, 1 Feb 2019 22:30:51 +0000 (22:30 +0000)]
[Test] Update file w/update_test_checks.py to make a follow on change obvious

llvm-svn: 352932

5 years ago[WebAssembly] Add codegen support for the import_field attribute
Dan Gohman [Fri, 1 Feb 2019 22:27:34 +0000 (22:27 +0000)]
[WebAssembly] Add codegen support for the import_field attribute

This adds the LLVM side of https://reviews.llvm.org/D57602 -- the
import_field attribute. See that patch for details.

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

llvm-svn: 352931

5 years ago[WebAssembly] Add an import_field function attribute
Dan Gohman [Fri, 1 Feb 2019 22:25:23 +0000 (22:25 +0000)]
[WebAssembly] Add an import_field function attribute

This is similar to import_module, but sets the import field name
instead.

By default, the import field name is the same as the C/asm/.o symbol
name. However, there are situations where it's useful to have it be
different. For example, suppose I have a wasm API with a module named
"pwsix" and a field named "read". There's no risk of namespace
collisions with user code at the wasm level because the generic name
"read" is qualified by the module name "pwsix". However in the C/asm/.o
namespaces, the module name is not used, so if I have a global function
named "read", it is intruding on the user's namespace.

With the import_field module, I can declare my function (in libc) to be
"__read", and then set the wasm import module to be "pwsix" and the wasm
import field to be "read". So at the C/asm/.o levels, my symbol is
outside the user namespace.

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

llvm-svn: 352930

5 years ago[COFF] Create range extension thunks for ARM64
Martin Storsjo [Fri, 1 Feb 2019 22:08:09 +0000 (22:08 +0000)]
[COFF] Create range extension thunks for ARM64

On ARM64, this is normally necessary only after a module exceeds
128 MB in size (while the limit for thumb is 16 MB). For conditional
branches, the range limit is only 1 MB though (the same as for thumb),
and for the tbz instruction, the range is only 32 KB, which allows for
a test much smaller than the full 128 MB.

This fixes PR40467.

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

llvm-svn: 352929

5 years ago[COFF] Fix crashes when writing a PDB after adding thunks.
Martin Storsjo [Fri, 1 Feb 2019 22:08:03 +0000 (22:08 +0000)]
[COFF] Fix crashes when writing a PDB after adding thunks.

When writing a PDB, the OutputSection of all chunks need to be set.
The thunks are added directly to OutputSection after the normal
machinery that sets it for all other chunks.

This fixes part of PR40467.

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

llvm-svn: 352928

5 years agoImprove diagnostic to tell you a type is incomplete.
Eric Fiselier [Fri, 1 Feb 2019 22:06:02 +0000 (22:06 +0000)]
Improve diagnostic to tell you a type is incomplete.

I recently ran into this code:
```
\#include <iostream>
void foo(const std::string &s, const std::string& = "");
\#include <string>
void test() { foo(""); }
```

The diagnostic produced said it can't bind char[1] to std::string
const&. It didn't mention std::string is incomplete. The user had to
infer that.

This patch causes the diagnostic to now say "incomplete type".

llvm-svn: 352927

5 years agoadd a test and a couple minor bug fixes for the implicit-signed-integer-truncation...
Marshall Clow [Fri, 1 Feb 2019 21:59:27 +0000 (21:59 +0000)]
add a test and a couple minor bug fixes for the implicit-signed-integer-truncation sanitizer. This is PR#40566

llvm-svn: 352926

5 years agoFactor out duplication between ExprIterator and ConstExprIterator.
Richard Smith [Fri, 1 Feb 2019 21:58:17 +0000 (21:58 +0000)]
Factor out duplication between ExprIterator and ConstExprIterator.

This also exposes a more general iterator cast mechanism suitable for
use in http://reviews.llvm.org/D56571.

llvm-svn: 352925

5 years ago[COFF, ARM64] Fix localaddress to handle stack realignment and variable size objects
Mandeep Singh Grang [Fri, 1 Feb 2019 21:41:33 +0000 (21:41 +0000)]
[COFF, ARM64] Fix localaddress to handle stack realignment and variable size objects

Summary: This fixes using the correct stack registers for SEH when stack realignment is needed or when variable size objects are present.

Reviewers: rnk, efriedma, ssijaric, TomTan

Reviewed By: rnk, efriedma

Subscribers: javed.absar, kristof.beyls, llvm-commits

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

llvm-svn: 352923

5 years ago[X86][AVX] Add VMOVDDUP-VPBROADCASTQ execution domain mapping
Simon Pilgrim [Fri, 1 Feb 2019 21:41:30 +0000 (21:41 +0000)]
[X86][AVX] Add VMOVDDUP-VPBROADCASTQ execution domain mapping

Noticed in D57514.

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

llvm-svn: 352922

5 years ago[ubsan] Make suppressions.cpp test pass for me on Windows
Reid Kleckner [Fri, 1 Feb 2019 21:35:17 +0000 (21:35 +0000)]
[ubsan] Make suppressions.cpp test pass for me on Windows

The test seems to be failing because the module suppression file
contains a colon. I found that it was sufficient to just use the
basename of the suppression file.

While I was here, I noticed that we don't implement IsAbsolutePath for
Windows, so I added it.

llvm-svn: 352921

5 years ago[AMDGPU] Mark test functions with hidden visibility
Scott Linder [Fri, 1 Feb 2019 21:23:28 +0000 (21:23 +0000)]
[AMDGPU] Mark test functions with hidden visibility

Prepare for future patch which affects codegen for calls to preemptible
functions.

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

llvm-svn: 352920

5 years agoDon't use ASTContext in DeclOpenMP.h because it's still incomplete.
Eric Fiselier [Fri, 1 Feb 2019 21:19:20 +0000 (21:19 +0000)]
Don't use ASTContext in DeclOpenMP.h because it's still incomplete.

llvm-svn: 352919

5 years ago[DebugInfo] Fix mkdir use in test
Jordan Rupprecht [Fri, 1 Feb 2019 21:14:21 +0000 (21:14 +0000)]
[DebugInfo] Fix mkdir use in test

llvm-svn: 352918

5 years ago[InstCombine] Expand Windows test (NFC)
Evandro Menezes [Fri, 1 Feb 2019 21:14:10 +0000 (21:14 +0000)]
[InstCombine] Expand Windows test (NFC)

Run checks for Win32 as well.

llvm-svn: 352917

5 years ago[DebugInfo] Don't use realpath when looking up debug binary locations.
Jordan Rupprecht [Fri, 1 Feb 2019 21:04:16 +0000 (21:04 +0000)]
[DebugInfo] Don't use realpath when looking up debug binary locations.

Summary:
Using realpath makes assumptions about build systems that do not always hold true. The debug binary referred to from the .gnu_debuglink should exist in the same directory (or in a .debug directory, etc.), but the files may only exist as symlinks to a differently named files elsewhere, and using realpath causes that lookup to fail.

This was added in r189250, and this is basically a revert + regression test case.

Reviewers: dblaikie, samsonov, jhenderson

Reviewed By: dblaikie

Subscribers: llvm-commits, hiraditya

Tags: #llvm

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

llvm-svn: 352916

5 years ago[opaque pointer types] Pass function type for CallBase::setCalledFunction.
James Y Knight [Fri, 1 Feb 2019 20:44:54 +0000 (20:44 +0000)]
[opaque pointer types] Pass function type for CallBase::setCalledFunction.

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

llvm-svn: 352914

5 years ago[opaque pointer types] Pass value type to GetElementPtr creation.
James Y Knight [Fri, 1 Feb 2019 20:44:47 +0000 (20:44 +0000)]
[opaque pointer types] Pass value type to GetElementPtr creation.

This cleans up all GetElementPtr creation in LLVM to explicitly pass a
value type rather than deriving it from the pointer's element-type.

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

llvm-svn: 352913

5 years ago[opaque pointer types] Pass value type to LoadInst creation.
James Y Knight [Fri, 1 Feb 2019 20:44:24 +0000 (20:44 +0000)]
[opaque pointer types] Pass value type to LoadInst creation.

This cleans up all LoadInst creation in LLVM to explicitly pass the
value type rather than deriving it from the pointer's element-type.

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

llvm-svn: 352911

5 years ago[opaque pointer types] Pass function types to InvokeInst creation.
James Y Knight [Fri, 1 Feb 2019 20:43:34 +0000 (20:43 +0000)]
[opaque pointer types] Pass function types to InvokeInst creation.

This cleans up all InvokeInst creation in LLVM to explicitly pass a
function type rather than deriving it from the pointer's element-type.

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

llvm-svn: 352910

5 years ago[opaque pointer types] Pass function types to CallInst creation.
James Y Knight [Fri, 1 Feb 2019 20:43:25 +0000 (20:43 +0000)]
[opaque pointer types] Pass function types to CallInst creation.

This cleans up all CallInst creation in LLVM to explicitly pass a
function type rather than deriving it from the pointer's element-type.

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

llvm-svn: 352909

5 years ago[InstCombine] Expand Windows test (NFC)
Evandro Menezes [Fri, 1 Feb 2019 20:42:03 +0000 (20:42 +0000)]
[InstCombine] Expand Windows test (NFC)

Run checks for Win64 as well.

llvm-svn: 352908

5 years agogn build: Create regular archives for the sanitizer runtimes.
Peter Collingbourne [Fri, 1 Feb 2019 20:34:43 +0000 (20:34 +0000)]
gn build: Create regular archives for the sanitizer runtimes.

We'll need to do this eventually if we create an installable package.
For now, this lets me use the archives to build Android, whose build
system wants to copy the archives to another location.

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

llvm-svn: 352907

5 years ago[OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive.
Michael Kruse [Fri, 1 Feb 2019 20:25:04 +0000 (20:25 +0000)]
[OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive.

This patch implements parsing and sema for "omp declare mapper"
directive. User defined mapper, i.e., declare mapper directive, is a new
feature in OpenMP 5.0. It is introduced to extend existing map clauses
for the purpose of simplifying the copy of complex data structures
between host and device (i.e., deep copy). An example is shown below:

    struct S {  int len;  int *d; };
    #pragma omp declare mapper(struct S s) map(s, s.d[0:s.len]) // Memory region that d points to is also mapped using this mapper.

Contributed-by: Lingda Li <lildmh@gmail.com>
Differential Revision: https://reviews.llvm.org/D56326

llvm-svn: 352906

5 years ago[libc++] Disentangle the 3 implementations of type_info
Louis Dionne [Fri, 1 Feb 2019 20:00:13 +0000 (20:00 +0000)]
[libc++] Disentangle the 3 implementations of type_info

Summary:
We currently have effectively 3 implementations of type_info: one for
the Microsoft ABI, one that does not assume that there's a unique copy
of each RTTI in a progran, and one that assumes a unique copy.

Those 3 implementations are entangled into the same class with nested
ifdefs, which makes it very difficult to understand. Furthermore, the
benefit of doing this is rather small since the code that is duplicated
across implementations is just a couple of trivial lines.

This patch stamps out the 3 versions of type_info explicitly to increase
readability. It also explains what's going on with short comments, because
it's far from obvious.

Reviewers: EricWF, mclow.lists

Subscribers: christof, jkorous, dexonsmith

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

llvm-svn: 352905

5 years ago[InstCombine] Extra null-checking on TFE/LWE support
Michael Liao [Fri, 1 Feb 2019 19:53:44 +0000 (19:53 +0000)]
[InstCombine] Extra null-checking on TFE/LWE support

- If that operand is not ConstantInt, skip enabling TFE/LWE.

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

llvm-svn: 352904

5 years agoHopefully fix a couple more sphinx doc errors.
James Y Knight [Fri, 1 Feb 2019 19:40:07 +0000 (19:40 +0000)]
Hopefully fix a couple more sphinx doc errors.

These seem to only appear on the buildbot runner, and it looks like we
tried to suppress them, but it's not working. Not sure why.

llvm-svn: 352903

5 years agoFix the xcode build for r352845, attempt #2
Stefan Granitz [Fri, 1 Feb 2019 19:31:02 +0000 (19:31 +0000)]
Fix the xcode build for r352845, attempt #2

llvm-svn: 352902

5 years agoRevert "Fix the xcode build for r352845."
Stefan Granitz [Fri, 1 Feb 2019 19:30:57 +0000 (19:30 +0000)]
Revert "Fix the xcode build for r352845."

This reverts commit 72c1213a5e901b80c0f1d2794e5088d7f71a3632.

llvm-svn: 352901

5 years ago[llvm-objdump] - llvm-objdump can skip bytes at the end of a section.
Sid Manning [Fri, 1 Feb 2019 19:11:47 +0000 (19:11 +0000)]
[llvm-objdump] - llvm-objdump can skip bytes at the end of a section.

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

llvm-svn: 352900

5 years ago[lldb] Relax libc++ ABI version checking
Thomas Anderson [Fri, 1 Feb 2019 19:10:39 +0000 (19:10 +0000)]
[lldb] Relax libc++ ABI version checking

libc++ has programmable ABI versioning controllable with the _LIBCPP_ABI_VERSION
macro.  Currently there are at least 3 settings used in real systems (1 as the
default, ndk1 for Anroid, Cr for Chromium).

Only the 1 and ndk1 cases were handled.  This change relaxes the check to allow
any ABI version.

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

llvm-svn: 352899

5 years agoFix a bug in the definition of isUnordered on MachineMemOperand
Philip Reames [Fri, 1 Feb 2019 19:08:59 +0000 (19:08 +0000)]
Fix a bug in the definition of isUnordered on MachineMemOperand

Background: At the moment, we record the AtomicOrdering of an access in the MMO, but also mark any atomic access as volatile in SelectionDAG. GlobalISEL keeps the two separate, but currently doesn't know how to lower an atomic G_LOAD at all. See https://reviews.llvm.org/D57601 for context.

The definition used for unordered was only checking volatility, not atomicity. As noted above, all atomic MMOs are currently also volatile, so this is a latent bug only. Copy the definition used in IR, after auditing the two (2) uses of the function to be sure the desired semantics are the same.

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

llvm-svn: 352898

5 years agotest commit (add blank line) NFC
Roland Froese [Fri, 1 Feb 2019 18:55:43 +0000 (18:55 +0000)]
test commit (add blank line) NFC

llvm-svn: 352897

5 years ago[llvm-readobj] Add a flag to dump just the section-to-segment mapping.
Matt Davis [Fri, 1 Feb 2019 18:51:10 +0000 (18:51 +0000)]
[llvm-readobj] Add a flag to dump just the section-to-segment mapping.

Summary:
The following patch introduces a new function `printSectionMapping` which is responsible for dumping just the section-to-segment mapping.
This patch also introduces a n option `-section-mapping` that outputs that mapping without the program headers.

Previously, this functionality was controlled by `printProgramHeaders`, and the output from `-program-headers` has not been changed.  I am happy to change the option name, I copied  the name that was displayed when outputting the mapping table.

Reviewers: khemant, jhenderson, grimar, rupprecht

Reviewed By: jhenderson, grimar, rupprecht

Subscribers: rupprecht, jhenderson, llvm-commits

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

llvm-svn: 352896

5 years ago[InstCombine] Refactor test checks (NFC)
Evandro Menezes [Fri, 1 Feb 2019 18:34:20 +0000 (18:34 +0000)]
[InstCombine] Refactor test checks (NFC)

llvm-svn: 352895

5 years agoFix the xcode build for r352845.
Jim Ingham [Fri, 1 Feb 2019 18:26:08 +0000 (18:26 +0000)]
Fix the xcode build for r352845.

llvm-svn: 352894

5 years agogn build: Add a missing dependency from llvm/test to llvm-lit
Nico Weber [Fri, 1 Feb 2019 18:17:19 +0000 (18:17 +0000)]
gn build: Add a missing dependency from llvm/test to llvm-lit

check-llvm already listed llvm-lit as script which counts as a dep, so running
check-llvm worked fine, but `ninja -C out/gn llvm/test` didn't build llvm-lit
before if it wasn't already there.

llvm-svn: 352893

5 years ago[InstCombine] Expand Windows test (NFC)
Evandro Menezes [Fri, 1 Feb 2019 17:39:48 +0000 (17:39 +0000)]
[InstCombine] Expand Windows test (NFC)

Add checks for Win64 to existing cases.

llvm-svn: 352892

5 years ago[llvm-nm] Report '.comment' ELF sections as 'n' instead of '?'
Matt Davis [Fri, 1 Feb 2019 17:38:08 +0000 (17:38 +0000)]
[llvm-nm] Report '.comment' ELF sections as 'n' instead of '?'

Summary:
The previous implementation reported `.comment` sections as '?'
GNU uses 'n' which means  "The symbol is a debugging symbol."  `.note`  sections are represented as 'n' too.

The test related to this change was updated to CHECK-NEXT to ensure
order and that we did not miss any symbols in the dump.

Reviewers: jhenderson

Reviewed By: jhenderson

Subscribers: rupprecht, llvm-commits

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

llvm-svn: 352891

5 years agoUpdate SanitizerCoverage doc regarding the issue with pc-table and gc-sections.
Max Moroz [Fri, 1 Feb 2019 17:12:35 +0000 (17:12 +0000)]
Update SanitizerCoverage doc regarding the issue with pc-table and gc-sections.

Summary:
There is a bug for this: https://bugs.llvm.org/show_bug.cgi?id=34636
But it would be also helpful to leave a note in the docs to prevent users from
running into issues, e.g. https://crbug.com/926588.

Reviewers: morehouse

Reviewed By: morehouse

Subscribers: cfe-commits, llvm-commits, kcc

Tags: #clang

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

llvm-svn: 352890

5 years ago[DWARF v5] Fix DWARF emitter and consumer to produce/expect a uleb for a location...
Wolfgang Pieb [Fri, 1 Feb 2019 17:11:58 +0000 (17:11 +0000)]
[DWARF v5] Fix DWARF emitter and consumer to produce/expect a uleb for a location description's length.

Reviewer: davide, JDevliegere

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

llvm-svn: 352889

5 years ago[llvm-objcopy][NFC] More error propagation (executeObjcopyOnArchive)
Jordan Rupprecht [Fri, 1 Feb 2019 17:08:07 +0000 (17:08 +0000)]
[llvm-objcopy][NFC] More error propagation (executeObjcopyOnArchive)

Summary:
Replace some reportError() calls with error propagation that was missed from rL352625.

Note this also adds an error check during Archive iteration that was being hidden by a different error check before:

```
  for (const Archive::Child &Child : Ar.children(Err)) {
    Expected<std::unique_ptr<Binary>> ChildOrErr = Child.getAsBinary();
    if (!ChildOrErr)
      // This aborts, so Err is never checked
      reportError(Ar.getFileName(), ChildOrErr.takeError());
```

Err is being checked after the loop, so during happy runs, everything is fine. But when reportError is changed to return the error instead of aborting, the fact that Err is never checked is now noticed in tests that trigger an error during the loop.

Reviewers: jhenderson, dblaikie, alexshap

Reviewed By: dblaikie

Subscribers: llvm-commits, lhames, jakehehrlich

Tags: #llvm

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

llvm-svn: 352888

5 years agoFix some sphinx doc errors.
James Y Knight [Fri, 1 Feb 2019 17:06:41 +0000 (17:06 +0000)]
Fix some sphinx doc errors.

llvm-svn: 352887

5 years ago[InstCombine] Refactor test checks (NFC)
Evandro Menezes [Fri, 1 Feb 2019 16:57:53 +0000 (16:57 +0000)]
[InstCombine] Refactor test checks (NFC)

llvm-svn: 352886

5 years ago[AMDGPU] Fix for vector element insertion
Tim Corringham [Fri, 1 Feb 2019 16:51:09 +0000 (16:51 +0000)]
[AMDGPU] Fix for vector element insertion

Summary:
Incorrect code was generated when lowering insertelement operations
for vectors with 8 or 16 bit elements.  The value being inserted was
not adjusted for the position of the element within the 32 bit word
and so only the low element within each 32 bit word could receive
the intended value.

Fixed by simply replicating the value to each element of a
congruent vector before the mask and or operation used to
update the intended element.

A number of affected LIT tests have been updated appropriately.

before the mask & or into the intended

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

Subscribers: llvm-commits, arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

Tags: #llvm

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

llvm-svn: 352885

5 years ago[SDAG] improve variable names; NFC
Sanjay Patel [Fri, 1 Feb 2019 16:06:53 +0000 (16:06 +0000)]
[SDAG] improve variable names; NFC

The version of FoldConstantArithmetic() that takes arbitrary nodes
was confusingly naming those nodes as constants when they might
not be; also "Cst" reads like "Cast".

llvm-svn: 352884

5 years ago[X86][SSE] Use PSLLDQ/PSRLDQ to mask out zeroable ends of a shuffle
Simon Pilgrim [Fri, 1 Feb 2019 16:02:12 +0000 (16:02 +0000)]
[X86][SSE] Use PSLLDQ/PSRLDQ to mask out zeroable ends of a shuffle

As suggested on PR40318, this patch uses PSLLDQ/PSRLDQ to lower shuffles to zero out the ends of a vector, leaving a sequential inner section.

For pre-SSSE3 we do this for shuffles with zeros at either end (requiring up to 3 shifts), but once PSHUFB is available I've limited this to shuffles with a single zeroable end (2 shifts).

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

llvm-svn: 352883

5 years ago[AST][OpenMP] OpenMP Sections / Section constructs contain Structured blocks
Roman Lebedev [Fri, 1 Feb 2019 15:41:54 +0000 (15:41 +0000)]
[AST][OpenMP] OpenMP Sections / Section constructs contain Structured blocks

Summary:
I'm working on a clang-tidy check, much like existing [[ http://clang.llvm.org/extra/clang-tidy/checks/bugprone-exception-escape.html | bugprone-exception-escape ]],
to detect when an exception might escape out of an OpenMP construct it isn't supposed to escape from.
For that i will be using the `nothrow` bit of `CapturedDecl`s.

While that bit is already correctly set for some constructs, e.g. `#pragma omp parallel`: https://godbolt.org/z/2La7pv
it isn't set for the `#pragma omp sections`, or `#pragma omp section`: https://godbolt.org/z/qZ-EbP

If i'm reading [[ https://www.openmp.org/wp-content/uploads/OpenMP-API-Specification-5.0.pdf | `OpenMP Application Programming Interface Version 5.0 November 2018` ]] correctly,
they should be, as per `2.8.1 sections Construct`, starting with page 86:
* The sections construct is a non-iterative worksharing construct that contains a set of **structured blocks**
  that are to be distributed among and executed by the threads in a team. Each **structured block** is executed
  once by one of the threads in the team in the context of its implicit task.
* The syntax of the sections construct is as follows:
  #pragma omp sections [clause[ [,] clause] ... ] new-line
    {
      [#pragma omp section new-line]
        **structured-block**
   ...
* Description
  Each **structured block** in the sections construct is preceded by a section directive except
  possibly **the first block**, for which a preceding section directive is optional.

* Restrictions
  â€¢ The code enclosed in a sections construct must be a **structured block**.
  * A throw executed inside a sections region must cause execution to resume within the same
    section of the sections region, and the same thread that threw the exception must catch it.

Reviewers: ABataev, #openmp

Reviewed By: ABataev

Subscribers: guansong, openmp-commits, cfe-commits

Tags: #clang, #openmp

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

llvm-svn: 352882

5 years ago[CMake] External compiler-rt-configure requires LLVMTestingSupport when including...
Stefan Granitz [Fri, 1 Feb 2019 15:35:25 +0000 (15:35 +0000)]
[CMake] External compiler-rt-configure requires LLVMTestingSupport when including tests

Summary:
Apparently `LLVMTestingSupport` must be built before `llvm-config` can be asked for it. Symptom with `LLVM_INCLUDE_TESTS=ON` is:
```
$ ./path/to/llvm-build/bin/llvm-config --ldflags --libs testingsupport
-L/path/to/llvm-build/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names
llvm-config: error: component libraries and shared library

llvm-config: error: missing: /path/to/llvm-build/lib/libLLVMTestingSupport.a
```

With `LLVMTestingSupport` as dependency of `compiler-rt-configure` we get the expected behavior:
```
$ ./path/to/llvm-build/bin/llvm-config --ldflags --libs testingsupport
-L/path/to/llvm-build/lib -Wl,-search_paths_first -Wl,-headerpad_max_install_names
-lLLVMTestingSupport -lLLVMSupport -lLLVMDemangle
```

Reviewers: ab, beanz

Subscribers: dberris, mgorny, erik.pilkington, llvm-commits, cfe-commits

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

llvm-svn: 352881

5 years ago[TargetLowering] try harder to determine undef elements of vector binops
Sanjay Patel [Fri, 1 Feb 2019 15:35:12 +0000 (15:35 +0000)]
[TargetLowering] try harder to determine undef elements of vector binops

This might be the start of tracking all vector element constants generally if we take it to its
logical conclusion, but let's stop here and make sure this is correct/beneficial so far.

The affected tests require a convoluted path before they get simplified currently because we
don't call SimplifyDemandedVectorElts() from binops directly and don't modify the binop operands
directly in SimplifyDemandedVectorElts().

That's why the tests all have a trailing shuffle to induce a chain reaction of transforms. So
something like this is happening:

1. Improve the knowledge of undefs in the binop via a SimplifyDemandedVectorElts() call that
   originates from a shuffle.
2. Transfer that undef knowledge back to the shuffle mask user as more undef lanes.
3. Combine the modified shuffle by calling SimplifyDemandedVectorElts() again.
4. Translate the improved shuffle mask as undemanded lanes of build vector constants causing
   those to become full undef constants.
5. Simplify the binop now that it has a full undef operand.

As we can see from the unchanged 'and' and 'or' tests, tracking undefs alone isn't a full solution.
We would need to track zero and all-ones constants to improve those opcodes. We'd probably need to
track NaN for FP ops too (assuming we don't have fast-math-flags set).

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

llvm-svn: 352880

5 years ago[X86][AVX] Combine INSERT_SUBVECTOR(SRC0, BITCAST(SHUFFLE(EXTRACT_SUBVECTOR(SRC1)))
Simon Pilgrim [Fri, 1 Feb 2019 15:31:01 +0000 (15:31 +0000)]
[X86][AVX] Combine INSERT_SUBVECTOR(SRC0, BITCAST(SHUFFLE(EXTRACT_SUBVECTOR(SRC1)))

Enable peeking through one use bitcasts to the subvector shuffle.

This still depends on the subvector being the same scalar-size but D57514 has already helped with the more tricky patterns

llvm-svn: 352879

5 years ago[llvm-strip] Implement --keep-file-symbols
Eugene Leviant [Fri, 1 Feb 2019 15:25:15 +0000 (15:25 +0000)]
[llvm-strip] Implement --keep-file-symbols

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

llvm-svn: 352878

5 years ago[llvm-objcopy][NFC] Propagate errors in removeSymbols/removeSectionReferences
Jordan Rupprecht [Fri, 1 Feb 2019 15:20:36 +0000 (15:20 +0000)]
[llvm-objcopy][NFC] Propagate errors in removeSymbols/removeSectionReferences

Reviewers: jhenderson, alexshap, jakehehrlich, espindola

Reviewed By: jhenderson

Subscribers: emaste, arichardson, llvm-commits

Tags: #llvm

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

llvm-svn: 352877

5 years ago[clangd] Expose SelectionTree to code tweaks, and use it for swap if branches.
Sam McCall [Fri, 1 Feb 2019 15:09:47 +0000 (15:09 +0000)]
[clangd] Expose SelectionTree to code tweaks, and use it for swap if branches.

Summary:
This reduces the per-check implementation burden and redundant work.
It also makes checks range-aware by default (treating the commonAncestor
as if it were a point selection should be good baseline behavior).

Reviewers: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet

Tags: #clang

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

llvm-svn: 352876

5 years ago[clangd] Lib to compute and represent selection under cursor.
Sam McCall [Fri, 1 Feb 2019 15:09:41 +0000 (15:09 +0000)]
[clangd] Lib to compute and represent selection under cursor.

Summary:
The primary problem this solves is to expose the codeAction selection to
AST-based refactorings in a way that makes it easy and efficient for them to
bind to the right parts of the AST.

It should also allow us to make XRefs based features (textDocument/definition)
more robust, more easily implement textDocument/typeDefinition etc.
As an example, template parameter references can be identified without special
handling.
There should be slight speedup too: we can prune most of the AST traversal
in most cases.

Elephant in the room: this is similar-but-different to Tooling/Refactoring/ASTSelection.
That captures a smaller set of AST nodes, has a slightly different way of
representing selections, and generally has mare features and does more work.
The overall shape is pretty similar, and yet I can't quite get to behave as I
expect.

Reviewers: ilya-biryukov, kadircet

Subscribers: mgorny, ioeric, MaskRay, jkorous, mgrang, arphaman

Tags: #clang

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

llvm-svn: 352875

5 years ago[clangd] Lib to compute and represent selection under cursor.
Sam McCall [Fri, 1 Feb 2019 15:05:11 +0000 (15:05 +0000)]
[clangd] Lib to compute and represent selection under cursor.

Summary:
The primary problem this solves is to expose the codeAction selection to
AST-based refactorings in a way that makes it easy and efficient for them to
bind to the right parts of the AST.

It should also allow us to make XRefs based features (textDocument/definition)
more robust, more easily implement textDocument/typeDefinition etc.
As an example, template parameter references can be identified without special
handling.
There should be slight speedup too: we can prune most of the AST traversal
in most cases.

Elephant in the room: this is similar-but-different to Tooling/Refactoring/ASTSelection.
That captures a smaller set of AST nodes, has a slightly different way of
representing selections, and generally has mare features and does more work.
The overall shape is pretty similar, and yet I can't quite get to behave as I
expect.

Reviewers: ilya-biryukov, kadircet

Subscribers: mgorny, ioeric, MaskRay, jkorous, mgrang, arphaman

Tags: #clang

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

llvm-svn: 352874

5 years ago[InstCombine] reduce duplicate code; NFC
Sanjay Patel [Fri, 1 Feb 2019 14:37:49 +0000 (14:37 +0000)]
[InstCombine] reduce duplicate code; NFC

An unused variable problem was introduced with rL352870
and stubbed out with rL352871, but we can make a better
fix by actually using the local variable in code rather
than just the assert.

llvm-svn: 352873

5 years ago[libclang] Fix -DBUILD_SHARED_LIBS=on build after rC352803
Fangrui Song [Fri, 1 Feb 2019 14:31:01 +0000 (14:31 +0000)]
[libclang] Fix -DBUILD_SHARED_LIBS=on build after rC352803

llvm-svn: 352872

5 years ago[InstCombine] Fix -Wunused-variable when -DLLVM_ENABLE_ASSERTIONS=off
Fangrui Song [Fri, 1 Feb 2019 14:22:02 +0000 (14:22 +0000)]
[InstCombine] Fix -Wunused-variable when -DLLVM_ENABLE_ASSERTIONS=off

llvm-svn: 352871

5 years ago[InstCombine] try to reduce x86 addcarry to generic uaddo intrinsic
Sanjay Patel [Fri, 1 Feb 2019 14:14:47 +0000 (14:14 +0000)]
[InstCombine] try to reduce x86 addcarry to generic uaddo intrinsic

If we can reduce the x86-specific intrinsic to the generic op, it allows existing
simplifications and value tracking folds. AFAICT, this always results in identical
x86 codegen in the non-reduced case...which should be true because we semi-generically
(too aggressively IMO) convert to llvm.uadd.with.overflow in CGP, so the DAG/isel must
already combine/lower this intrinsic as expected.

This isn't quite what was requested in:
https://bugs.llvm.org/show_bug.cgi?id=40486
...but we want to have these kinds of folds early for efficiency and to enable greater
simplifications. For the case in the bug report where we have:
_addcarry_u64(0, ahi, 0, &ahi)
...this gets completely simplified away in IR.

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

llvm-svn: 352870

5 years ago[CMake] Add install targets for utilities to LLVM exports if LLVM_INSTALL_UTILS=ON
Stefan Granitz [Fri, 1 Feb 2019 13:08:09 +0000 (13:08 +0000)]
[CMake] Add install targets for utilities to LLVM exports if LLVM_INSTALL_UTILS=ON

Summary: D56606 was only appending target names to the `LLVM_EXPORTS`/`LLVM_EXPORTS_BUILDTREE_ONLY` properties. Targets showed up correctly in the build-tree `LLVMExports.cmake`, but they were missing in the installed one (as we found in https://bugs.llvm.org/show_bug.cgi?id=40443), because install did not register them explicitly.

Reviewers: mgorny, smeenai, beanz, gottesmm, dschuff, tstellar, serge-sans-paille

Reviewed By: smeenai

Subscribers: llvm-commits

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

llvm-svn: 352869

5 years ago[clangd] Penalize file-scope symbols in the ranking for non-completion queries
Sam McCall [Fri, 1 Feb 2019 13:07:37 +0000 (13:07 +0000)]
[clangd] Penalize file-scope symbols in the ranking for non-completion queries

Patch by Nathan Ridge!

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

llvm-svn: 352868

5 years ago[AArch64] Optimize floating point materialization
Adhemerval Zanella [Fri, 1 Feb 2019 12:26:06 +0000 (12:26 +0000)]
[AArch64] Optimize floating point materialization

This patch changes isFPImmLegal to return if the value can be enconded
as the immediate operand of a logical instruction besides checking if
for immediate field for fmov.

This optimizes some floating point materization, inclusive values
used on isinf lowering.

Reviewed By: rengolin, efriedma, evandro

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

llvm-svn: 352866

5 years ago[CUDA] Relax lit test condition after r352798.
Eric Liu [Fri, 1 Feb 2019 11:36:23 +0000 (11:36 +0000)]
[CUDA] Relax lit test condition after r352798.

Clang executable doesn't match clang.* in all test environment.

llvm-svn: 352865

5 years ago[clangd] Implement textDocument/declaration from LSP 3.14
Sam McCall [Fri, 1 Feb 2019 11:26:13 +0000 (11:26 +0000)]
[clangd] Implement textDocument/declaration from LSP 3.14

Summary:
LSP now reflects the declaration/definition distinction.

Language server changes:
 - textDocument/definition now returns a definition if one is found, otherwise
   the declaration. It no longer returns declaration + definition if they are
   distinct.
 - textDocument/declaration returns the best declaration we can find.
 - For macros, the active macro definition is returned for both methods.
 - For include directive, the top of the target file is returned for both.
There doesn't appear to be a discovery mechanism (we can't return everything to
clients that only know about definition), so this changes existing behavior.
In practice, it should greatly reduce the fraction of the time we need to show
the user a menu of options.

C++ API changes:
 - findDefinitions is replaced by locateSymbolAt, which returns a
   vector<LocatedSymbol> - one for each symbol under the cursor.
 - this contains the preferred declaration, the definition (if found), and
   the symbol name
This API enables some potentially-neat extensions, like swapping between decl
and def, and exposing the symbol name to the UI in the case of multiple symbols.

Reviewers: hokein

Subscribers: ilya-biryukov, javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 352864

5 years ago[clangd] Use delimited style to make life easier for the fuzzer
Sam McCall [Fri, 1 Feb 2019 11:20:20 +0000 (11:20 +0000)]
[clangd] Use delimited style to make life easier for the fuzzer

llvm-svn: 352863

5 years agoDisable tidy checks with too many hits
Ilya Biryukov [Fri, 1 Feb 2019 11:20:13 +0000 (11:20 +0000)]
Disable tidy checks with too many hits

Summary:
Some tidy checks have too many hits in the codebase, making it hard to spot
other results from clang-tidy, therefore rendering the tool less useful.

Two checks were disabled:
  - misc-non-private-member-variable-in-classes in the whole LLVM monorepo,
    it is very common to have those in LLVM and the style guide does not forbid
    them.
  - readability-identifier-naming in the clang subtree. There are thousands of
    violations in 'Sema.h' alone.

Before the change, 'Sema.h' had >1000 tidy warnings, after the change the number
dropped to 3 warnings (unterminated namespace comments).

Reviewers: alexfh, hokein

Reviewed By: hokein

Subscribers: llvm-commits, cfe-commits

Tags: #clang, #llvm

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

llvm-svn: 352862

5 years ago[X86][BdVer2] Transfer delays from the integer to the floating point unit.
Roman Lebedev [Fri, 1 Feb 2019 11:15:13 +0000 (11:15 +0000)]
[X86][BdVer2] Transfer delays from the integer to the floating point unit.

Summary:
I'm unable to find this number in the "AMD SOG for family 15h".
llvm-exegesis measures the latencies of these instructions as `2`,
which matches the latencies specified in "AMD SOG for family 15h".

However if we look at Agner, Microarchitecture, "AMD Bulldozer, Piledriver,
Steamroller and Excavator pipeline", "Data delay between different execution
domains", the int->ivec transfer is listed as `8`..`10`cy of additional latency.

Also, Agner's "Instruction tables", for Piledriver, lists their latencies as `12`,
which is consistent with `2cy` from exegesis / AMD SOG + `10cy` transfer delay.

Additional data point comes from the fact that Agner's "Instruction tables",
for Jaguar, lists their latencies as `8`; and "AMD SOG for family 16h" does
state the `+6cy` int->ivec delay, which is consistent with instr latency of `1` or `2`.

Reviewers: andreadb, RKSimon, craig.topper

Reviewed By: andreadb

Subscribers: gbedwell, courbet, llvm-commits

Tags: #llvm

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

llvm-svn: 352861

5 years ago[PDB] Fix build after r352845
Aleksandr Urakov [Fri, 1 Feb 2019 11:10:28 +0000 (11:10 +0000)]
[PDB] Fix build after r352845

llvm-svn: 352858

5 years ago[clangd] Unbreak fuzzer target
Sam McCall [Fri, 1 Feb 2019 11:09:06 +0000 (11:09 +0000)]
[clangd] Unbreak fuzzer target

llvm-svn: 352857

5 years agoProvide reason messages for unviable inlining
Yevgeny Rouban [Fri, 1 Feb 2019 10:44:43 +0000 (10:44 +0000)]
Provide reason messages for unviable inlining

InlineCost's isInlineViable() is changed to return InlineResult
instead of bool. This provides messages for failure reasons and
allows to get more specific messages for cases where callsites
are not viable for inlining.

Reviewed By: xbolva00, anemet

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

llvm-svn: 352849

5 years agoRevert r352750.
James Henderson [Fri, 1 Feb 2019 10:38:40 +0000 (10:38 +0000)]
Revert r352750.

This was causing a build bot failure:
http://green.lab.llvm.org/green/job/clang-stage2-Rthinlto/15346/

llvm-svn: 352848

5 years ago[llvm-symbolizer][test] Rename and tweak tests using llvm-symbolizer
James Henderson [Fri, 1 Feb 2019 10:24:55 +0000 (10:24 +0000)]
[llvm-symbolizer][test] Rename and tweak tests using llvm-symbolizer

Prior to this change, there are a few tests called llvm-symbolizer* in
the DebugInfo test area. These really were testing either the DebugInfo
or Symbolizer library, rather than the llvm-symbolizer tool itself, so
this patch renames them to be clearer that they aren't explicitly tests
for llvm-symbolizer (such tests belong in test/tools/llvm-symbolizer).

This patch also reinstates the copying of a DWO file, removed previously
in r352752. The test needs this so that it could possibly fail.

Finally, some of the tests have been simplified slightly by removing
unnecessary switches and/or unused check-prefixes.

Reviewed by: dblaikie

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

llvm-svn: 352847

5 years ago[doc]Update String Error documentation in Programmer Manual
James Henderson [Fri, 1 Feb 2019 10:02:42 +0000 (10:02 +0000)]
[doc]Update String Error documentation in Programmer Manual

A while back, createStringError was added to provide easier construction
of StringError instances, especially with formatting options. Prior to
this patch, that the documentation only mentions the standard method of
using it. Since createStringError is slightly shorter to type, and also
provides the formatting options, this patch updates the Programmer's
Manual to use the new function in its examples, and to mention the
printf formatting options. It also fixes a small typo in one of the
examples and removes the unnecessary make_error_code call.

llvm-svn: 352846

5 years ago[PDB] Fix location retrieval for function local variables and arguments that are
Aleksandr Urakov [Fri, 1 Feb 2019 10:01:18 +0000 (10:01 +0000)]
[PDB] Fix location retrieval for function local variables and arguments that are
stored relative to VFRAME

Summary:
This patch makes LLDB able to retrieve proper values for function arguments and
local variables stored in PDB relative to VFRAME register.

Patch contains retrieval of corresponding FPO table entries from PDB and a
generic translator from FPO programs to DWARF expressions to get correct VFRAME
value.

Patch also improves variables-locations.test and makes this test passable on
x86.

Patch By: leonid.mashinsky

Reviewers: zturner, asmith, stella.stamenova, aleksandr.urakov

Reviewed By: zturner

Subscribers: arphaman, labath, mgorny, aprantl, JDevlieghere, lldb-commits

Tags: #lldb

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

llvm-svn: 352845

5 years ago[CodeGen] Don't scavenge non-saved regs in exception throwing functions
Oliver Stannard [Fri, 1 Feb 2019 09:23:51 +0000 (09:23 +0000)]
[CodeGen] Don't scavenge non-saved regs in exception throwing functions

Previously, LiveRegUnits was assuming that if a block has no successors
and does not return, then no registers are live at the end of it
(because the end of the block is unreachable). This was causing the
register scavenger to use callee-saved registers to materialise stack
frame addresses without saving them in the prologue. This would normally
be fine, because the end of the block is unreachable, but this is not
legal if the block ends by throwing a C++ exception. If this happens,
the scratch register will be modified, but its previous value won't be
preserved, so it doesn't get restored by the exception unwinder.

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

llvm-svn: 352844

5 years ago[clangd] clangDaemonTweaks - fix -DBUILD_SHARED_LIBS=ON build
Roman Lebedev [Fri, 1 Feb 2019 08:58:37 +0000 (08:58 +0000)]
[clangd] clangDaemonTweaks - fix -DBUILD_SHARED_LIBS=ON build

Followup for rL352841.

llvm-svn: 352843

5 years agoTest commit: fix typo
Sergi Mateo Bellido [Fri, 1 Feb 2019 08:39:01 +0000 (08:39 +0000)]
Test commit: fix typo

llvm-svn: 352842

5 years ago[clangd] Fix -DBUILD_SHARED_LIBS=ON build - SwapIfBranches needs clangAST.
Roman Lebedev [Fri, 1 Feb 2019 08:23:23 +0000 (08:23 +0000)]
[clangd] Fix -DBUILD_SHARED_LIBS=ON build - SwapIfBranches needs clangAST.

Else, fails with:

[1/2] Linking CXX executable bin/clangd
FAILED: bin/clangd
: && /usr/bin/g++  -pipe -O2 -g0 -UNDEBUG -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -pipe -O2 -g0 -UNDEBUG  -fuse-ld=lld -Wl,--color-diagnostics -Wl,-allow-shlib-undefined     -Wl,-O3 -Wl,--gc-sections tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/SwapIfBranches.cpp.o tools/clang/tools/extra/clangd/tool/CMakeFiles/clangd.dir/ClangdMain.cpp.o  -o bin/clangd  -Wl,-rpath,"\$ORIGIN/../lib" lib/libLLVMSupport.so.9svn -lpthread lib/libclangBasic.so.9svn lib/libclangTidy.so.9svn lib/libclangDaemon.so.9svn lib/libclangFormat.so.9svn lib/libclangFrontend.so.9svn lib/libclangSema.so.9svn lib/libclangTooling.so.9svn lib/libclangToolingCore.so.9svn && :
ld.lld: error: undefined symbol: clang::FunctionDecl::getBody(clang::FunctionDecl const*&) const
>>> referenced by SwapIfBranches.cpp
>>>               tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/SwapIfBranches.cpp.o:(clang::FunctionDecl::getBody() const)

and so on.

llvm-svn: 352841

5 years ago[obj2yaml] - Merge dumpRelSection and dumpRelaSection. NFC.
George Rimar [Fri, 1 Feb 2019 07:50:08 +0000 (07:50 +0000)]
[obj2yaml] - Merge dumpRelSection and dumpRelaSection. NFC.

These methods are very similar, patch merge them into one.

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

llvm-svn: 352840

5 years ago[SLPVectorizer] Get rid of IndexQueue array from vectorizeStores. NFCI.
Yevgeny Rouban [Fri, 1 Feb 2019 06:44:08 +0000 (06:44 +0000)]
[SLPVectorizer] Get rid of IndexQueue array from vectorizeStores. NFCI.

Indices are checked as they are generated. No need to fill the whole array of indices.

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

llvm-svn: 352839