platform/upstream/llvm.git
4 years ago[OpenMP] Fix broken build due to new OMPT tests
Hansang Bae [Mon, 5 Aug 2019 21:46:13 +0000 (21:46 +0000)]
[OpenMP] Fix broken build due to new OMPT tests

New OMPT tests with teams construct should be disabled for GCC as it
emits code with a GOMP entry not supported in the LLVM runtime.

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

llvm-svn: 367939

4 years agohwasan: Untag global variable addresses in tests.
Peter Collingbourne [Mon, 5 Aug 2019 21:46:10 +0000 (21:46 +0000)]
hwasan: Untag global variable addresses in tests.

Once we start instrumenting globals, all addresses including those of string literals
that we pass to the operating system will start being tagged. Since we can't rely
on the operating system to be able to cope with these addresses, we need to untag
them before passing them to the operating system. This change introduces a macro
that does so and uses it everywhere it is needed.

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

llvm-svn: 367938

4 years agoAdd "REQUIRES: x86-registered-target" to test.
Peter Collingbourne [Mon, 5 Aug 2019 21:44:45 +0000 (21:44 +0000)]
Add "REQUIRES: x86-registered-target" to test.

llvm-svn: 367937

4 years ago[lldb][NFC] Document and refactor ClangPersistentVariables::RemovePersistentVariable
Raphael Isemann [Mon, 5 Aug 2019 21:43:53 +0000 (21:43 +0000)]
[lldb][NFC] Document and refactor ClangPersistentVariables::RemovePersistentVariable

llvm-svn: 367936

4 years ago[WebAssembly] Fix conflict between ret legalization and sjlj
Keno Fischer [Mon, 5 Aug 2019 21:36:09 +0000 (21:36 +0000)]
[WebAssembly] Fix conflict between ret legalization and sjlj

Summary:
When the WebAssembly backend encounters a return type that doesn't
fit within i32, SelectionDAG performs sret demotion, adding an
additional argument to the start of the function that contains
a pointer to an sret buffer to use instead. However, this conflicts
with the emscripten sjlj lowering pass. There we translate calls like:

```
call {i32, i32} @foo()
```

into (in pseudo-llvm)
```
%addr = @foo
call {i32, i32} @__invoke_{i32,i32}(%addr)
```

i.e. we perform an indirect call through an extra function.
However, the sret transform now transforms this into
the equivalent of
```
        %addr = @foo
        %sret = alloca {i32, i32}
        call {i32, i32} @__invoke_{i32,i32}(%sret, %addr)
```
(while simultaneously translation the implementation of @foo as well).
Unfortunately, this doesn't work out. The __invoke_ ABI expected
the function address to be the first argument, causing crashes.

There is several possible ways to fix this:
1. Implementing the sret rewrite at the IR level as well and performing
   it as part of lowering to __invoke
2. Fixing the wasm backend to recognize that __invoke has a special ABI
3. A change to the binaryen/emscripten ABI to recognize this situation

This revision implements the middle option, teaching the backend to
treat __invoke_ functions specially in sret lowering. This is achieved
by
1) Introducing a new CallingConv ID for invoke functions
2) When this CallingConv ID is seen in the backend and the first argument
   is marked as sret (a function pointer would never be marked as sret),
   swapping the first two arguments.

Reviewed By: tlively, aheejin
Differential Revision: https://reviews.llvm.org/D65463

llvm-svn: 367935

4 years ago[Attributor][Fix] Do not remove instructions during manifestation
Johannes Doerfert [Mon, 5 Aug 2019 21:35:02 +0000 (21:35 +0000)]
[Attributor][Fix] Do not remove instructions during manifestation

When we remove instructions cached references could still be live. This
patch avoids removing invoke instructions that are replaced by calls and
instead keeps them around but in a dead block.

llvm-svn: 367933

4 years agoRevert Register/MCRegister: Add conversion operators to avoid use of implicit convert...
Daniel Sanders [Mon, 5 Aug 2019 21:34:45 +0000 (21:34 +0000)]
Revert Register/MCRegister: Add conversion operators to avoid use of implicit convert to unsigned. NFC

MSVC finds ambiguity where clang doesn't and it looks like it's not going to be an easy fix
Reverting while I figure out how to fix it

This reverts r367916 (git commit aa15ec3c231717826e3c262b5ef9813d2fb5cadb)
This reverts r367920 (git commit 5d14efe279b5db9f4746ff834ab5c70e249d3871)

llvm-svn: 367932

4 years ago[Attributor][Fix] Keep invokes if handlers catch asynchronous exceptions
Johannes Doerfert [Mon, 5 Aug 2019 21:34:45 +0000 (21:34 +0000)]
[Attributor][Fix] Keep invokes if handlers catch asynchronous exceptions

Similar to other places where we transform invokes to calls we need to
be careful if the handler (=personality) can catch asynchronous
exceptions as they are not modeled as part of nounwind.

This is tested with D59978.

llvm-svn: 367931

4 years ago[libc++] Accept any non-zero return for .fail.cpp tests
Louis Dionne [Mon, 5 Aug 2019 21:26:50 +0000 (21:26 +0000)]
[libc++] Accept any non-zero return for .fail.cpp tests

llvm-svn: 367930

4 years agoBMI2 support is indicated in bit eight of EBX, not nine.
Eric Christopher [Mon, 5 Aug 2019 21:25:59 +0000 (21:25 +0000)]
BMI2 support is indicated in bit eight of EBX, not nine.
See Intel SDM, Vol 2A, Table 3-8:
https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-2a-manual.pdf#page=296

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

llvm-svn: 367929

4 years ago[NFC][pstl] Remove stray semi-colon
Louis Dionne [Mon, 5 Aug 2019 21:20:42 +0000 (21:20 +0000)]
[NFC][pstl] Remove stray semi-colon

llvm-svn: 367928

4 years agollvm-symbolizer: Untag addresses in object files by default.
Peter Collingbourne [Mon, 5 Aug 2019 20:59:25 +0000 (20:59 +0000)]
llvm-symbolizer: Untag addresses in object files by default.

Any addresses that we pass to llvm-symbolizer are going to be untagged,
while any HWASAN instrumented globals are going to be tagged in the
symbol table. Therefore we need to untag the addresses before using them.

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

llvm-svn: 367926

4 years ago[Sanitizer] Linux refactor shadow huge page mode handling
David Carlier [Mon, 5 Aug 2019 20:54:36 +0000 (20:54 +0000)]
[Sanitizer] Linux refactor shadow huge page mode handling

Disabling Transparent huge page mode refactored in one function.

Reviewers: vitalybuka

Reviewed By: vitalybuka

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

llvm-svn: 367925

4 years ago[lldb][NFC] Refactor ClangUserExpression::UpdateLanguageForExpr
Raphael Isemann [Mon, 5 Aug 2019 20:31:47 +0000 (20:31 +0000)]
[lldb][NFC] Refactor ClangUserExpression::UpdateLanguageForExpr

The UpdateLanguageForExpr should only update the language, but over
time it started to do also do different things related to the generation
of the expression source code. This patch refactors all the source code
generation part into its own function.

llvm-svn: 367922

4 years ago[ORC] Work around broken GCC/libstdc++ by adding an explicit conversion.
Lang Hames [Mon, 5 Aug 2019 20:30:35 +0000 (20:30 +0000)]
[ORC] Work around broken GCC/libstdc++ by adding an explicit conversion.

This should fix the bots that have been failing due to r367712.

llvm-svn: 367921

4 years agoFix MSVC error after r367916
Daniel Sanders [Mon, 5 Aug 2019 20:03:43 +0000 (20:03 +0000)]
Fix MSVC error after r367916

It seems that MSVC sees ambiguity between the operator==()'s where clang
doesn't

llvm-svn: 367920

4 years ago[AArch64][GlobalISel] Inline tiny memcpy et al at -O0.
Amara Emerson [Mon, 5 Aug 2019 20:02:52 +0000 (20:02 +0000)]
[AArch64][GlobalISel] Inline tiny memcpy et al at -O0.

FastISel already does this since the initial arm64 port was upstreamed, so
it seems there are no issues with doing this at -O0 for very small memcpys.

Gives a 0.2% geomean code size improvement on CTMark.

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

llvm-svn: 367919

4 years ago[docs] don't use :option: for Wall Wextra
JF Bastien [Mon, 5 Aug 2019 19:59:07 +0000 (19:59 +0000)]
[docs] don't use :option: for Wall Wextra

The bots are sad that they're not documented.

llvm-svn: 367918

4 years ago[compiler-rt] Move FDP to include/fuzzer/FuzzedDataProvider.h for easier use.
Max Moroz [Mon, 5 Aug 2019 19:55:52 +0000 (19:55 +0000)]
[compiler-rt] Move FDP to include/fuzzer/FuzzedDataProvider.h for easier use.

Summary:
FuzzedDataProvider is a helper class for writing fuzz targets that fuzz
multple inputs simultaneously. The header is supposed to be used for fuzzing
engine agnostic fuzz targets (i.e. the same target can be used with libFuzzer,
AFL, honggfuzz, and other engines). The common thing though is that fuzz targets
are typically compiled with clang, as it provides all sanitizers as well as
different coverage instrumentation modes. Therefore, making this FDP class a
part of the compiler-rt installation package would make it easier to develop
and distribute fuzz targets across different projects, build systems, etc.
Some context also available in https://github.com/google/oss-fuzz/pull/2547.

This CL does not delete the header from `lib/fuzzer/utils` directory in order to
provide the downstream users some time for a smooth migration to the new
header location.

Reviewers: kcc, morehouse

Reviewed By: morehouse

Subscribers: lebedev.ri, kubamracek, dberris, mgorny, delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 367917

4 years agoRegister/MCRegister: Add conversion operators to avoid use of implicit convert to...
Daniel Sanders [Mon, 5 Aug 2019 19:50:25 +0000 (19:50 +0000)]
Register/MCRegister: Add conversion operators to avoid use of implicit convert to unsigned. NFC

Summary:
This has no functional effect but makes it more obvious which parts of the
compiler do not use Register/MCRegister when you mark the implicit conversion
deprecated.

Implicit conversions for comparisons accounted for ~20% (~3k of ~13k) of
the implicit conversions when I first measured it. I haven't maintained
those numbers as other patches have landed though so it may be out of date.

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: wdng, llvm-commits

Tags: #llvm

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

llvm-svn: 367916

4 years ago[docs] don't use :option: for C++ compat
JF Bastien [Mon, 5 Aug 2019 19:45:23 +0000 (19:45 +0000)]
[docs] don't use :option: for C++ compat

The bots are sad that they're not documented.

llvm-svn: 367914

4 years agoFix another uninit read found by msan after r367829
Nico Weber [Mon, 5 Aug 2019 19:35:59 +0000 (19:35 +0000)]
Fix another uninit read found by msan after r367829

llvm-svn: 367912

4 years agocompiler-rt: Remove .cc from all lit config files
Nico Weber [Mon, 5 Aug 2019 19:25:35 +0000 (19:25 +0000)]
compiler-rt: Remove .cc from all lit config files

All cc files have been renamed to cpp now.

llvm-svn: 367911

4 years ago[libomptarget] Harmonize emitting CUDA errors and general debug messages.
Michael Kruse [Mon, 5 Aug 2019 19:12:10 +0000 (19:12 +0000)]
[libomptarget] Harmonize emitting CUDA errors and general debug messages.

Ensures that CUDA fail reasons (such as "No CUDA-capable device detected")
are printed together with libomptarget's debug message
(e.g. "Error when setting CUDA context"). Previously, the former was
printed only in CMAKE_BUILD_TYPE=Debug builds while the latter was
enabled by LIBOMPTARGET_ENABLE_DEBUG.

With this change, also only call cuGetErrorString when the error will be
printed.

Suggested-by: Ye Luo <xw111luoye@gmail.com>
Differential Revision: https://reviews.llvm.org/D65687

llvm-svn: 367910

4 years agoRevert "Try to fix failing AMDGPU disasm test, both Lin/Win agree this is 0 not 0x0"
Dmitri Gribenko [Mon, 5 Aug 2019 19:07:09 +0000 (19:07 +0000)]
Revert "Try to fix failing AMDGPU disasm test, both Lin/Win agree this is 0 not 0x0"

This reverts commit r367907, it broke the test.

llvm-svn: 367909

4 years ago[llvm-lipo] Implement -segalign
Anusha Basana [Mon, 5 Aug 2019 19:06:55 +0000 (19:06 +0000)]
[llvm-lipo] Implement -segalign

Sets section alignments of the specified architecture slices to the
alignment values.
Alignment values are hexadecimal values that are powers of 2.

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

llvm-svn: 367908

4 years agoTry to fix failing AMDGPU disasm test, both Lin/Win agree this is 0 not 0x0
Reid Kleckner [Mon, 5 Aug 2019 18:46:26 +0000 (18:46 +0000)]
Try to fix failing AMDGPU disasm test, both Lin/Win agree this is 0 not 0x0

llvm-svn: 367907

4 years ago[DirectoryWatcher][linux] Fix build for older kernels
Jan Korous [Mon, 5 Aug 2019 18:44:07 +0000 (18:44 +0000)]
[DirectoryWatcher][linux] Fix build for older kernels

Apparently kernel support for IN_EXCL_UNLINK in inotify_add_watch() doesn't imply it's defined in sys/inotify.h.

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

llvm-svn: 367906

4 years ago[OpenMP 5.0] Codegen support for user-defined mappers.
Michael Kruse [Mon, 5 Aug 2019 18:43:21 +0000 (18:43 +0000)]
[OpenMP 5.0] Codegen support for user-defined mappers.

This patch implements the code generation for OpenMP 5.0 declare mapper
(user-defined mapper) constructs. For each declare mapper, a mapper
function is generated. These mapper functions will be called by the
runtime and/or other mapper functions to achieve user defined mapping.

The design slides can be found at
https://github.com/lingda-li/public-sharing/blob/master/mapper_runtime_design.pptx

Re-commit after revert in r367773 because r367755 changed the LLVM-IR
output such that a CHECK line failed.

Patch by Lingda Li <lildmh@gmail.com>

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

llvm-svn: 367905

4 years agoRevert "[AMDGPU] Use S_DENORM_MODE for gfx10"
Dmitri Gribenko [Mon, 5 Aug 2019 18:36:43 +0000 (18:36 +0000)]
Revert "[AMDGPU] Use S_DENORM_MODE for gfx10"

This reverts commit r367882. It broke the test
MC/Disassembler/AMDGPU/gfx10_dasm_all.txt.

llvm-svn: 367904

4 years ago[libc++] Take 2: Integrate the PSTL into libc++
Louis Dionne [Mon, 5 Aug 2019 18:29:14 +0000 (18:29 +0000)]
[libc++] Take 2: Integrate the PSTL into libc++

Summary:
This commit allows specifying LIBCXX_ENABLE_PARALLEL_ALGORITHMS when
configuring libc++ in CMake. When that option is enabled, libc++ will
assume that the PSTL can be found somewhere on the CMake module path,
and it will provide the C++17 parallel algorithms based on the PSTL
(that is assumed to be available).

The commit also adds support for running the PSTL tests as part of
the libc++ test suite.

The first attempt to commit this failed because it exposed a bug in the
tests for modules. Now that this has been fixed, it should be safe to
commit this.

Reviewers: EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits, mclow.lists, EricWF

Tags: #libc

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

llvm-svn: 367903

4 years ago[X86] Enable -x86-experimental-vector-widening-legalization by default.
Craig Topper [Mon, 5 Aug 2019 18:25:36 +0000 (18:25 +0000)]
[X86] Enable -x86-experimental-vector-widening-legalization by default.

This patch changes our defualt legalization behavior for 16, 32, and
64 bit vectors with i8/i16/i32/i64 scalar types from promotion to
widening. For example, v8i8 will now be widened to v16i8 instead of
promoted to v8i16. This keeps the elements widths the same and pads
with undef elements. We believe this is a better legalization strategy.
But it carries some issues due to the fragmented vector ISA. For
example, i8 shifts and multiplies get widened and then later have
to be promoted/split into vXi16 vectors.

This has the potential to cause regressions so we wanted to get
it in early in the 10.0 cycle so we have plenty of time to
address them.

Next steps will be to merge tests that explicitly test the command
line option. And then we can remove the option and its associated
code.

llvm-svn: 367901

4 years agoRobustify update_test_checks.py to non-autogened tests, and add a mode to skip non...
Philip Reames [Mon, 5 Aug 2019 18:25:08 +0000 (18:25 +0000)]
Robustify update_test_checks.py to non-autogened tests, and add a mode to skip non-autogenerated ones

Intended use case is:
./utils/update_test_checks.py test/Transform/PassDir/* --update-only
(i.e. rapidly be able to see changes in autogened filed, before handing non-autogened tests individually)

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

llvm-svn: 367900

4 years agoFix build when both gtest death tests and LLVM_NODISCARD are available.
David Blaikie [Mon, 5 Aug 2019 18:12:50 +0000 (18:12 +0000)]
Fix build when both gtest death tests and LLVM_NODISCARD are available.

(matching r367495)

llvm-svn: 367899

4 years ago[AArch64] Expand bcmp() for small block lengths
Evandro Menezes [Mon, 5 Aug 2019 18:09:14 +0000 (18:09 +0000)]
[AArch64] Expand bcmp() for small block lengths

Patch D56593 by @courbet results in calls to `bcmp()` in some cases, should
the target support the it.  Unless `TTI::MemCmpExpansionOptions()`
is overridden by the target.

In a proprietary benchmark we see a performance drop of about 12% on PNG
compression before this patch, though it passes all tests.

This patch mirrors X86 for AArch64 and initializes
`TTI::MemCmpExpansionOptions()` to then expand calls to `bcmp()` when
appropriate.  No tuning of the parameters was performed, but, at this point,
it's enough to recover the performance drop above.

This problem also exists on ARM.  Once a consensus is reached for AArch64, we
can work to fix ARM as well.

Authors:
- Evandro Menezes (@evandro) <e.menezes@samsung.com>
- Brian Rzycki (@brzycki) <b.rzycki@samsung.com>

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

llvm-svn: 367898

4 years ago[InstCombine][NFC] Tests for non-canonical clamp-like pattern
Roman Lebedev [Mon, 5 Aug 2019 18:01:22 +0000 (18:01 +0000)]
[InstCombine][NFC] Tests for non-canonical clamp-like pattern

As discussed in https://reviews.llvm.org/D65148#1607019

The canonical fold is: https://rise4fun.com/Alive/FKe

llvm-svn: 367897

4 years agoNFC. Documenting Native tablegen dependency
Chris Bieneman [Mon, 5 Aug 2019 18:00:55 +0000 (18:00 +0000)]
NFC. Documenting Native tablegen dependency

Adding documentation explaining why this dependency is required and should not be removed again.

llvm-svn: 367896

4 years agoNATIVE tablegen needs to depend on target tablegen
Chris Bieneman [Mon, 5 Aug 2019 17:50:08 +0000 (17:50 +0000)]
NATIVE tablegen needs to depend on target tablegen

This dependency was removed in  r357486, which has lead to a stream of difficult to diagnose bugs.

Without this dependency, when building with `LLVM_OPTIMIZED_TABLEGEN=On` the native tablegen executible may not be rebuilt at all, and often won't get rebuilt before targets that use the tablegen headers. In the best case this results in a build-time failure, in the worst case it results in runtime failures.

llvm-svn: 367895

4 years ago[AArch64] Set preferred function alignment to 16 bytes on Neoverse N1
Pablo Barrio [Mon, 5 Aug 2019 17:38:58 +0000 (17:38 +0000)]
[AArch64] Set preferred function alignment to 16 bytes on Neoverse N1

Summary:
The Arm Neoverse N1 Software Optimization Guide [1], Section "4.8 Branch
instruction alignment" states:

"Consider aligning subroutine entry points and branch targets to 32B
boundaries, within the bounds of the code-density requirements of the
program."

This patch sets the preferred function alignment on Neoverse N1 to 2^4=16B.
This was already the case in some of the latest Cortex-A CPUs. Benchmarking
in previous Cortex-A CPUs suggested that 16B alignment is already better
than the default. See commit d04ee305.

The reason we don't set it to 32B right now (as the optimisation guide
suggests) is that this will impact code size and perhaps the instruction
cache performance. Therefore we need benchmark numbers first.

I have also added testing for A75 and A76 that we were missing.

[1] https://developer.arm.com/docs/swog309707/latest

Reviewers: fhahn, greened, samparker, dmgreen

Reviewed By: dmgreen

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

Tags: #llvm

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

llvm-svn: 367894

4 years agoRevert "Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC"
Jan Vesely [Mon, 5 Aug 2019 17:23:23 +0000 (17:23 +0000)]
Revert "Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC"

This reverts commit 58c814614d2ac69bcf79b09543505fac80ada4e6.
Fixes build breakage using LLVM<7.

llvm-svn: 367893

4 years ago[AST] Fix buildbot failure because of raw string inside macro from 367839.
Johan Vikstrom [Mon, 5 Aug 2019 17:14:46 +0000 (17:14 +0000)]
[AST] Fix buildbot failure because of raw string inside macro from 367839.

llvm-svn: 367892

4 years ago[InstCombine] combine mul+shl separated by zext
Sanjay Patel [Mon, 5 Aug 2019 16:59:58 +0000 (16:59 +0000)]
[InstCombine] combine mul+shl separated by zext

This appears to slightly help patterns similar to what's
shown in PR42874:
https://bugs.llvm.org/show_bug.cgi?id=42874
...but not in the way requested.

That fix will require some later IR and/or backend pass to
decompose multiply/shifts into something more optimal per
target. Those transforms already exist in some basic forms,
but probably need enhancing to catch more cases.

https://rise4fun.com/Alive/Qzv2

llvm-svn: 367891

4 years agogn build: run "gn format"
Nico Weber [Mon, 5 Aug 2019 16:55:04 +0000 (16:55 +0000)]
gn build: run "gn format"

llvm-svn: 367890

4 years ago[docs] document -Weveything more betterer
JF Bastien [Mon, 5 Aug 2019 16:53:45 +0000 (16:53 +0000)]
[docs] document -Weveything more betterer

Reviewers: aaron.ballman

Subscribers: jkorous, dexonsmith, cfe-commits

Tags: #clang

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

llvm-svn: 367889

4 years agoFollow-up for r367863 and r367656
Nico Weber [Mon, 5 Aug 2019 16:50:56 +0000 (16:50 +0000)]
Follow-up for r367863 and r367656

llvm-svn: 367888

4 years agocompiler-rt: Rename cc files below test/asan to cpp
Nico Weber [Mon, 5 Aug 2019 16:48:12 +0000 (16:48 +0000)]
compiler-rt: Rename cc files below test/asan to cpp

See r367803 and similar other changes.

llvm-svn: 367887

4 years ago[AST] Fix RecursiveASTVisitorTest multiline string literal. NFC
David Green [Mon, 5 Aug 2019 16:27:36 +0000 (16:27 +0000)]
[AST] Fix RecursiveASTVisitorTest multiline string literal. NFC

Some compiler, notably older gccs (< 8) can have trouble with multiline raw
string literals inside macros. This just moves the code outsize the macro, to
attempt to appease the bots.

llvm-svn: 367885

4 years ago[llvm-readobj][test] Add llvm-readobj style test cases for r367878
Jordan Rupprecht [Mon, 5 Aug 2019 16:26:48 +0000 (16:26 +0000)]
[llvm-readobj][test] Add llvm-readobj style test cases for r367878

llvm-svn: 367884

4 years ago[InstCombine] add tests for shl+mul; NFC
Sanjay Patel [Mon, 5 Aug 2019 16:17:07 +0000 (16:17 +0000)]
[InstCombine] add tests for shl+mul; NFC

llvm-svn: 367883

4 years ago[AMDGPU] Use S_DENORM_MODE for gfx10
Austin Kerbow [Mon, 5 Aug 2019 16:09:49 +0000 (16:09 +0000)]
[AMDGPU] Use S_DENORM_MODE for gfx10

Summary: During fdiv32 lowering use S_DENORM_MODE to select denorm mode in gfx10.

Reviewers: arsenm, rampitec

Reviewed By: arsenm, rampitec

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

Tags: #llvm

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

llvm-svn: 367882

4 years agoAMDGPU/LoadStoreOptimizer: Set the correct offset whem merging MMOs
Tom Stellard [Mon, 5 Aug 2019 16:08:44 +0000 (16:08 +0000)]
AMDGPU/LoadStoreOptimizer: Set the correct offset whem merging MMOs

Summary:
This is a follow up to r367237.  MachineFunction::getMachineMemOperand()
adds the offset parameter to the existing offset instead of resetting it.
So we need to reset the offset to the correct value after calling this
function.

Reviewers: arsenm

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

Tags: #llvm

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

llvm-svn: 367881

4 years ago[InstCombine] add extra use constraint for shl-zext fold
Sanjay Patel [Mon, 5 Aug 2019 16:04:07 +0000 (16:04 +0000)]
[InstCombine] add extra use constraint for shl-zext fold

As the test shows, we can end up with more instructions than
we started with if we don't include the extra-use check.

llvm-svn: 367880

4 years agoAMDGPU: Correct behavior of f16 buffer loads
Matt Arsenault [Mon, 5 Aug 2019 15:59:07 +0000 (15:59 +0000)]
AMDGPU: Correct behavior of f16 buffer loads

Don't assume format loads for f16. Also fixes support for targets
without i16.

llvm-svn: 367879

4 years ago[llvm-readelf] Fix core note descriptions
Jordan Rupprecht [Mon, 5 Aug 2019 15:43:20 +0000 (15:43 +0000)]
[llvm-readelf] Fix core note descriptions

Summary:
Core files have different descriptions for note values. llvm-readelf currently prints the generic note type, which is wrong when using it to read a core file.

To verify the constants/strings, see:
Values: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=include/elf/common.h;h=75c4fb7e9d7c0f780d635ac305f579546b7b071b;hb=HEAD#l571
Strings: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=binutils/readelf.c;h=c31a5c1266b7bb62a485895b01b49e1f832ade35;hb=HEAD#l16881

Note: this does not handle printing the note data for NT_FILE, it just fixes the descriptions.

Reviewers: MaskRay

Reviewed By: MaskRay

Subscribers: labath, llvm-commits

Tags: #llvm

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

llvm-svn: 367878

4 years ago[ELF][test] Reorganize some tls-*.s tests
Fangrui Song [Mon, 5 Aug 2019 15:34:01 +0000 (15:34 +0000)]
[ELF][test] Reorganize some tls-*.s tests

Some tls-*.s tests do not test generic TLS behavior but rather are x86 specific.
Rename them to i386-*.s or x86-64-*.s

Delete tls-static.s: covered by tls-opt.s
Delete tls-opt-no-plt.s: add --implicit-check-not=.plt to x86-64-tls-gdie.s to cover it

Rename tls-dynamic-i686.s to i386-tls-dynamic.s
Rename tls-i686.s to i386-tls-le.s
Rename tls-opt-i686.s to i386-tls-opt.s
Rename tls-opt-iele-i686-nopic.s to i386-tls-opt-iele-nopic.s

Rename tls-dynamic.s to x86-64-tls-dynamic.s . IE should be split off in the future.
Rename tls-error.s to x86-64-reloc-tpoff32-error.s
Rename tls-opt-gdie.s to x86-64-tls-gdie.s
Rename tls-opt-x86_64-noplt.s to x86-64-tls-opt-noplt.s
Rename tls-opt-local.s => x86-64-tls-ie-opt-local.s . It can be merged with x86-64-tls-ie-local.s in the future.

llvm-svn: 367877

4 years ago[InstCombine] add test for shl-zext with extra use; NFC
Sanjay Patel [Mon, 5 Aug 2019 15:25:07 +0000 (15:25 +0000)]
[InstCombine] add test for shl-zext with extra use; NFC

llvm-svn: 367876

4 years agoUndo what looks like an unintentional change in r367829
Nico Weber [Mon, 5 Aug 2019 15:23:10 +0000 (15:23 +0000)]
Undo what looks like an unintentional change in r367829

The MSan bot was (rightfully) complaining that NumASTLoaded was
unitialized, so put the initialization removed in r367829 back in.

While here, remove two needless semicolons added in that change.

llvm-svn: 367875

4 years agoTry to fix OOB tests more on Windows after r367642
Nico Weber [Mon, 5 Aug 2019 15:10:15 +0000 (15:10 +0000)]
Try to fix OOB tests more on Windows after r367642

See PR42868 for more details.

The affected list of tests is:

Failing Tests (8):
    AddressSanitizer-Unit :: ./Asan-x86_64-calls-Test.exe/AddressSanitizer.LargeOOBRightTest
    AddressSanitizer-Unit :: ./Asan-x86_64-calls-Test.exe/AddressSanitizer.OOBRightTest
    AddressSanitizer-Unit :: ./Asan-x86_64-calls-Test.exe/AddressSanitizer.OOB_char
    AddressSanitizer-Unit :: ./Asan-x86_64-calls-Test.exe/AddressSanitizer.OOB_int
    AddressSanitizer-Unit :: ./Asan-x86_64-inline-Test.exe/AddressSanitizer.LargeOOBRightTest
    AddressSanitizer-Unit :: ./Asan-x86_64-inline-Test.exe/AddressSanitizer.OOBRightTest
    AddressSanitizer-Unit :: ./Asan-x86_64-inline-Test.exe/AddressSanitizer.OOB_char
    AddressSanitizer-Unit :: ./Asan-x86_64-inline-Test.exe/AddressSanitizer.OOB_int

llvm-svn: 367874

4 years agoTry to fix OOB tests on at least Windows after r367642
Nico Weber [Mon, 5 Aug 2019 15:04:20 +0000 (15:04 +0000)]
Try to fix OOB tests on at least Windows after r367642

gtest's built-in regex engine doesn't support (). Looks like it's not
needed, just remove it.

See PR42868 for more details.

llvm-svn: 367873

4 years agoAMDGPU: Correct behavior of f16/i16 non-format store intrinsics
Matt Arsenault [Mon, 5 Aug 2019 14:57:59 +0000 (14:57 +0000)]
AMDGPU: Correct behavior of f16/i16 non-format store intrinsics

This was switching to use a format store for a non-format store for
f16 types. Also fixes i16/f16 stores on targets without legal f16.

The corresponding loads also need to be fixed.

llvm-svn: 367872

4 years agoAMDGPU/GlobalISel: Alternative mappings for constants
Matt Arsenault [Mon, 5 Aug 2019 14:40:26 +0000 (14:40 +0000)]
AMDGPU/GlobalISel: Alternative mappings for constants

Without context we assume SGPR. Allowing VGPR constants theoretically
helps avoid a copy. This seems to not actually work now, and the
choice isn't based on the use bank.

llvm-svn: 367871

4 years agoAMDGPU/GlobalISel: Don't reject shader types
Matt Arsenault [Mon, 5 Aug 2019 14:40:23 +0000 (14:40 +0000)]
AMDGPU/GlobalISel: Don't reject shader types

I'm not sure what complications these present, but the current
argument lowering is pretty much directly copied from the DAG
lowering, so I assume these work as they should.

No tests because I'm lazy and things are getting pretty close to the
point where the existing calling-conventions.ll can be shared with
SelectionDAG.

llvm-svn: 367870

4 years ago[ELF] Consistently prioritize non-* wildcards overs "*" in version scripts
Fangrui Song [Mon, 5 Aug 2019 14:31:39 +0000 (14:31 +0000)]
[ELF] Consistently prioritize non-* wildcards overs "*" in version scripts

We prioritize non-* wildcards overs VER_NDX_LOCAL/VER_NDX_GLOBAL "*".
This patch generalizes the rule to "*" of other versions and thus fixes PR40176.
I don't feel strongly about this GNU linkers' behavior but the
generalization simplifies code.

Delete `config->defaultSymbolVersion` which was used to special case
VER_NDX_LOCAL/VER_NDX_GLOBAL "*".

In `SymbolTable::scanVersionScript`, custom versions are handled the same
way as VER_NDX_LOCAL/VER_NDX_GLOBAL. So merge
`config->versionScript{Locals,Globals}` into `config->versionDefinitions`.
Overall this seems to simplify the code.

In `SymbolTable::assign{Exact,Wildcard}Versions`,
`sym->verdefIndex == config->defaultSymbolVersion` is changed to
`verdefIndex == UINT32_C(-1)`.
This allows us to give duplicate assignment diagnostics for
`{ global: foo; };` `V1 { global: foo; };`

In test/linkerscript/version-script.s:
  vs_index of an undefined symbol changes from 0 to 1. This doesn't matter (arguably 1 is better because the binding is STB_GLOBAL) because vs_index of an undefined symbol is ignored.

Reviewed By: ruiu

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

llvm-svn: 367869

4 years agogn build: Merge r367864
Nico Weber [Mon, 5 Aug 2019 14:22:21 +0000 (14:22 +0000)]
gn build: Merge r367864

llvm-svn: 367868

4 years agoChanging representation of .cv_def_range directives in Codeview debug info assembly...
Nilanjana Basu [Mon, 5 Aug 2019 14:16:58 +0000 (14:16 +0000)]
Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability

llvm-svn: 367867

4 years ago[Driver] Properly use values-X[ca].o, values-xpg[46].o on Solaris
Rainer Orth [Mon, 5 Aug 2019 14:06:16 +0000 (14:06 +0000)]
[Driver] Properly use values-X[ca].o, values-xpg[46].o on Solaris

Builtins-*-sunos :: compiler_rt_logbf_test.c currently FAILs on Solaris, both SPARC and
x86, 32 and 64-bit.

It turned out that this is due to different behaviour of logb depending on the C
standard compiled for, as documented on logb(3M):

  RETURN VALUES
         Upon successful completion, these functions return the exponent of x.

         If x is subnormal:

             o      For SUSv3-conforming applications compiled with the c99 com-
                    piler  driver  (see standards(7)), the exponent of x as if x
                    were normalized is returned.

             o      Otherwise, if compiled with the cc compiler  driver,  -1022,
                    -126,  and  -16382  are  returned  for  logb(), logbf(), and
                    logbl(), respectively.

Studio c99 and gcc control this by linking with the appropriate version of values-xpg[46].o, but clang uses neither of those.

The following patch fixes this by following what gcc does, as corrected some time ago in

  Fix use of Solaris values-Xc.o (PR target/40411)
  https://gcc.gnu.org/ml/gcc-patches/2018-01/msg02350.html and
  https://gcc.gnu.org/ml/gcc-patches/2018-01/msg02384.html.

Tested on x86_64-pc-solaris2.11, sparcv9-sun-solaris2.11, and x86_64-pc-linux-gnu.

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

llvm-svn: 367866

4 years ago[lldb][clang] Reflect LangStandard.h move to clang/Basic
Rainer Orth [Mon, 5 Aug 2019 14:00:43 +0000 (14:00 +0000)]
[lldb][clang] Reflect LangStandard.h move to clang/Basic

D65562 <https://reviews.llvm.org/D65562> moves LangStandard.h from clang/Frontend to clang/Basic.  This patch
adjusts the single file in lldb that uses it to match.

Tested on x86_64-pc-linux-gnu.

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

llvm-svn: 367865

4 years agoMove LangStandard*, InputKind::Language to Basic
Rainer Orth [Mon, 5 Aug 2019 13:59:26 +0000 (13:59 +0000)]
Move LangStandard*, InputKind::Language to Basic

This patch is a prerequisite for using LangStandard from Driver in
https://reviews.llvm.org/D64793.

It moves LangStandard* and InputKind::Language to Basic.  It is mostly
mechanical, with only a few changes of note:

- enum Language has been changed into enum class Language : uint8_t to
  avoid a clash between OpenCL in enum Language and OpenCL in enum
  LangFeatures and not to increase the size of class InputKind.

- Now that getLangStandardForName, which is currently unused, also checks
  both canonical and alias names, I've introduced a helper getLangKind
  which factors out a code pattern already used 3 times.

The patch has been tested on x86_64-pc-solaris2.11, sparcv9-sun-solaris2.11,
and x86_64-pc-linux-gnu.

There's a companion patch for lldb which uses LangStandard.h
(https://reviews.llvm.org/D65717).

While polly includes isl which in turn uses InputKind::C, that part of the
code isn't even built inside the llvm tree.  I've posted a patch to allow
for both InputKind::C and Language::C upstream
(https://groups.google.com/forum/#!topic/isl-development/6oEvNWOSQFE).

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

llvm-svn: 367864

4 years agocompiler-rt: Rename cc files below test/sanitizer_common to cpp
Nico Weber [Mon, 5 Aug 2019 13:57:03 +0000 (13:57 +0000)]
compiler-rt: Rename cc files below test/sanitizer_common to cpp

See r367803 and similar other changes.

llvm-svn: 367863

4 years ago[yaml2obj][tests] Fix overly restrictive od output check
Hubert Tong [Mon, 5 Aug 2019 13:55:41 +0000 (13:55 +0000)]
[yaml2obj][tests] Fix overly restrictive od output check

Summary:
rL364517 introduced further instances of `od` output checking of the
kind previously corrected by rL363829. This patch corrects the issue by
suppressing output of the input offset. The check remains sufficiently
sensitive to test for the intended value of the specific byte since the
relevant byte value is the only output we are expecting from `od`.

Reviewers: grimar, xingxue, daltenty, jasonliu, jhenderson, MaskRay

Reviewed By: grimar, MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 367862

4 years agoRevert "Changing representation of .cv_def_range directives in Codeview debug info...
Nilanjana Basu [Mon, 5 Aug 2019 13:55:21 +0000 (13:55 +0000)]
Revert "Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability"

This reverts commit a885afa9fa8cab3b34f1ddf3d21535f88b662881.

llvm-svn: 367861

4 years ago[yaml2obj] - Allow overriding sh_entsize for SHT_GNU_versym sections.
George Rimar [Mon, 5 Aug 2019 13:54:35 +0000 (13:54 +0000)]
[yaml2obj] - Allow overriding sh_entsize for SHT_GNU_versym sections.

This allows to write a test case for one of untested errors
in llvm/Object/ELF.h.

I did it in this patch to demonstrate.

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

llvm-svn: 367860

4 years ago[AArch64] Implement initial SVE calling convention support
Cullen Rhodes [Mon, 5 Aug 2019 13:44:10 +0000 (13:44 +0000)]
[AArch64] Implement initial SVE calling convention support

Summary:

This patch adds initial support for the SVE calling convention such that
SVE types can be passed as arguments and return values to/from a
subroutine.

The SVE AAPCS states [1]:

    z0-z7 are used to pass scalable vector arguments to a subroutine,
    and to return scalable vector results from a function. If a
    subroutine takes arguments in scalable vector or predicate
    registers, or if it is a function that returns results in such
    registers, it must ensure that the entire contents of z8-z23 are
    preserved across the call. In other cases it need only preserve the
    low 64 bits of z8-z15, as described in ยง5.1.2.

    p0-p3 are used to pass scalable predicate arguments to a subroutine
    and to return scalable predicate results from a function. If a
    subroutine takes arguments in scalable vector or predicate
    registers, or if it is a function that returns results in these
    registers, it must ensure that p4-p15 are preserved across the call.
    In other cases it need not preserve any scalable predicate register
    contents.

SVE predicate and data registers are passed indirectly (i.e. spilled to the
stack and pass the address) if they exceed the registers used for argument
passing defined by the PCS referenced above.  Until SVE stack support is merged
we can't spill SVE registers to the stack, so currently an llvm_unreachable is
used where we will eventually handle this.

[1] https://static.docs.arm.com/100986/0000/100986_0000.pdf

Reviewed By: ostannard

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

llvm-svn: 367859

4 years agocompiler-rt: Rename remaining cc files in test/profile to cpp
Nico Weber [Mon, 5 Aug 2019 13:42:31 +0000 (13:42 +0000)]
compiler-rt: Rename remaining cc files in test/profile to cpp

See r367803 and similar other changes.

llvm-svn: 367858

4 years ago[lldb][NFC] Fix documentation for ClangPersistentVariables::m_next_persistent_variable_id
Raphael Isemann [Mon, 5 Aug 2019 13:40:39 +0000 (13:40 +0000)]
[lldb][NFC] Fix documentation for ClangPersistentVariables::m_next_persistent_variable_id

llvm-svn: 367857

4 years agoMore follow-up to r367851
Nico Weber [Mon, 5 Aug 2019 13:27:37 +0000 (13:27 +0000)]
More follow-up to r367851

llvm-svn: 367856

4 years agocompiler-rt: Rename last few cc files below test/ubsan to cpp
Nico Weber [Mon, 5 Aug 2019 13:23:38 +0000 (13:23 +0000)]
compiler-rt: Rename last few cc files below test/ubsan to cpp

See r367803 and similar other changes.

llvm-svn: 367855

4 years agocompiler-rt: Rename .cc file in test/dfsan to cpp
Nico Weber [Mon, 5 Aug 2019 13:19:28 +0000 (13:19 +0000)]
compiler-rt: Rename .cc file in test/dfsan to cpp

See r367849 et al.

llvm-svn: 367854

4 years ago[MCA][doc] Add a section for the 'Bottleneck Analysis'.
Andrea Di Biagio [Mon, 5 Aug 2019 13:18:37 +0000 (13:18 +0000)]
[MCA][doc] Add a section for the 'Bottleneck Analysis'.

Also clarify the meaning of 'Block RThroughput' and 'RThroughput'.

llvm-svn: 367853

4 years ago[obj2yaml] - Teach tool to dump SHT_NULL sections.
George Rimar [Mon, 5 Aug 2019 13:16:06 +0000 (13:16 +0000)]
[obj2yaml] - Teach tool to dump SHT_NULL sections.

Recently an advanced support of SHT_NULL sections
was implemented in yaml2obj.

This patch adds a corresponding support to obj2yaml.

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

llvm-svn: 367852

4 years agocompiler-rt: Rename cc files in test/hwasan/TestCases subdirectories as well
Nico Weber [Mon, 5 Aug 2019 13:12:23 +0000 (13:12 +0000)]
compiler-rt: Rename cc files in test/hwasan/TestCases subdirectories as well

Should've been part of r367849.

llvm-svn: 367851

4 years agoChanging representation of .cv_def_range directives in Codeview debug info assembly...
Nilanjana Basu [Mon, 5 Aug 2019 13:11:51 +0000 (13:11 +0000)]
Changing representation of .cv_def_range directives in Codeview debug info assembly format for better readability

llvm-svn: 367850

4 years agocompiler-rt: Rename .cc file in test/hwasan to .cpp
Nico Weber [Mon, 5 Aug 2019 13:10:50 +0000 (13:10 +0000)]
compiler-rt: Rename .cc file in test/hwasan to .cpp

Like r367463, but for test/hwasan.

llvm-svn: 367849

4 years agotest-release.sh: Perform the sed substitution on both files (PR42739)
Hans Wennborg [Mon, 5 Aug 2019 13:04:12 +0000 (13:04 +0000)]
test-release.sh: Perform the sed substitution on both files (PR42739)

The comparison would otherwise fail if Phase2 occurrs naturally in the
object file. It would get replaced with Phase3 in the one .o, but not
in the other.

We were already running both files through sed to have them processed in
this same way; this is a logical extension of that.

llvm-svn: 367847

4 years agoWrite the RequiredLibraries for 'all' in LibraryDependencies.inc in a deterministic...
Hans Wennborg [Mon, 5 Aug 2019 13:04:07 +0000 (13:04 +0000)]
Write the RequiredLibraries for 'all' in LibraryDependencies.inc in a deterministic order (PR42739)

llvm-svn: 367846

4 years ago[clangd] Add a callback mechanism for handling responses from client.
Haojian Wu [Mon, 5 Aug 2019 12:48:09 +0000 (12:48 +0000)]
[clangd] Add a callback mechanism for handling responses from client.

Summary:
The callback will be invoked in clangd when we receive a reply from the client.

This is a prerequisite of implementing a generic mechanism for chainable
refactorings (e.g. extract variable and rename), this would allow server to
trigger a new request to the LSP client after receiving a reply from the client.

Reviewers: sammccall

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

Tags: #clang

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

llvm-svn: 367845

4 years agogn build: Merge r367839
Nico Weber [Mon, 5 Aug 2019 12:44:53 +0000 (12:44 +0000)]
gn build: Merge r367839

llvm-svn: 367844

4 years ago[lldb][NFC] Clang format GetNextPersistentVariableName signature
Raphael Isemann [Mon, 5 Aug 2019 12:37:54 +0000 (12:37 +0000)]
[lldb][NFC] Clang format GetNextPersistentVariableName signature

llvm-svn: 367843

4 years ago[lldb] Move redundant persistent variable counter to ClangPersistentVariables
Raphael Isemann [Mon, 5 Aug 2019 12:32:59 +0000 (12:32 +0000)]
[lldb] Move redundant persistent variable counter to ClangPersistentVariables

Currently Target::m_next_persistent_variable_index is counting up
for our persistent variables ($0, $1, ...) but we also have a
unused counter that is supposed to do this in
ClangPersistentVariables but that stays always at 0 (because
we currently increase the target counter when we should increase
that unused counter).

This patch removes the counter in Target and lets the documented
counter in ClangPersistentVariables do the variable counting.

Patch *should* be NFC, but it might unexpectedly bring LLDB to
new code paths that could contain exciting new bugs to fix.

llvm-svn: 367842

4 years agoRemove another empty directory.
Nico Weber [Mon, 5 Aug 2019 12:28:08 +0000 (12:28 +0000)]
Remove another empty directory.

llvm-svn: 367841

4 years ago[clang][NFC] Remove unused private variable 'CI' in CrossTranslationUnit.h
Raphael Isemann [Mon, 5 Aug 2019 12:23:39 +0000 (12:23 +0000)]
[clang][NFC] Remove unused private variable 'CI' in CrossTranslationUnit.h

It seems because of the recent refactorings this variable has become unused
and now we get this warning in the build logs:

In file included from llvm/clang/lib/CrossTU/CrossTranslationUnit.cpp:12:
llvm/clang/include/clang/CrossTU/CrossTranslationUnit.h:200:21: warning: private field 'CI' is not used [-Wunused-private-field]
  CompilerInstance &CI;
                    ^

I'll remove them for now to get the builds back to green.

llvm-svn: 367840

4 years ago[AST] Fix RecursiveASTVisitor visiting implicit constructor initializers.
Johan Vikstrom [Mon, 5 Aug 2019 12:20:43 +0000 (12:20 +0000)]
[AST] Fix RecursiveASTVisitor visiting implicit constructor initializers.

Summary: RecursiveASTVisitor was visiting implcit constructor initializers. This caused semantic highlighting in clangd to emit error logs. Fixes this by checking if the constructor is written or if the visitor should visit implicit decls.

Reviewers: hokein, ilya-biryukov

Subscribers: kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 367839

4 years agoRemove empty directory.
Nico Weber [Mon, 5 Aug 2019 12:18:04 +0000 (12:18 +0000)]
Remove empty directory.

The directory was added in rL292747 which was reverted again in 292751 --
but the revert was apparently done via git and the empty dir stuck around in
svn.

llvm-svn: 367838

4 years ago[MinGW] Add an lld specific option for requesting to delay load libraries
Martin Storsjo [Mon, 5 Aug 2019 11:57:06 +0000 (11:57 +0000)]
[MinGW] Add an lld specific option for requesting to delay load libraries

With GNU tools, delayload is handled completely differently. (One
creates a specific delayload import library using dlltool and then
links against it instead of the normal import library.)

Instead of requiring using -Xlink=-delayload:lib.dll, we can provide
an lld specific option for this.

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

llvm-svn: 367837

4 years ago[COFF] Omit automatically imported symbols from the symbol table
Martin Storsjo [Mon, 5 Aug 2019 11:57:00 +0000 (11:57 +0000)]
[COFF] Omit automatically imported symbols from the symbol table

These symbols actually point to the symbol's IAT entry, which
obviously is different from the symbol itself (which is imported
from a different module and doesn't exist in the current one).

Omitting this symbol helps gdb inspect automatically imported
symbols, see https://sourceware.org/bugzilla/show_bug.cgi?id=24574
for discussion on the matter.

Surprisingly, those extra symbols don't seem to be an issue for
gdb when the sources have been built with clang, only with gcc.
The actual logic in gdb that this depends on still is unknown, but
omitting these symbols from the symbol table is the right thing to
do in any case.

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

llvm-svn: 367836

4 years agoFix PDB tests after r367820
Pavel Labath [Mon, 5 Aug 2019 11:29:01 +0000 (11:29 +0000)]
Fix PDB tests after r367820

The commit changed Module dumping code to call SymbolFile::Dump
directly, which meant that we were no longer showing the plugin name in
the output (as that was done in the SymbolVendor).

This adds the plugin name printing code to the SymbolFile dump method,
and tweak the assertions in the PDB tests to match it correctly.

llvm-svn: 367835

4 years ago[DAGCombiner][x86] prevent infinite loop from truncate/extend transforms
Sanjay Patel [Mon, 5 Aug 2019 11:27:07 +0000 (11:27 +0000)]
[DAGCombiner][x86] prevent infinite loop from truncate/extend transforms

The test case is based on the example from the post-commit thread for:
https://reviews.llvm.org/rGc9171bd0a955

This replaces the x86-specific simple-type check from:
rL367766
with a check in the DAGCombiner. Adding the check isn't
strictly necessary after the fix from:
rL367768
...but it seems likely that we're heading for trouble if
we are creating weird types in this transform.

I combined the earlier legality check into the initial
clause to simplify the code.

So we should only try the trunc/sext transform at the
earliest combine stage, but we limit the transform to
simple types anyway because the TLI hook is probably
too lax about what it considers a free truncate.

llvm-svn: 367834

4 years ago[llvm/Object] - Remove ELFFile<ELFT>::getSection(const StringRef SectionName). NFC.
George Rimar [Mon, 5 Aug 2019 11:19:28 +0000 (11:19 +0000)]
[llvm/Object] - Remove ELFFile<ELFT>::getSection(const StringRef SectionName). NFC.

This method is dead. It was introduced in D47989,
but now the logic from D63475 is used in llvm-readobj instead.
Also it has a problem: it returns the first matching section,
even if there are multiple sections with the same name.

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

llvm-svn: 367833

4 years ago[MVT][SVE] Map between scalable vector IR Type and VTs
Graham Hunter [Mon, 5 Aug 2019 11:18:19 +0000 (11:18 +0000)]
[MVT][SVE] Map between scalable vector IR Type and VTs

Adds a two way mapping between the scalable vector IR type and
corresponding SelectionDAG ValueTypes.

Reviewers: craig.topper, jeroen.dobbelaere, fhahn, rengolin, greened, rovka

Reviewed By: greened

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

llvm-svn: 367832

4 years ago[AArch64] Skip isZIPMask check for masks with an odd number of elements.
Florian Hahn [Mon, 5 Aug 2019 11:12:23 +0000 (11:12 +0000)]
[AArch64] Skip isZIPMask check for masks with an odd number of elements.

We process 2 elements at a time and expect the number of elements to be
even. Similar to D60690.

Reviewers: dmgreen, samparker, t.p.northover

Reviewed By: dmgreen

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

llvm-svn: 367831