platform/upstream/llvm.git
5 years ago[OPENMP]Fix crash for the ordered(n) clause.
Alexey Bataev [Thu, 14 Mar 2019 20:36:00 +0000 (20:36 +0000)]
[OPENMP]Fix crash for the ordered(n) clause.

If the doacross lop construct is used and the loop counter is declare
outside of the loop, the compiler might crash trying to get the address
of the loop counter. Patch fixes this problem.

llvm-svn: 356198

5 years agoReland part of "Add AIX Target Info"
Jason Liu [Thu, 14 Mar 2019 20:27:39 +0000 (20:27 +0000)]
Reland part of "Add AIX Target Info"

This patch reland the test case max_align.c which is failing at
Windows and PS4 platform in the previous commit.

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

original llvm-svn: 356060

llvm-svn: 356197

5 years ago[CodeGen] Consider tied operands when adjusting inline asm operands.
Eli Friedman [Thu, 14 Mar 2019 19:46:51 +0000 (19:46 +0000)]
[CodeGen] Consider tied operands when adjusting inline asm operands.

The constraint "0" in the following asm did not consider the its
relationship with "=y" when try to replace the type of the operands.

asm ("nop" : "=y"(Mu8_1 ) : "0"(Mu8_0 ));

Patch by Xiang Zhang.

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

llvm-svn: 356196

5 years ago[InstCombine] remove duplicate tests
Sanjay Patel [Thu, 14 Mar 2019 19:41:21 +0000 (19:41 +0000)]
[InstCombine] remove duplicate tests

These got accidentally doubled with rL356191.

llvm-svn: 356195

5 years ago[pstl] By default, disable the parallel policies
Louis Dionne [Thu, 14 Mar 2019 19:33:58 +0000 (19:33 +0000)]
[pstl] By default, disable the parallel policies

Since we don't have any non-trivial PSTL backend that doesn't require
TBB yet, enabling the parallel policies by default breaks people that
try to build all of LLVM without having an installation of TBB. Since
this is unacceptable, parallel policies are disabled by default.

We can re-enable it once we have a backend that does not require anything
beyond what C++ already requires. For example, we could have a simple
backend that uses std::thread by default or something along those lines,
with the understanding that vendors would use their own (more efficient)
backend.

llvm-svn: 356194

5 years agoHandle consecutive-double-quotes in Windows argument parsing
Sunil Srivastava [Thu, 14 Mar 2019 19:26:04 +0000 (19:26 +0000)]
Handle consecutive-double-quotes in Windows argument parsing

Windows command line argument processing treats consecutive double quotes
as a single double-quote. This patch implements this functionality.

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

llvm-svn: 356193

5 years ago[InstCombine] canonicalize funnel shift constant shift amount to be modulo bitwidth
Sanjay Patel [Thu, 14 Mar 2019 19:22:08 +0000 (19:22 +0000)]
[InstCombine] canonicalize funnel shift constant shift amount to be modulo bitwidth

The shift argument is defined to be modulo the bitwidth, so if that argument
is a constant, we can always reduce the constant to its minimal form to allow
better CSE and other follow-on transforms.

We need to be careful to ignore constant expressions here, or we will likely
infinite loop. I'm adding a general vector constant query for that case.

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

llvm-svn: 356192

5 years ago[InstCombine] add tests for funnel shift constant shift amount mod bitwidth; NFC
Sanjay Patel [Thu, 14 Mar 2019 19:22:00 +0000 (19:22 +0000)]
[InstCombine] add tests for funnel shift constant shift amount mod bitwidth; NFC

llvm-svn: 356191

5 years agoReturn llvm::Error and llvm::Expected from DWARF parsing code.
Zachary Turner [Thu, 14 Mar 2019 19:05:55 +0000 (19:05 +0000)]
Return llvm::Error and llvm::Expected from DWARF parsing code.

The goal here is to improve our error handling and error recovery while
parsing DWARF, while at the same time getting us closer to being able to
merge LLDB's DWARF parser with LLVM's. To this end, I've udpated several
of the low-level parsing functions in LLDB to return llvm::Error and
llvm::Expected.

For now, this only updates LLDB parsing functions and not LLVM. In some
ways, this actually gets us *farther* from parity with the two
interfaces, because prior to this patch, at least the parsing interfaces
were the same (i.e. they all just returned bools, and now with this
patch they're diverging). But, I chose to do this for two primary
reasons.

LLDB has error logging code engrained deep within some of its parsing
functions. We don't want to lose this logging information, but obviously
LLVM has no logging mechanism at all. So if we're to merge the
interfaces, we have to find a way to still allow LLDB to properly report
parsing errors while not having the reporting code be inside of LLVM.
LLDB (and indeed, LLVM) overload the meaning of the false return value
from all of these extraction functions to mean both "We reached the null
entry at the end of a list of items, therefore everything was
successful" as well as "something bad and unrecoverable happened during
parsing". So you would have a lot code that would do something like:
while (foo.extract(...)) {
  ...
}

But when the loop stops, why did it stop? Did it stop because it
finished parsing, or because there was an error? Because of this, in
some cases we don't always know whether it is ok to proceed, or how to
proceed, but we were doing it anyway.

In this patch, I solve the second problem by introducing an
enumeration called DWARFEnumState which has two values MoreItems and
Complete. Both of these indicate success, but the latter indicates
that we reached the null entry. Then, I return this value instead of
bool, and convey parsing failure separately.

To solve the first problem (and convey parsing failure) these
functions now return either llvm::Error or llvm::Expected<DWARFEnumState>.
Having this extra bit of information allows us to properly convey all 3 of
"error, bail out", "success, call this function again", and "success,
don't call this function again".

In subsequent patches I plan to extend this pattern to the rest of the
parsing interfaces, which will ultimately get all of the log statements
and error reporting out of the low level parsing code and into the high
level parsing code (e.g. SymbolFileDWARF, DWARFASTParserClang, etc).

Eventually, these same changes will have to be backported to LLVM's
DWARF parser, but diverging in the short term is the easiest way to
converge in the long term.

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

llvm-svn: 356190

5 years ago[MemorySSA] Remove redundant walker assignment [NFC].
Alina Sbirlea [Thu, 14 Mar 2019 18:45:17 +0000 (18:45 +0000)]
[MemorySSA] Remove redundant walker assignment [NFC].

Subscribers: llvm-commits
llvm-svn: 356189

5 years ago[LLD][COFF] Add /summary to print statistics
Alexandre Ganea [Thu, 14 Mar 2019 18:45:08 +0000 (18:45 +0000)]
[LLD][COFF] Add /summary to print statistics

/summary prints information about the data (OBJ/LIB/PDB) processed by LLD. The goal is have an estimate about the inputs and outputs, to better understand where the timings go.

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

llvm-svn: 356188

5 years ago[Sema] Fix a use-after-free of a _Nonnull ParsedAttr
Erik Pilkington [Thu, 14 Mar 2019 18:38:02 +0000 (18:38 +0000)]
[Sema] Fix a use-after-free of a _Nonnull ParsedAttr

We were allocating the implicit attribute in the declarator's attribute pool,
but putting into the declaration specifier's ParsedAttributesView. If there are
multiple declarators, then we'll use the attribute from the declaration
specifier after clearing out the declarators attribute pool. Fix this by
allocating the attribute in the declaration specifier's pool.

rdar://48529718

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

llvm-svn: 356187

5 years agoMake a hack for LTO work only when you are actually doing LTO.
Rui Ueyama [Thu, 14 Mar 2019 18:21:32 +0000 (18:21 +0000)]
Make a hack for LTO work only when you are actually doing LTO.

We allow an archive file without symbol table as a linker input as a
workaround for a very common error in LTO build. But that logic worked
even for an archive file containing non-bitcode files, which is not
expected. This patch limits that workaround to one that contains only
bitcode files.

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

llvm-svn: 356186

5 years agoAdd PragmaHandler for MSVC pragma execution_character_set
Reid Kleckner [Thu, 14 Mar 2019 18:12:17 +0000 (18:12 +0000)]
Add PragmaHandler for MSVC pragma execution_character_set

__pragma(execution_character_set(push, "UTF-8")) is used in
TraceLoggingProvider.h. This commit implements a no-op handler for
compatability, similar to how the flag -fexec_charset is handled.

Patch by Matt Gardner!

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

llvm-svn: 356185

5 years ago[Tests] Add tests to demonstrate hoisting of unordered invariant loads
Philip Reames [Thu, 14 Mar 2019 18:06:15 +0000 (18:06 +0000)]
[Tests] Add tests to demonstrate hoisting of unordered invariant loads

llvm-svn: 356184

5 years ago[Tests] Revert an accident change to a test
Philip Reames [Thu, 14 Mar 2019 18:02:19 +0000 (18:02 +0000)]
[Tests] Revert an accident change to a test

llvm-svn: 356183

5 years ago[GlobalISel][AArch64] Add partial selection support for G_INSERT_VECTOR_ELT
Jessica Paquette [Thu, 14 Mar 2019 18:01:30 +0000 (18:01 +0000)]
[GlobalISel][AArch64] Add partial selection support for G_INSERT_VECTOR_ELT

This adds support for inserting elements into packed vectors. It also adds
two tests: one for selection, and one for regbank select.

Unpacked vectors will come in a follow-up.

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

llvm-svn: 356182

5 years agoAuto-generate an existing test to make it easier to update
Philip Reames [Thu, 14 Mar 2019 17:59:59 +0000 (17:59 +0000)]
Auto-generate an existing test to make it easier to update

llvm-svn: 356181

5 years ago[ARC] Better classify add/sub immediate instructions in frame lowering.
Pete Couperus [Thu, 14 Mar 2019 17:50:46 +0000 (17:50 +0000)]
[ARC] Better classify add/sub immediate instructions in frame lowering.

Summary:
Some operations have multiple ARC instructions that are applicable.
For instance, "add r0, r0, 123" can be encoded as a "LImm" instruction
with a 32-bit immediate (8-bytes), or as a signed 12-bit immediate instruction
for the case where the source and destination register are the same (4-bytes).
The ARC assembler will choose the shortest encoding, but we should track
the correct instruction in the compiler.
This patch fixes the instruction used in some cases from ARCFrameLowering.

Subscribers: hiraditya, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 356179

5 years agoSpeeding up llvm-cov export with multithreaded renderFiles implementation.
Max Moroz [Thu, 14 Mar 2019 17:49:27 +0000 (17:49 +0000)]
Speeding up llvm-cov export with multithreaded renderFiles implementation.

Summary:
CoverageExporterJson::renderFiles accounts for most of the execution time given a large profdata file with multiple binaries.

Proposed solution is to generate JSON for each file in parallel and sort at the end to preserve deterministic output. Also added flags to skip generating parts of the output to trim the output size.

Patch by Sajjad Mirza (@sajjadm).

Reviewers: Dor1s, vsk

Reviewed By: Dor1s, vsk

Subscribers: liaoyuke, mgrang, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 356178

5 years agoReorg the midpoint pointer test into runtime and constexpr tests; comment out the...
Marshall Clow [Thu, 14 Mar 2019 17:43:41 +0000 (17:43 +0000)]
Reorg the midpoint pointer test into runtime and constexpr tests; comment out the volatile constexpr tests for GCC because our experimental gcc bot barfs on them.

llvm-svn: 356177

5 years ago[DataFormatters] Delete unused code. Not even exposed in the API.
Davide Italiano [Thu, 14 Mar 2019 17:41:29 +0000 (17:41 +0000)]
[DataFormatters] Delete unused code. Not even exposed in the API.

I stumbled upon this while removing LLDB_DISABLE_PYTHON when
not needed.

llvm-svn: 356176

5 years ago[InstCombine] add tests for funnel shift constant shift amount mod bitwidth; NFC
Sanjay Patel [Thu, 14 Mar 2019 17:39:40 +0000 (17:39 +0000)]
[InstCombine] add tests for funnel shift constant shift amount mod bitwidth; NFC

llvm-svn: 356175

5 years agoSafer casting in ClangExpressionParser code completion
Raphael Isemann [Thu, 14 Mar 2019 17:39:39 +0000 (17:39 +0000)]
Safer casting in ClangExpressionParser code completion

Summary:
Makes the code a bit safer in the unlikely situation that we don't get a ClangUserExpression
when doing code completion.

Reviewers: aprantl, jingham

Reviewed By: aprantl

Subscribers: labath, jdoerfert, lldb-commits

Tags: #lldb

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

llvm-svn: 356174

5 years ago[Tests] Add tests for reordering of unordered atomics on invariant locations
Philip Reames [Thu, 14 Mar 2019 17:36:58 +0000 (17:36 +0000)]
[Tests] Add tests for reordering of unordered atomics on invariant locations

llvm-svn: 356172

5 years ago[Python] Start eradicating unneeded LLDB_DISABLE_PYTHON guards.
Davide Italiano [Thu, 14 Mar 2019 17:23:08 +0000 (17:23 +0000)]
[Python] Start eradicating unneeded LLDB_DISABLE_PYTHON guards.

While we don't have a bot, I'm testing by hand that this configuration
compiles. We'll probably set up one once I'm done flensing.

llvm-svn: 356171

5 years agoAllow code motion (and thus folding) for atomic (but unordered) memory operands
Philip Reames [Thu, 14 Mar 2019 17:20:59 +0000 (17:20 +0000)]
Allow code motion (and thus folding) for atomic (but unordered) memory operands

Building on the work done in D57601, now that we can distinguish between atomic and volatile memory accesses, go ahead and allow code motion of unordered atomics. As seen in the diffs, this allows much better folding of memory operations into using instructions. (Mostly done by the PeepholeOpt pass.)

Note: I have not reviewed all callers of hasOrderedMemoryRef since one of them - isSafeToMove - is very widely used. I'm relying on the documented semantics of each method to judge correctness.

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

llvm-svn: 356170

5 years agoFix two of the three bot failures for midpoint; the ones regarding the lack of '__int...
Marshall Clow [Thu, 14 Mar 2019 17:20:02 +0000 (17:20 +0000)]
Fix two of the three bot failures for midpoint; the ones regarding the lack of '__int128_t'

llvm-svn: 356169

5 years ago[Reproducers] Fix data race found by tsan
Jonas Devlieghere [Thu, 14 Mar 2019 17:19:34 +0000 (17:19 +0000)]
[Reproducers] Fix data race found by tsan

This fixes a data race uncovered by tsan during destruction of the
GDBRemoteReplay server. The solution is to lock the thread state mutex
when receiving packets.

llvm-svn: 356168

5 years ago[libc++][CMake] Do not define `cxx_shared_EXPORTS` when building the shared library
Louis Dionne [Thu, 14 Mar 2019 17:15:47 +0000 (17:15 +0000)]
[libc++][CMake] Do not define `cxx_shared_EXPORTS` when building the shared library

CMake will define -Dcxx_shared_EXPORTS when building the shared library
by default. In theory, this is used to signal to the library that we're
building a shared library and that dllimport/dllexport should be used.
However, we already have our own way of doing that, so I'm removing this
define to avoid meaningless command line arguments in the build.

llvm-svn: 356167

5 years ago[HWASan] Use less Printf() calls in register dump.
Mitch Phillips [Thu, 14 Mar 2019 17:05:53 +0000 (17:05 +0000)]
[HWASan] Use less Printf() calls in register dump.

Summary:
Explicitly print 4 registers/line in each iteration during register
dump. Reduces logcat spam as we get a single logcat message per call to
Printf(), even if the output isn't newline-terminated. This brings the
output format in logcat closer to that of the normal textual dump.

Reviewers: eugenis, pcc

Reviewed By: pcc

Subscribers: kubamracek, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 356166

5 years ago[Tests] Add negative folding tests w/fences as requested in D59345
Philip Reames [Thu, 14 Mar 2019 17:05:18 +0000 (17:05 +0000)]
[Tests] Add negative folding tests w/fences as requested in D59345

llvm-svn: 356165

5 years ago[X86] Fix the pattern changes from r356121 so that the ROR*r1/ROR*m1 pattern use...
Craig Topper [Thu, 14 Mar 2019 16:53:24 +0000 (16:53 +0000)]
[X86] Fix the pattern changes from r356121 so that the ROR*r1/ROR*m1 pattern use the rotr opcode.

These instructions used to use rotl with a bitwidth-1 immediate. I changed the immediate to 1,
but failed to change the opcode.

Thankfully this seems to have not caused a functional issue because we now had two rotl by 1 patterns,
but the correct ones were earlier and took priority. So we just missed some optimization.

llvm-svn: 356164

5 years agoAdd IR debug info support for Elemental, Pure, and Recursive Procedures.
Adrian Prantl [Thu, 14 Mar 2019 16:29:54 +0000 (16:29 +0000)]
Add IR debug info support for Elemental, Pure, and Recursive Procedures.

Patch by Eric Schweitz!

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

llvm-svn: 356163

5 years agoAdd std::midpoint for integral and poiner types. Described in P0811, reviewed as...
Marshall Clow [Thu, 14 Mar 2019 16:25:55 +0000 (16:25 +0000)]
Add std::midpoint for integral and poiner types. Described in P0811, reviewed as D59099.

llvm-svn: 356162

5 years ago[analyzer] Fix an assertation failure for invalid sourcelocation, add a new debug...
Kristof Umann [Thu, 14 Mar 2019 16:10:29 +0000 (16:10 +0000)]
[analyzer] Fix an assertation failure for invalid sourcelocation, add a new debug checker

For a rather short code snippet, if debug.ReportStmts (added in this patch) was
enabled, a bug reporter visitor crashed:

struct h {
  operator int();
};

int k() {
  return h();
}

Ultimately, this originated from PathDiagnosticLocation::createMemberLoc, as it
didn't handle the case where it's MemberExpr typed parameter returned and
invalid SourceLocation for MemberExpr::getMemberLoc. The solution was to find
any related valid SourceLocaion, and Stmt::getBeginLoc happens to be just that.

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

llvm-svn: 356161

5 years agoFix a double-overrelease in the TestDataFormatterObjC test program.
Adrian Prantl [Thu, 14 Mar 2019 15:58:21 +0000 (15:58 +0000)]
Fix a double-overrelease in the TestDataFormatterObjC test program.

llvm-svn: 356160

5 years ago[NFC][ARM] Update test
Sam Parker [Thu, 14 Mar 2019 15:36:54 +0000 (15:36 +0000)]
[NFC][ARM] Update test

Change some regex to handle commutable instructions.

llvm-svn: 356159

5 years ago[x86] prevent infinite looping from vselect commutation (PR41066)
Sanjay Patel [Thu, 14 Mar 2019 15:32:34 +0000 (15:32 +0000)]
[x86] prevent infinite looping from vselect commutation (PR41066)

This is an immediate fix for:
https://bugs.llvm.org/show_bug.cgi?id=41066
...but as noted there and the code comments, we should do better
by stubbing this out sooner.

llvm-svn: 356158

5 years agoYAMLIO: Improve template arg deduction for mapOptional
Pavel Labath [Thu, 14 Mar 2019 15:23:40 +0000 (15:23 +0000)]
YAMLIO: Improve template arg deduction for mapOptional

Summary:
The way c++ template argument deduction works, both arguments are used
to deduce the template type in the three-argument overload of
mapOptional. This is a problem if the types are slightly different, even
if they are implicitly convertible. This is fairly easy to trigger with
integral types, as the default type of most integral constants is int,
which then requires casting the constant to the type of the other
argument.

This patch fixes that by using a separate template type for the default
value, which is then cast to the type of the first argument.  To avoid
this conversion triggerring conversions marged as explicit, we use
static_assert to check that the types are implicitly convertible.

Reviewers: zturner, sammccall

Subscribers: kristina, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 356157

5 years ago[CodeGen][ObjC] Remove the leading 'l' from symbols for protocol
Akira Hatanaka [Thu, 14 Mar 2019 15:17:37 +0000 (15:17 +0000)]
[CodeGen][ObjC] Remove the leading 'l' from symbols for protocol
metadata and protocol list

The leading 'l' tells ld64 to remove the symbol name, which can make
debugging difficult.

rdar://problem/47256637

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

llvm-svn: 356156

5 years ago[libc++][CMake] Fix typo introduced in r356150
Louis Dionne [Thu, 14 Mar 2019 14:52:26 +0000 (14:52 +0000)]
[libc++][CMake] Fix typo introduced in r356150

That typo broke the build when the shared library build was disabled.

llvm-svn: 356155

5 years agoFix test after r356148
Nico Weber [Thu, 14 Mar 2019 14:40:48 +0000 (14:40 +0000)]
Fix test after r356148

llvm-svn: 356154

5 years ago[libc++] Do not force building with -fPIC (re-applying)
Louis Dionne [Thu, 14 Mar 2019 14:38:38 +0000 (14:38 +0000)]
[libc++] Do not force building with -fPIC (re-applying)

Summary:
In r355746, we stopped forcing to build with -fPIC because that should
be specified by the CMAKE_POSITION_INDEPENDENT_CODE option at CMake
configure time (and by default -fPIC is used for shared libraries anyways).

However, r355746 had to be reverted in r355756 because we were not
actually building the shared library with -fPIC. The reason is that
we were sharing an object library between the static and the shared
library, which caused flags for static libraries to be used when
building object files that were going to be used for a shared library.

Since this was resolved by r356150, we can stop forcing -fPIC again.

Reviewers: EricWF, smeenai

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

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

llvm-svn: 356153

5 years agoRemove unused variable to silence compiler warning [NFC]
Mikael Holmen [Thu, 14 Mar 2019 14:20:50 +0000 (14:20 +0000)]
Remove unused variable to silence compiler warning [NFC]

The only use of MI was removed in r356142.

llvm-svn: 356152

5 years ago[ASTImporter] Fix import of NestedNameSpecifierLoc.
Balazs Keri [Thu, 14 Mar 2019 14:20:23 +0000 (14:20 +0000)]
[ASTImporter] Fix import of NestedNameSpecifierLoc.

Summary:
Import type location in case of TypeSpec and TypeSpecWithTemplate.
Without this fix the imported NespedNameSpecifierLoc will have an
invalid begin location.

Reviewers: a.sidorin, shafik, a_sidorin, martong

Reviewed By: a_sidorin

Subscribers: rnkovacs, jdoerfert, dkrupp, martong, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

llvm-svn: 356151

5 years ago[libc++] Do not share an object library to create the static/shared libraries
Louis Dionne [Thu, 14 Mar 2019 14:19:08 +0000 (14:19 +0000)]
[libc++] Do not share an object library to create the static/shared libraries

Summary:
The problem with using an object library for doing this is that it prevents
the shared library and the static library from being built with the right
default flags. For example, CMake will build shared libraries with -fPIC
by default, but not static libraries. Using an object library to create
the shared library will prevent the right default flags for shared
libraries from being used.

As a side effect, this patch also localizes the logic related to building
a hermetic static library to the static library case, making clear that
this has no effect on the shared library.

Reviewers: phosek, EricWF

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

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

llvm-svn: 356150

5 years agoAMDGPU: Scavenge register instead of findUnusedReg
Matt Arsenault [Thu, 14 Mar 2019 14:19:01 +0000 (14:19 +0000)]
AMDGPU: Scavenge register instead of findUnusedReg

llvm-svn: 356149

5 years agoObjective-C++11: Support static_assert() in @interface/@implementation ivar lists...
Nico Weber [Thu, 14 Mar 2019 14:18:56 +0000 (14:18 +0000)]
Objective-C++11: Support static_assert() in @interface/@implementation ivar lists and method declarations

This adds support for static_assert() (and _Static_assert()) in
@interface/@implementation ivar lists and in @interface method declarations.

It was already supported in @implementation blocks outside of the ivar lists.

The assert AST nodes are added at file scope, matching where other
(non-Objective-C) declarations at @interface / @implementation level go (cf
`allTUVariables`).

Also add a `__has_feature(objc_c_static_assert)` that's true in C11 (and
`__has_extension(objc_c_static_assert)` that's always true) and
`__has_feature(objc_cxx_static_assert)` that's true in C++11 modea fter this
patch, so it's possible to check if this is supported.

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

llvm-svn: 356148

5 years agoGlobalISel: Use multiple returns for intrinsic structs
Matt Arsenault [Thu, 14 Mar 2019 14:18:56 +0000 (14:18 +0000)]
GlobalISel: Use multiple returns for intrinsic structs

This is consistent with what SelectionDAG does and is much easier to
work with than the extract sequence with an artificial wide register.

For the AMDGPU control flow intrinsics, this was producing an s128 for
the i64, i1 tuple return. Any legalization that should apply to a real
s128 value would badly obscure the direct values that need to be seen.

llvm-svn: 356147

5 years ago[SampleFDO] add suffix elision control for fcn names
Than McIntosh [Thu, 14 Mar 2019 13:56:49 +0000 (13:56 +0000)]
[SampleFDO] add suffix elision control for fcn names

Summary:
Add hooks for determining the policy used to decide whether/how
to chop off symbol 'suffixes' when locating a given function
in a sample profile.

Prior to this change, any function symbols of the form "X.Y" were
elided/truncated into just "X" when looking up things in a sample
profile data file.

With this change, the policy on suffixes can be changed by adding a
new attribute "sample-profile-suffix-elision-policy" to the function:
this attribute can have the value "all" (the default), "selected", or
"none". A value of "all" preserves the previous behavior (chop off
everything after the first "." character, then treat that as the
symbol name). A value of "selected" chops off only the rightmost
".llvm.XXXX" suffix (where "XXX" is any string not containing a "."
char). A value of "none" indicates that names should be left as is.

Subscribers: jdoerfert, wmi, mtrofin, danielcdh, llvm-commits

Tags: #llvm

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

llvm-svn: 356146

5 years agoNote ImmArg in documentation for adding intrinsics
Matt Arsenault [Thu, 14 Mar 2019 13:46:17 +0000 (13:46 +0000)]
Note ImmArg in documentation for adding intrinsics

llvm-svn: 356145

5 years agoARM: Add ImmArg to intrinsics
Matt Arsenault [Thu, 14 Mar 2019 13:46:14 +0000 (13:46 +0000)]
ARM: Add ImmArg to intrinsics

I found these by asserting in clang for any GCCBuiltin that doesn't
require mangling and requires a constant for the builtin. This means
that intrinsics are missing which don't use GCCBuiltin, don't have
builtins defined in clang, or were missing the constant annotation in
the builtin definition.

llvm-svn: 356144

5 years agoAMDGPU: Don't add unnecessary convergent attributes
Matt Arsenault [Thu, 14 Mar 2019 13:46:09 +0000 (13:46 +0000)]
AMDGPU: Don't add unnecessary convergent attributes

These are redundant with the intrinsic declaration.

llvm-svn: 356143

5 years ago[analyzer] Fix function macro crash
Kristof Umann [Thu, 14 Mar 2019 13:38:16 +0000 (13:38 +0000)]
[analyzer] Fix function macro crash

Re-commit D57893.

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

llvm-svn: 356142

5 years ago[clang-tidy] Add additional patterns to the abseil-duration-unnecessary-conversion...
Hyrum Wright [Thu, 14 Mar 2019 13:38:16 +0000 (13:38 +0000)]
[clang-tidy] Add additional patterns to the abseil-duration-unnecessary-conversion check.

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

llvm-svn: 356141

5 years agoProperly constrain basic_string(Iter, Iter, Alloc = A())
Eric Fiselier [Thu, 14 Mar 2019 12:31:10 +0000 (12:31 +0000)]
Properly constrain basic_string(Iter, Iter, Alloc = A())

llvm-svn: 356140

5 years agogn build: Merge r356080
Hans Wennborg [Thu, 14 Mar 2019 12:22:50 +0000 (12:22 +0000)]
gn build: Merge r356080

llvm-svn: 356139

5 years ago[SystemZ] Remove icmp undef
Simon Pilgrim [Thu, 14 Mar 2019 11:56:41 +0000 (11:56 +0000)]
[SystemZ] Remove icmp undef

Prep-work for PR40800 (Add UNDEF handling to SelectionDAG::FoldSetCC)

llvm-svn: 356138

5 years ago[SystemZ] Regenerate tests to make complete codegen more obvious
Simon Pilgrim [Thu, 14 Mar 2019 11:54:46 +0000 (11:54 +0000)]
[SystemZ] Regenerate tests to make complete codegen more obvious

llvm-svn: 356137

5 years ago[llvm-objcopy]Don't implicitly strip sections in segments
James Henderson [Thu, 14 Mar 2019 11:47:41 +0000 (11:47 +0000)]
[llvm-objcopy]Don't implicitly strip sections in segments

This patch changes llvm-objcopy's behaviour to not strip sections that
are in segments, if they otherwise would be due to a stripping operation
(--strip-all, --strip-sections, --strip-non-alloc). This preserves the
segment contents. It does not change the behaviour of --strip-all-gnu
(although we could choose to do so), because GNU objcopy's behaviour in
this case seems to be to strip the section, nor does it prevent removing
of sections in segments with --remove-section (if a user REALLY wants to
remove a section, we should probably let them, although I could be
persuaded that warning might be appropriate). Tests have been added to
show this latter behaviour.

This fixes https://bugs.llvm.org/show_bug.cgi?id=41006.

Reviewed by: grimar, rupprecht, jakehehrlich

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

This is a reland of r356129, attempting to fix greendragon failures
due to a suspected compatibility issue with od on the greendragon bots
versus other versions.

llvm-svn: 356136

5 years agoFix for buildbots
Sam Parker [Thu, 14 Mar 2019 11:38:55 +0000 (11:38 +0000)]
Fix for buildbots

Remove unused private field.

llvm-svn: 356135

5 years ago[clangd] Using symbol name to map includes for STL symbols.
Haojian Wu [Thu, 14 Mar 2019 11:25:26 +0000 (11:25 +0000)]
[clangd] Using symbol name to map includes for STL symbols.

Summary:
Using suffix path mapping relies on the STL implementations, and it is
not portable. This patch is using symbol name mapping, which should
work with different STL implementations, fix clangd/clangd#9.

To generate the symbol mapping, we parse the cppreference symbol index
page to build a lookup table.

The mapping is not completed, a few TODOs:
  - support symbols from different headers (e.g. std::move)
  - support STL macros
  - support symbols from std's sub-namespaces (e.g. chrono)

Reviewers: ioeric, jfb, serge-sans-paille

Reviewed By: ioeric

Subscribers: sammccall, klimek, ilya-biryukov, ioeric, MaskRay, jkorous, mgrang, arphaman, kadircet, jfb, jdoerfert, cfe-commits

Tags: #clang-tools-extra, #clang

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

llvm-svn: 356134

5 years agoRevert r356129 due to greendragon bot failures
James Henderson [Thu, 14 Mar 2019 11:23:04 +0000 (11:23 +0000)]
Revert r356129 due to greendragon bot failures

llvm-svn: 356133

5 years ago[ARM][ParallelDSP] Enable multiple uses of loads
Sam Parker [Thu, 14 Mar 2019 11:14:13 +0000 (11:14 +0000)]
[ARM][ParallelDSP] Enable multiple uses of loads

When choosing whether a pair of loads can be combined into a single
wide load, we check that the load only has a sext user and that sext
also only has one user. But this can prevent the transformation in
the cases when parallel macs use the same loaded data multiple times.

To enable this, we need to fix up any other uses after creating the
wide load: generating a trunc and a shift + trunc pair to recreate
the narrow values. We also need to keep a record of which loads have
already been widened.

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

llvm-svn: 356132

5 years ago[NFC][LSR] Cleanup Cost API
Sam Parker [Thu, 14 Mar 2019 11:05:07 +0000 (11:05 +0000)]
[NFC][LSR] Cleanup Cost API

Create members for Loop, ScalarEvolution, DominatorTree,
TargetTransformInfo and Formula.

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

llvm-svn: 356131

5 years ago[ARM] Run ARMParallelDSP in the IRPasses phase
Sam Parker [Thu, 14 Mar 2019 10:57:40 +0000 (10:57 +0000)]
[ARM] Run ARMParallelDSP in the IRPasses phase

Run EarlyCSE before ParallelDSP and do this in the backend IR opt
phase.

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

llvm-svn: 356130

5 years ago[llvm-objcopy]Don't implicitly strip sections in segments
James Henderson [Thu, 14 Mar 2019 10:20:27 +0000 (10:20 +0000)]
[llvm-objcopy]Don't implicitly strip sections in segments

This patch changes llvm-objcopy's behaviour to not strip sections that
are in segments, if they otherwise would be due to a stripping operation
(--strip-all, --strip-sections, --strip-non-alloc). This preserves the
segment contents. It does not change the behaviour of --strip-all-gnu
(although we could choose to do so), because GNU objcopy's behaviour in
this case seems to be to strip the section, nor does it prevent removing
of sections in segments with --remove-section (if a user REALLY wants to
remove a section, we should probably let them, although I could be
persuaded that warning might be appropriate). Tests have been added to
show this latter behaviour.

This fixes https://bugs.llvm.org/show_bug.cgi?id=41006.

Reviewed by: grimar, rupprecht, jakehehrlich

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

llvm-svn: 356129

5 years agogn build: Merge r356082
Hans Wennborg [Thu, 14 Mar 2019 10:10:25 +0000 (10:10 +0000)]
gn build: Merge r356082

llvm-svn: 356128

5 years ago[clangd] Fix an out-of-date FIXME, NFC.
Haojian Wu [Thu, 14 Mar 2019 10:01:07 +0000 (10:01 +0000)]
[clangd] Fix an out-of-date FIXME, NFC.

llvm-svn: 356127

5 years ago[clangd] Build Dex index after loading all shards in BackgroundIndex.
Haojian Wu [Thu, 14 Mar 2019 09:57:10 +0000 (09:57 +0000)]
[clangd] Build Dex index after loading all shards in BackgroundIndex.

Summary:
Currently after loadding all shards, we use MemIndex which has poor query
performance, we should use Dex.

Reviewers: kadircet

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

Tags: #clang

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

llvm-svn: 356126

5 years ago[clangd] Store explicit template specializations in index for code navigation purposes
Kadir Cetinkaya [Thu, 14 Mar 2019 08:35:17 +0000 (08:35 +0000)]
[clangd] Store explicit template specializations in index for code navigation purposes

Summary:
This introduces ~4k new symbols, and ~10k refs for LLVM. We need that
information for providing better code navigation support:
- When references for a class template is requested, we should return these specializations as well.
- When children of a specialization is requested, we should be able to query for those symbols(instead of just class template)

Number of symbols: 378574 -> 382784
Number of refs: 5098857 -> 5110689

Reviewers: hokein, gribozavr

Reviewed By: gribozavr

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

Tags: #clang

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

llvm-svn: 356125

5 years ago[RISCV] Fix rL356123
Alex Bradbury [Thu, 14 Mar 2019 08:31:35 +0000 (08:31 +0000)]
[RISCV] Fix rL356123

The wrong version of the patch was committed. This fixes typos that broke the build.

llvm-svn: 356124

5 years ago[RISCV][NFC] Rename callee saved regs 'CSR' to CSR_ILP32_LP64 and minor RISCVRegister...
Alex Bradbury [Thu, 14 Mar 2019 08:28:48 +0000 (08:28 +0000)]
[RISCV][NFC] Rename callee saved regs 'CSR' to CSR_ILP32_LP64 and minor RISCVRegisterInfo refactoring

The CSR renaming further prepares the way for an upcoming patch adding support for more
RISC-V ABIs.

Modify RISCVRegisterInfo::getCalleeSavedRegs and
RISCVRegisterInfo::getReservedRegs to do MF->getSubtarget<RISCVSubtarget>()
once rather than multiple times.

llvm-svn: 356123

5 years ago[RISCV] Extend test/CodeGen/RISCV/callee-saved-* to test getCalleePreservedRegs
Alex Bradbury [Thu, 14 Mar 2019 08:17:44 +0000 (08:17 +0000)]
[RISCV] Extend test/CodeGen/RISCV/callee-saved-* to test getCalleePreservedRegs

Add a caller which exhausts regs then calls another function. This allows
getCalleePreservedRegs to be tested.

llvm-svn: 356122

5 years ago[X86] Add patterns for rotr by immediate to fix PR41057.
Craig Topper [Thu, 14 Mar 2019 07:07:26 +0000 (07:07 +0000)]
[X86] Add patterns for rotr by immediate to fix PR41057.

Prior to the introduction of funnel shift intrinsics we could count on rotate
by immediates prefering to use rotl since that's what MatchRotate would check
first. The or+shift pattern doesn't have a direction so one must be chosen
arbitrarily.

With funnel shift, there is a direction and fshr will try to use rotr first.
While fshl will try to use rotl first.

This patch adds the isel patterns for rotr to complement the rotl patterns. I've
put the rotr by 1 patterns in the instruction patterns. And moved the rotl by
bitwidth-1 patterns to separate Pat patterns.

Fixes PR41057.

llvm-svn: 356121

5 years ago[X86] Add various test cases for PR41057. NFC
Craig Topper [Thu, 14 Mar 2019 07:07:24 +0000 (07:07 +0000)]
[X86] Add various test cases for PR41057. NFC

llvm-svn: 356120

5 years ago[X86] Only define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 in 64-bit mode.
Craig Topper [Thu, 14 Mar 2019 05:45:42 +0000 (05:45 +0000)]
[X86] Only define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 in 64-bit mode.

Summary:
This define should correspond to CMPXCHG16B being available which requires 64-bit mode.

I checked and gcc also seems to only define this in 64-bit mode.

Reviewers: RKSimon, spatel, efriedma, jyknight, jfb

Reviewed By: jfb

Subscribers: jfb, cfe-commits, llvm-commits

Tags: #clang

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

llvm-svn: 356118

5 years ago[ELF] Simplify RelRo, TLS, NOBITS section ranks and make RW PT_LOAD start with RelRo
Fangrui Song [Thu, 14 Mar 2019 03:47:45 +0000 (03:47 +0000)]
[ELF] Simplify RelRo, TLS, NOBITS section ranks and make RW PT_LOAD start with RelRo

Old: PT_LOAD(.data | PT_GNU_RELRO(.data.rel.ro .bss.rel.ro) | .bss)
New: PT_LOAD(PT_GNU_RELRO(.data.rel.ro .bss.rel.ro) | .data .bss)

The placement of | indicates page alignment caused by PT_GNU_RELRO. The
new layout has simpler rules and saves space for many cases.

Old size: roundup(.data) + roundup(.data.rel.ro)
New size: roundup(.data.rel.ro + .bss.rel.ro) + .data

Other advantages:

* At runtime the 3 memory mappings decrease to 2.
* start(PT_TLS) = start(PT_GNU_RELRO) = start(RW PT_LOAD). This
  simplifies binary manipulation tools.
  GNU strip before 2.31 discards PT_GNU_RELRO if its
  address is not equal to the start of its associated PT_LOAD.
  This has been fixed by https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f2731e0c374e5323ce4cdae2bcc7b7fe22da1a6f
  But with this change, we will be compatible with GNU strip before 2.31
* Before, .got.plt (non-relro by default) was placed before .got (relro
  by default), which made it impossible to have _GLOBAL_OFFSET_TABLE_
  (start of .got.plt on x86-64) equal to the end of .got (R_GOT*_FROM_END)
  (https://bugs.llvm.org/show_bug.cgi?id=36555). With the new ordering, we
  can improve on this regard if we'd like to.

Reviewers: ruiu, espindola, pcc

Subscribers: emaste, arichardson, llvm-commits, joerg, jdoerfert

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

llvm-svn: 356117

5 years ago[GlobalISel][Utils] Add a getConstantVRegVal variant that looks through instrs
Quentin Colombet [Thu, 14 Mar 2019 01:37:13 +0000 (01:37 +0000)]
[GlobalISel][Utils] Add a getConstantVRegVal variant that looks through instrs

getConstantVRegVal used to only look for G_CONSTANT when looking at
unboxing the value of a vreg. However, constants are sometimes not
directly used and are hidden behind trunc, s|zext or copy chain of
computation.

In particular this may be introduced by the legalization process that
doesn't want to simplify these patterns because it can lead to infine
loop when legalizing a constant.

To circumvent that problem, add a new variant of getConstantVRegVal,
named getConstantVRegValWithLookThrough, that allow to look through
extensions.

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

llvm-svn: 356116

5 years agoFixup tests to check for any MCInst number instead of a specific one.
Douglas Yung [Thu, 14 Mar 2019 01:24:35 +0000 (01:24 +0000)]
Fixup tests to check for any MCInst number instead of a specific one.

llvm-svn: 356115

5 years ago[ResetMachineFunctionPass] Add visited functions statistics info
Craig Topper [Thu, 14 Mar 2019 01:13:15 +0000 (01:13 +0000)]
[ResetMachineFunctionPass] Add visited functions statistics info

Adding a "NumFunctionsVisited" for collecting the visited function number.
It can be used to collect function pass rate in some tests,
the pass rate = (NumberVisited - NumberReset)/NumberVisited.
e.g. it can be used for caculating GlobalISel pass rate in Test-Suite.

Patch by Tianyang Zhu (zhutianyang)

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

llvm-svn: 356114

5 years agoMake sure that a sanitizer LLDB's environment doesn't get passed on
Adrian Prantl [Thu, 14 Mar 2019 00:46:15 +0000 (00:46 +0000)]
Make sure that a sanitizer LLDB's environment doesn't get passed on
to test binaries.

llvm-svn: 356113

5 years ago[X86] Add 64-bit mode command lines to rot32.ll so that it will demonstrate PR41055...
Craig Topper [Thu, 14 Mar 2019 00:23:31 +0000 (00:23 +0000)]
[X86] Add 64-bit mode command lines to rot32.ll so that it will demonstrate PR41055 for 32 bit. NFC

llvm-svn: 356112

5 years agoFix invocation of Gold plugin with LTO after r355331
Nemanja Ivanovic [Wed, 13 Mar 2019 23:54:52 +0000 (23:54 +0000)]
Fix invocation of Gold plugin with LTO after r355331

The above commit breaks the usage of PGO and LTO when -fprofile-use is
supplied without a path. This patch changes the usage of this argument
to be inline with its use in addPGOAndCoverageFlags().

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

llvm-svn: 356111

5 years ago[lldb-vscode] Don't try to launch an invalid program.
Jorge Gorbe Moya [Wed, 13 Mar 2019 23:50:35 +0000 (23:50 +0000)]
[lldb-vscode] Don't try to launch an invalid program.

If an invalid program is specified, lldb-vscode will send back a
response with "success" = false, but then will continue executing the
rest of request_launch(), try to launch the program anyway and try to
send another response (possibly using the `response` object after it was
moved).

This change adds a return statement so we stop executing the handler
after producing the first failing response.

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

llvm-svn: 356110

5 years ago[llvm-objcopy][NFC] Remove unnecessary llvm-objcopy.h #includes
Jordan Rupprecht [Wed, 13 Mar 2019 23:40:16 +0000 (23:40 +0000)]
[llvm-objcopy][NFC] Remove unnecessary llvm-objcopy.h #includes

llvm-svn: 356109

5 years agoReorder the operations in
Jason Molenda [Wed, 13 Mar 2019 23:34:20 +0000 (23:34 +0000)]
Reorder the operations in
DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule a
bit so that we only read the binaries out of memory once we've
determined that we can find a real binary on the local system.

Previously, lldb would read all of the kext binaries out of memory
and then determine if it had the local copy.  The kext table gives
us most the information we need (address, name, uuid) so lldb only
needs the actual in-memory load commands when it comes time to set
the section load addresses.  Delay reading until that point for all
the kexts.

NFC; doing the operations in a different order.

<rdar://problem/41181173>

llvm-svn: 356108

5 years ago[AArch64][GlobalISel] Gardening: Simplify subregister copy in selectBuildVector
Jessica Paquette [Wed, 13 Mar 2019 23:29:54 +0000 (23:29 +0000)]
[AArch64][GlobalISel] Gardening: Simplify subregister copy in selectBuildVector

NFC. Some more preliminary factoring for G_INSERT_VECTOR_ELT.

Also better code-reuse, etc., etc.

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

llvm-svn: 356107

5 years ago[GlobalISel][AArch64] Gardening: Factor out vector inserts
Jessica Paquette [Wed, 13 Mar 2019 23:22:23 +0000 (23:22 +0000)]
[GlobalISel][AArch64] Gardening: Factor out vector inserts

Factor out the vector insert code in `selectBuildVector`. Replace part of it
with `emitScalarToVector`, since it was pretty much equivalent.

This will make implementing G_INSERT_VECTOR_ELT easier.

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

llvm-svn: 356106

5 years ago[llvm-objcopy] Cleanup errors from CopyConfig and remove llvm-objcopy.h dependency
Jordan Rupprecht [Wed, 13 Mar 2019 22:26:01 +0000 (22:26 +0000)]
[llvm-objcopy] Cleanup errors from CopyConfig and remove llvm-objcopy.h dependency

error() was previously cleaned up from CopyConfig, but new uses were introduced.

This also tweaks the error message for --add-symbol to report all invalid flags.

llvm-svn: 356105

5 years ago[AIX][CMake] Changes for building on AIX with XL and GCC
Jason Liu [Wed, 13 Mar 2019 21:50:25 +0000 (21:50 +0000)]
[AIX][CMake] Changes for building on AIX with XL and GCC

Summary:
In support of IBM's efforts to produce a viable C and C++ LLVM compiler for AIX
(ref: RFC at http://lists.llvm.org/pipermail/llvm-dev/2019-February/130175.html),
this patch adds customizations to the CMake files in order to properly
invoke the host toolchain for the build on AIX.
Additional changes to enable a successful build will follow.

Patch by Xing Xue

Reviewers: hubert.reinterpretcast, jasonliu, sfertile

Reviewed by: hubert.reinterpretcast

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

llvm-svn: 356104

5 years agoRevert "Add a new attribute, fortify_stdlib"
Erik Pilkington [Wed, 13 Mar 2019 21:37:01 +0000 (21:37 +0000)]
Revert "Add a new attribute, fortify_stdlib"

This reverts commit r353765. After talking with our c stdlib folks, we decided
to use the existing pass_object_size attribute to implement _FORTIFY_SOURCE
wrappers, like Bionic does (I didn't realize that pass_object_size could be used
for this purpose). Sorry for the flip/flop, and thanks to James Y. Knight for
pointing this out to me.

llvm-svn: 356103

5 years ago[WebAssembly] Improve support for "needed" list in dylink section
Sam Clegg [Wed, 13 Mar 2019 21:29:20 +0000 (21:29 +0000)]
[WebAssembly] Improve support for "needed" list in dylink section

This change adds basic support for shared library dependencies
via the dylink section.

See https://github.com/WebAssembly/tool-conventions/pull/77

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

llvm-svn: 356102

5 years ago[GlobalISel][AArch64] Gardening: Factor out code to find lane indices
Jessica Paquette [Wed, 13 Mar 2019 21:19:29 +0000 (21:19 +0000)]
[GlobalISel][AArch64] Gardening: Factor out code to find lane indices

Some more refactoring for G_INSERT_VECTOR_ELT.

Factor out the code used to find a lane index from `selectExtractElt`. Put it
into a more general-purpose `getConstantValueForReg` function.

This will be shared with the code for G_INSERT_VECTOR_ELT.

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

llvm-svn: 356101

5 years ago[AMDGPU] Silence gcc 7 warnings
Stanislav Mekhanoshin [Wed, 13 Mar 2019 21:15:52 +0000 (21:15 +0000)]
[AMDGPU] Silence gcc 7 warnings

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

llvm-svn: 356100

5 years ago[clang-format] Propagate inferred language to getLLVMStyle() in getPredefinedStyle()
Jordan Rupprecht [Wed, 13 Mar 2019 21:13:01 +0000 (21:13 +0000)]
[clang-format] Propagate inferred language to getLLVMStyle() in getPredefinedStyle()

rC355158 added an optional language parameter to getLLVMStyle(), but this parameter was not used in getPredefinedStyle(). Because unit tests directly specify the style, this codepath wasn't tested. Add an additional unit test for getStyle().

llvm-svn: 356099

5 years ago[OPENMP]Fix PR37283: Assertion failure on openmp task with by reference
Alexey Bataev [Wed, 13 Mar 2019 20:46:28 +0000 (20:46 +0000)]
[OPENMP]Fix PR37283: Assertion failure on openmp task with by reference
array.

If the firstprivate variable is a reference, we may incorrectly classify
the kind of the private copy. Use the type of the private copy instead
of the original shared variable.

llvm-svn: 356098

5 years ago[clang-format][NFC] Include TableGen in enum->string mapping used for debugging
Jordan Rupprecht [Wed, 13 Mar 2019 20:34:34 +0000 (20:34 +0000)]
[clang-format][NFC] Include TableGen in enum->string mapping used for debugging

Running `clang-format -debug` prints "Unknown" for tablegen files because of this missing mapping, even though it is recognized as a tablegen file.

llvm-svn: 356097

5 years ago[Python] Fix TestDataFormatterSmartArray to work across python versions.
Davide Italiano [Wed, 13 Mar 2019 20:04:34 +0000 (20:04 +0000)]
[Python] Fix TestDataFormatterSmartArray to work across python versions.

Python 3 default encoding is utf-8, so taking random bytes and
interpreting them as a string might result in invalid unicode sequences.
As the only thing we care about here is that the formatter shows the
elements of the underyling array, relax the string matching (this is
good enough as all the elements are distinct so they resolve to different
strings).

llvm-svn: 356096