platform/upstream/llvm.git
5 years ago[X86][SSE] Add masked bit test cases for PR26697
Simon Pilgrim [Wed, 24 Apr 2019 10:34:15 +0000 (10:34 +0000)]
[X86][SSE] Add masked bit test cases for PR26697

llvm-svn: 359082

5 years agoAdd 'REQUIRES: shell' to verbose-output-quoting.c
Hans Wennborg [Wed, 24 Apr 2019 10:12:30 +0000 (10:12 +0000)]
Add 'REQUIRES: shell' to verbose-output-quoting.c

The lit shell couldn't handle these run lines.

llvm-svn: 359081

5 years agoAvoid name conflict with kernel headers
Eric Fiselier [Wed, 24 Apr 2019 09:43:44 +0000 (09:43 +0000)]
Avoid name conflict with kernel headers

llvm-svn: 359080

5 years ago[clangd] Fix handling of include paths in windows tests
Kadir Cetinkaya [Wed, 24 Apr 2019 09:42:53 +0000 (09:42 +0000)]
[clangd] Fix handling of include paths in windows tests

llvm-svn: 359079

5 years ago[clang][HeaderSuggestion] Handle the case of dotdot with an absolute path
Kadir Cetinkaya [Wed, 24 Apr 2019 09:23:31 +0000 (09:23 +0000)]
[clang][HeaderSuggestion] Handle the case of dotdot with an absolute path

Summary:
Include insertion in clangd was inserting absolute paths when the
include directory was an absolute path with a double dot. This patch makes sure
double dots are handled both with absolute and relative paths.

Reviewers: sammccall

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

Tags: #clang

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

llvm-svn: 359078

5 years agoFix unquoted spaces in args in clang --verbose output
Hans Wennborg [Wed, 24 Apr 2019 09:06:03 +0000 (09:06 +0000)]
Fix unquoted spaces in args in clang --verbose output

The behaviour of not quoting spaces appears to have been introduced by
mistake in r190620.

Patch by Brad Moody!

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

llvm-svn: 359077

5 years agoRevert r359048: C++ DR2387: a variable template declared wthi
Ilya Biryukov [Wed, 24 Apr 2019 08:50:24 +0000 (08:50 +0000)]
Revert r359048: C++ DR2387: a variable template declared wthi

The change breaks libc++ with the follwing error:

In file included from valarray:4:
.../include/c++/v1/valarray:1062:60: error: explicit instantiation declaration of 'valarray<_Tp>' with internal linkage
_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS valarray<size_t>::valarray(size_t))
                                                           ^
.../include/c++/v1/valarray:1063:60: error: explicit instantiation declaration of '~valarray<_Tp>' with internal linkage
_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS valarray<size_t>::~valarray())

llvm-svn: 359076

5 years ago[clang][HeaderSearch] Make sure there are no backslashes in suggestedPath
Kadir Cetinkaya [Wed, 24 Apr 2019 08:45:03 +0000 (08:45 +0000)]
[clang][HeaderSearch] Make sure there are no backslashes in suggestedPath

Reviewers: sammccall

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

llvm-svn: 359075

5 years agoyamlify lit/Minidump tests
Pavel Labath [Wed, 24 Apr 2019 08:09:36 +0000 (08:09 +0000)]
yamlify lit/Minidump tests

Replace checked-in binaries by their yaml equivalents.

llvm-svn: 359074

5 years agoPostfixExpression: move parser out of NativePDB internals
Pavel Labath [Wed, 24 Apr 2019 07:27:05 +0000 (07:27 +0000)]
PostfixExpression: move parser out of NativePDB internals

Summary:
The postfix expressions in PDB and breakpad symbol files are similar
enough that they can be parsed by the same parser. This patch
generalizes the parser in the NativePDB plugin and moves it into the
PostfixExpression file created in the previous commit (r358976).

The generalization consists of treating any unrecognised token as a
"symbol" node (previously these would only be created for tokens
starting with "$", and other token would abort the parse). This is
needed because breakpad symbols can also contain ".cfa" tokens, which
refer to the frame's CFA.

The cosmetic changes include:
- using a factory function instead of a class for creating nodes (this
  is more generic as it allows the same BumpPtrAllocator to be used for
  other things too)
- using dedicated function for parsing operator tokens instead of a
  DenseMap (more efficient as we don't need to create the DenseMap every
  time).

Reviewers: amccarth, clayborg, JDevlieghere, aleksandr.urakov

Subscribers: jasonmolenda, lldb-commits, markmentovai, mgorny

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

llvm-svn: 359073

5 years agoAdd "const" in GetUnderlyingObjects. NFC
Bjorn Pettersson [Wed, 24 Apr 2019 06:55:50 +0000 (06:55 +0000)]
Add "const" in GetUnderlyingObjects. NFC

Summary:
Both the input Value pointer and the returned Value
pointers in GetUnderlyingObjects are now declared as
const.

It turned out that all current (in-tree) uses of
GetUnderlyingObjects were trivial to update, being
satisfied with have those Value pointers declared
as const. Actually, in the past several of the users
had to use const_cast, just because of ValueTracking
not providing a version of GetUnderlyingObjects with
"const" Value pointers. With this patch we get rid
of those const casts.

Reviewers: hfinkel, materi, jkorous

Reviewed By: jkorous

Subscribers: dexonsmith, jkorous, jholewinski, sdardis, eraman, hiraditya, jrtc27, atanasyan, llvm-commits

Tags: #llvm

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

llvm-svn: 359072

5 years ago[Mips][CodeGen] Remove MachineFunction::setSubtarget. Change Mips to just copy the...
Craig Topper [Wed, 24 Apr 2019 06:48:31 +0000 (06:48 +0000)]
[Mips][CodeGen] Remove MachineFunction::setSubtarget. Change Mips to just copy the subtarget from the MachineFunction instead of recalculating it.

Summary:
The MachineFunction should have been created with the correct subtarget. As
long as there is no way to change it, MipsTargetMachine can just capture it
directly from the MachineFunction without calling getSubtargetImpl again.

While there, const correct the Subtarget pointer to avoid a const_cast.

I believe the Mips16Subtarget and NoMips16Subtarget members are never used, but
I'll leave there removal for a separate patch.

Reviewers: echristo, atanasyan

Reviewed By: atanasyan

Subscribers: sdardis, arichardson, hiraditya, jrtc27, llvm-commits

Tags: #llvm

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

llvm-svn: 359071

5 years ago[ELF] Fix a gcc -Wextra warning
Fangrui Song [Wed, 24 Apr 2019 05:33:33 +0000 (05:33 +0000)]
[ELF] Fix a gcc -Wextra warning

Extracted from D61046.

warning: enumeral and non-enumeral type in conditional expression [-Wextra]

Cast SHF_ALLOC to avoid that.

llvm-svn: 359070

5 years agoCleanup new cxa guard implementation.
Eric Fiselier [Wed, 24 Apr 2019 04:21:05 +0000 (04:21 +0000)]
Cleanup new cxa guard implementation.

* Add TSAN annotations around the futex syscalls.
* Test that the futex syscall wrappers actually work.
* Fix bad names.

llvm-svn: 359069

5 years ago[CommandLine] Provide parser<unsigned long> instantiation to allow cl::opt<uint64_t...
Fangrui Song [Wed, 24 Apr 2019 02:40:20 +0000 (02:40 +0000)]
[CommandLine] Provide parser<unsigned long> instantiation to allow cl::opt<uint64_t> on LP64 platforms

Summary:
And migrate opt<unsigned long long> to opt<uint64_t>

Fixes PR19665

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

llvm-svn: 359068

5 years ago[Builtins] Implement __builtin_is_constant_evaluated for use in C++2a
Eric Fiselier [Wed, 24 Apr 2019 02:23:30 +0000 (02:23 +0000)]
[Builtins] Implement __builtin_is_constant_evaluated for use in C++2a

Summary:
This patch implements `__builtin_is_constant_evaluated` as specifier by [P0595R2](https://wg21.link/p0595r2). It is built on the back of Bill Wendling's work for `__builtin_constant_p()`.

More tests to come, but early feedback is appreciated.

I plan to implement warnings for common mis-usages like those belowe in a following patch:
```
void foo(int x) {
  if constexpr (std::is_constant_evaluated())) { // condition is always `true`. Should use plain `if` instead.
   foo_constexpr(x);
  } else {
    foo_runtime(x);
  }
}
```

Reviewers: rsmith, MaskRay, bruno, void

Reviewed By: rsmith

Subscribers: dexonsmith, zoecarver, fdeazeve, kristina, cfe-commits

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

llvm-svn: 359067

5 years agoRevert r350917 "[Sema] If CheckPlaceholderExpr rewrites the initializer
Richard Smith [Wed, 24 Apr 2019 02:22:38 +0000 (02:22 +0000)]
Revert r350917 "[Sema] If CheckPlaceholderExpr rewrites the initializer
of an auto"

This commit changed the initializer expression passed into
initialization (stripping off an enclosing pair of parentheses or
braces) and subtly changing the meaning of programs, typically by
inserting bogus calls to copy constructors.

See the added testcase in test/SemaCXX/cxx1y-init-captures.cpp for an
example of the breakage.

llvm-svn: 359066

5 years agoWork around GCC test failure.
Eric Fiselier [Wed, 24 Apr 2019 02:21:13 +0000 (02:21 +0000)]
Work around GCC test failure.

llvm-svn: 359065

5 years agollvm-cvtres: Accept /? as help flag, like cvtres.exe
Nico Weber [Wed, 24 Apr 2019 02:11:24 +0000 (02:11 +0000)]
llvm-cvtres: Accept /? as help flag, like cvtres.exe

llvm-svn: 359064

5 years ago[Docs] Add more redirects
Jonas Devlieghere [Wed, 24 Apr 2019 01:58:17 +0000 (01:58 +0000)]
[Docs] Add more redirects

Found two more broken links.

llvm-svn: 359063

5 years ago[Docs] Update the CI page
Jonas Devlieghere [Wed, 24 Apr 2019 01:48:43 +0000 (01:48 +0000)]
[Docs] Update the CI page

 - Add the Sphinx bot
 - Add a little more info

llvm-svn: 359062

5 years ago[Docs] Move external links up
Jonas Devlieghere [Wed, 24 Apr 2019 01:48:40 +0000 (01:48 +0000)]
[Docs] Move external links up

With a duplicate link removed and the API reference moved up, the page
didn't make much sense anymore.

llvm-svn: 359061

5 years agoRewrite cxa guard implementation.
Eric Fiselier [Wed, 24 Apr 2019 01:47:30 +0000 (01:47 +0000)]
Rewrite cxa guard implementation.

This patch does three main things:
  (1) It re-writes the cxa guard implementation to make it testable.
  (2) Adds support for recursive init detection on non-apple platforms.
  (3) It adds a futex based implementation.

The futex based implementation locks and notifies on a per-object basis, unlike the
current implementation which uses a global lock for all objects. Once this patch settles
I'll turn it on by default when supported.

llvm-svn: 359060

5 years agoFix interactions between __builtin_constant_p and constexpr to match
Richard Smith [Wed, 24 Apr 2019 01:29:28 +0000 (01:29 +0000)]
Fix interactions between __builtin_constant_p and constexpr to match
current trunk GCC.

GCC permits information from outside the operand of
__builtin_constant_p (but in the same constant evaluation context) to be
used within that operand; clang now does so too. A few other minor
deviations from GCC's behavior showed up in my testing and are also
fixed (matching GCC):
 * Clang now supports nullptr_t as the argument type for
   __builtin_constant_p
 * Clang now returns true from __builtin_constant_p if called with a
   null pointer
 * Clang now returns true from __builtin_constant_p if called with an
   integer cast to pointer type

llvm-svn: 359059

5 years agogn build: Merge r359050 more
Nico Weber [Wed, 24 Apr 2019 00:59:24 +0000 (00:59 +0000)]
gn build: Merge r359050 more

llvm-svn: 359058

5 years agoFix test after r359009 on platforms where %ms_abi_triple is 32-bit
Nico Weber [Wed, 24 Apr 2019 00:48:04 +0000 (00:48 +0000)]
Fix test after r359009 on platforms where %ms_abi_triple is 32-bit

llvm-svn: 359057

5 years agogn build: Merge r359050
Nico Weber [Wed, 24 Apr 2019 00:44:14 +0000 (00:44 +0000)]
gn build: Merge r359050

llvm-svn: 359056

5 years agoRevert [AliasAnalysis] AAResults preserves AAManager.
Alina Sbirlea [Wed, 24 Apr 2019 00:28:29 +0000 (00:28 +0000)]
Revert [AliasAnalysis] AAResults preserves AAManager.

Triggers use-after-free.

llvm-svn: 359055

5 years agoFixes in creduce-clang-crash.py for clang crash message parsing and reading the comma...
Amy Huang [Wed, 24 Apr 2019 00:28:23 +0000 (00:28 +0000)]
Fixes in creduce-clang-crash.py for clang crash message parsing and reading the command from the repro script.

llvm-svn: 359054

5 years ago[Remarks] Fix documentation indentation
Francis Visoiu Mistrih [Wed, 24 Apr 2019 00:27:59 +0000 (00:27 +0000)]
[Remarks] Fix documentation indentation

Fix the documentation bot:

http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/30450/steps/docs-llvm-html/logs/stdio

llvm-svn: 359053

5 years ago[Docs] Fix link to C++ docs
Jonas Devlieghere [Wed, 24 Apr 2019 00:10:23 +0000 (00:10 +0000)]
[Docs] Fix link to C++ docs

... and add a redirect for the old URL.

llvm-svn: 359052

5 years agoAdd missing diagnostic for anonymous struct/union definitions that don't
Richard Smith [Wed, 24 Apr 2019 00:08:02 +0000 (00:08 +0000)]
Add missing diagnostic for anonymous struct/union definitions that don't
introduce any names.

llvm-svn: 359051

5 years ago[Remarks] Add string deduplication using a string table
Francis Visoiu Mistrih [Wed, 24 Apr 2019 00:06:24 +0000 (00:06 +0000)]
[Remarks] Add string deduplication using a string table

* Add support for uniquing strings in the remark streamer and emitting the string table in the remarks section.

* Add parsing support for the string table in the RemarkParser.

From this remark:

```
--- !Missed
Pass:     inline
Name:     NoDefinition
DebugLoc: { File: 'test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c',
            Line: 7, Column: 3 }
Function: printArgsNoRet
Args:
  - Callee:   printf
  - String:   ' will not be inlined into '
  - Caller:   printArgsNoRet
    DebugLoc: { File: 'test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c',
                Line: 6, Column: 0 }
  - String:   ' because its definition is unavailable'
...
```

to:

```
--- !Missed
Pass: 0
Name: 1
DebugLoc: { File: 3, Line: 7, Column: 3 }
Function: 2
Args:
  - Callee:   4
  - String:   5
  - Caller:   2
    DebugLoc: { File: 3, Line: 6, Column: 0 }
  - String:   6
...
```

And the string table in the .remarks/__remarks section containing:

```
inline\0NoDefinition\0printArgsNoRet\0
test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c\0printf\0
will not be inlined into \0 because its definition is unavailable\0
```

This is mostly supposed to be used for testing purposes, but it gives us
a 2x reduction in the remark size, and is an incremental change for the
updates to the remarks file format.

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

llvm-svn: 359050

5 years agoImprove -Wuninitialized warning under ARC for block variables that are
Akira Hatanaka [Tue, 23 Apr 2019 23:52:02 +0000 (23:52 +0000)]
Improve -Wuninitialized warning under ARC for block variables that are
recursively captured.

Under ARC, a block variable is zero-initialized when it is recursively
captured by the block literal initializer.

rdar://problem/11022762

llvm-svn: 359049

5 years agoC++ DR2387: a variable template declared wtih (or instantiated with) a
Richard Smith [Tue, 23 Apr 2019 23:48:00 +0000 (23:48 +0000)]
C++ DR2387: a variable template declared wtih (or instantiated with) a
const-qualified type is not implicitly given internal linkage. But a
variable template declared 'static' is.

llvm-svn: 359048

5 years ago[Lint] Permit aliasing noalias readonly arguments
Josh Stone [Tue, 23 Apr 2019 23:43:47 +0000 (23:43 +0000)]
[Lint] Permit aliasing noalias readonly arguments

Summary:
If two arguments are both readonly, then they have no memory dependency
that would violate noalias, even if they do actually overlap.

Reviewers: hfinkel, efriedma

Reviewed By: efriedma

Subscribers: efriedma, hiraditya, llvm-commits, tstellar

Tags: #llvm

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

llvm-svn: 359047

5 years ago[AArch64][GlobalISel] Select G_INTRINSIC_ROUND
Jessica Paquette [Tue, 23 Apr 2019 23:03:03 +0000 (23:03 +0000)]
[AArch64][GlobalISel] Select G_INTRINSIC_ROUND

Add selection support for G_INTRINSIC_ROUND, add a selection test, and add
check lines to arm64-vfloatintrinsics.ll and f16-instructions.ll.

llvm-svn: 359046

5 years ago[libcxx] Use relative path for libc++ library when generating script
Petr Hosek [Tue, 23 Apr 2019 22:55:28 +0000 (22:55 +0000)]
[libcxx] Use relative path for libc++ library when generating script

This addresses the issue introduced in D60309 which leads to linker
scripts being generated with absolute paths.

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

llvm-svn: 359045

5 years ago[AArch64][GlobalISel] Mark G_INTRINSIC_ROUND as a pre-isel floating point opcode
Jessica Paquette [Tue, 23 Apr 2019 22:47:00 +0000 (22:47 +0000)]
[AArch64][GlobalISel] Mark G_INTRINSIC_ROUND as a pre-isel floating point opcode

Add G_INTRINSIC_ROUND to isPreISelGenericFloatingPointOpcode to ensure that its
input and output are assigned the correct register bank.

Add a regbankselect test to verify that we get what we expect here.

llvm-svn: 359044

5 years agoThe error message for mismatched value sites is very cryptic.
Dmitry Mikulin [Tue, 23 Apr 2019 22:26:55 +0000 (22:26 +0000)]
The error message for mismatched value sites is very cryptic.
Make it more readable for an average user.

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

llvm-svn: 359043

5 years ago[CMake] Use add_dependencies in add_llvm_install_targets
Alex Langford [Tue, 23 Apr 2019 21:59:07 +0000 (21:59 +0000)]
[CMake] Use add_dependencies in add_llvm_install_targets

Summary:
The CMake documentation says that the `DEPENDS` field of
add_custom_target is for files and output of custom commands. Adding a
dependency on a target should be done with `add_dependency`.

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

llvm-svn: 359042

5 years ago[CGP] Look through bitcasts when duplicating returns for tail calls
Francis Visoiu Mistrih [Tue, 23 Apr 2019 21:57:46 +0000 (21:57 +0000)]
[CGP] Look through bitcasts when duplicating returns for tail calls

The simple case of:

```
int *callee();
void *caller(void *a) {
  if (a == NULL)
    return callee();
  return a;
}
```

would generate a regular call instead of a tail call because we don't
look through the bitcast of the call to `callee` when duplicating the
return blocks.

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

llvm-svn: 359041

5 years ago[X86] Add codegen prepare test exercising a bitcast + tail call
Francis Visoiu Mistrih [Tue, 23 Apr 2019 21:57:43 +0000 (21:57 +0000)]
[X86] Add codegen prepare test exercising a bitcast + tail call

In preparation of https://reviews.llvm.org/D60837, add this test where
we don't perform a tail call because we don't look through a bitcast.

llvm-svn: 359040

5 years agoMove setTargetAttributes after setGVProperties in SetFunctionAttributes
Scott Linder [Tue, 23 Apr 2019 21:50:11 +0000 (21:50 +0000)]
Move setTargetAttributes after setGVProperties in SetFunctionAttributes

AMDGPU currently relies on global properties being set before
setTargetProperties is called. Existing targets like MIPS which rely on
setTargetProperties do not rely on the current behavior, so this patch
moves the call later in SetFunctionAttributes.

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

llvm-svn: 359039

5 years ago[WebAssembly] Emit br_table for most switch instructions
Heejin Ahn [Tue, 23 Apr 2019 21:30:30 +0000 (21:30 +0000)]
[WebAssembly] Emit br_table for most switch instructions

Summary:
Always convert switches to br_tables unless there is only one case,
which is equivalent to a simple branch. This reduces code size for wasm,
and we defer possible jump table optimizations to the VM.
Addresses PR41502.

Reviewers: kripken, sunfish

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

Tags: #llvm

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

llvm-svn: 359038

5 years ago[analyzer] Fix macro names in diagnostics within bigger macros.
Artem Dergachev [Tue, 23 Apr 2019 21:30:30 +0000 (21:30 +0000)]
[analyzer] Fix macro names in diagnostics within bigger macros.

If macro "CHECK_X(x)" expands to something like "if (x != NULL) ...",
the "Assuming..." note no longer says "Assuming 'x' is equal to CHECK_X".

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

llvm-svn: 359037

5 years ago[WebAssembly] Make LBB markers not affected by test order
Heejin Ahn [Tue, 23 Apr 2019 21:17:03 +0000 (21:17 +0000)]
[WebAssembly] Make LBB markers not affected by test order

Summary:
This way we can change the order of tests or delete some of them without
affecting tests for other functions.

Reviewers: tlively

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

Tags: #llvm

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

llvm-svn: 359036

5 years agoRe-apply r357823 "[Lexer] NFC: Fix an off-by-one bug in getAsCharRange()."
Artem Dergachev [Tue, 23 Apr 2019 21:15:26 +0000 (21:15 +0000)]
Re-apply r357823 "[Lexer] NFC: Fix an off-by-one bug in getAsCharRange()."

It now comes with a follow-up fix for the clients of this API
in clangd and clang-tidy.

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

llvm-svn: 359035

5 years agoRevert "[MS] Emit S_HEAPALLOCSITE debug info" because of ToTWin64(db)
Amy Huang [Tue, 23 Apr 2019 21:12:58 +0000 (21:12 +0000)]
Revert "[MS] Emit S_HEAPALLOCSITE debug info" because of ToTWin64(db)
buildbot failure.

This reverts commit d07d6d617713bececf57f3547434dd52f0f13f9e and
c774f687b6880484a126ed3e3d737e74c926f0ae.

llvm-svn: 359034

5 years ago[AArch64][GlobalISel] Legalize G_INTRINSIC_ROUND
Jessica Paquette [Tue, 23 Apr 2019 21:11:57 +0000 (21:11 +0000)]
[AArch64][GlobalISel] Legalize G_INTRINSIC_ROUND

Add it to the same rule as G_FCEIL etc. Add a legalizer test, and add a missing
switch case to AArch64LegalizerInfo.cpp.

llvm-svn: 359033

5 years ago[MemorySSA] LCSSA preserves MemorySSA.
Alina Sbirlea [Tue, 23 Apr 2019 20:59:44 +0000 (20:59 +0000)]
[MemorySSA] LCSSA preserves MemorySSA.

Summary:
Enabling MemorySSA in the old pass manager leads to MemorySSA being run
twice due to the fact that LCSSA and LoopSimplify do not preserve
MemorySSA. This is the first step to address that: target LCSSA.

LCSSA does not make any changes that invalidate MemorySSA, so it
preserves it by design. It must preserve AA as well, for this to hold.

After this patch, MemorySSA is still run twice in the old pass manager.
Step two follows: target LoopSimplify.

Subscribers: mehdi_amini, jlebar, Prazek, llvm-commits, george.burgess.iv, chandlerc

Tags: #llvm

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

llvm-svn: 359032

5 years ago[X86] Autogenerate complete checks. NFC
Craig Topper [Tue, 23 Apr 2019 20:52:00 +0000 (20:52 +0000)]
[X86] Autogenerate complete checks. NFC

Prep for D60993

llvm-svn: 359031

5 years ago[AArch64][GlobalISel] Actually select G_INTRINSIC_TRUNC
Jessica Paquette [Tue, 23 Apr 2019 20:46:19 +0000 (20:46 +0000)]
[AArch64][GlobalISel] Actually select G_INTRINSIC_TRUNC

Apparently FileCheck wasn't actually matching the fallback check lines in
arm64-vfloatintrinsics.ll properly. So, there were selection fallbacks for
G_INTRINSIC_TRUNC there.

Actually hook it up into AArch64InstructionSelector.cpp and write a proper
selection test.

I guess I'll figure out the FileCheck magic to make the fallback checks work
properly in arm64-vfloatintrinsics.ll.

llvm-svn: 359030

5 years ago[clang-format] Fix bug in reflow of block comments containing CR/LF
Owen Pan [Tue, 23 Apr 2019 20:29:46 +0000 (20:29 +0000)]
[clang-format] Fix bug in reflow of block comments containing CR/LF

Fix PR36119

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

llvm-svn: 359029

5 years agoLock accesses to OptionValueFileSpecList objects
Frederic Riss [Tue, 23 Apr 2019 20:17:04 +0000 (20:17 +0000)]
Lock accesses to OptionValueFileSpecList objects

Before a Debugger gets a Target, target settings are routed to a global set
of settings. Even without this, some part of the LLDB which exist independently
of the Debugger object (the Module cache, the Symbol vendors, ...) access
directly the global default store for those settings.

Of course, if you modify one of those global settings while they are being read,
bad things happen. We see this quite a bit with FileSpecList settings. In
particular, we see many cases where one debug session changes
target.exec-search-paths while another session starts up and it crashes when
one of those accesses invalid FileSpecs.

This patch addresses the specific FileSpecList issue by adding locking to
OptionValueFileSpecList and never returning by reference.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 359028

5 years ago[ObjC][ARC] Check the basic block size before calling
Akira Hatanaka [Tue, 23 Apr 2019 19:49:03 +0000 (19:49 +0000)]
[ObjC][ARC] Check the basic block size before calling
DominatorTree::dominate.

ARC contract pass has an optimization that replaces the uses of the
argument of an ObjC runtime function call with the call result.

For example:

; Before optimization
%1 = tail call i8* @foo1()
%2 = tail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %1)
store i8* %1, i8** @g0, align 8

; After optimization
%1 = tail call i8* @foo1()
%2 = tail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %1)
store i8* %2, i8** @g0, align 8 // %1 is replaced with %2

Before replacing the argument use, DominatorTree::dominate is called to
determine whether the user instruction is dominated by the ObjC runtime
function call instruction. The call to DominatorTree::dominate can be
expensive if the two instructions belong to the same basic block and the
size of the basic block is large. This patch checks the basic block size
and just bails out if the size exceeds the limit set by command line
option "arc-contract-max-bb-size".

rdar://problem/49477063

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

llvm-svn: 359027

5 years agoReapply: "DebugInfo: Emit only one kind of accelerated access/name table""
David Blaikie [Tue, 23 Apr 2019 19:00:45 +0000 (19:00 +0000)]
Reapply: "DebugInfo: Emit only one kind of accelerated access/name table""

Originally committed in r358931
Reverted in r358997

Seems this change made Apple accelerator tables miss names (because
names started respecting the CU NameTableKind GNU & assuming that
shouldn't produce accelerated names too), which is never correct (apple
accelerator tables don't have separators or CU lists - if present, they
must describe all names in all CUs).

Original Description:
Currently to opt in to debug_names in DWARFv5, the IR must contain
'nameTableKind: Default' which also enables debug_pubnames.

Instead, only allow one of {debug_names, apple_names, debug_pubnames,
debug_gnu_pubnames}.

nameTableKind: Default gives debug_names in DWARFv5 and greater,
debug_pubnames in v4 and earlier - and apple_names when tuning for lldb
on MachO.
nameTableKind: GNU always gives gnu_pubnames

llvm-svn: 359026

5 years ago[ThinLTO] Pass down opt level to LTO backend and handle -O0 LTO in new PM
Teresa Johnson [Tue, 23 Apr 2019 18:56:19 +0000 (18:56 +0000)]
[ThinLTO] Pass down opt level to LTO backend and handle -O0 LTO in new PM

Summary:
The opt level was not being passed down to the ThinLTO backend when
invoked via clang (for distributed ThinLTO).

This exposed an issue where the new PM was asserting if the Thin or
regular LTO backend pipelines were invoked with -O0 (not a new issue,
could be provoked by invoking in-process *LTO backends via linker using
new PM and -O0). Fix this similar to the old PM where -O0 only does the
necessary lowering of type metadata (WPD and LowerTypeTest passes) and
then quits, rather than asserting.

Reviewers: xur

Subscribers: mehdi_amini, inglorion, eraman, hiraditya, steven_wu, dexonsmith, cfe-commits, llvm-commits, pcc

Tags: #clang, #llvm

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

llvm-svn: 359025

5 years agollvm-cvtres: Split addChild(ID) into two functions
Nico Weber [Tue, 23 Apr 2019 18:46:53 +0000 (18:46 +0000)]
llvm-cvtres: Split addChild(ID) into two functions

Before, there was an IsData parameter. Now, there are two different
functions for data nodes and ID nodes. No behavior change, needed for a
follow-up change to make two data nodes (but not two ID nodes) with the
same ID an error.

For consistency, rename another addChild() overload to addNameChild().

llvm-svn: 359024

5 years agoFix namespace name conflict with GCC
Eric Fiselier [Tue, 23 Apr 2019 18:23:33 +0000 (18:23 +0000)]
Fix namespace name conflict with GCC

llvm-svn: 359023

5 years ago[AArch64][GlobalISel] Teach regbankselect about G_INTRINSIC_TRUNC
Jessica Paquette [Tue, 23 Apr 2019 18:20:47 +0000 (18:20 +0000)]
[AArch64][GlobalISel] Teach regbankselect about G_INTRINSIC_TRUNC

Add it to isPreISelGenericFloatingPointOpcode, and add a regbankselect test.

Update arm64-vfloatintrinsics.ll now that we can select it.

llvm-svn: 359022

5 years ago[AArch64][GlobalISel] Legalize G_INTRINSIC_TRUNC
Jessica Paquette [Tue, 23 Apr 2019 18:20:44 +0000 (18:20 +0000)]
[AArch64][GlobalISel] Legalize G_INTRINSIC_TRUNC

Same patch as G_FCEIL etc.

Add the missing switch case in widenScalar, add G_INTRINSIC_TRUNC to the correct
rule in AArch64LegalizerInfo.cpp, and add a test.

llvm-svn: 359021

5 years agoFix implementation of ::abs and std::abs LWG 2192.
Eric Fiselier [Tue, 23 Apr 2019 18:01:58 +0000 (18:01 +0000)]
Fix implementation of ::abs and std::abs LWG 2192.

Summary:
All overloads of `::abs` and `std::abs` must be present in both `<cmath>` and `<cstdlib>`. This is problematic to implement because C defines `fabs` in `math.h` and `labs` in `stdlib.h`. This introduces a circular dependency between the two headers.

This patch implements that requirement by moving `abs` into `math.h` and making `stdlib.h` include `math.h`. In order to get the underlying C declarations from the "real" `stdlib.h` inside our `math.h` we need some trickery. Specifically we need to make `stdlib.h` include next itself.

Suggestions for a cleaner implementation are welcome.

Reviewers: mclow.lists, ldionne

Reviewed By: ldionne

Subscribers: krytarowski, fedor.sergeev, dexonsmith, jdoerfert, jsji, libcxx-commits

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

llvm-svn: 359020

5 years ago[ConstantRange] Add urem support
Nikita Popov [Tue, 23 Apr 2019 18:00:17 +0000 (18:00 +0000)]
[ConstantRange] Add urem support

Add urem support to ConstantRange, so we can handle in in LVI. This
is an approximate implementation that tries to capture the most useful
conditions: If the LHS is always strictly smaller than the RHS, then
the urem is a no-op and the result is the same as the LHS range.
Otherwise the lower bound is zero and the upper bound is
min(LHSMax, RHSMax - 1).

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

llvm-svn: 359019

5 years ago[ConstantRangeTest] Move helper methods; NFC
Nikita Popov [Tue, 23 Apr 2019 18:00:02 +0000 (18:00 +0000)]
[ConstantRangeTest] Move helper methods; NFC

Move Test(Unsigned|Signed)BinOpExhaustive() towards the top of the
file, so they're easier to reuse.

llvm-svn: 359018

5 years ago[AMDGPU] Fixed addReg() in SIOptimizeExecMaskingPreRA.cpp
Stanislav Mekhanoshin [Tue, 23 Apr 2019 17:59:26 +0000 (17:59 +0000)]
[AMDGPU] Fixed addReg() in SIOptimizeExecMaskingPreRA.cpp

The second argument is flags, not subreg.

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

llvm-svn: 359017

5 years ago[Reproducers] Limit logging to calls that cross the API boundary.
Jonas Devlieghere [Tue, 23 Apr 2019 17:44:40 +0000 (17:44 +0000)]
[Reproducers] Limit logging to calls that cross the API boundary.

We recently moved API logging into the instrumentation macros. This made
that logging is now consistent and abstracted behind a macro for every
API functions, independent of the reproducers. It also means we have a
lot more output. While this is a good thing, it also meant a lot more
noise in the log, from things that aren't always equally interesting,
such as the copy constructor for example.

To improve usability, we should increase the signal-to-noise ratio. I
propose to achieve this by only logging API functions that cross the API
boundary. This is a divergence of what we had before, where a select
number of functions were logged, irregardless of the API boundary, a
concept that was introduced for the reproducers. However, I believe this
is in line with the purpose of the API log.

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

llvm-svn: 359016

5 years ago[AArch64][GlobalISel] Legalize G_FMA for more vector types
Jessica Paquette [Tue, 23 Apr 2019 17:37:56 +0000 (17:37 +0000)]
[AArch64][GlobalISel] Legalize G_FMA for more vector types

Same as G_FCEIL, G_FABS, etc. Just move it into that rule.

Add a legalizer test for G_FMA, which we didn't have before and update
arm64-vfloatintrinsics.ll.

llvm-svn: 359015

5 years ago[AliasAnalysis] AAResults preserves AAManager.
Alina Sbirlea [Tue, 23 Apr 2019 17:21:18 +0000 (17:21 +0000)]
[AliasAnalysis] AAResults preserves AAManager.

Summary:
AAResults should not invalidate AAManager.
Update tests.

Reviewers: chandlerc

Subscribers: mehdi_amini, jlebar, llvm-commits

Tags: #llvm

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

llvm-svn: 359014

5 years ago[AArch64][GlobalISel] Add G_FMA to isPreISelGenericFloatingPointOpcode
Jessica Paquette [Tue, 23 Apr 2019 17:17:06 +0000 (17:17 +0000)]
[AArch64][GlobalISel] Add G_FMA to isPreISelGenericFloatingPointOpcode

Noticed an unnecessary fallback in arm64-vmul caused by this.

Also add a regbankselect test for G_FMA.

llvm-svn: 359013

5 years ago[APSInt][OpenMP] Fix isNegative, etc. for unsigned types
Joel E. Denny [Tue, 23 Apr 2019 17:04:15 +0000 (17:04 +0000)]
[APSInt][OpenMP] Fix isNegative, etc. for unsigned types

Without this patch, APSInt inherits APInt::isNegative, which merely
checks the sign bit without regard to whether the type is actually
signed.  isNonNegative and isStrictlyPositive call isNegative and so
are also affected.

This patch adjusts APSInt to override isNegative, isNonNegative, and
isStrictlyPositive with implementations that consider whether the type
is signed.

A large set of Clang OpenMP tests are affected.  Without this patch,
these tests assume that `true` is not a valid argument for clauses
like `collapse`.  Indeed, `true` fails APInt::isStrictlyPositive but
not APSInt::isStrictlyPositive.  This patch adjusts those tests to
assume `true` should be accepted.

This patch also adds tests revealing various other similar fixes due
to APSInt::isNegative calls in Clang's ExprConstant.cpp and
SemaExpr.cpp: `++` and `--` overflow in `constexpr`, evaluated object
size based on `alloc_size`, `<<` and `>>` shift count validation, and
OpenMP array section validation.

Reviewed By: lebedev.ri, ABataev, hfinkel

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

llvm-svn: 359012

5 years agoRevert "[EditLineTest] Not always TERM is available, e.g. on some bots."
Davide Italiano [Tue, 23 Apr 2019 16:51:20 +0000 (16:51 +0000)]
Revert "[EditLineTest] Not always TERM is available, e.g. on some bots."

This was a speculative fix trying to placate some bots, but it's
ultimately just a bot configuration problem and not a code problem.

llvm-svn: 359011

5 years ago[dsymutil] Put Swift interface files into a per-arch subdirectory.
Adrian Prantl [Tue, 23 Apr 2019 16:42:35 +0000 (16:42 +0000)]
[dsymutil] Put Swift interface files into a per-arch subdirectory.

This was meant to be part of the original commit r358921, but somehow
got lost.

<rdar://problem/49751748>

llvm-svn: 359010

5 years agoMS ABI: Support mangling op<=> now that MSVC 2019 has a mangling
Nico Weber [Tue, 23 Apr 2019 16:37:42 +0000 (16:37 +0000)]
MS ABI: Support mangling op<=> now that MSVC 2019 has a mangling

llvm-svn: 359009

5 years ago[x86] fix test checks for fdiv combine; NFC
Sanjay Patel [Tue, 23 Apr 2019 16:31:30 +0000 (16:31 +0000)]
[x86] fix test checks for fdiv combine; NFC

Must have picked up some transient code changes when originally generating this.

llvm-svn: 359008

5 years agollvm-undname: Support demangling the spaceship operator
Nico Weber [Tue, 23 Apr 2019 16:20:27 +0000 (16:20 +0000)]
llvm-undname: Support demangling the spaceship operator

Also add a test for demanling the co_await operator.

llvm-svn: 359007

5 years ago[x86] add tests for vector fdiv with splat divisor; NFC
Sanjay Patel [Tue, 23 Apr 2019 16:16:16 +0000 (16:16 +0000)]
[x86] add tests for vector fdiv with splat divisor; NFC

llvm-svn: 359006

5 years ago[Docs] Add missing leading slash
Jonas Devlieghere [Tue, 23 Apr 2019 16:00:43 +0000 (16:00 +0000)]
[Docs] Add missing leading slash

llvm-svn: 359005

5 years ago[Docs] Add 301 redirects for old URLs
Jonas Devlieghere [Tue, 23 Apr 2019 15:57:47 +0000 (15:57 +0000)]
[Docs] Add 301 redirects for old URLs

llvm-svn: 359004

5 years ago[dsymutil] Fix use-after-free when sys::path::append grows the buffer.
Adrian Prantl [Tue, 23 Apr 2019 15:44:22 +0000 (15:44 +0000)]
[dsymutil] Fix use-after-free when sys::path::append grows the buffer.

<rdar://problem/50117620>

llvm-svn: 359003

5 years agoRevert "[dsymutil] Fix use-after-free when sys::path::append grows the buffer."
Adrian Prantl [Tue, 23 Apr 2019 15:44:19 +0000 (15:44 +0000)]
Revert "[dsymutil] Fix use-after-free when sys::path::append grows the buffer."

llvm-svn: 359002

5 years ago[dsymutil] Fix use-after-free when sys::path::append grows the buffer.
Adrian Prantl [Tue, 23 Apr 2019 15:39:13 +0000 (15:39 +0000)]
[dsymutil] Fix use-after-free when sys::path::append grows the buffer.

<rdar://problem/50117620>

llvm-svn: 359001

5 years ago[InstCombine] Convert a masked.load of a dereferenceable address to an unconditional...
Philip Reames [Tue, 23 Apr 2019 15:25:14 +0000 (15:25 +0000)]
[InstCombine] Convert a masked.load of a dereferenceable address to an unconditional load

If we have a masked.load from a location we know to be dereferenceable, we can simply issue a speculative unconditional load against that address. The key advantage is that it produces IR which is well understood by the optimizer. The select (cnd, load, passthrough) form produced should be pattern matchable back to hardware predication if profitable.

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

llvm-svn: 359000

5 years ago[x86] use psubus for more vsetcc lowering (PR39859)
Sanjay Patel [Tue, 23 Apr 2019 15:20:17 +0000 (15:20 +0000)]
[x86] use psubus for more vsetcc lowering (PR39859)

Circling back to a leftover bit from PR39859:
https://bugs.llvm.org/show_bug.cgi?id=39859#c1

...we have this counter-intuitive (based on the test diffs) opportunity to use 'psubus'.
This appears to be the better perf option for both Haswell and Jaguar based on llvm-mca.
We already do this transform for the SETULT predicate, so this makes the code more
symmetrical too. If we have pminub/pminuw, we prefer those, so this should not affect
anything but pre-SSE4.1 subtargets.

  $ cat before.s
movdqa -16(%rip), %xmm2    ## xmm2 = [32768,32768,32768,32768,32768,32768,32768,32768]
pxor %xmm0, %xmm2
pcmpgtw -32(%rip), %xmm2 ## xmm2 = [255,255,255,255,255,255,255,255]
pand %xmm2, %xmm0
pandn %xmm1, %xmm2
por %xmm2, %xmm0

  $ cat after.s
movdqa -16(%rip), %xmm2    ## xmm2 = [256,256,256,256,256,256,256,256]
psubusw %xmm0, %xmm2
pxor %xmm3, %xmm3
pcmpeqw %xmm2, %xmm3
pand %xmm3, %xmm0
pandn %xmm1, %xmm3
por %xmm3, %xmm0

  $ llvm-mca before.s -mcpu=haswell
  Iterations:        100
  Instructions:      600
  Total Cycles:      909
  Total uOps:        700

  Dispatch Width:    4
  uOps Per Cycle:    0.77
  IPC:               0.66
  Block RThroughput: 1.8

  $ llvm-mca after.s -mcpu=haswell
  Iterations:        100
  Instructions:      700
  Total Cycles:      409
  Total uOps:        700

  Dispatch Width:    4
  uOps Per Cycle:    1.71
  IPC:               1.71
  Block RThroughput: 1.8

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

llvm-svn: 358999

5 years ago[SPARC] Use the correct register set for the "r" asm constraint.
Joerg Sonnenberger [Tue, 23 Apr 2019 15:15:33 +0000 (15:15 +0000)]
[SPARC] Use the correct register set for the "r" asm constraint.

64bit mode must use 64bit registers, otherwise assumptions about the top
half of the registers are made. Problem found by Takeshi Nakayama in
NetBSD.

llvm-svn: 358998

5 years agoRevert "DebugInfo: Emit only one kind of accelerated access/name table"
David Blaikie [Tue, 23 Apr 2019 15:03:24 +0000 (15:03 +0000)]
Revert "DebugInfo: Emit only one kind of accelerated access/name table"

Regresses some apple_names situations - still investigating.

This reverts commit r358931.

llvm-svn: 358997

5 years agoUse llvm::stable_sort
Fangrui Song [Tue, 23 Apr 2019 14:51:27 +0000 (14:51 +0000)]
Use llvm::stable_sort

While touching the code, simplify if feasible.

llvm-svn: 358996

5 years ago[WebAssembly] Fix typo in relocation checking
Sam Clegg [Tue, 23 Apr 2019 14:49:38 +0000 (14:49 +0000)]
[WebAssembly] Fix typo in relocation checking

Runtime relocation are generated for relocations of type
R_WASM_MEMORY_ADDR_I32 when in PIC mode (either -shared or -pie).

Followup on https://reviews.llvm.org/D60882.

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

llvm-svn: 358995

5 years ago[RISCV] Support assembling %tls_{ie,gd}_pcrel_hi modifiers
Lewis Revill [Tue, 23 Apr 2019 14:46:13 +0000 (14:46 +0000)]
[RISCV] Support assembling %tls_{ie,gd}_pcrel_hi modifiers

This patch adds support for parsing and assembling the %tls_ie_pcrel_hi
and %tls_gd_pcrel_hi modifiers.

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

llvm-svn: 358994

5 years agogn build: Merge r358944
Nico Weber [Tue, 23 Apr 2019 14:32:18 +0000 (14:32 +0000)]
gn build: Merge r358944

llvm-svn: 358993

5 years ago[AMDGPU] Fix hidden argument metadata duplication for V3
Scott Linder [Tue, 23 Apr 2019 14:31:17 +0000 (14:31 +0000)]
[AMDGPU] Fix hidden argument metadata duplication for V3

Essentially complete a proper rebase of the V3 metadata change over
https://reviews.llvm.org/D49096.

Minimize the diff between the V2 and V3 variants of the relevant lit
tests, and clean up some trailing whitespace.

llvm-svn: 358992

5 years agogn build: Merge r358949
Nico Weber [Tue, 23 Apr 2019 14:31:15 +0000 (14:31 +0000)]
gn build: Merge r358949

llvm-svn: 358991

5 years ago[LLD][ELF] - Remove dynamic-section-sh_size.elf binary, convert test to yaml. NFCI.
George Rimar [Tue, 23 Apr 2019 14:21:31 +0000 (14:21 +0000)]
[LLD][ELF] - Remove dynamic-section-sh_size.elf binary, convert test to yaml. NFCI.

dynamic-section-sh_size.elf was introduced in D25090.
Now it is possible to use yaml2obj instead.
That is what this patch does.

Also I added one more case of a possibly broken .dynamic
section just in case.

llvm-svn: 358990

5 years ago[X86] Pull out collectConcatOps helper. NFCI.
Simon Pilgrim [Tue, 23 Apr 2019 14:07:49 +0000 (14:07 +0000)]
[X86] Pull out collectConcatOps helper. NFCI.

Create collectConcatOps helper that returns all the subvector ops for CONCAT_VECTORS or a INSERT_SUBVECTOR series.

llvm-svn: 358989

5 years ago[libc++] Remove redundant conditionals for Apple platforms
Louis Dionne [Tue, 23 Apr 2019 14:05:04 +0000 (14:05 +0000)]
[libc++] Remove redundant conditionals for Apple platforms

Summary:
In a bunch of places, we used to check whether LIBCXX_BUILDING_LIBCXXABI
is defined OR we're building for an Apple platform. This used to
be necessary in a time when Apple's build script did NOT define
LIBCXX_BUILDING_LIBCXXABI. However this is not relevant anymore
since Apple's build does define LIBCXX_BUILDING_LIBCXXABI.

Reviewers: EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

llvm-svn: 358988

5 years agoARM: disallow add/sub to sp unless Rn is also sp.
Tim Northover [Tue, 23 Apr 2019 13:50:13 +0000 (13:50 +0000)]
ARM: disallow add/sub to sp unless Rn is also sp.

The manual says that Thumb2 add/sub instructions are only allowed to modify sp
if the first source is also sp. This is slightly different from the usual rGPR
restriction since it's context-sensitive, so implement it in C++.

llvm-svn: 358987

5 years ago[Docs] ReleaseNotes: fixup markup in memcmp()->bcmp() entry
Roman Lebedev [Tue, 23 Apr 2019 13:46:18 +0000 (13:46 +0000)]
[Docs] ReleaseNotes: fixup markup in memcmp()->bcmp() entry

llvm-svn: 358986

5 years ago[LLD][ELF] - Remove file-class.a binary from inputs and improve the test case.
George Rimar [Tue, 23 Apr 2019 13:27:54 +0000 (13:27 +0000)]
[LLD][ELF] - Remove file-class.a binary from inputs and improve the test case.

file-class.a was used to diagnose the "corrupted ELF file: invalid file class"
error when the object was fetched from the archive.

file-class.a contained an object of 16 bytes size. I replaced it with
an echo call (because it is impossible to use yaml2obj for that, and I am
not sure it is worth to support), and also increased its size to 18 bytes.
That allowed to also test a case when such object is a regular input and not an
archive member (we have a bit different logic for these cases).

llvm-svn: 358985

5 years ago[DAGCombiner] generalize binop-of-splats scalarization
Sanjay Patel [Tue, 23 Apr 2019 13:16:41 +0000 (13:16 +0000)]
[DAGCombiner] generalize binop-of-splats scalarization

If we only match build vectors, we can miss some patterns
that use shuffles as seen in the affected tests.

Note that the underlying calls within getSplatSourceVector()
have the potential for compile-time explosion because of
exponential recursion looking through binop opcodes, but
currently the list of supported opcodes is very limited.
Both of those problems should be addressed in follow-up
patches.

llvm-svn: 358984

5 years agoAMDGPU: Fix LCSSA phi lowering in SILowerI1Copies
Nicolai Haehnle [Tue, 23 Apr 2019 13:12:52 +0000 (13:12 +0000)]
AMDGPU: Fix LCSSA phi lowering in SILowerI1Copies

Summary:
When an LCSSA phi survives through instruction selection, the pass
ends up removing that phi entirely because it is dominated by the
logic that does the lanemask merging.

This then used to trigger an assertion when processing a dependent
phi instruction.

Change-Id: Id4949719f8298062fe476a25718acccc109113b6

Reviewers: llvm-commits

Subscribers: kzhuravl, jvesely, wdng, yaxunl, t-tye, tpr, dstuttard, rtaylor, arsenm

Tags: #llvm

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

llvm-svn: 358983