platform/upstream/llvm.git
6 years ago[clangd] Fix msan failure after r344735 by initializing bitfields
Krasimir Georgiev [Fri, 19 Oct 2018 06:05:32 +0000 (06:05 +0000)]
[clangd] Fix msan failure after r344735 by initializing bitfields

That revision changed integer members to bitfields; the integers were
default initialized before and the bitfields lost that default
initialization. This started causing msan use-of-uninitialized memory in
clangd tests.

llvm-svn: 344773

6 years ago[clang-tidy] readability-uppercase-literal-suffix: specify target for ms test too
Roman Lebedev [Fri, 19 Oct 2018 06:04:07 +0000 (06:04 +0000)]
[clang-tidy] readability-uppercase-literal-suffix: specify target for ms test too

Apparently the bots were still failing with this.
Sadly, i did not see *this* failure when i last looked.

llvm-svn: 344772

6 years agoRevert commit r344670 as the test fails on a bot http://lab.llvm.org:8011/builders...
Douglas Yung [Fri, 19 Oct 2018 04:09:32 +0000 (04:09 +0000)]
Revert commit r344670 as the test fails on a bot lab.llvm.org:8011/builders/clang-cmake-armv7-full/builds/2683/.

llvm-svn: 344771

6 years ago[CodeGen] Fix for PR39094.
Hsiangkai Wang [Fri, 19 Oct 2018 01:52:54 +0000 (01:52 +0000)]
[CodeGen] Fix for PR39094.

When using MachineInstr to get SlotIndex, the MI could not be a debug
instruction. mi2iMap does not contain debug instructions in it.

After enabling DBG_LABEL in the generated code, the first instruction in
the bundle may be a debug instruction. In this patch, I use the first
non-debug instruction in the bundle to query SlotIndex in mi2iMap.

Bugzilla report: https://bugs.llvm.org/show_bug.cgi?id=39094

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

llvm-svn: 344770

6 years ago[TI removal] Remove `TerminatorInst` from the IR type system!
Chandler Carruth [Fri, 19 Oct 2018 00:22:37 +0000 (00:22 +0000)]
[TI removal] Remove `TerminatorInst` from the IR type system!

llvm-svn: 344769

6 years ago[TI removal] Switch some newly added code over to use `Instruction`
Chandler Carruth [Fri, 19 Oct 2018 00:22:10 +0000 (00:22 +0000)]
[TI removal] Switch some newly added code over to use `Instruction`
directly.

llvm-svn: 344768

6 years ago[COFF, ARM64] Enable unit test arm64-microsoft-status-reg.cpp only for aarch64 target
Mandeep Singh Grang [Fri, 19 Oct 2018 00:05:26 +0000 (00:05 +0000)]
[COFF, ARM64] Enable unit test arm64-microsoft-status-reg.cpp only for aarch64 target

This should unbreak bots broken here:
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/14391
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/38288

llvm-svn: 344767

6 years agoUpdate the project name in README.md
Greg Bedwell [Fri, 19 Oct 2018 00:03:01 +0000 (00:03 +0000)]
Update the project name in README.md

Per llvm.org: "The name "LLVM" itself is not an acronym; it is the full
name of the project."

llvm-svn: 344766

6 years ago[COFF, ARM64] Add _ReadStatusReg and_WriteStatusReg intrinsics
Mandeep Singh Grang [Thu, 18 Oct 2018 23:35:35 +0000 (23:35 +0000)]
[COFF, ARM64] Add _ReadStatusReg and_WriteStatusReg intrinsics

Reviewers: rnk, compnerd, mstorsjo, efriedma, TomTan, haripul, javed.absar

Reviewed By: efriedma

Subscribers: dmajor, kristof.beyls, chrib, cfe-commits

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

llvm-svn: 344765

6 years ago[TI removal] Update the C API for the move away from `TerminatorInst`.
Chandler Carruth [Thu, 18 Oct 2018 23:03:55 +0000 (23:03 +0000)]
[TI removal] Update the C API for the move away from `TerminatorInst`.

This updates the C API for the removal of `TerminatorInst`. It converts
the type query to a predicate query and moves the generic methods to
work on `Instruction` instances that satisfy this predicate rather than
requiring a specific type. It also clarifies that the C API wrapping
`BasicBlock::getTerminator` just returns an `Instruction`. Because this
was always wrapped opaquely as a value and the functions consuming these
values will work on `Instruction` objects, this shouldn't break any
clients.

This is a completely compatible change to the C API.

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

llvm-svn: 344764

6 years ago[ORC] Add a createJITDylib method to LLJIT.
Lang Hames [Thu, 18 Oct 2018 22:42:32 +0000 (22:42 +0000)]
[ORC] Add a createJITDylib method to LLJIT.

Because I'm about to get on stage at the dev meeting and claim that it exists.

This method creates a JITDylib instance with the given name and returns a
reference to it.

llvm-svn: 344763

6 years ago[Test] Fix test file for C++98 mode
David Bolvansky [Thu, 18 Oct 2018 21:26:01 +0000 (21:26 +0000)]
[Test] Fix test file for C++98 mode

llvm-svn: 344762

6 years ago[Diagnostics] Add missing expected warning to test file
David Bolvansky [Thu, 18 Oct 2018 21:06:14 +0000 (21:06 +0000)]
[Diagnostics] Add missing expected warning to test file

llvm-svn: 344761

6 years ago[clang-tidy] readability-uppercase-literal-suffix: specify target for opencl test
Roman Lebedev [Thu, 18 Oct 2018 20:59:03 +0000 (20:59 +0000)]
[clang-tidy] readability-uppercase-literal-suffix: specify target for opencl test

I'm not sure if it will actually help or not.
ppc64be-clang-lnt-test bot is failing.

llvm-svn: 344760

6 years ago[Diagnostics] Check for integer overflow in array size expressions
David Bolvansky [Thu, 18 Oct 2018 20:49:06 +0000 (20:49 +0000)]
[Diagnostics] Check for integer overflow in array size expressions

Summary: Fixes PR27439

Reviewers: rsmith, Rakete1111

Reviewed By: rsmith

Subscribers: Rakete1111, cfe-commits

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

llvm-svn: 344759

6 years ago[clang-tidy] readability-uppercase-literal-suffix: specify target for fp tests
Roman Lebedev [Thu, 18 Oct 2018 20:27:10 +0000 (20:27 +0000)]
[clang-tidy] readability-uppercase-literal-suffix: specify target for fp tests

__float128 isn't universally avaliable.

llvm-svn: 344758

6 years ago[clang-tidy] Non-private member variables in classes (MISRA, CppCoreGuidelines, HICPP)
Roman Lebedev [Thu, 18 Oct 2018 20:16:44 +0000 (20:16 +0000)]
[clang-tidy] Non-private member variables in classes (MISRA, CppCoreGuidelines, HICPP)

Summary:
Finds classes that not only contain the data (non-static member variables),
but also have logic (non-static member functions), and diagnoses all member
variables that have any other scope other than `private`. They should be
made `private`, and manipulated exclusively via the member functions.

Optionally, classes with all member variables being `public` could be
ignored, and optionally all `public` member variables could be ignored.

Options
-------

* IgnoreClassesWithAllMemberVariablesBeingPublic

  Allows to completely ignore classes if **all** the member variables in that
  class have `public` visibility.

* IgnorePublicMemberVariables

  Allows to ignore (not diagnose) **all** the member variables with `public`
  visibility scope.

References:
* MISRA 11-0-1 Member data in non-POD class types shall be private.
* https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c2-use-class-if-the-class-has-an-invariant-use-struct-if-the-data-members-can-vary-independently
* https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rc-private
* https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rh-protected

Reviewers: JonasToth, aaron.ballman, alexfh, hokein, xazax.hun

Reviewed By: aaron.ballman

Subscribers: Eugene.Zelenko, zinovy.nis, cfe-commits, rnkovacs, nemanjai, mgorny, xazax.hun, kbarton

Tags: #clang-tools-extra

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

llvm-svn: 344757

6 years agoSupport of hurd in llvm-shlib
Sylvestre Ledru [Thu, 18 Oct 2018 20:07:44 +0000 (20:07 +0000)]
Support of hurd in llvm-shlib

Svante Signell

llvm-svn: 344756

6 years ago[clang-tidy] Add new 'readability-uppercase-literal-suffix' check (CERT DCL16-C,...
Roman Lebedev [Thu, 18 Oct 2018 20:06:40 +0000 (20:06 +0000)]
[clang-tidy] Add new 'readability-uppercase-literal-suffix' check (CERT DCL16-C, MISRA C:2012, 7.3, MISRA C++:2008, 2-13-4)

Summary:
Detects when the integral literal or floating point (decimal or hexadecimal)
literal has non-uppercase suffix, and suggests to make the suffix uppercase,
with fix-it.

All valid combinations of suffixes are supported.

```
  auto x = 1;  // OK, no suffix.

  auto x = 1u; // warning: integer literal suffix 'u' is not upper-case

  auto x = 1U; // OK, suffix is uppercase.

  ...
```

References:
* [[ https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87152241 | CERT DCL16-C ]]
* MISRA C:2012, 7.3 - The lowercase character "l" shall not be used in a literal suffix
* MISRA C++:2008, 2-13-4 - Literal suffixes shall be upper case

Reviewers: JonasToth, aaron.ballman, alexfh, hokein, xazax.hun

Reviewed By: aaron.ballman

Subscribers: Eugene.Zelenko, mgorny, rnkovacs, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 344755

6 years agoMake Function::getInstructionCount const
Mircea Trofin [Thu, 18 Oct 2018 19:49:44 +0000 (19:49 +0000)]
Make Function::getInstructionCount const

Summary: Function::getInstructionCount can be const.

Reviewers: davidxl, paquette

Reviewed By: davidxl

Subscribers: llvm-commits

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

llvm-svn: 344754

6 years agoRevert r344693 ("[ARM] bottom-top mul support in ARMParallelDSP")
Eli Friedman [Thu, 18 Oct 2018 19:34:30 +0000 (19:34 +0000)]
Revert r344693 ("[ARM] bottom-top mul support in ARMParallelDSP")

Still causing failures on the polly-aosp buildbot; I'll follow up
with a reduced testcase.

llvm-svn: 344752

6 years ago[compiler-rt] Don't explicitly set CMAKE_CXX_FLAGS.
Dan Albert [Thu, 18 Oct 2018 18:04:28 +0000 (18:04 +0000)]
[compiler-rt] Don't explicitly set CMAKE_CXX_FLAGS.

Summary:
C++ flags should not be used for not-C++ files as it may trigger
-Werror=unused-command-line-argument. CMake will use CMAKE_C_FLAGS,
CMAKE_CXX_FLAGS, and CMAKE_ASM_FLAGS as appropriate implicitly, so
this does not need to be explicitly handled here.

This change depends on https://reviews.llvm.org/D53301, since one of
the builders depended on this behavior because it was not configuring
CMAKE_ASM_FLAGS.

Reviewers: eugenis, vitalybuka

Reviewed By: eugenis, vitalybuka

Subscribers: dberris, mgorny, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 344751

6 years agoAdd check-clang-python to the Clang tests directory in IDEs; NFC.
Aaron Ballman [Thu, 18 Oct 2018 17:47:18 +0000 (17:47 +0000)]
Add check-clang-python to the Clang tests directory in IDEs; NFC.

llvm-svn: 344750

6 years agoAdd language standard aliases for -std=c18, -std=gnu18, and -std=iso9899:2018.
Aaron Ballman [Thu, 18 Oct 2018 17:42:41 +0000 (17:42 +0000)]
Add language standard aliases for -std=c18, -std=gnu18, and -std=iso9899:2018.

As described in D40225, the C17 standard was balloted and approved in 2017, but the ISO publication process delayed the actual publication until 2018. WG14 considers the release to be C17 and describes it as such, but users can still be confused by the publication year which is why -std=c18 adds value. These aliases map to c17 and are all supported by GCC 8.x with the same behavior. Note that the value of __STDC_VERSION__ remains at 201710L.

llvm-svn: 344749

6 years ago[Pipeliner] copyToPhi DAG Mutation to improve scheduling.
Sumanth Gundapaneni [Thu, 18 Oct 2018 15:51:16 +0000 (15:51 +0000)]
[Pipeliner] copyToPhi DAG Mutation to improve scheduling.

In a loop, create artificial dependences between the source of a
COPY/REG_SEQUENCE to the use in next iteration.

Eg:
SRC ----Data Dep--> COPY
COPY ---Anti Dep--> PHI (implies, to be used in next iteration)
PHI ----Data Dep--> USE

This patches creates
USE ----Artificial Dep---> SRC

This will effectively schedule the COPY late to eliminate additional copies.
Before this patch, the schedule can be
SRC, COPY, USE : The COPY is used in next iteration and it needs to be
preserved.

After this patch, the schedule can be
USE, SRC, COPY : The COPY is used in next iteration and the live interval is
reduced.

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

llvm-svn: 344748

6 years ago[PPC64] Fix offset checks on rel24 call relocations.
Sean Fertile [Thu, 18 Oct 2018 15:43:41 +0000 (15:43 +0000)]
[PPC64] Fix offset checks on rel24 call relocations.

Adjusted the range check on a call instruction from 24 bits signed to
26 bits signed. While the instruction only encodes 24 bits, the target is
assumed to be 4 byte aligned, and the value that is encoded in the instruction
gets shifted left by 2 to form the offset. Also added a check that the offset is
indeed at least 4 byte aligned.

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

llvm-svn: 344747

6 years ago[SymbolFileNativePDB] Fix missing linkage to DebugInfoCodeView
Michal Gorny [Thu, 18 Oct 2018 15:39:22 +0000 (15:39 +0000)]
[SymbolFileNativePDB] Fix missing linkage to DebugInfoCodeView

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

llvm-svn: 344746

6 years ago[clangd] Clear the semantic of RefSlab::size.
Haojian Wu [Thu, 18 Oct 2018 15:33:20 +0000 (15:33 +0000)]
[clangd] Clear the semantic of RefSlab::size.

Summary:
The RefSlab::size can easily cause confusions, it returns the number of
different symbols, rahter than the number of all references.

- add numRefs() method and cache it, since calculating it everytime is nontrivial.
- clear misused places.

Reviewers: sammccall

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

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

llvm-svn: 344745

6 years ago[lldbsuite] Mark the TestScriptedResolver tests as XFAIL on Windows
Stella Stamenova [Thu, 18 Oct 2018 15:30:31 +0000 (15:30 +0000)]
[lldbsuite] Mark the TestScriptedResolver tests as XFAIL on Windows

Summary: They fail similarly to some of the other breakpoint tests on Windows, so I suspect the cause is the same. I've linked to the same bug.

Reviewers: asmith, zturner, jingham

Subscribers: abidh, lldb-commits

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

llvm-svn: 344744

6 years ago[LV] Fold tail by masking to vectorize loops of arbitrary trip count under opt for...
Ayal Zaks [Thu, 18 Oct 2018 15:03:15 +0000 (15:03 +0000)]
[LV] Fold tail by masking to vectorize loops of arbitrary trip count under opt for size

When optimizing for size, a loop is vectorized only if the resulting vector loop
completely replaces the original scalar loop. This holds if no runtime guards
are needed, if the original trip-count TC does not overflow, and if TC is a
known constant that is a multiple of the VF. The last two TC-related conditions
can be overcome by
1. rounding the trip-count of the vector loop up from TC to a multiple of VF;
2. masking the vector body under a newly introduced "if (i <= TC-1)" condition.

The patch allows loops with arbitrary trip counts to be vectorized under -Os,
subject to the existing cost model considerations. It also applies to loops with
small trip counts (under -O2) which are currently handled as if under -Os.

The patch does not handle loops with reductions, live-outs, or w/o a primary
induction variable, and disallows interleave groups.

(Third, final and main part of -)
Differential Revision: https://reviews.llvm.org/D50480

llvm-svn: 344743

6 years ago[X86][Tests] Make sure tls-direct-seg-refs tests only run where supported
Kristina Brooks [Thu, 18 Oct 2018 14:44:25 +0000 (14:44 +0000)]
[X86][Tests] Make sure tls-direct-seg-refs tests only run where supported

This flag is only supported for x86 targets, make sure the tests only run
for those.

llvm-svn: 344742

6 years ago[clangd] Enforce rules around "initialize" request, and create ClangdServer lazily.
Sam McCall [Thu, 18 Oct 2018 14:41:50 +0000 (14:41 +0000)]
[clangd] Enforce rules around "initialize" request, and create ClangdServer lazily.

Summary:
LSP is a slightly awkward map to C++ object lifetimes: the initialize request
is part of the protocol and provides information that doesn't change over the
lifetime of the server.

Until now, we handled this by initializing ClangdServer and ClangdLSPServer
right away, and making anything that can be set in the "initialize" request
mutable.
With this patch, we create ClangdLSPServer immediately, but defer creating
ClangdServer until "initialize". This opens the door to passing the relevant
initialize params in the constructor and storing them immutably.
(That change isn't actually done in this patch).

To make this safe, we have the MessageDispatcher enforce that the "initialize"
method is called before any other (as required by LSP). That way each method
handler can assume Server is initialized, as today.

As usual, while implementing this I found places where our test cases violated
the protocol.

Reviewers: ioeric

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

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

llvm-svn: 344741

6 years ago[OPENMP] Move OMPClausePrinter to OpenMPClause.h/OpenMPClause.cpp - NFC. Differential...
Patrick Lyster [Thu, 18 Oct 2018 14:28:23 +0000 (14:28 +0000)]
[OPENMP] Move OMPClausePrinter to OpenMPClause.h/OpenMPClause.cpp - NFC. Differential Revision: https://reviews.llvm.org/D53102

llvm-svn: 344740

6 years agoAdd support for -mno-tls-direct-seg-refs to Clang
Kristina Brooks [Thu, 18 Oct 2018 14:07:02 +0000 (14:07 +0000)]
Add support for -mno-tls-direct-seg-refs to Clang

This patch exposes functionality added in rL344723 to the Clang driver/frontend
as a flag and adds appropriate metadata.

Driver tests pass:
```
ninja check-clang-driver
-snip-
  Expected Passes    : 472
  Expected Failures  : 3
  Unsupported Tests  : 65
```

Odd failure in CodeGen tests but unrelated to this:
```
ninja check-clang-codegen
-snip-
/SourceCache/llvm-trunk-8.0/tools/clang/test/CodeGen/builtins-wasm.c:87:10:
error: cannot compile this builtin function yet
-snip-
Failing Tests (1):
    Clang :: CodeGen/builtins-wasm.c

  Expected Passes    : 1250
  Expected Failures  : 2
  Unsupported Tests  : 120
  Unexpected Failures: 1
```

Original commit:
[X86] Support for the mno-tls-direct-seg-refs flag
Allows to disable direct TLS segment access (%fs or %gs). GCC supports a
similar flag, it can be useful in some circumstances, e.g. when a thread
context block needs to be updated directly from user space. More info and
specific use cases: https://bugs.llvm.org/show_bug.cgi?id=16145

Patch by nruslan (Ruslan Nikolaev).

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

llvm-svn: 344739

6 years agoDivergenceAnalysisTest: fix use of uninitialized memory
Nicolai Haehnle [Thu, 18 Oct 2018 12:54:39 +0000 (12:54 +0000)]
DivergenceAnalysisTest: fix use of uninitialized memory

Thanks to Simon Moll for chasing it down.

Change-Id: If188f07c4aaec217f40a7a2ca029818f9202f1cb
llvm-svn: 344738

6 years ago[clangd] Lay JSONRPCDispatcher to rest.
Sam McCall [Thu, 18 Oct 2018 12:32:04 +0000 (12:32 +0000)]
[clangd] Lay JSONRPCDispatcher to rest.

Summary:
Most of its functionality is moved into ClangdLSPServer.
The decoupling between JSONRPCDispatcher, ProtocolCallbacks, ClangdLSPServer
was never real, and only served to obfuscate.

Some previous implicit/magic stuff is now explicit:
 - the return type of LSP method calls are now in the signature
 - no more reply() that gets the ID using global context magic
 - arg tracing no longer relies on RequestArgs::stash context magic either

This is mostly refactoring, but some deliberate fixes while here:
 - LSP method params are now by const reference
 - notifications and calls are now distinct namespaces.
   (some tests had protocol errors and needed updating)
 - we now reply to calls we failed to decode
 - outgoing calls use distinct IDs
A few error codes and message IDs changed in unimportant ways (see tests).

Reviewers: ioeric

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

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

llvm-svn: 344737

6 years ago[clangd] Names that are not spelled in source code are reserved.
Eric Liu [Thu, 18 Oct 2018 12:23:05 +0000 (12:23 +0000)]
[clangd] Names that are not spelled in source code are reserved.

Summary:
These are often not expected to be used directly e.g.
```
TEST_F(Fixture, X) {
  ^  // "Fixture_X_Test" expanded in the macro should be down ranked.
}
```

Only doing this for sema for now, as such symbols are mostly coming from sema
e.g. gtest macros expanded in the main file. We could also add a similar field
for the index symbol.

Reviewers: sammccall

Reviewed By: sammccall

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

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

llvm-svn: 344736

6 years ago[clangd] Encode Line/Column as a 32-bits integer.
Haojian Wu [Thu, 18 Oct 2018 10:43:50 +0000 (10:43 +0000)]
[clangd] Encode Line/Column as a 32-bits integer.

Summary:
This would buy us more memory. Using a 32-bits integer is enough for
most human-readable source code (up to 4M lines and 4K columns).

Previsouly, we used 8 bytes for a position, now 4 bytes, it would save
us 8 bytes for each Ref and each Symbol instance.

For LLVM-project binary index file, we save ~13% memory.

| Before | After |
| 412MB  | 355MB |

Reviewers: sammccall

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

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

llvm-svn: 344735

6 years ago[DA] DivergenceAnalysis for unstructured, reducible CFGs
Nicolai Haehnle [Thu, 18 Oct 2018 09:38:44 +0000 (09:38 +0000)]
[DA] DivergenceAnalysis for unstructured, reducible CFGs

Summary:
This is patch 2 of the new DivergenceAnalysis (https://reviews.llvm.org/D50433).

This patch contains a generic divergence analysis implementation for
unstructured, reducible Control-Flow Graphs. It contains two new classes.
The `SyncDependenceAnalysis` class lazily computes sync dependences, which
relate divergent branches to points of joining divergent control. The
`DivergenceAnalysis` class contains the generic divergence analysis
implementation.

Reviewers: nhaehnle

Reviewed By: nhaehnle

Subscribers: sameerds, kristina, nhaehnle, xbolva00, tschuett, mgorny, llvm-commits

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

llvm-svn: 344734

6 years ago[clang-tidy] Ignore a case where the fix of make_unique check introduces side effect.
Haojian Wu [Thu, 18 Oct 2018 09:13:34 +0000 (09:13 +0000)]
[clang-tidy] Ignore a case where the fix of make_unique check introduces side effect.

Summary:
Previously, ptr.reset(new char[5]) will be replaced with `p =
make_unique<char[]>(5)`, the fix has side effect -- doing
default initialization, it may cause performace regression (we are
bitten by this rececntly)

The check should be conservative for these cases.

Reviewers: alexfh

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 344733

6 years ago[Support] json::Value construction from std::vector<T> and std::map<string,T>.
Sam McCall [Thu, 18 Oct 2018 08:47:24 +0000 (08:47 +0000)]
[Support] json::Value construction from std::vector<T> and std::map<string,T>.

Summary: Previously this required a conversion to json::Array/json::Object first.

Reviewers: ioeric

Subscribers: kristina, llvm-commits

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

llvm-svn: 344732

6 years ago[llvm-exegesis] Fix off by one error
Guillaume Chatelet [Thu, 18 Oct 2018 08:20:50 +0000 (08:20 +0000)]
[llvm-exegesis] Fix off by one error

llvm-svn: 344731

6 years ago[TI removal] Test predicate rather than casting to detect a terminator
Chandler Carruth [Thu, 18 Oct 2018 08:16:20 +0000 (08:16 +0000)]
[TI removal] Test predicate rather than casting to detect a terminator
and use the range based successor API.

llvm-svn: 344730

6 years ago[Windows] Fix threads comparison on Windows
Aleksandr Urakov [Thu, 18 Oct 2018 07:52:56 +0000 (07:52 +0000)]
[Windows] Fix threads comparison on Windows

Summary:
This patch makes Windows threads to compare by a thread ID, not by a handle.
It's because the same thread can have different handles on Windows
(for example, `GetCurrentThread` always returns the fake handle `-2`).
This leads to some incorrect behavior. For example, in `Process::GetRunLock`
always `m_public_run_lock` is returned without this patch.

Reviewers: zturner, clayborg, stella.stamenova

Reviewed By: stella.stamenova

Subscribers: stella.stamenova, lldb-commits

Tags: #lldb

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

llvm-svn: 344729

6 years ago[TI removal] Generically discuss terminators rather than use the soon to
Chandler Carruth [Thu, 18 Oct 2018 07:43:30 +0000 (07:43 +0000)]
[TI removal] Generically discuss terminators rather than use the soon to
vanish subclass name.

llvm-svn: 344728

6 years ago[TI removal] Remove discussion of `TerminatorInst` from the LLVM
Chandler Carruth [Thu, 18 Oct 2018 07:40:24 +0000 (07:40 +0000)]
[TI removal] Remove discussion of `TerminatorInst` from the LLVM
documentation.

llvm-svn: 344727

6 years ago[TI removal] Remove TerminatorInst references from bindings.
Chandler Carruth [Thu, 18 Oct 2018 07:40:03 +0000 (07:40 +0000)]
[TI removal] Remove TerminatorInst references from bindings.

For the Go bindings, this just removes the no longer useful "isa"-style
wrapper. If there is a user that is interested, they can add a wrapper
for `Instruction::isTerminator`.

For the OCaml bindings, this is just a documentation update.

llvm-svn: 344726

6 years agoAdd a emitUnaryFloatFnCall version that fetches the function name from TLI
Mikael Holmen [Thu, 18 Oct 2018 06:27:53 +0000 (06:27 +0000)]
Add a emitUnaryFloatFnCall version that fetches the function name from TLI

Summary:
In several places in the code we use the following pattern:

  if (hasUnaryFloatFn(&TLI, Ty, LibFunc_tan, LibFunc_tanf, LibFunc_tanl)) {
    [...]
    Value *Res = emitUnaryFloatFnCall(X, TLI.getName(LibFunc_tan), B, Attrs);
    [...]
  }

In short, we check if there is a lib-function for a certain type, and then
we _always_ fetch the name of the "double" version of the lib function and
construct a call to the appropriate function, that we just checked exists,
using that "double" name as a basis.

This is of course a problem in cases where the target doesn't support the
"double" version, but e.g. only the "float" version.

In that case TLI.getName(LibFunc_tan) returns "", and
emitUnaryFloatFnCall happily appends an "f" to "", and we erroneously end
up with a call to a function called "f".

To solve this, the above pattern is changed to

  if (hasUnaryFloatFn(&TLI, Ty, LibFunc_tan, LibFunc_tanf, LibFunc_tanl)) {
    [...]
    Value *Res = emitUnaryFloatFnCall(X, &TLI, LibFunc_tan, LibFunc_tanf,
                                      LibFunc_tanl, B, Attrs);
    [...]
  }

I.e instead of first fetching the name of the "double" version and then
letting emitUnaryFloatFnCall() add the final "f" or "l", we let
emitUnaryFloatFnCall() fetch the right name from TLI.

Reviewers: eli.friedman, efriedma

Reviewed By: efriedma

Subscribers: efriedma, bjope, llvm-commits

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

llvm-svn: 344725

6 years agoFix warning about unused variable [NFC]
Mikael Holmen [Thu, 18 Oct 2018 06:00:39 +0000 (06:00 +0000)]
Fix warning about unused variable [NFC]

llvm-svn: 344724

6 years ago[X86] Support for the mno-tls-direct-seg-refs flag
Kristina Brooks [Thu, 18 Oct 2018 03:14:37 +0000 (03:14 +0000)]
[X86] Support for the mno-tls-direct-seg-refs flag

Allows to disable direct TLS segment access (%fs or %gs). GCC supports
a similar flag, it can be useful in some circumstances, e.g. when a thread
context block needs to be updated directly from user space. More info
and specific use cases: https://bugs.llvm.org/show_bug.cgi?id=16145

There is another revision for clang as well.
Related: D53102

All X86 CodeGen tests appear to pass:
```
[46/47] Running lit suite /SourceCache/llvm-trunk-8.0/test/CodeGen
Testing Time: 23.17s
  Expected Passes    : 3801
  Expected Failures  : 15
  Unsupported Tests  : 8021
```

Reviewed by: Craig Topper.

Patch by nruslan (Ruslan Nikolaev).

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

llvm-svn: 344723

6 years agoRevert "Return a named error in the result object of an expression with no result"
Krasimir Georgiev [Thu, 18 Oct 2018 03:10:43 +0000 (03:10 +0000)]
Revert "Return a named error in the result object of an expression with no result"

This reverts commit r344647.
This causes build failures with [-Werror, -Wswitch]. Some cases where the newly
introduced enum value is not handled in particular are in:
  lldb/source/Expression/REPL.cpp:350
  lldb/source/Interpreter/CommandInterpreter.cpp:1529
(maybe there could be more)

As I don't understand lldb to make sure the likely trivial fixes are
correct and also as they might need additional tests, leaving to the
author to resolve.

llvm-svn: 344722

6 years ago[llvm-exegesis] Mark destructor virtual after r344695
Krasimir Georgiev [Thu, 18 Oct 2018 02:06:16 +0000 (02:06 +0000)]
[llvm-exegesis] Mark destructor virtual after r344695

This was causing a -Wnon-virtual-dtor warning.

llvm-svn: 344721

6 years ago[BuildingAJIT] Update the Ch1 KaleidoscopeJIT class to expose errors to clients.
Lang Hames [Thu, 18 Oct 2018 00:51:38 +0000 (00:51 +0000)]
[BuildingAJIT] Update the Ch1 KaleidoscopeJIT class to expose errors to clients.

Returning the error to clients provides an opportunity to introduce readers to
the Expected and Error APIs and makes the tutorial more useful as a starting
point for a real JIT class, while only slightly complicating the code.

llvm-svn: 344720

6 years ago[TI removal] Switch simple loop unswitch to `Instruction`.
Chandler Carruth [Thu, 18 Oct 2018 00:40:26 +0000 (00:40 +0000)]
[TI removal] Switch simple loop unswitch to `Instruction`.

llvm-svn: 344719

6 years ago[TI removal] Switch NewGVN to directly use `Instruction`.
Chandler Carruth [Thu, 18 Oct 2018 00:39:46 +0000 (00:39 +0000)]
[TI removal] Switch NewGVN to directly use `Instruction`.

llvm-svn: 344718

6 years ago[TI removal] Use `Instruction` instead of `TerminatorInst` for
Chandler Carruth [Thu, 18 Oct 2018 00:39:18 +0000 (00:39 +0000)]
[TI removal] Use `Instruction` instead of `TerminatorInst` for
a variable's type.

llvm-svn: 344717

6 years ago[TI removal] Update CodeExtractor to use Instruction directly.
Chandler Carruth [Thu, 18 Oct 2018 00:38:54 +0000 (00:38 +0000)]
[TI removal] Update CodeExtractor to use Instruction directly.

llvm-svn: 344716

6 years ago[TI removal] Switch ObjCARC code to directly use the nice range-based
Chandler Carruth [Thu, 18 Oct 2018 00:38:34 +0000 (00:38 +0000)]
[TI removal] Switch ObjCARC code to directly use the nice range-based
successors API or directly build the iterators out of the terminator
instruction and avoid requiring a TerminatorInst variable.

llvm-svn: 344715

6 years ago[TI removal] Switch MergeFunctions to directly use Instruction API.
Chandler Carruth [Thu, 18 Oct 2018 00:37:37 +0000 (00:37 +0000)]
[TI removal] Switch MergeFunctions to directly use Instruction API.

llvm-svn: 344714

6 years ago[TI removal] Switch an analysis to just use Instruction.
Chandler Carruth [Thu, 18 Oct 2018 00:36:15 +0000 (00:36 +0000)]
[TI removal] Switch an analysis to just use Instruction.

llvm-svn: 344713

6 years ago[BuildingAJIT] Simplify a tutorial example and fix a syntax error.
Lang Hames [Wed, 17 Oct 2018 22:27:09 +0000 (22:27 +0000)]
[BuildingAJIT] Simplify a tutorial example and fix a syntax error.

llvm-svn: 344712

6 years agoAMDGPU: Add options to enable/disable code object v3
Konstantin Zhuravlyov [Wed, 17 Oct 2018 21:39:12 +0000 (21:39 +0000)]
AMDGPU: Add options to enable/disable code object v3

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

llvm-svn: 344711

6 years ago[AArch64] Define __ELF__ for aarch64-none-elf and other similar triples.
Eli Friedman [Wed, 17 Oct 2018 21:07:11 +0000 (21:07 +0000)]
[AArch64] Define __ELF__ for aarch64-none-elf and other similar triples.

"aarch64-none-elf" is commonly used for AArch64 baremetal toolchains.

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

llvm-svn: 344710

6 years ago[clang-doc] Bringing bitcode tests in line
Julie Hockett [Wed, 17 Oct 2018 20:16:05 +0000 (20:16 +0000)]
[clang-doc] Bringing bitcode tests in line

Makes bitcode tests line up with what's actually called in the tool.
Should fix the failing bot.

Also fixes a warning that was being thrown about initialization braces.

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

llvm-svn: 344707

6 years ago[BuildingAJIT] Fix a function signature in the documentation.
Lang Hames [Wed, 17 Oct 2018 19:35:38 +0000 (19:35 +0000)]
[BuildingAJIT] Fix a function signature in the documentation.

llvm-svn: 344705

6 years agoPort libcxxabi r344607 into llvm
Pavel Labath [Wed, 17 Oct 2018 18:50:25 +0000 (18:50 +0000)]
Port libcxxabi r344607 into llvm

Summary:
The original commit message was:
    This uses CRTP (for performance reasons) to allow a user the override
    demangler functions to implement custom parsing logic. The motivation
    for this is LLDB, which needs to occasionaly modify the mangled names.
    One such instance is already implemented via the TypeCallback member,
    but this is very specific functionality which does not help with any
    other use case. Currently we have a use case for modifying the
    constructor flavours, which would require adding another callback. This
    approach does not scale.

    With CRTP, the user (LLDB) can override any function it needs without
    any special support from the demangler library. After LLDB is ported to
    use this instead of the TypeCallback mechanism, the callback can be
    removed.

The only difference here is the addition of a unit test which exercises
the CRTP mechanism to override a function in the parser.

Reviewers: erik.pilkington, rsmith, EricWF

Subscribers: mgorny, kristina, llvm-commits

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

llvm-svn: 344703

6 years agoFix for arm bots afternew PM pass port. Prevent cross compiling on arm.
Leonard Chan [Wed, 17 Oct 2018 18:12:18 +0000 (18:12 +0000)]
Fix for arm bots afternew PM pass port. Prevent cross compiling on arm.

llvm-svn: 344702

6 years agoFix for failing unit tests on some bots after r344696.
Leonard Chan [Wed, 17 Oct 2018 16:21:19 +0000 (16:21 +0000)]
Fix for failing unit tests on some bots after r344696.

llvm-svn: 344701

6 years ago[libcxx] Improve reporting when running the lit test suite
Louis Dionne [Wed, 17 Oct 2018 16:12:04 +0000 (16:12 +0000)]
[libcxx] Improve reporting when running the lit test suite

Summary:
Running the test suite with -a will now properly show all the executed
commands. The reports also include the environment under which the test
is being executed, which is helpful for reproducing issues.

Reviewers: EricWF

Subscribers: christof, dexonsmith, libcxx-commits

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

llvm-svn: 344700

6 years ago[PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitiz...
Leonard Chan [Wed, 17 Oct 2018 15:38:22 +0000 (15:38 +0000)]
[PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with -fsanitize=address

Enable usage of `AddressSanitizer` and `AddressModuleSanitizer` ported from the
legacy to the new PassManager.

This patch depends on https://reviews.llvm.org/D52739.

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

llvm-svn: 344699

6 years agoAMDGPU: Avoid selecting ds_{read,write}2_b32 on SI
Nicolai Haehnle [Wed, 17 Oct 2018 15:37:48 +0000 (15:37 +0000)]
AMDGPU: Avoid selecting ds_{read,write}2_b32 on SI

Summary:
To workaround a hardware issue in the (base + offset) calculation
when base is negative. The impact on code quality should be limited
since SILoadStoreOptimizer still runs afterwards and is able to
combine loads/stores based on known sign information.

This fixes visible corruption in Hitman on SI (easily reproducible
by running benchmark mode).

Change-Id: Ia178d207a5e2ac38ae7cd98b532ea2ae74704e5f
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99923

Reviewers: arsenm, mareko

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

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

llvm-svn: 344698

6 years agoStructurizeCFG: Simplify inserted PHI nodes
Nicolai Haehnle [Wed, 17 Oct 2018 15:37:41 +0000 (15:37 +0000)]
StructurizeCFG: Simplify inserted PHI nodes

Summary:
This improves subsequent divergence analysis in some cases.

Change-Id: I5e95e7ec7fd3fa80d414d1a53a02fea23e3d67d3

Reviewers: arsenm, rampitec

Subscribers: jvesely, wdng, llvm-commits

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

llvm-svn: 344697

6 years agoAMDGPU: Divergence-driven selection of scalar buffer load intrinsics
Nicolai Haehnle [Wed, 17 Oct 2018 15:37:30 +0000 (15:37 +0000)]
AMDGPU: Divergence-driven selection of scalar buffer load intrinsics

Summary:
Moving SMRD to VMEM in SIFixSGPRCopies is rather bad for performance if
the load is really uniform. So select the scalar load intrinsics directly
to either VMEM or SMRD buffer loads based on divergence analysis.

If an offset happens to end up in a VGPR -- either because a floating
point calculation was involved, or due to other remaining deficiencies
in SIFixSGPRCopies -- we use v_readfirstlane.

There is some unrelated churn in tests since we now select MUBUF offsets
in a unified way with non-scalar buffer loads.

Change-Id: I170e6816323beb1348677b358c9d380865cd1a19

Reviewers: arsenm, alex-t, rampitec, tpr

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

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

llvm-svn: 344696

6 years ago[llvm-exegesis] Allow measuring several instructions in a single run.
Clement Courbet [Wed, 17 Oct 2018 15:04:15 +0000 (15:04 +0000)]
[llvm-exegesis] Allow measuring several instructions in a single run.

Summary:
We try to recover gracefully on instructions that would crash the
program.

This includes some refactoring of runMeasurement() implementations.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

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

llvm-svn: 344695

6 years agoFix broken formatting caused by test commit
Theodoros Theodoridis [Wed, 17 Oct 2018 15:01:18 +0000 (15:01 +0000)]
Fix broken formatting caused by test commit

llvm-svn: 344694

6 years ago[ARM] bottom-top mul support in ARMParallelDSP
Sam Parker [Wed, 17 Oct 2018 13:02:48 +0000 (13:02 +0000)]
[ARM] bottom-top mul support in ARMParallelDSP

Previously reverted in rL343082.

Original commit message:

On failing to find sequences that can be converted into dual macs,
try to find sequential 16-bit loads that are used by muls which we
can then use smultb, smulbt, smultt with a wide load.

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

llvm-svn: 344693

6 years agoFix uninitialized variable
Guillaume Chatelet [Wed, 17 Oct 2018 12:27:46 +0000 (12:27 +0000)]
Fix uninitialized variable

llvm-svn: 344692

6 years agoAMDGPU: Remove dead TableGen code
Nicolai Haehnle [Wed, 17 Oct 2018 12:14:26 +0000 (12:14 +0000)]
AMDGPU: Remove dead TableGen code

Summary: Change-Id: Ic1f2c1d0cf9e90a0baa9fc6bacd0d3c386069fb0

Reviewers: tpr

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

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

Change-Id: Ib4d143c898801e5cf6cb9999a495d62c91ae77fb
llvm-svn: 344691

6 years agoBuildBot fix, compiler complains about array decay to pointer
Guillaume Chatelet [Wed, 17 Oct 2018 12:09:21 +0000 (12:09 +0000)]
BuildBot fix, compiler complains about array decay to pointer

llvm-svn: 344690

6 years ago[llvm-exegeis] Computing Latency configuration upfront so we can generate many CodeTe...
Guillaume Chatelet [Wed, 17 Oct 2018 11:37:28 +0000 (11:37 +0000)]
[llvm-exegeis] Computing Latency configuration upfront so we can generate many CodeTemplates at once.

Summary: LatencyGenerator now computes all possible mode of serial execution for an Instruction upfront and generates CodeTemplate for the ones that give the best results (e.g. no need to generate a two instructions snippet when repeating a single one would do). The next step is to generate even more configurations for cases (e.g. for XOR we should generate "XOR EAX, EAX, EAX" and "XOR EAX, EAX, EBX")

Reviewers: courbet

Reviewed By: courbet

Subscribers: llvm-commits

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

llvm-svn: 344689

6 years ago[clangd] Support scope proximity in code completion.
Eric Liu [Wed, 17 Oct 2018 11:19:02 +0000 (11:19 +0000)]
[clangd] Support scope proximity in code completion.

Summary:
This should make all-scope completion more usable. Scope proximity for
indexes will be added in followup patch.

Reviewers: sammccall

Reviewed By: sammccall

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

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

llvm-svn: 344688

6 years ago[NFC] Remove GOTO from SCEV
Max Kazantsev [Wed, 17 Oct 2018 11:16:25 +0000 (11:16 +0000)]
[NFC] Remove GOTO from SCEV

llvm-svn: 344687

6 years ago[NewPM] Fixing test failure on Windows - removed opt binary name from pattern
Fedor Sergeev [Wed, 17 Oct 2018 11:01:15 +0000 (11:01 +0000)]
[NewPM] Fixing test failure on Windows - removed opt binary name from pattern

llvm-svn: 344686

6 years ago[NewPM] teach -passes= to emit meaningful error messages
Fedor Sergeev [Wed, 17 Oct 2018 10:36:23 +0000 (10:36 +0000)]
[NewPM] teach -passes= to emit meaningful error messages

All the PassBuilder::parse interfaces now return descriptive StringError
instead of a plain bool. It allows to make -passes/aa-pipeline parsing
errors context-specific and thus less confusing.

TODO: ideally we should also make suggestions for misspelled pass names,
but that requires some extensions to PassBuilder.

Reviewed By: philip.pfaffe, chandlerc
Differential Revision: https://reviews.llvm.org/D53246

llvm-svn: 344685

6 years ago[MIPS GlobalISel] Legalize constants
Petar Jovanovic [Wed, 17 Oct 2018 10:30:03 +0000 (10:30 +0000)]
[MIPS GlobalISel] Legalize constants

Legalize s1, s8, s16 and s64 G_CONSTANT for MIPS32.

Patch by Petar Avramovic.

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

llvm-svn: 344684

6 years ago[ARM] Do not fuse VADD and VMUL, continued (2/2)
Sjoerd Meijer [Wed, 17 Oct 2018 10:05:44 +0000 (10:05 +0000)]
[ARM] Do not fuse VADD and VMUL, continued (2/2)

This is patch 2/2, following up on D53314, and is the functional change
to prevent fusing mul + add sequences into VFMAs.

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

llvm-svn: 344683

6 years agoTest commit
Theodoros Theodoridis [Wed, 17 Oct 2018 09:59:41 +0000 (09:59 +0000)]
Test commit

llvm-svn: 344682

6 years ago[LoopPredication] add some simple stats
Fedor Sergeev [Wed, 17 Oct 2018 09:02:54 +0000 (09:02 +0000)]
[LoopPredication] add some simple stats

Just adding some useful statistics to LoopPredication pass
which was lacking any of these.

llvm-svn: 344681

6 years ago[clangd] Fix buildbot failure.
Haojian Wu [Wed, 17 Oct 2018 08:54:48 +0000 (08:54 +0000)]
[clangd] Fix buildbot failure.

llvm-svn: 344680

6 years ago[clangd] Print numbers of symbols and refs as well when loading the
Haojian Wu [Wed, 17 Oct 2018 08:48:04 +0000 (08:48 +0000)]
[clangd] Print numbers of symbols and refs as well when loading the
index.

llvm-svn: 344679

6 years ago[clangd] Collect refs from headers.
Haojian Wu [Wed, 17 Oct 2018 08:38:36 +0000 (08:38 +0000)]
[clangd] Collect refs from headers.

Summary:
Add a flag to SymbolCollector to collect refs fdrom headers.

Note that we collect refs from headers in static index, and we don't do it for
dynamic index because of the preamble (we skip function body in preamble,
collecting it will result incomplete results).

Reviewers: sammccall

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

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

llvm-svn: 344678

6 years ago[ARM] Follow up of rL344671, attempt to pacify a buildbot
Sjoerd Meijer [Wed, 17 Oct 2018 07:51:24 +0000 (07:51 +0000)]
[ARM] Follow up of rL344671, attempt to pacify a buildbot

It was rightfully complaining about an unpretty logical expression.

llvm-svn: 344677

6 years ago[clangd] Hide unused function. NFC
Sam McCall [Wed, 17 Oct 2018 07:41:53 +0000 (07:41 +0000)]
[clangd] Hide unused function. NFC

llvm-svn: 344676

6 years ago[clangd] Rename and move trivial logger to Logger.cpp. NFC
Sam McCall [Wed, 17 Oct 2018 07:39:32 +0000 (07:39 +0000)]
[clangd] Rename and move trivial logger to Logger.cpp. NFC

llvm-svn: 344675

6 years ago[LLDB] - Add support for DW_RLE_start_end entries (.debug_rnglists)
George Rimar [Wed, 17 Oct 2018 07:37:26 +0000 (07:37 +0000)]
[LLDB] - Add support for DW_RLE_start_end entries (.debug_rnglists)

DWARF5 describes DW_RLE_start_end as:

This is a form of bounded range entry that has two target address operands.
Each operand is the same size as used in DW_FORM_addr. These indicate
the starting and ending addresses, respectively, that define the address range
for which the following location is valid.

The patch implements the support.

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

llvm-svn: 344674

6 years ago[clangd] Simplify client capabilities parsing.
Sam McCall [Wed, 17 Oct 2018 07:33:42 +0000 (07:33 +0000)]
[clangd] Simplify client capabilities parsing.

Summary:
Instead of parsing into structs that mirror LSP, simply parse into a flat struct
that contains the info we need.
This is an exception to our strategy with Protocol.h, which seems justified:
 - the structure here is very large and deeply nested
 - we care about almost none of it
 - we should never have to serialize client capabilities

Reviewers: kadircet

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

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

llvm-svn: 344673

6 years ago[clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction. (re-land...
Sam McCall [Wed, 17 Oct 2018 07:32:05 +0000 (07:32 +0000)]
[clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction. (re-land r344620)

Summary:
This paves the way for alternative transports (mac XPC, maybe messagepack?),
and also generally improves layering: testing ClangdLSPServer becomes less of
a pipe dream, we split up the JSONOutput monolith, etc.

This isn't a final state, much of what remains in JSONRPCDispatcher can go away,
handlers can call reply() on the transport directly, JSONOutput can be renamed
to StreamLogger and removed, etc. But this patch is sprawling already.

The main observable change (see tests) is that hitting EOF on input is now an
error: the client should send the 'exit' notification.
This is defensible: the protocol doesn't spell this case out. Reproducing the
current behavior for all combinations of shutdown/exit/EOF clutters interfaces.
We can iterate on this if desired.

Reviewers: jkorous, ioeric, hokein

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

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

llvm-svn: 344672

6 years ago[ARM][NFCI] Do not fuse VADD and VMUL, continued (1/2)
Sjoerd Meijer [Wed, 17 Oct 2018 07:26:35 +0000 (07:26 +0000)]
[ARM][NFCI] Do not fuse VADD and VMUL, continued (1/2)

This is a follow up of rL342874, which stopped fusing muls and adds into VMLAs
for performance reasons on the Cortex-M4 and Cortex-M33.  This is a serie of 2
patches, that is trying to achieve the same for VFMA.  The second column in the
table below shows what we were generating before rL342874, the third column
what changed with rL342874, and the last column what we want to achieve with
these 2 patches:

 --------------------------------------------------------
 | Opt   |  < rL342874   |  >= rL342874   |             |
 |------------------------------------------------------|
 |-O3    |     vmla      |      vmul      |     vmul    |
 |       |               |      vadd      |     vadd    |
 |------------------------------------------------------|
 |-Ofast |     vfma      |      vfma      |     vmul    |
 |       |               |                |     vadd    |
 |------------------------------------------------------|
 |-Oz    |     vmla      |      vmla      |     vmla    |
 --------------------------------------------------------

This patch 1/2, is a cleanup of the spaghetti predicate logic on the different
VMLA and VFMA codegen rules, so that we can make the final functional change in
patch 2/2.  This also fixes a typo in the regression test added in rL342874.

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

llvm-svn: 344671

6 years ago[XRay][compiler-rt] Generational Buffer Management
Dean Michael Berris [Wed, 17 Oct 2018 06:57:50 +0000 (06:57 +0000)]
[XRay][compiler-rt] Generational Buffer Management

Summary:
This change updates the buffer queue implementation to support using a
generation number to identify the lifetime of buffers. This first part
introduces the notion of the generation number, without changing the way
we handle the buffers yet.

What's missing here is the cleanup of the buffers. Ideally we'll keep
the two most recent generations. We need to ensure that before we do any
writes to the buffers, that we check the generation number(s) first.

Those changes will follow-on from this change.

Depends on D52588.

Reviewers: mboerger, eizan

Subscribers: llvm-commits, jfb

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

llvm-svn: 344670

6 years agoDocument the behavior of option passing when using -DCLANG_ENABLE_BOOTSTRAP=On
Sylvestre Ledru [Wed, 17 Oct 2018 06:35:10 +0000 (06:35 +0000)]
Document the behavior of option passing when using -DCLANG_ENABLE_BOOTSTRAP=On
Also document -DCLANG_BOOTSTRAP_PASSTHROUGH

Reviewers: ecbeckmann

Subscribers: llvm-commits

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

llvm-svn: 344669