platform/upstream/llvm.git
6 years ago[clang-format] Improve detection of ObjC for-in statements
Ben Hamilton [Tue, 6 Mar 2018 17:21:42 +0000 (17:21 +0000)]
[clang-format] Improve detection of ObjC for-in statements

Summary:
Previously, clang-format would detect the following as an
Objective-C for-in statement:

  for (int x = in.value(); ...) {}

because the logic only decided a for-loop was definitely *not*
an Objective-C for-in loop after it saw a semicolon or a colon.

To fix this, I delayed the decision of whether this was a for-in
statement until after we found the matching right-paren, at which
point we know if we've seen a semicolon or not.

Test Plan: New tests added. Ran tests with:
  make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: krasimir, jolesiak

Reviewed By: jolesiak

Subscribers: djasper, cfe-commits, klimek

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

llvm-svn: 326815

6 years agoRefactor check for dllimport in the Verifier.
Rafael Espindola [Tue, 6 Mar 2018 17:19:23 +0000 (17:19 +0000)]
Refactor check for dllimport in the Verifier.

This avoids duplicated code and now also rejects dllimport aliases.

llvm-svn: 326814

6 years agoImprove duplicated version handling.
Rafael Espindola [Tue, 6 Mar 2018 17:05:12 +0000 (17:05 +0000)]
Improve duplicated version handling.

It looks like the problem that caused us to originally warn instead of
error was that of a symbol being assigned to the same version twice.

Now we don't warn if a symbol is assigned to the same version twice,
but error if it is assigned to multiple.

This fixes pr28342.

llvm-svn: 326813

6 years ago[ValueTracking] move helpers for SelectPatterns from InstCombine to ValueTracking
Sanjay Patel [Tue, 6 Mar 2018 16:57:55 +0000 (16:57 +0000)]
[ValueTracking] move helpers for SelectPatterns from InstCombine to ValueTracking

Most of the folds based on SelectPatternResult belong in InstSimplify rather than
InstCombine, so the helper code should be available to other passes/analysis.

llvm-svn: 326812

6 years ago[AArch64] define isExtractSubvectorCheap
Sebastian Pop [Tue, 6 Mar 2018 16:54:55 +0000 (16:54 +0000)]
[AArch64] define isExtractSubvectorCheap

Following the ARM-neon backend, define isExtractSubvectorCheap to return true
when extracting low and high part of a neon register.

The patch disables a test in llvm/test/CodeGen/AArch64/arm64-ext.ll This
testcase is fragile in the sense that it requires a BUILD_VECTOR to "survive"
all DAG transforms until ISelLowering. The testcase is supposed to check that
AArch64TargetLowering::ReconstructShuffle() works, and for that we need a
BUILD_VECTOR in ISelLowering. As we now transform the BUILD_VECTOR earlier into
an VEXT + vector_shuffle, we don't have the BUILD_VECTOR pattern when we get to
ISelLowering. As there is no way to disable the combiner to only exercise the
code in ISelLowering, the patch disables the testcase.

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

llvm-svn: 326811

6 years ago[Asm] Fix another layering violation in assmebly macro dumping
Oliver Stannard [Tue, 6 Mar 2018 16:51:17 +0000 (16:51 +0000)]
[Asm] Fix another layering violation in assmebly macro dumping

AsmToken is in the MCParser library, so we can't use its dump function from
MCAsmMacro in the MC library. Instead, just print the string, which we don't
need the MCParser library for.

llvm-svn: 326810

6 years ago[clangd] Don't end completion item labels with '::'
Ilya Biryukov [Tue, 6 Mar 2018 16:45:21 +0000 (16:45 +0000)]
[clangd] Don't end completion item labels with '::'

llvm-svn: 326809

6 years ago[Pipeliner] Test commit: fixed spelling mistake in comments
Roorda, Jan-Willem [Tue, 6 Mar 2018 16:26:01 +0000 (16:26 +0000)]
[Pipeliner] Test commit: fixed spelling mistake in comments

Reviewers: bcahoon

Subscribers: llvm-commits

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

llvm-svn: 326808

6 years ago[X86] Fix typo in cpuid.h, bit_AVX51SER->bit_AVX512ER.
Craig Topper [Tue, 6 Mar 2018 16:06:44 +0000 (16:06 +0000)]
[X86] Fix typo in cpuid.h, bit_AVX51SER->bit_AVX512ER.

llvm-svn: 326807

6 years ago[AMDGPU] Fix lowering OpenCL enqueue_kernel
Yaxun Liu [Tue, 6 Mar 2018 16:04:39 +0000 (16:04 +0000)]
[AMDGPU] Fix lowering OpenCL enqueue_kernel

One addrspacecast disappeared in clang emitted IR for
block invoke function due to adoption of the new
addr space mapping.

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

llvm-svn: 326806

6 years agoRewrite TestTargetSymbolsBuildidCase to be more focused
Pavel Labath [Tue, 6 Mar 2018 15:56:20 +0000 (15:56 +0000)]
Rewrite TestTargetSymbolsBuildidCase to be more focused

Summary:
The test was failing in remote debugging scenario with windows as a host
as cmd.exe is not able to parse the complicated shell commands in the
Makefile.

The test seemed like a perfect candidate for a more focused testing
approach, so I have rewritten in on top of lldb-test's module-sections
functionality. The slight gotcha there was that the
Module::GetSectionList does not include the sections from the symbol
file until someone manually calls Module::GetSymbolVendor. Normally,
this is not an issue, because someone will have initialized the symbol
vendor by the time anyone starts looking at the sections. However, when
all one this is dump the section list, we run into this problem.

I've tried making this behavior more automatic, but it turns out it's
not that easy, so for now, I just manually initialize the Symbol Vendor
before dumping out the sections in lldb-test.

Reviewers: jankratochvil

Subscribers: lldb-commits

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

llvm-svn: 326805

6 years ago[ARM][Asm] Fix layering violation introduced by r326795
Oliver Stannard [Tue, 6 Mar 2018 15:32:34 +0000 (15:32 +0000)]
[ARM][Asm] Fix layering violation introduced by r326795

The MCAsmMacro::dump function is in the MCParser library, so can't be called
from the MC library.

llvm-svn: 326804

6 years ago[ARM]Decoding MSR with unpredictable destination register causes an assert
Simi Pallipurath [Tue, 6 Mar 2018 15:21:19 +0000 (15:21 +0000)]
[ARM]Decoding MSR with unpredictable destination register causes an assert

This patch handling:

    Enable parsing of raw encodings of system registers .
    Allows UNPREDICTABLE sysregs to be decoded to a raw number in the same way that disasslib does, rather than llvm crashing.
    Disassemble msr/mrs with unpredictable sysregs as SoftFail.
    Fix regression due to SoftFailing some encodings.

Patch by Chris Ryder

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

llvm-svn: 326803

6 years agoOne more test for P0767:
Marshall Clow [Tue, 6 Mar 2018 15:01:55 +0000 (15:01 +0000)]
One more test for P0767:

llvm-svn: 326802

6 years agoImplement P0767R1 - Deprecate POD
Marshall Clow [Tue, 6 Mar 2018 15:01:19 +0000 (15:01 +0000)]
Implement P0767R1 - Deprecate POD

llvm-svn: 326801

6 years agotest commit: fix typo in comment
Simi Pallipurath [Tue, 6 Mar 2018 14:35:23 +0000 (14:35 +0000)]
test commit: fix typo in comment

This is  a simple change to do the test commit and verify commit access.

llvm-svn: 326800

6 years ago[clang-tidy] Fix one corner case in make-unique check.
Haojian Wu [Tue, 6 Mar 2018 14:34:35 +0000 (14:34 +0000)]
[clang-tidy] Fix one corner case in make-unique check.

Summary:
Previously, we tried to cover all "std::initializer_list" implicit conversion
cases in the code, but there are some corner cases that not covered (see
newly-added test in the patch).

Sipping all implicit AST nodes is a better way to filter out all these cases.

Reviewers: ilya-biryukov

Subscribers: klimek, xazax.hun, cfe-commits

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

llvm-svn: 326799

6 years ago[clangd] Address missed comments from D44003
Sam McCall [Tue, 6 Mar 2018 14:30:07 +0000 (14:30 +0000)]
[clangd] Address missed comments from D44003

llvm-svn: 326798

6 years ago[demangler] Modernize the rest of the demangler.
Erik Pilkington [Tue, 6 Mar 2018 14:21:10 +0000 (14:21 +0000)]
[demangler] Modernize the rest of the demangler.

llvm-svn: 326797

6 years ago[demangler] Modernize parse_unresolved_name.
Erik Pilkington [Tue, 6 Mar 2018 14:21:08 +0000 (14:21 +0000)]
[demangler] Modernize parse_unresolved_name.

llvm-svn: 326796

6 years ago[Asm] Add debug printing for assembler macros
Oliver Stannard [Tue, 6 Mar 2018 14:07:01 +0000 (14:07 +0000)]
[Asm] Add debug printing for assembler macros

This adds some debug printing (gated behind the "asm-macros" debug flag) which
can help tracing complicated assembly macros.

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

llvm-svn: 326795

6 years ago[Asm] Refactor debug printing of AsmToken
Oliver Stannard [Tue, 6 Mar 2018 14:02:14 +0000 (14:02 +0000)]
[Asm] Refactor debug printing of AsmToken

* Move printing from llvm-mc to the AsmToken class, so that it can be used elsewhere.
* Add 5 cases which were missed: BigNum, Comment, HashDirective, Space and
  BackSlash, and remove the default case so that -Wswitch will catch this error
  in future.

This is almost NFC, except for the fact that llvm-mc can now print those 5
tokens in -as-lex mode.

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

llvm-svn: 326794

6 years ago[CallSiteSplitting] Do not crash when BB's terminator changes.
Florian Hahn [Tue, 6 Mar 2018 14:00:58 +0000 (14:00 +0000)]
[CallSiteSplitting] Do not crash when BB's terminator changes.

Change doCallSiteSplitting to iterate until we reach the terminator instruction.
tryToSplitCallSite can replace BB's terminator in case BB is a successor of
itself. Then IE will be invalidated and we also have to check the current
terminator.

Reviewers: junbuml, davidxl, davide, fhahn

Reviewed By: fhahn, junbuml

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

llvm-svn: 326793

6 years ago[clang-format] fix handling of consecutive unary operators
Krasimir Georgiev [Tue, 6 Mar 2018 13:56:28 +0000 (13:56 +0000)]
[clang-format] fix handling of consecutive unary operators

Summary:
Code that used to be formatted as `if (! + object) {` is now formatted as `if (!+object) {`
(we have a particular object in our codebase where unary `operator+` is overloaded to return the underlying value, which in this case is a `bool`)

We still preserve the TypeScript behavior where `!` is a trailing non-null operator. (This is already tested by an existing unit test in `FormatTestJS.cpp`)

It doesn't appear like handling of consecutive unary operators are tested in general, so I added another test for completeness

Patch contributed by @kevinl!

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

llvm-svn: 326792

6 years agoObjectFileMachO: split CreateSections mega-function into more manageable chunks
Pavel Labath [Tue, 6 Mar 2018 13:53:26 +0000 (13:53 +0000)]
ObjectFileMachO: split CreateSections mega-function into more manageable chunks

Summary:
In an effort to understand the function's operation, I've split it into logical
pieces. Parsing of a single segment is moved to a separate function (and the
parsing state that is carried from one segment to another is explicitly
captured in the SegmentParsingContext object). I've also extracted some pieces
of code which were already standalone (validation of the segment load command,
determining the section type, determining segment permissions) into
separate functions.

Parsing of a single section within the segment should probably also be a
separate function, but I've left that for a separate patch.

This patch is intended to be NFC.

Reviewers: clayborg, davide

Subscribers: lldb-commits

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

llvm-svn: 326791

6 years agoTableGen: Add !foldl operation
Nicolai Haehnle [Tue, 6 Mar 2018 13:49:16 +0000 (13:49 +0000)]
TableGen: Add !foldl operation

Change-Id: I63d67bf6e0b315e2d3360e47e3b62c9517f38987
llvm-svn: 326790

6 years agoTableGen: Remove the ResolveFirst mechanism
Nicolai Haehnle [Tue, 6 Mar 2018 13:49:06 +0000 (13:49 +0000)]
TableGen: Remove the ResolveFirst mechanism

Summary:
It is no longer used.

Change-Id: I1e47267d1975d43ad43acd6347f54e958e3b6c86

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326789

6 years agoTableGen: Delay instantiating inline anonymous records
Nicolai Haehnle [Tue, 6 Mar 2018 13:49:01 +0000 (13:49 +0000)]
TableGen: Delay instantiating inline anonymous records

Summary:
Only instantiate anonymous records once all variable references in template
arguments have been resolved. This allows patterns like the new test case,
which in practice can appear in expressions like:

  class IntrinsicTypeProfile<list<LLVMType> ty, int shift> {
    list<LLVMType> types =
      !listconcat(ty, [llvm_any_ty, LLVMMatchType<shift>]);
  }

  class FooIntrinsic<IntrinsicTypeProfile P, ...>
    : Intrinsic<..., P.types, ...>;

Without this change, the anonymous LLVMMatchType instantiation would
never get resolved.

Another consequence of this change is that anonymous inline
instantiations are uniqued via the folding set of the newly introduced
VarDefInit.

Change-Id: I7a7041a20e297cf98c9109b28d85e64e176c932a

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326788

6 years agoTableGen: Move getNewAnonymousName into RecordKeeper
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:54 +0000 (13:48 +0000)]
TableGen: Move getNewAnonymousName into RecordKeeper

Summary:
So that we will be able to generate new anonymous names more easily
outside the parser as well.

Change-Id: I28f396a7bdbc3ff0c665d466abbd3d31376e21b4

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326787

6 years agoTableGen: Explicitly check whether a record has been resolved
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:47 +0000 (13:48 +0000)]
TableGen: Explicitly check whether a record has been resolved

Summary:
There are various places where resolving and constant folds can
get stuck, especially around casts. We don't always signal an
error for those, because in many cases they can legitimately
occur without being an error in the "untaken branch" of an !if.

Change-Id: I3befc0e4234c8e6cc61190504702918c9f29ce5c

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326786

6 years agoTableGen: Allow !cast of records, cleanup conversion machinery
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:39 +0000 (13:48 +0000)]
TableGen: Allow !cast of records, cleanup conversion machinery

Summary:
Distinguish two relationships between types: is-a and convertible-to.
For example, a bit is not an int or vice versa, but they can be
converted into each other (with range checks that you can think of
as "dynamic": unlike other type checks, those range checks do not
happen during parsing, but only once the final values have been
established).

Actually converting initializers between types is subtle: even
when values of type A can be converted to type B (e.g. int into
string), it may not be possible to do so with a concrete initializer
(e.g., a VarInit that refers to a variable of type int cannot
be immediately converted to a string).

For this reason, distinguish between getCastTo and convertInitializerTo:
the latter implements the actual conversion when appropriate, while
the former will first try to do the actual conversion and fall back
to introducing a !cast operation so that the conversion will be
delayed until variable references have been resolved.

To make the approach of adding !cast operations to work, !cast needs
to fallback to convertInitializerTo when the special string <-> record
logic does not apply.

This enables casting records to a subclass, although that new
functionality is only truly useful together with !isa, which will be
added in a later change.

The test is removed because it uses !srl on a bit sequence,
which cannot really be supported consistently, but luckily
isn't used anywhere either.

Change-Id: I98168bf52649176654ed2ec61a29bdb29970cfe7

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326785

6 years agoTableGen: Simplify BitsInit::resolveReferences
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:30 +0000 (13:48 +0000)]
TableGen: Simplify BitsInit::resolveReferences

Summary:
No functional change intended. The removed code has a loop for
recursive resolving, which is superseded by the recursive
resolving done by the Resolver implementations.

Add a test case which was broken by an earlier version of this
change.

Change-Id: Ib208d037b77a8bbb725977f1388601fc984723d8

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326784

6 years agoTableGen: Generalize record types to fix typeIsConvertibleTo et al.
Nicolai Haehnle [Tue, 6 Mar 2018 13:48:20 +0000 (13:48 +0000)]
TableGen: Generalize record types to fix typeIsConvertibleTo et al.

Summary:
Allow RecordRecTy to represent the type "subclass of N superclasses",
where N may be zero. Furthermore, generate RecordRecTy instances only
with actual classes in the list.

Keeping track of multiple superclasses is required to resolve the type
of a list correctly in some cases. The old code relied on the incorrect
behavior of typeIsConvertibleTo, and an earlier version of this change
relied on a modified ordering of superclasses (it was committed in
r325884 and then reverted because unfortunately some of clang-tblgen's
backends depend on the ordering).

Previously, the DefInit for each Record would have a RecordRecTy of
that Record as its type. Now, all defs with the same superclasses will
share the same type.

This allows us to be more consistent about type checks involving records:

- typeIsConvertibleTo actually requires the LHS to be a subtype of the
  RHS

- resolveTypes will return the least supertype of given record types in
  all cases

- different record types in the two branches of an !if are handled
  correctly

Add a test that used to be accepted without flagging the obvious type
error.

Change-Id: Ib366db1a4e6a079f1a0851e469b402cddae76714

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326783

6 years ago[analyzer] CStringChecker.cpp: Remove the duplicated check about null dereference...
Henry Wong [Tue, 6 Mar 2018 13:38:42 +0000 (13:38 +0000)]
[analyzer] CStringChecker.cpp: Remove the duplicated check about null dereference on dest-buffer or src-buffer.

Summary: `CheckBufferAccess()` calls `CheckNonNull()`, so there are some calls to `CheckNonNull()` that are useless.

Reviewers: dcoughlin, NoQ, xazax.hun, cfe-commits, george.karpenkov

Reviewed By: NoQ

Subscribers: szepet, rnkovacs, MTC, a.sidorin

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

llvm-svn: 326782

6 years ago[clang-format] Fix documentation for SpaceAfterCStyleCast option
Krasimir Georgiev [Tue, 6 Mar 2018 13:24:01 +0000 (13:24 +0000)]
[clang-format] Fix documentation for SpaceAfterCStyleCast option

Patch contributed by @EricMarti!

Summary: I noticed that the example for SpaceAfterCStyleCast does not match its description. I fixed the example after testing it out.

Reviewers: rsmith, krasimir

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

llvm-svn: 326781

6 years agoFixup for rL326769 (RegState::Debug is being truncated to a bool)
Bjorn Pettersson [Tue, 6 Mar 2018 13:23:28 +0000 (13:23 +0000)]
Fixup for rL326769 (RegState::Debug is being truncated to a bool)

I obviously messed up arguments to MachineOperand::CreateReg
in rL326769. This should make it work as intended.

Thanks to RKSimon for spotting this.

llvm-svn: 326780

6 years ago[CloneFunction] Support BB == PredBB in DuplicateInstructionsInSplit.
Florian Hahn [Tue, 6 Mar 2018 13:12:32 +0000 (13:12 +0000)]
[CloneFunction] Support BB == PredBB in DuplicateInstructionsInSplit.

In case PredBB == BB and StopAt == BB's terminator, StopAt != &*BI will
fail, because BB's terminator instruction gets replaced.

By using BB.getTerminator() we get the current terminator which we can use
to compare.

Reviewers: sanjoy, anna, reames

Reviewed By: anna

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

llvm-svn: 326779

6 years ago[clangd] Fix -Wpedantic warning, NFC.
Haojian Wu [Tue, 6 Mar 2018 12:56:18 +0000 (12:56 +0000)]
[clangd] Fix -Wpedantic warning, NFC.

llvm-svn: 326778

6 years agoHostThreadPosix::Cancel: remove android-specific implementation
Pavel Labath [Tue, 6 Mar 2018 12:46:05 +0000 (12:46 +0000)]
HostThreadPosix::Cancel: remove android-specific implementation

Noone is calling this function on android, so we can just use the
generic llvm_unreachable "implementation".

llvm-svn: 326777

6 years ago[Analyzer] More accurate modeling about the increment operator of the operand with...
Henry Wong [Tue, 6 Mar 2018 12:29:09 +0000 (12:29 +0000)]
[Analyzer] More accurate modeling about the increment operator of the operand with type bool.

Summary:
There is a problem with analyzer that a wrong value is given when modeling the increment operator of the operand with type bool. After `rL307604` is applied, a unsigned overflow may occur.

Example:
```
void func() {
  bool b = true;
  // unsigned overflow occur, 2 -> 0 U1b
  b++;
}
```

The use of an operand of type bool with the ++ operators is deprecated but valid untill C++17. And if the operand of the increment operator is of type bool, it is set to true.

This patch includes two parts:

  - If the operand of the increment operator is of type bool or type _Bool, set to true.
  - Modify `BasicValueFactory::getTruthValue()`, use `getIntWidth()` instead `getTypeSize()` and use `unsigned` instead `signed`.

Reviewers: alexshap, NoQ, dcoughlin, george.karpenkov

Reviewed By: NoQ

Subscribers: xazax.hun, szepet, a.sidorin, cfe-commits, MTC

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

llvm-svn: 326776

6 years ago[LLDB][PPC64] Fixed issues with expedited registers
Pavel Labath [Tue, 6 Mar 2018 11:54:41 +0000 (11:54 +0000)]
[LLDB][PPC64] Fixed issues with expedited registers

Summary:
- reg_nums were missing the end marker entry
- marked FP test to be skipped for ppc64

Reviewers: labath, clayborg

Reviewed By: labath, clayborg

Subscribers: alexandreyy, lbianc, nemanjai, kbarton

Differential Revision: https://reviews.llvm.org/D43767
Patch by Leandro Lupori <leandro.lupori@gmail.com>

llvm-svn: 326775

6 years ago[AVR] Remove the earlyclobber flag from LDDWRdYQ
Dylan McKay [Tue, 6 Mar 2018 11:20:25 +0000 (11:20 +0000)]
[AVR] Remove the earlyclobber flag from LDDWRdYQ

Before I started maintaining the AVR backend, this instruction
never originally used to have an earlyclobber flag.

Some time afterwards (years ago), I must've added it back in, not realising that it
was left out for a reason.

This pseudo instrction exists solely to work around a long standing bug
in the register allocator.

Before this commit, the LDDWRdYQ pseudo was not actually working around
any bug. With the earlyclobber flag removed again, the LDDWRdYQ pseudo
now correctly works around PR13375 again.

llvm-svn: 326774

6 years ago[clangd] Sort includes when formatting code or inserting new includes.
Eric Liu [Tue, 6 Mar 2018 10:42:50 +0000 (10:42 +0000)]
[clangd] Sort includes when formatting code or inserting new includes.

Reviewers: hokein, ilya-biryukov

Subscribers: klimek, jkorous-apple, cfe-commits

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

llvm-svn: 326773

6 years agoMove test/gcdasyncsemaphorechecker_test.m to a subdirectory
Alexander Kornienko [Tue, 6 Mar 2018 10:40:11 +0000 (10:40 +0000)]
Move test/gcdasyncsemaphorechecker_test.m to a subdirectory

llvm-svn: 326772

6 years ago[DebugInfo] Discard invalid DBG_VALUE instructions in LiveDebugVariables
Bjorn Pettersson [Tue, 6 Mar 2018 08:47:07 +0000 (08:47 +0000)]
[DebugInfo] Discard invalid DBG_VALUE instructions in LiveDebugVariables

Summary:
This is a workaround for pr36417
https://bugs.llvm.org/show_bug.cgi?id=36417

LiveDebugVariables will now verify that the DBG_VALUE instructions
are sane (prior to register allocation) by asking LIS if a virtual
register used in the DBG_VALUE is live (or dead def) in the slot
index before the DBG_VALUE. If it isn't sane the DBG_VALUE is
discarded.

One pass that was identified as introducing non-sane DBG_VALUE
instructtons, when analysing pr36417, was the DAG->DAG Instruction
Selection. It sometimes inserts DBG_VALUE instructions referring to
a virtual register that is defined later in the same basic block.
So it is a use before def kind of problem. The DBG_VALUE is
typically inserted in the beginning of a basic block when this
happens. The problem can be seen in the test case
test/DebugInfo/X86/dbg-value-inlined-parameter.ll

Reviewers: aprantl, rnk, probinson

Reviewed By: aprantl

Subscribers: vsk, davide, alexcrichton, Ka-Ka, eraman, llvm-commits, JDevlieghere

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

llvm-svn: 326769

6 years agoOpenBSD sanitizer common, define RLIMIT_AS constant
Kamil Rytarowski [Tue, 6 Mar 2018 08:24:16 +0000 (08:24 +0000)]
OpenBSD sanitizer common, define RLIMIT_AS constant

Summary: define RLIMIT_AS constant until it s defined in the future

Patch by: David Carlier

Reviewers: krytarowski, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

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

llvm-svn: 326768

6 years agoFix an unused variable warning; NFC
George Burgess IV [Tue, 6 Mar 2018 07:45:11 +0000 (07:45 +0000)]
Fix an unused variable warning; NFC

llvm-svn: 326767

6 years ago[ExprConstant] Look through ExprWithCleanups for `allocsize`
George Burgess IV [Tue, 6 Mar 2018 07:42:36 +0000 (07:42 +0000)]
[ExprConstant] Look through ExprWithCleanups for `allocsize`

llvm-svn: 326766

6 years ago[WebAssebmly] Remove reloc ordering constraint
Sam Clegg [Tue, 6 Mar 2018 07:13:10 +0000 (07:13 +0000)]
[WebAssebmly] Remove reloc ordering constraint

The MC layer doesn't currently emit relocations in offset
order for the entire code section so this check was causing
failures on the wasm waterfall.

Perhaps we can re-instate this check if we divide the relocations
per-function, or add extra ordering the MC object writer.

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

llvm-svn: 326765

6 years ago[X86] Handle EAX being live when calling chkstk for x86_64
Martin Storsjo [Tue, 6 Mar 2018 06:00:13 +0000 (06:00 +0000)]
[X86] Handle EAX being live when calling chkstk for x86_64

EAX can turn out to be alive here, when shrink wrapping is done
(which is allowed when using dwarf exceptions, contrary to the
normal case with WinCFI).

This fixes PR36487.

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

llvm-svn: 326764

6 years agoUpdated docs in CrashRecoveryContext.h
Serge Pavlov [Tue, 6 Mar 2018 04:00:30 +0000 (04:00 +0000)]
Updated docs in CrashRecoveryContext.h

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

llvm-svn: 326763

6 years agoRevert "[DWARFv5] Emit file 0 to the line table."
Paul Robinson [Tue, 6 Mar 2018 03:15:21 +0000 (03:15 +0000)]
Revert "[DWARFv5] Emit file 0 to the line table."
Caused an asan failure.

This reverts commit d54883f081186cdcce74e6f98cfc0438579ec019.
aka r326758

llvm-svn: 326762

6 years ago[MergeICmp] Simplify how BCECmpBlock instructions are blacklisted
Xin Tong [Tue, 6 Mar 2018 02:24:02 +0000 (02:24 +0000)]
[MergeICmp] Simplify how BCECmpBlock instructions are blacklisted

llvm-svn: 326761

6 years ago[MergeICmp] Fix printing. NFC
Xin Tong [Tue, 6 Mar 2018 02:04:57 +0000 (02:04 +0000)]
[MergeICmp] Fix printing. NFC

llvm-svn: 326760

6 years ago[sanitizer] Fix the return type for GetTid in Fuchsia implementation
Petr Hosek [Tue, 6 Mar 2018 02:01:32 +0000 (02:01 +0000)]
[sanitizer] Fix the return type for GetTid in Fuchsia implementation

This is triggering "functions that differ only in their return type
cannot be overloaded" error.

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

llvm-svn: 326759

6 years ago[DWARFv5] Emit file 0 to the line table.
Paul Robinson [Tue, 6 Mar 2018 01:59:56 +0000 (01:59 +0000)]
[DWARFv5] Emit file 0 to the line table.

DWARF v5 specifies that the root file (also given in the DW_AT_name
attribute of the compilation unit DIE) should be emitted explicitly to
the line table's list of files.  This makes the line table more
independent of the .debug_info section.

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

llvm-svn: 326758

6 years ago[StaticAnalyzer] Fix some Clang-tidy modernize and Include What You Use warnings...
Eugene Zelenko [Tue, 6 Mar 2018 00:47:41 +0000 (00:47 +0000)]
[StaticAnalyzer] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 326757

6 years agoUpstreaming avx512 register support in debugserver. These changes
Jason Molenda [Tue, 6 Mar 2018 00:27:41 +0000 (00:27 +0000)]
Upstreaming avx512 register support in debugserver.  These changes
were originally written by Chris Bieneman, they've undergone a
number of changes since then.

Also including the debugserver bridgeos support, another arm
environment that runs Darwin akin to ios.  These codepaths are
activated when running in a bridgeos environment which we're not
set up to test today.

There's additional (small) lldb changes to handle bridgeos binaries
that still need to be merged up.

Tested on a darwin system with avx512 hardware and without.

<rdar://problem/36424951>

llvm-svn: 326756

6 years ago[analyzer] [quickfix] Prevent a crash in NamedDecl::getName()
George Karpenkov [Tue, 6 Mar 2018 00:18:21 +0000 (00:18 +0000)]
[analyzer] [quickfix] Prevent a crash in NamedDecl::getName()

llvm-svn: 326755

6 years agoLLDBStandalone.cmake: set path to llvm-lit inside of llvm build dir
Adrian Prantl [Mon, 5 Mar 2018 23:57:46 +0000 (23:57 +0000)]
LLDBStandalone.cmake: set path to llvm-lit inside of llvm build dir

llvm-svn: 326754

6 years agoRemove redundant casts.
Rui Ueyama [Mon, 5 Mar 2018 23:50:45 +0000 (23:50 +0000)]
Remove redundant casts.

llvm-svn: 326753

6 years agoDisable llvm-opt-fuzzer/exec-options.ll on Windows, it is too flaky
Reid Kleckner [Mon, 5 Mar 2018 23:18:13 +0000 (23:18 +0000)]
Disable llvm-opt-fuzzer/exec-options.ll on Windows, it is too flaky

llvm-svn: 326752

6 years ago[X86] cvttpd2dq lowering has been supported for some time
Simon Pilgrim [Mon, 5 Mar 2018 23:00:39 +0000 (23:00 +0000)]
[X86] cvttpd2dq lowering has been supported for some time

Tests in vec_fp_to_int.ll

llvm-svn: 326751

6 years ago[InstSimplify] remove redundant folds
Sanjay Patel [Mon, 5 Mar 2018 22:46:48 +0000 (22:46 +0000)]
[InstSimplify] remove redundant folds

The 'hasOneUse' check is a giveaway that something's not right.
We never need to check that in InstSimplify because we don't
create new instructions here.

These are all handled as icmp simplifies which then trigger
existing select simplifies, so there's no need to duplicate
a composite fold of the two.

llvm-svn: 326750

6 years agoGlobalISel: IRTranslate llvm.fabs.* intrinsic
Volkan Keles [Mon, 5 Mar 2018 22:31:55 +0000 (22:31 +0000)]
GlobalISel: IRTranslate llvm.fabs.* intrinsic

Summary:
Fabs is a common floating-point operation, especially for some expansions. This patch adds
a new generic opcode for llvm.fabs.* intrinsic in order to avoid building/matching this intrinsic.

Reviewers: qcolombet, aditya_nandakumar, dsanders, rovka

Reviewed By: aditya_nandakumar

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

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

llvm-svn: 326749

6 years ago[RewriteStatepoints] Fix stale parse points
Daniel Neilson [Mon, 5 Mar 2018 22:27:30 +0000 (22:27 +0000)]
[RewriteStatepoints] Fix stale parse points

Summary:
RewriteStatepointsForGC collects parse points for further processing.
During the collection if a callsite is found in an unreachable block
(DominatorTree::isReachableFromEntry()) then all unreachable blocks are
removed by removeUnreachableBlocks(). Some of the removed blocks could
have been reachable according to DominatorTree::isReachableFromEntry().
In this case the collected parse points became stale and resulted in a
crash when accessed.

The fix is to unconditionally canonicalize the IR to
removeUnreachableBlocks and then collect the parse points.

The added test crashes with the old version and passes with this patch.

Patch by Yevgeny Rouban!

Reviewed by: Anna

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

llvm-svn: 326748

6 years ago[X86] Add silvermont fp arithmetic cost model tests
Simon Pilgrim [Mon, 5 Mar 2018 22:13:22 +0000 (22:13 +0000)]
[X86] Add silvermont fp arithmetic cost model tests

Add silvermont to existing high coverage tests instead of repeating in slm-arith-costs.ll

llvm-svn: 326747

6 years ago[analyzer] AST-matching checker to detect global central dispatch performance anti...
George Karpenkov [Mon, 5 Mar 2018 22:03:32 +0000 (22:03 +0000)]
[analyzer] AST-matching checker to detect global central dispatch performance anti-pattern

rdar://37312818

NB: The checker does not care about the ordering of callbacks, see the
relevant FIXME in tests.

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

llvm-svn: 326746

6 years ago[AMDGPU] Remove unused AMDOpenCL triple environment
Tony Tye [Mon, 5 Mar 2018 21:39:41 +0000 (21:39 +0000)]
[AMDGPU] Remove unused AMDOpenCL triple environment

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

llvm-svn: 326745

6 years ago[msvc] Allow MSVC toolchain driver to find the aarch64 / arm64 cross-compiler.
Reid Kleckner [Mon, 5 Mar 2018 21:36:23 +0000 (21:36 +0000)]
[msvc] Allow MSVC toolchain driver to find the aarch64 / arm64 cross-compiler.

Starting with the Fall Creators Update, Windows 10 Desktop can run on
machines that are powered by aarch64 processors.

Microsoft call the aarch64 architecture "arm64". This patch maps
ArchType::aarch64 to "arm64" to allow the MSVC toolchain driver to find
the aarch64 / arm64 cross-compiler.

Patch by Chris January

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

llvm-svn: 326744

6 years agoFix the install location of LLDBWrapPython.cpp when building
Adrian Prantl [Mon, 5 Mar 2018 21:08:42 +0000 (21:08 +0000)]
Fix the install location of LLDBWrapPython.cpp when building
LLDB.framework to point to the build directory where it is expected by
the top-level CMakeLists.txt.

This should be a no-op in any other configurations.

rdar://problem/38005302

llvm-svn: 326743

6 years ago[AVR] Fix the test suite after r326500.
Dylan McKay [Mon, 5 Mar 2018 20:56:25 +0000 (20:56 +0000)]
[AVR] Fix the test suite after r326500.

r326500 subtly changed the way the instructions are printed.

llvm-svn: 326742

6 years agoFix typo in comment.
Richard Smith [Mon, 5 Mar 2018 20:54:34 +0000 (20:54 +0000)]
Fix typo in comment.

llvm-svn: 326741

6 years ago[SLP] Additional tests for stores vectorization, NFC.
Alexey Bataev [Mon, 5 Mar 2018 20:20:12 +0000 (20:20 +0000)]
[SLP] Additional tests for stores vectorization, NFC.

llvm-svn: 326740

6 years ago[test] Skip pexpect-based lldb-mi tests on Darwin
Vedant Kumar [Mon, 5 Mar 2018 20:16:52 +0000 (20:16 +0000)]
[test] Skip pexpect-based lldb-mi tests on Darwin

These tests fail with a relatively frequently on Darwin machines with
errors such as:

  File ".../lldb/third_party/Python/module/pexpect-2.4/pexpect.py", line 1444, in expect_loop
    raise EOF(str(e) + '\n' + str(self))
EOF: End Of File (EOF) in read_nonblocking(). Empty string style platform.

The unpredictable failures make these tests noisy.

rdar://37046976

llvm-svn: 326739

6 years agoRe-commit: Make STATISTIC() values available programmatically
Daniel Sanders [Mon, 5 Mar 2018 19:38:16 +0000 (19:38 +0000)]
Re-commit: Make STATISTIC() values available programmatically

Summary:
It can be useful for tools to be able to retrieve the values of variables
declared via STATISTIC() directly without having to emit them and parse
them back. Use cases include:
* Needing to report specific statistics to a test harness
* Wanting to post-process statistics. For example, to produce a percentage of
  functions that were fully selected by GlobalISel

Make this possible by adding llvm::GetStatistics() which returns an
iterator_range that can be used to inspect the statistics that have been
touched during execution. When statistics are disabled (NDEBUG and not
LLVM_ENABLE_STATISTICS) this method will return an empty range.

This patch doesn't address the effect of multiple compilations within the same
process. In such situations, the statistics will be cumulative for all
compilations up to the GetStatistics() call.

Reviewers: qcolombet, rtereshin, aditya_nandakumar, bogner

Reviewed By: rtereshin, bogner

Subscribers: llvm-commits, mgorny

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

This re-commit fixes a missing include of <vector> which it seems clang didn't
mind but G++ and MSVC objected to. It seems that, clang was ok with std::vector
only being forward declared at the point of use since it was fully defined
eventually but G++/MSVC both rejected it at the point of use.

llvm-svn: 326738

6 years agoOn Windows we need to be able to process response files with Windows-style
Dmitry Mikulin [Mon, 5 Mar 2018 19:34:33 +0000 (19:34 +0000)]
On Windows we need to be able to process response files with Windows-style
path names.

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

llvm-svn: 326737

6 years ago[PowerPC] Do not emit record-form rotates when record-form andi suffices
Nemanja Ivanovic [Mon, 5 Mar 2018 19:27:16 +0000 (19:27 +0000)]
[PowerPC] Do not emit record-form rotates when record-form andi suffices

Up until Power9, the performance profile for rlwinm., rldicl. and andi. looked
more or less equivalent. However with Power9, the rotates are still 2-way
cracked whereas the and-immediate is not.

This patch just ensures that we don't emit record-form rotates when an andi.
is adequate.

As first pointed out by Carrot in https://bugs.llvm.org/show_bug.cgi?id=30833
(this patch is a fix for that PR).

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

llvm-svn: 326736

6 years ago[x86] auto-generate full checks for fabs tests
Sanjay Patel [Mon, 5 Mar 2018 19:11:20 +0000 (19:11 +0000)]
[x86] auto-generate full checks for fabs tests

Also, change the x86-64 test to optimized and remove the
unnecessary platform specification from the RUN lines..

llvm-svn: 326735

6 years agoOn Windows expansion of regex file name patterns is the responsibility of each
Dmitry Mikulin [Mon, 5 Mar 2018 18:54:56 +0000 (18:54 +0000)]
On Windows expansion of regex file name patterns is the responsibility of each
tool. Fix ar to do that.

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

llvm-svn: 326734

6 years agoImprove OpenMP threadprivate implementation.
Andrey Churbanov [Mon, 5 Mar 2018 18:42:01 +0000 (18:42 +0000)]
Improve OpenMP threadprivate implementation.

Patch by Terry Wilmarth

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

llvm-svn: 326733

6 years agoFix an unused variable warning introduced by rr326703. NFC
Eric Liu [Mon, 5 Mar 2018 18:36:39 +0000 (18:36 +0000)]
Fix an unused variable warning introduced by rr326703. NFC

llvm-svn: 326732

6 years ago[llvm-pdbdump] Dump restrict type qualifier
Aaron Smith [Mon, 5 Mar 2018 18:29:43 +0000 (18:29 +0000)]
[llvm-pdbdump] Dump restrict type qualifier

Reviewers: zturner, llvm-commits, rnk

Reviewed By: zturner

Subscribers: majnemer

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

llvm-svn: 326731

6 years ago[InstCombine] Don't blow up in foldICmpWithCastAndCast on vector icmp instructions.
Daniel Neilson [Mon, 5 Mar 2018 18:05:51 +0000 (18:05 +0000)]
[InstCombine] Don't blow up in foldICmpWithCastAndCast on vector icmp instructions.

Summary:
Presently, InstCombiner::foldICmpWithCastAndCast() implicitly assumes that it is
only invoked with icmp instructions of integer type. If that assumption is broken,
and it is called with an icmp of vector type, then it fails (asserts/crashes).

This patch addresses the deficiency. It allows it to simplify
icmp (ptrtoint x), (ptrtoint/c) of vector type into a compare of the inputs,
much as is done when the type is integer.

Reviewers: apilipenko, fedor.sergeev, mkazantsev, anna

Reviewed By: anna

Subscribers: llvm-commits

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

llvm-svn: 326730

6 years ago[InstCombine] Add constant vector support to getMinimumFPType for visitFPTrunc.
Craig Topper [Mon, 5 Mar 2018 18:04:12 +0000 (18:04 +0000)]
[InstCombine] Add constant vector support to getMinimumFPType for visitFPTrunc.

This patch teaches getMinimumFPType to support shrinking a vector of ConstantFPs. This should improve our ability to combine vector fptrunc with fp binops.

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

llvm-svn: 326729

6 years agoFixed build of the OpenMP stubs library.
Andrey Churbanov [Mon, 5 Mar 2018 18:01:47 +0000 (18:01 +0000)]
Fixed build of the OpenMP stubs library.

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

llvm-svn: 326728

6 years agoIncluding <functional> for std::bind
Raphael Isemann [Mon, 5 Mar 2018 17:54:23 +0000 (17:54 +0000)]
Including <functional> for std::bind

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

llvm-svn: 326727

6 years agoRevert r326723: Make STATISTIC() values available programmatically
Daniel Sanders [Mon, 5 Mar 2018 17:52:43 +0000 (17:52 +0000)]
Revert r326723: Make STATISTIC() values available programmatically

Despite building cleanly on my machine in three separate configs, it's failing on pretty much all bots due to missing includes among other things. Investigating.

llvm-svn: 326726

6 years ago[AMDGPU] Clean up old address space mapping and fix constant address space value
Yaxun Liu [Mon, 5 Mar 2018 17:50:10 +0000 (17:50 +0000)]
[AMDGPU] Clean up old address space mapping and fix constant address space value

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

llvm-svn: 326725

6 years ago[AArch64] Harden test case
Evandro Menezes [Mon, 5 Mar 2018 17:42:18 +0000 (17:42 +0000)]
[AArch64] Harden test case

NFC

llvm-svn: 326724

6 years agoMake STATISTIC() values available programmatically
Daniel Sanders [Mon, 5 Mar 2018 17:41:45 +0000 (17:41 +0000)]
Make STATISTIC() values available programmatically

Summary:
It can be useful for tools to be able to retrieve the values of variables
declared via STATISTIC() directly without having to emit them and parse
them back. Use cases include:
* Needing to report specific statistics to a test harness
* Wanting to post-process statistics. For example, to produce a percentage of
  functions that were fully selected by GlobalISel

Make this possible by adding llvm::GetStatistics() which returns an
iterator_range that can be used to inspect the statistics that have been
touched during execution. When statistics are disabled (NDEBUG and not
LLVM_ENABLE_STATISTICS) this method will return an empty range.

This patch doesn't address the effect of multiple compilations within the same
process. In such situations, the statistics will be cumulative for all
compilations up to the GetStatistics() call.

Reviewers: qcolombet, rtereshin, aditya_nandakumar, bogner

Reviewed By: rtereshin, bogner

Subscribers: llvm-commits, mgorny

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

llvm-svn: 326723

6 years agofix PR36582
Sebastian Pop [Mon, 5 Mar 2018 17:35:49 +0000 (17:35 +0000)]
fix PR36582

The error occurs when reading i16 elements (as in the testcase) from a v8i8
with a pattern of <0,2,4,6>. As all the data in the vector is accessed, the
operation is not a VUZP. The patch stops the pattern recognition of VUZP when
EXTRACT_VECTOR_ELT has a different element type than BUILD_VECTOR.

llvm-svn: 326722

6 years ago[clangd] Fix unintentionally loose fuzzy matching, and the tests masking it.
Sam McCall [Mon, 5 Mar 2018 17:34:33 +0000 (17:34 +0000)]
[clangd] Fix unintentionally loose fuzzy matching, and the tests masking it.

Summary:
The intent was that [ar] doesn't match "FooBar"; the first character must match
a Head character (hard requirement, not just a low score).
This matches VSCode, and was "tested" but the tests were defective.

The tests expected matches("FooBar") to fail for lack of a match. But instead
it fails because the string should be annotated - matches("FooB[ar]").
This patch makes matches("FooBar") ignore annotations, as was intended.

Fixing the code to reject weak matches for the first char causes problems:
-  [bre] no longer matches "HTMLBRElement".
   We allow matching against an uppercase char even if we don't think it's head.
   Only do this if there's at least one lowercase, to avoid triggering on MACROS
-  [print] no longer matches "sprintf".
   This is hard to fix without false positives (e.g. [int] vs "sprintf"])
   This patch leaves this case broken. A future patch will add a dictionary
   providing custom segmentation to common names from the standard library.

Fixed a couple of index tests that indirectly relied on broken fuzzy matching.
Added const in a couple of missing places for consistency with new code.

Subscribers: klimek, ilya-biryukov, jkorous-apple, ioeric, cfe-commits

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

llvm-svn: 326721

6 years ago[IPSCCP] Add getCompare which returns either true, false, undef or null.
Florian Hahn [Mon, 5 Mar 2018 17:33:50 +0000 (17:33 +0000)]
[IPSCCP] Add getCompare which returns either true, false, undef or null.

getCompare returns true, false or undef constants if the comparison can
be evaluated, or nullptr if it cannot. This is in line with what
ConstantExpr::getCompare returns. It also allows us to use
ConstantExpr::getCompare for comparing constants.

Reviewers: davide, mssimpso, dberlin, anna

Reviewed By: davide

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

llvm-svn: 326720

6 years ago[clangd] Extract ClangdServer::Options struct.
Sam McCall [Mon, 5 Mar 2018 17:28:54 +0000 (17:28 +0000)]
[clangd] Extract ClangdServer::Options struct.

Summary:
This subsumes most of the params to ClangdServer and ClangdLSPServer.
Adjacent changes:
 - tests use a consistent set of options, except when testing specific options
 - tests that previously used synchronous mode for convenience no longer do
 - added a runAddDocument helper to SyncAPIs to mitigate the extra code
 - rearranged main a bit to follow the structure of the options

Reviewers: ilya-biryukov

Subscribers: klimek, jkorous-apple, ioeric, cfe-commits

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

llvm-svn: 326719

6 years ago[AArch64] Improve code generation of constant vectors
Evandro Menezes [Mon, 5 Mar 2018 17:02:47 +0000 (17:02 +0000)]
[AArch64] Improve code generation of constant vectors

Use the whole gammut of constant immediates available to set up a vector.
Instead of using, for example, `mov w0, #0xffff; dup v0.4s, w0`, which
transfers between register files, use the more efficient `movi v0.4s, #-1`
instead.  Not limited to just a few values, but any immediate value that can
be encoded by all the variants of `FMOV`, `MOVI`, `MVNI`, thus eliminating
the need to there be patterns to optimize special cases.

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

llvm-svn: 326718

6 years ago[demangler] Modernize parse_name.
Erik Pilkington [Mon, 5 Mar 2018 16:35:06 +0000 (16:35 +0000)]
[demangler] Modernize parse_name.

llvm-svn: 326717

6 years ago[MachineScheduler] Dump SUnits before calling SchedImpl->initialize()
Jonas Paulsson [Mon, 5 Mar 2018 16:31:49 +0000 (16:31 +0000)]
[MachineScheduler] Dump SUnits before calling SchedImpl->initialize()

This is a NFC simple patch that changes the DEBUG dumping in the
MachineScheduler so that the dumping of the built SUnits is done before the
SchedImpl->initialize() is called.

This is better on SystemZ, since it has a strategy that does some dumping at
the start of the region, and it is not possible to easily read it if it is
output above a long list of SU.

Review: Javed Absar
https://reviews.llvm.org/D44089

llvm-svn: 326716

6 years agoAMDGPU/GlobalISel: Add InstrMapping for G_EXTRACT
Matt Arsenault [Mon, 5 Mar 2018 16:25:18 +0000 (16:25 +0000)]
AMDGPU/GlobalISel: Add InstrMapping for G_EXTRACT

llvm-svn: 326715

6 years agoAMDGPU/GlobalISel: Make some G_EXTRACTs legal
Matt Arsenault [Mon, 5 Mar 2018 16:25:15 +0000 (16:25 +0000)]
AMDGPU/GlobalISel: Make some G_EXTRACTs legal

As far as I can tell legalization of weird sizes for the
output type isn't implemented.

llvm-svn: 326714