platform/upstream/llvm.git
6 years ago[clang-tidy] readability-inconsistent-declaration-parameter-name: accept approximate...
Sam McCall [Fri, 13 Jul 2018 11:41:56 +0000 (11:41 +0000)]
[clang-tidy] readability-inconsistent-declaration-parameter-name: accept approximate name matches.

Summary:
The goal is to reduce false positives when the difference is intentional, like:

foo(StringRef name);
foo(StringRef name_ref) {
  string name = cleanup(name_ref);
  ...
}

Or semantically unimportant, like:
foo(StringRef full_name);
foo(StringRef name) { ... }

There are other matching names we won't recognise (e.g. syns vs synonyms) but
this catches many that we see in practice, and gives people a systematic
workaround.

The old behavior is available as a 'Strict' option.

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 336992

6 years agoAdd abbreviated name for Debugger::EventHandlerThread.
Tatyana Krasnukha [Fri, 13 Jul 2018 11:21:06 +0000 (11:21 +0000)]
Add abbreviated name for Debugger::EventHandlerThread.

On OS's where thread names are limited to 16 bytes, the full name was truncated to not very meaningful "r.event-handler".

llvm-svn: 336991

6 years ago[SLH] Introduce a new pass to do Speculative Load Hardening to mitigate
Chandler Carruth [Fri, 13 Jul 2018 11:13:58 +0000 (11:13 +0000)]
[SLH] Introduce a new pass to do Speculative Load Hardening to mitigate
Spectre variant #1 for x86.

There is a lengthy, detailed RFC thread on llvm-dev which discusses the
high level issues. High level discussion is probably best there.

I've split the design document out of this patch and will land it
separately once I update it to reflect the latest edits and updates to
the Google doc used in the RFC thread.

This patch is really just an initial step. It isn't quite ready for
prime time and is only exposed via debugging flags. It has two major
limitations currently:
1) It only supports x86-64, and only certain ABIs. Many assumptions are
   currently hard-coded and need to be factored out of the code here.
2) It doesn't include any options for more fine-grained control, either
   of which control flow edges are significant or which loads are
   important to be hardened.
3) The code is still quite rough and the testing lighter than I'd like.

However, this is enough for people to begin using. I have had numerous
requests from people to be able to experiment with this patch to
understand the trade-offs it presents and how to use it. We would also
like to encourage work to similar effect in other toolchains.

The ARM folks are actively developing a system based on this for
AArch64. We hope to merge this with their efforts when both are far
enough along. But we also don't want to block making this available on
that effort.

Many thanks to the *numerous* people who helped along the way here. For
this patch in particular, both Eric and Craig did a ton of review to
even have confidence in it as an early, rough cut at this functionality.

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

llvm-svn: 336990

6 years ago[SLPVectorizer] Add initial alternate opcode support for cast instructions. (REAPPLIED-2)
Simon Pilgrim [Fri, 13 Jul 2018 11:09:52 +0000 (11:09 +0000)]
[SLPVectorizer] Add initial alternate opcode support for cast instructions. (REAPPLIED-2)

We currently only support binary instructions in the alternate opcode shuffles.

This patch is an initial attempt at adding cast instructions as well, this raises several issues that we probably want to address as we continue to generalize the alternate mechanism:

1 - Duplication of cost determination - we should probably add scalar/vector costs helper functions and get BoUpSLP::getEntryCost to use them instead of determining costs directly.
2 - Support alternate instructions with the same opcode (e.g. casts with different src types) - alternate vectorization of calls with different IntrinsicIDs will require this.
3 - Allow alternates to be a different instruction type - mixing binary/cast/call etc.
4 - Allow passthrough of unsupported alternate instructions - related to PR30787/D28907 'copyable' elements.

Reapplied with fix to only accept 2 different casts if they come from the same source type (PR38154).

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

llvm-svn: 336989

6 years agoConvert a location information from PDB to a DWARF expression
Jonas Devlieghere [Fri, 13 Jul 2018 10:29:27 +0000 (10:29 +0000)]
Convert a location information from PDB to a DWARF expression

The current version of SymbolFilePDB::ParseVariableForPDBData function
always initializes variables with an empty location. This patch adds the
converter of a location information from PDB to a DWARF expression, so
it becomes possible to watch values of variables of primitive data
types. At the moment the converter supports only Static, TLS, RegRel,
Enregistered and Constant PDB location types, but it seems that it's
enough for most cases. There are still some problems with retrieving
values of variables (e.g. we can't watch variables of composite types),
but they look not relevant to the conversion to DWARF.

Patch by: Aleksandr Urakov

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

llvm-svn: 336988

6 years ago[UpdateTestChecks] Teach the x86 asm parser to skip over the function
Chandler Carruth [Fri, 13 Jul 2018 10:29:23 +0000 (10:29 +0000)]
[UpdateTestChecks] Teach the x86 asm parser to skip over the function
begin label emitted for some routines with personality functions and
such.

Without this, we don't even recognize such functions as appearing in the
output and so don't attach any assertions to them. Happy to tweak this
or improve it if folks w/ deeper knowledge of the asm sequences that
show up here want.

llvm-svn: 336987

6 years ago[x86] Fix a capitalization that I failed to save in my editor before
Chandler Carruth [Fri, 13 Jul 2018 09:48:04 +0000 (09:48 +0000)]
[x86] Fix a capitalization that I failed to save in my editor before
landing the patch. =/

llvm-svn: 336986

6 years ago[x86] Teach the EFLAGS copy lowering to handle much more complex control
Chandler Carruth [Fri, 13 Jul 2018 09:39:10 +0000 (09:39 +0000)]
[x86] Teach the EFLAGS copy lowering to handle much more complex control
flow patterns including forks, merges, and even cyles.

This tries to cover a reasonably comprehensive set of patterns that
still don't require PHIs or PHI placement. The coverage was inspired by
the amazing variety of patterns produced when copy EFLAGS and restoring
it to implement Speculative Load Hardening. Without this patch, we
simply cannot make such complex and invasive changes to x86 instruction
sequences due to EFLAGS.

I've added "just" one test, but this test covers many different
complexities and corner cases of this approach. It is actually more
comprehensive, as far as I can tell, than anything that I have
encountered in the wild on SLH.

Because the test is so complex, I've tried to give somewhat thorough
comments and an ASCII-art diagram of the control flows to make it a bit
easier to read and maintain long-term.

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

llvm-svn: 336985

6 years ago[llvm-mca] Simplify the Pipeline constructor. NFC
Andrea Di Biagio [Fri, 13 Jul 2018 09:31:02 +0000 (09:31 +0000)]
[llvm-mca] Simplify the Pipeline constructor. NFC

llvm-svn: 336984

6 years ago[llvm-mca] Removed unused arguments from methods in class Pipeline. NFC
Andrea Di Biagio [Fri, 13 Jul 2018 09:27:34 +0000 (09:27 +0000)]
[llvm-mca] Removed unused arguments from methods in class Pipeline. NFC

llvm-svn: 336983

6 years ago[AArch64][SVE] Asm: Vector Unpack Low/High instructions.
Sander de Smalen [Fri, 13 Jul 2018 09:25:43 +0000 (09:25 +0000)]
[AArch64][SVE] Asm: Vector Unpack Low/High instructions.

This patch adds support for the following unpack instructions:

- PUNPKLO, PUNPKHI   Unpack elements from low/high half and
                     place into elements of twice their size.

  e.g. punpklo p0.h, p0.b

- UUNPKLO, UUNPKHI   Unpack elements from low/high half and
  SUNPKLO, SUNPKHI   place into elements of twice their size
                     after zero- or sign-extending the values.

  e.g. uunpklo z0.h, z0.b

llvm-svn: 336982

6 years ago[AArch64] Updated bigendian buildvector tests
Simon Pilgrim [Fri, 13 Jul 2018 09:25:32 +0000 (09:25 +0000)]
[AArch64] Updated bigendian buildvector tests

As suggested by @efriedma on D49262 - changed the extractelement to a store to prevent SimplifyDemandedVectorElts from simplifying the build vectors - this keeps the immediate generation which was the point of the tests.

llvm-svn: 336981

6 years ago[ARM] Regenerated arg endian test
Simon Pilgrim [Fri, 13 Jul 2018 09:16:56 +0000 (09:16 +0000)]
[ARM] Regenerated arg endian test

As requested on D49262

llvm-svn: 336980

6 years ago[AArch64][SVE] Asm: Support for insert element (INSR) instructions.
Sander de Smalen [Fri, 13 Jul 2018 08:51:57 +0000 (08:51 +0000)]
[AArch64][SVE] Asm: Support for insert element (INSR) instructions.

Insert general purpose register into shifted vector, e.g.
  insr    z0.s, w0
  insr    z0.d, x0

Insert SIMD&FP scalar register into shifted vector, e.g.
  insr    z0.b, b0
  insr    z0.h, h0
  insr    z0.s, s0
  insr    z0.d, d0

llvm-svn: 336979

6 years ago[LiveDebugValues] Tracking copying value between registers
Petar Jovanovic [Fri, 13 Jul 2018 08:24:26 +0000 (08:24 +0000)]
[LiveDebugValues] Tracking copying value between registers

During the execution of long functions or functions that have a lot of
inlined code it could come to the situation where tracked value could be
transferred from one register to another. The transfer is recognized only if
destination register is a callee saved register and if source register is
killed. We do not salvage caller-saved registers since there is a great
chance that killed register would outlive it.

Patch by Nikola Prica.

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

llvm-svn: 336978

6 years agoRemove `tsan/Darwin/gcd-after-null.mm` test.
Dan Liew [Fri, 13 Jul 2018 07:37:01 +0000 (07:37 +0000)]
Remove `tsan/Darwin/gcd-after-null.mm` test.

Summary:
This test invokes undocumented behaviour that could change in
the future. Given this, it's probably best to just remove the
test.

rdar://problem/42022283

Reviewers: kubamracek

Subscribers: llvm-commits, #sanitizers

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

llvm-svn: 336977

6 years ago[X86] Prefer MOVSS/SD over BLEND under optsize in isel.
Craig Topper [Fri, 13 Jul 2018 06:25:31 +0000 (06:25 +0000)]
[X86] Prefer MOVSS/SD over BLEND under optsize in isel.

Previously we iseled to blend, commuted to another blend, and then commuted back to movss/movsd or blend depending on optsize. Now we do it directly.

llvm-svn: 336976

6 years ago[XRay][compiler-rt] Add PID field to llvm-xray tool and add PID metadata record entry...
Dean Michael Berris [Fri, 13 Jul 2018 05:38:22 +0000 (05:38 +0000)]
[XRay][compiler-rt] Add PID field to llvm-xray tool and add PID metadata record entry in FDR mode

Summary:
llvm-xray changes:
- account-mode - process-id  {...} shows after thread-id
- convert-mode - process {...} shows after thread
- parses FDR and basic mode pid entries
- Checks version number for FDR log parsing.

Basic logging changes:
- Update header version from 2 -> 3

FDR logging changes:
- Update header version from 2 -> 3
- in writeBufferPreamble, there is an additional PID Metadata record (after thread id record and tsc record)

Test cases changes:
- fdr-mode.cc, fdr-single-thread.cc, fdr-thread-order.cc modified to catch process id output in the log.

Reviewers: dberris

Reviewed By: dberris

Subscribers: hiraditya, llvm-commits, #sanitizers

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

llvm-svn: 336974

6 years ago[X86] Remove isel patterns that turns packed add/sub/mul/div+movss/sd into scalar...
Craig Topper [Fri, 13 Jul 2018 04:50:39 +0000 (04:50 +0000)]
[X86] Remove isel patterns that turns packed add/sub/mul/div+movss/sd into scalar intrinsic instructions.

This is not an optimization we should be doing in isel. This is more suitable for a DAG combine.

My main concern is a future time when we support more FPENV. Changing a packed op to a scalar op could cause us to miss some exceptions that should have occured if we had done a packed op. A DAG combine would be better able to manage this.

llvm-svn: 336971

6 years ago[XRay][compiler-rt] Profiling Mode: Flush logs on exit
Dean Michael Berris [Fri, 13 Jul 2018 04:04:18 +0000 (04:04 +0000)]
[XRay][compiler-rt] Profiling Mode: Flush logs on exit

Summary:
This change adds support for writing out profiles at program exit.

Depends on D48653.

Reviewers: kpw, eizan

Reviewed By: kpw

Subscribers: llvm-commits

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

llvm-svn: 336969

6 years ago[DomTreeUpdater] Ignore updates when both DT and PDT are nullptrs
Chijun Sima [Fri, 13 Jul 2018 04:02:13 +0000 (04:02 +0000)]
[DomTreeUpdater] Ignore updates when both DT and PDT are nullptrs

Summary:
Previously, when both DT and PDT are nullptrs and the UpdateStrategy is Lazy, DomTreeUpdater still pends updates inside.
After this patch, DomTreeUpdater will ignore all updates from(`applyUpdates()/insertEdge*()/deleteEdge*()`) in this case. (call `delBB()` still pends BasicBlock deletion until a flush event according to the doc).
The behavior of DomTreeUpdater previously documented won't change after the patch.

Reviewers: dmgreen, davide, kuhar, brzycki, grosser

Reviewed By: kuhar

Subscribers: llvm-commits

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

llvm-svn: 336968

6 years ago[FileCheck] Implement -v and -vv for tracing matches
Joel E. Denny [Fri, 13 Jul 2018 03:08:23 +0000 (03:08 +0000)]
[FileCheck] Implement -v and -vv for tracing matches

-v prints all directive pattern matches.

-vv additionally prints info that might be noise to users but that can
be helpful to FileCheck developers.

To maximize code reuse and to make diagnostics more consistent, this
patch also adjusts and extends some of the existing diagnostics.
CHECK-NOT failures now report variables uses.  Many more diagnostics
now report the check prefix and kind of directive.

Reviewed By: probinson

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

llvm-svn: 336967

6 years ago[fuzzer] [tests] Increase the number of iterations for three-bytes.test
George Karpenkov [Fri, 13 Jul 2018 01:21:50 +0000 (01:21 +0000)]
[fuzzer] [tests] Increase the number of iterations for three-bytes.test

The test is flaky otherwise on some of our macOS machines in the test fleet.

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

llvm-svn: 336966

6 years ago[InstCombine] return when SimplifyAssociativeOrCommutative makes a change
Sanjay Patel [Fri, 13 Jul 2018 01:18:07 +0000 (01:18 +0000)]
[InstCombine] return when SimplifyAssociativeOrCommutative makes a change

This bug was created by rL335258 because we used to always call instsimplify
after trying the associative folds. After that change it became possible
for subsequent folds to encounter unsimplified code (and potentially assert
because of it).

Instead of carrying changed state through instcombine, we can just return
immediately. This allows instsimplify to run, so we can continue assuming
that easy folds have already occurred.

llvm-svn: 336965

6 years agoCodeGen: Remove pipeline dependencies on StackProtector; NFC
Matthias Braun [Fri, 13 Jul 2018 00:08:38 +0000 (00:08 +0000)]
CodeGen: Remove pipeline dependencies on StackProtector; NFC

This re-applies r336929 with a fix to accomodate for the Mips target
scheduling multiple SelectionDAG instances into the pass pipeline.

PrologEpilogInserter and StackColoring depend on the StackProtector analysis
being alive from the point it is run until PEI, which requires that they are all
scheduled in the same FunctionPassManager. Inserting a (machine) ModulePass
between StackProtector and PEI results in these passes being in separate
FunctionPassManagers and the StackProtector is not available for PEI.

PEI and StackColoring don't use much information from the StackProtector pass,
so transfering the required information to MachineFrameInfo is cleaner than
keeping the StackProtector pass around. This commit moves the SSP layout
information to MFI instead of keeping it in the pass.

This patch set (D37580, D37581, D37582, D37583, D37584, D37585, D37586, D37587)
is a first draft of the pagerando implementation described in
http://lists.llvm.org/pipermail/llvm-dev/2017-June/113794.html.

Patch by Stephen Crane <sjc@immunant.com>

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

llvm-svn: 336964

6 years agoSimplify recursive launder.invariant.group and strip
Piotr Padlewski [Thu, 12 Jul 2018 23:55:20 +0000 (23:55 +0000)]
Simplify recursive launder.invariant.group and strip

Summary:
This patch is crucial for proving equality laundered/stripped
pointers. eg:

  bool foo(A *a) {
    return a == std::launder(a);
  }

Clang with -fstrict-vtable-pointers will emit something like:

    define dso_local zeroext i1 @_Z3fooP1A(%struct.A* %a) {
    entry:
      %c = bitcast %struct.A* %a to i8*
      %call = tail call i8* @llvm.launder.invariant.group.p0i8(i8* %c)
      %0 = bitcast %struct.A* %a to i8*
      %1 = tail call i8* @llvm.strip.invariant.group.p0i8(i8* %0)
      %2 = tail call i8* @llvm.strip.invariant.group.p0i8(i8* %call)
      %cmp = icmp eq i8* %1, %2
      ret i1 %cmp
    }

and because %2 can be replaced with @llvm.strip.invariant.group(%0)
and that %2 and %1 will produce the same value (because strip is readnone)
we can replace compare with true.

Reviewers: rsmith, hfinkel, majnemer, amharc, kuhar

Subscribers: llvm-commits, hiraditya

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

llvm-svn: 336963

6 years agoPR38136: improve handling of template argument deduction of non-trailing
Richard Smith [Thu, 12 Jul 2018 23:32:39 +0000 (23:32 +0000)]
PR38136: improve handling of template argument deduction of non-trailing
function parameter packs.

This makes our handling of non-trailing function parameter packs
consistent between the case of deduction at the top level in a function
call and other cases where deduction encounters a non-trailing function
parameter pack.

Instead of treating a non-trailing pack and all later parameters as
being non-deduced, we treat a non-trailing pack as exactly matching
any explicitly-specified template arguments (or being an empty pack
if there are no such arguments). This corresponds to the "never deduced"
rule in [temp.deduct.call]p1, but generalized to all deduction contexts.

Non-trailing template argument packs still result in the entire
template argument list being treated as non-deduced, as specified in
[temp.deduct.type]p9.

llvm-svn: 336962

6 years ago[llvm-mca] Constify SourceMgr::hasNext. NFC.
Matt Davis [Thu, 12 Jul 2018 23:19:30 +0000 (23:19 +0000)]
[llvm-mca] Constify SourceMgr::hasNext.  NFC.

llvm-svn: 336961

6 years ago[lldbsuite] The test inside TestOverloadedFunctions.py has the wrong class name
Stella Stamenova [Thu, 12 Jul 2018 23:02:33 +0000 (23:02 +0000)]
[lldbsuite] The test inside TestOverloadedFunctions.py has the wrong class name

Summary: It looks like the test file was copied from TestCPPStaticMethods.py because they have the same name. This means that the two tests will try to write to the same output files and will either overwrite each other's output or occasionally cause failures because they can't both access the same file.

Reviewers: asmith, zturner

Reviewed By: zturner

Subscribers: llvm-commits

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

llvm-svn: 336960

6 years ago[llvm-mca] Add cycleBegin/cycleEnd callbacks to mca::Stage.
Matt Davis [Thu, 12 Jul 2018 22:59:53 +0000 (22:59 +0000)]
[llvm-mca] Add cycleBegin/cycleEnd callbacks to mca::Stage.

Summary:
This patch  clears up some of the semantics within the Stage class.  Now, preExecute
can be called multiple times per simulated cycle.  Previously preExecute was
only called once per cycle, and postExecute could have been called multiple
times.

Now, cycleStart/cycleEnd are called only once per simulated cycle.
preExecute/postExecute can be called multiple times per cycle.  This
occurs because multiple execution events can occur during a single cycle.

When stages are executed (Pipeline::runCycle), the postExecute hook will
be called only if all Stages return a success from their 'execute' callback.

Reviewers: andreadb, courbet, RKSimon

Reviewed By: andreadb

Subscribers: tschuett, gbedwell, llvm-commits

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

llvm-svn: 336959

6 years ago[X86] Regenerate checks in sse-scalar-fp-arith.ll.
Craig Topper [Thu, 12 Jul 2018 22:59:03 +0000 (22:59 +0000)]
[X86] Regenerate checks in sse-scalar-fp-arith.ll.

llvm-svn: 336958

6 years ago[InstCombine] Simplify isKnownNegation
Fangrui Song [Thu, 12 Jul 2018 22:56:23 +0000 (22:56 +0000)]
[InstCombine] Simplify isKnownNegation

llvm-svn: 336957

6 years agoRemove incorrect thread-pc-values clearing
Jason Molenda [Thu, 12 Jul 2018 22:45:41 +0000 (22:45 +0000)]
Remove incorrect thread-pc-values clearing
from ProcessGDBRemote::UpdateThreadIDsFromStopReplyThreadsValue.

Patch by Venkata Ramanaiah.

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

llvm-svn: 336956

6 years agoGet rid of the C-string parameter in DoExecute
Raphael Isemann [Thu, 12 Jul 2018 22:28:52 +0000 (22:28 +0000)]
Get rid of the C-string parameter in DoExecute

Summary:
This patch gets rid of the C-string parameter in the RawCommandObject::DoExecute function,
making the code simpler and less memory unsafe.

There seems to be a assumption in some command objects that this parameter could be a nullptr,
but from what I can see the rest of the API doesn't actually allow this (and other command
objects and related code pieces dereference this parameter without any checks).

Especially CommandObjectRegexCommand has error handling code for a nullptr that is now gone.

Reviewers: davide, jingham, teemperor

Reviewed By: teemperor

Subscribers: jingham, lldb-commits

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

llvm-svn: 336955

6 years ago[X86] Add AVX512 equivalents of some isel patterns so we get EVEX instructions.
Craig Topper [Thu, 12 Jul 2018 22:14:10 +0000 (22:14 +0000)]
[X86] Add AVX512 equivalents of some isel patterns so we get EVEX instructions.

These are the patterns for matching fceil, ffloor, and sqrt to intrinsic instructions if they have a MOVSS/SD.

llvm-svn: 336954

6 years agoRevert r336950 and r336951 "[X86] Add AVX512 equivalents of some isel patterns so...
Craig Topper [Thu, 12 Jul 2018 21:58:03 +0000 (21:58 +0000)]
Revert r336950 and r336951 "[X86] Add AVX512 equivalents of some isel patterns so we get EVEX instructions." and "foo"

One of them had a bad title and they should have been squashed.

llvm-svn: 336953

6 years agoRemove redundant *_or_null checks; NFC
George Burgess IV [Thu, 12 Jul 2018 21:56:31 +0000 (21:56 +0000)]
Remove redundant *_or_null checks; NFC

For the first one, we dereference `NewDef` right before the `if` anyway.
For the second, we shouldn't have NULL users().

llvm-svn: 336952

6 years ago[X86] Add AVX512 equivalents of some isel patterns so we get EVEX instructions.
Craig Topper [Thu, 12 Jul 2018 21:53:23 +0000 (21:53 +0000)]
[X86] Add AVX512 equivalents of some isel patterns so we get EVEX instructions.

These are the patterns for matching fceil, ffloor, and sqrt to intrinsic instructions if they have a MOVSS/SD.

llvm-svn: 336951

6 years agofoo
Craig Topper [Thu, 12 Jul 2018 21:53:07 +0000 (21:53 +0000)]
foo

llvm-svn: 336950

6 years agoRevert "[SLPVectorizer] Add initial alternate opcode support for cast instructions...
Martin Storsjo [Thu, 12 Jul 2018 21:33:42 +0000 (21:33 +0000)]
Revert "[SLPVectorizer] Add initial alternate opcode support for cast instructions. (REAPPLIED)"

This reverts commit r336812, which broke compilation of a number
of projects, see PR38154.

llvm-svn: 336949

6 years ago[process] Update the documentation for ReadMemory and DoReadMemory to include the...
Stella Stamenova [Thu, 12 Jul 2018 21:27:56 +0000 (21:27 +0000)]
[process] Update the documentation for ReadMemory and DoReadMemory to include the error parameter

Summary: The current documentation does not include the error parameter.

Reviewers: jingham, asmith

Reviewed By: jingham

Subscribers: llvm-commits

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

llvm-svn: 336948

6 years agoSupport linking static PIE binaries on NetBSD
Joerg Sonnenberger [Thu, 12 Jul 2018 21:21:29 +0000 (21:21 +0000)]
Support linking static PIE binaries on NetBSD

llvm-svn: 336947

6 years agoPR38141: check whether noexcept-specifications are equivalent in redeclarations
Richard Smith [Thu, 12 Jul 2018 21:11:25 +0000 (21:11 +0000)]
PR38141: check whether noexcept-specifications are equivalent in redeclarations

llvm-svn: 336946

6 years agoAttributeList de-listifying:
Erich Keane [Thu, 12 Jul 2018 21:09:05 +0000 (21:09 +0000)]
AttributeList de-listifying:

Basically, "AttributeList" loses all list-like mechanisms, ParsedAttributes is
switched to use a TinyPtrVector (and a ParsedAttributesView is created to
have a non-allocating attributes list). DeclaratorChunk gets the later kind,
Declarator/DeclSpec keep ParsedAttributes.

Iterators are added to the ParsedAttribute types so that for-loops work.

llvm-svn: 336945

6 years ago[CMake] Fix a typo in the variable used to retrieve source file names
Dan Liew [Thu, 12 Jul 2018 20:55:02 +0000 (20:55 +0000)]
[CMake] Fix a typo in the variable used to retrieve source file names
for the `RTHwasan_dynamic` target.

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

llvm-svn: 336944

6 years ago[gold-plugin] Disable section ordering for relocatable links
Bill Wendling [Thu, 12 Jul 2018 20:35:58 +0000 (20:35 +0000)]
[gold-plugin] Disable section ordering for relocatable links

Not all programs want section ordering when compiled with LTO.
In particular, the Linux kernel is very sensitive when it comes to linking, and
doesn't boot when each function is placed in its own sections.

Reviewed By: pcc

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

llvm-svn: 336943

6 years agoSimplify instrprof-dlopen-dlclose-gcov.test to avoid failures on Aarch64.
Marco Castelluccio [Thu, 12 Jul 2018 20:28:09 +0000 (20:28 +0000)]
Simplify instrprof-dlopen-dlclose-gcov.test to avoid failures on Aarch64.

The test for a function with an if block in a single line (https://bugs.llvm.org/show_bug.cgi?id=38065) will be moved to a separate test.

llvm-svn: 336942

6 years ago[SanitizerCoverage] Add associated metadata to 8-bit counters.
Matt Morehouse [Thu, 12 Jul 2018 20:24:58 +0000 (20:24 +0000)]
[SanitizerCoverage] Add associated metadata to 8-bit counters.

Summary:
This allows counters associated with unused functions to be
dead-stripped along with their functions.  This approach is the same one
we used for PC tables.

Fixes an issue where LLD removes an unused PC table but leaves the 8-bit
counter.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: llvm-commits, hiraditya, kcc

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

llvm-svn: 336941

6 years ago[PowerPC] [NFC] Update __float128 tests
Stefan Pintilie [Thu, 12 Jul 2018 20:18:57 +0000 (20:18 +0000)]
[PowerPC] [NFC] Update __float128 tests

Add the two options -ppc-vsr-nums-as-vr and -ppc-asm-full-reg-names to
the __float128 tests. Then modify the tests as required.

llvm-svn: 336940

6 years ago[X86][FastISel] Support EVEX version of sqrt.
Craig Topper [Thu, 12 Jul 2018 19:58:06 +0000 (19:58 +0000)]
[X86][FastISel] Support EVEX version of sqrt.

llvm-svn: 336939

6 years ago[X86] Add show-mc-encoding to some fast-isel intrinsic tests so we can observe a...
Craig Topper [Thu, 12 Jul 2018 19:58:01 +0000 (19:58 +0000)]
[X86] Add show-mc-encoding to some fast-isel intrinsic tests so we can observe a failure to select EVEX instructions.

The one I noticed is sqrtsss/sd, but there could be others.

I had to add a couple new tests that don't have insertelement in there to catch this on the fast-isel path. Otherwise we trigger an abort and use SelectionDAG.

llvm-svn: 336938

6 years ago[Driver] Conform warn_drv_object_size_disabled_O0 to DefaultWarnNoError
Vedant Kumar [Thu, 12 Jul 2018 19:53:15 +0000 (19:53 +0000)]
[Driver] Conform warn_drv_object_size_disabled_O0 to DefaultWarnNoError

This diagnostic triggers when -fsanitize=object-size is explicitly
specified but will be a no-op (i.e, at -O0).

This diagnostic should not fail a -Werror build because it's just an
explanatory note to the user. It's not always actionable.

For example, a user may not be able to simply disable object-size,
because they want it enabled in optimized builds.

rdar://42128447

llvm-svn: 336937

6 years ago[Hexagon] Fix testcases failing after r336933
Krzysztof Parzyszek [Thu, 12 Jul 2018 19:44:39 +0000 (19:44 +0000)]
[Hexagon] Fix testcases failing after r336933

llvm-svn: 336936

6 years agoAMDGPU: Fix assert in truncate combine with vectors
Matt Arsenault [Thu, 12 Jul 2018 19:40:16 +0000 (19:40 +0000)]
AMDGPU: Fix assert in truncate combine with vectors

The piece above probably has the same problem, but I need
to try to come up with a test for it.

llvm-svn: 336935

6 years agoRevert "(HEAD -> master, origin/master, arcpatch-D37582) CodeGen: Remove pipeline...
Matthias Braun [Thu, 12 Jul 2018 19:27:01 +0000 (19:27 +0000)]
Revert "(HEAD -> master, origin/master, arcpatch-D37582) CodeGen: Remove pipeline dependencies on StackProtector; NFC"

This was triggering pass scheduling failures.

This reverts commit r336929.

llvm-svn: 336934

6 years ago[Hexagon] Diagnose intrinsics not supported by selected CPU/HVX
Krzysztof Parzyszek [Thu, 12 Jul 2018 18:54:04 +0000 (18:54 +0000)]
[Hexagon] Diagnose intrinsics not supported by selected CPU/HVX

llvm-svn: 336933

6 years ago[libFuzzer] If LLD available, require it to build first.
Matt Morehouse [Thu, 12 Jul 2018 18:52:10 +0000 (18:52 +0000)]
[libFuzzer] If LLD available, require it to build first.

Since we now have a test that requires LLD, make sure it is built before
that test runs.

llvm-svn: 336932

6 years agoAdd tests for function conversions in conversion function template
Richard Smith [Thu, 12 Jul 2018 18:49:13 +0000 (18:49 +0000)]
Add tests for function conversions in conversion function template
deduction.

llvm-svn: 336931

6 years ago[C++17] Disallow lambdas in template parameters (PR33696).
Nicolas Lesser [Thu, 12 Jul 2018 18:45:41 +0000 (18:45 +0000)]
[C++17] Disallow lambdas in template parameters (PR33696).

Summary: This revision disallows lambdas in template parameters, as reported in PR33696.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 336930

6 years agoCodeGen: Remove pipeline dependencies on StackProtector; NFC
Matthias Braun [Thu, 12 Jul 2018 18:33:32 +0000 (18:33 +0000)]
CodeGen: Remove pipeline dependencies on StackProtector; NFC

PrologEpilogInserter and StackColoring depend on the StackProtector analysis
being alive from the point it is run until PEI, which requires that they are all
scheduled in the same FunctionPassManager. Inserting a (machine) ModulePass
between StackProtector and PEI results in these passes being in separate
FunctionPassManagers and the StackProtector is not available for PEI.

PEI and StackColoring don't use much information from the StackProtector pass,
so transfering the required information to MachineFrameInfo is cleaner than
keeping the StackProtector pass around. This commit moves the SSP layout
information to MFI instead of keeping it in the pass.

This patch set (D37580, D37581, D37582, D37583, D37584, D37585, D37586, D37587)
is a first draft of the pagerando implementation described in
http://lists.llvm.org/pipermail/llvm-dev/2017-June/113794.html.

Patch by Stephen Crane <sjc@immunant.com>

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

llvm-svn: 336929

6 years ago[Tooling] Make standalone executor support user-provided vfs.
Eric Liu [Thu, 12 Jul 2018 18:32:11 +0000 (18:32 +0000)]
[Tooling] Make standalone executor support user-provided vfs.

llvm-svn: 336928

6 years ago[DWARF v5] Generate range list tables into the .debug_rnglists section. No support...
Wolfgang Pieb [Thu, 12 Jul 2018 18:18:21 +0000 (18:18 +0000)]
[DWARF v5] Generate range list tables into the .debug_rnglists section. No support for split DWARF
and no use of DW_FORM_rnglistx with the DW_AT_ranges attribute.

Reviewer: aprantl

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

llvm-svn: 336927

6 years ago[libFuzzer] Use lld-available for gc-sections.test.
Matt Morehouse [Thu, 12 Jul 2018 18:09:03 +0000 (18:09 +0000)]
[libFuzzer] Use lld-available for gc-sections.test.

The lld feature is never available for libFuzzer tests, so
gc-sections.test never actually runs.

llvm-svn: 336926

6 years ago[X86] Connect the flags user from PCMPISTR instructions to the correct node from...
Craig Topper [Thu, 12 Jul 2018 18:04:05 +0000 (18:04 +0000)]
[X86] Connect the flags user from PCMPISTR instructions to the correct node from the instruction.

We were accidentally connecting it to result 0 instead of result 1. This was caught by the machine verifier that noticed the flags were dead, but we were using them somehow. I'm still not clear what actually happened downstream.

llvm-svn: 336925

6 years ago[X86][FastISel] Choose EVEX instructions when possible when lowering x86_sse_cvttss2s...
Craig Topper [Thu, 12 Jul 2018 18:03:56 +0000 (18:03 +0000)]
[X86][FastISel] Choose EVEX instructions when possible when lowering x86_sse_cvttss2si and similar intrinsics.

This should fix a machine verifier error.

llvm-svn: 336924

6 years agoReverted r336805 as it broke llvm-clang-x86_64-expensive-checks-win build bot
Galina Kistanova [Thu, 12 Jul 2018 17:58:10 +0000 (17:58 +0000)]
Reverted r336805 as it broke llvm-clang-x86_64-expensive-checks-win build bot

llvm-svn: 336923

6 years ago[C++11] Fix warning when dropping cv-qualifiers when assigning to a reference with...
Nicolas Lesser [Thu, 12 Jul 2018 17:43:49 +0000 (17:43 +0000)]
[C++11] Fix warning when dropping cv-qualifiers when assigning to a reference with a braced initializer list

llvm-svn: 336922

6 years agoAdd --strip-all option back to llvm-strip.
Stephen Hines [Thu, 12 Jul 2018 17:42:17 +0000 (17:42 +0000)]
Add --strip-all option back to llvm-strip.

Summary:
This option appears to have been dropped as part of the refactoring in
r331663. Unfortunately, if we want to use llvm-strip as a drop-in
replacement for strip, this option should still be available.

Reviewers: alexshap

Reviewed By: alexshap

Subscribers: meikeb, kongyi, chh, jakehehrlich, llvm-commits, pirama

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

llvm-svn: 336921

6 years agoRevert "[modules] Fix 37878; Autoload subdirectory modulemaps with specific LangOpts"
Bruno Cardoso Lopes [Thu, 12 Jul 2018 17:38:48 +0000 (17:38 +0000)]
Revert "[modules] Fix 37878; Autoload subdirectory modulemaps with specific LangOpts"

This reverts commit f40124d4f05ecf4f880cf4e8f26922d861f705f3 / r336660.

This change shouldn't be affecting `@import` behavior, but turns out it is:
https://ci.swift.org/view/swift-master-next/job/oss-swift-incremental-RA-osx-master-next/2800/consoleFull#-12570166563122a513-f36a-4c87-8ed7-cbc36a1ec144

Working on a reduced testcase for this, reverting in the meantime.

rdar://problem/42102222

llvm-svn: 336920

6 years ago[clang-tidy/ObjC] Add SQL to list of acronyms
Ben Hamilton [Thu, 12 Jul 2018 17:32:55 +0000 (17:32 +0000)]
[clang-tidy/ObjC] Add SQL to list of acronyms

Summary: SQL is a common acronym.

Reviewers: Wizard, hokein

Reviewed By: Wizard, hokein

Subscribers: cfe-commits

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

llvm-svn: 336919

6 years agoRestructure the minidump loading path and add early & explicit consistency checks
Leonard Mosescu [Thu, 12 Jul 2018 17:27:18 +0000 (17:27 +0000)]
Restructure the minidump loading path and add early & explicit consistency checks

Corrupted minidumps was leading to unpredictable behavior.

This change adds explicit consistency checks for the minidump early on. The
checks are not comprehensive but they should catch obvious structural violations:

streams with type == 0
duplicate streams (same type)
overlapping streams
truncated minidumps

Another early check is to make sure we actually support the minidump architecture
instead of crashing at a random place deep inside LLDB.

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

llvm-svn: 336918

6 years ago[NFC][X86][AArch64] Add tests for the 'check for [no] signed truncation' pattern
Roman Lebedev [Thu, 12 Jul 2018 17:00:11 +0000 (17:00 +0000)]
[NFC][X86][AArch64] Add tests for the 'check for [no] signed truncation' pattern

Summary:
[[ https://bugs.llvm.org/show_bug.cgi?id=38149 | PR38149 ]]

As discussed in https://reviews.llvm.org/D49179#1158957 and later,
the IR can be improved:
https://rise4fun.com/Alive/gBf
^ that pattern will be produced by Implicit Integer Truncation sanitizer,
https://reviews.llvm.org/D48958
https://bugs.llvm.org/show_bug.cgi?id=21530
in signed case, therefore it is probably a good idea to improve it.

But as it looks from these tests,
i think we want to revert at least some cases in DAGCombine.

Reviewers: spatel, craig.topper, RKSimon, javed.absar

Reviewed By: spatel

Subscribers: kristof.beyls, llvm-commits

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

llvm-svn: 336917

6 years ago[llvm-mca] Simplify eventing by adding an onEvent templated method.
Matt Davis [Thu, 12 Jul 2018 16:56:17 +0000 (16:56 +0000)]
[llvm-mca] Simplify eventing by adding an onEvent templated method.

Summary:
This patch eliminates some redundancy in iterating across Listeners for the
Instruction and Stall HWEvents, by introducing a template onEvent routine.
This change was suggested by @courbet in https://reviews.llvm.org/D48576.  I
 hope that this patch addresses that suggestion appropriately.  I do like this
change better than what we had previously.

Reviewers: andreadb, courbet, RKSimon

Reviewed By: andreadb, courbet

Subscribers: javed.absar, tschuett, gbedwell, llvm-commits, courbet

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

llvm-svn: 336916

6 years ago[OPENMP, NVPTX] Fix loop boundaries calculation for dynamic loops.
Alexey Bataev [Thu, 12 Jul 2018 15:18:28 +0000 (15:18 +0000)]
[OPENMP, NVPTX] Fix loop boundaries calculation for dynamic loops.

Summary:
Patch fixes the next problems.
1. Removes unused functions from omptarget_nvptx_ThreadPrivateContext
class + simplified data members.
2. Fixed calculation of loop boundaries for dynamic loops with static
scheduling.
3. Introduced saving/restoring of the dynamic loop boundaries to support
several nested parallel dynamic loops.

Reviewers: grokos

Subscribers: guansong, kkwli0, openmp-commits

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

llvm-svn: 336915

6 years agoFollow up of r336913: forgot to add the new test files.
Sjoerd Meijer [Thu, 12 Jul 2018 14:59:02 +0000 (14:59 +0000)]
Follow up of r336913: forgot to add the new test files.

llvm-svn: 336914

6 years ago[AArch64] Armv8.4-A: LDAPR & STLR with immediate offset instructions
Sjoerd Meijer [Thu, 12 Jul 2018 14:57:59 +0000 (14:57 +0000)]
[AArch64] Armv8.4-A: LDAPR & STLR with immediate offset instructions

These instructions are added to AArch64 only.

llvm-svn: 336913

6 years ago[InstCombine] icmp-logical.ll: restore the original intention of the test.
Roman Lebedev [Thu, 12 Jul 2018 14:56:17 +0000 (14:56 +0000)]
[InstCombine] icmp-logical.ll: restore the original intention of the test.

While that fold is clearly not happening [anymore],
we do now have separate test cases for these cases,
so we should be ok to slightly adjust these tests
to not potentially loose test coverage.

As suggested by Hiroshi Yamauchi in
https://reviews.llvm.org/D49179#1159345

llvm-svn: 336912

6 years ago[InstCombine] Fold x & (-1 >> y) != x to x u> (-1 >> y)
Roman Lebedev [Thu, 12 Jul 2018 14:56:12 +0000 (14:56 +0000)]
[InstCombine] Fold  x & (-1 >> y) != x  to  x u> (-1 >> y)

Summary:
A complementary fold to D49179.

https://bugs.llvm.org/show_bug.cgi?id=38123
https://rise4fun.com/Alive/Rny

Caveat: one more thing in `test/Transforms/InstCombine/icmp-logical.ll` breaks.

Reviewers: spatel, craig.topper

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 336911

6 years ago[Tooling] Get working directory properly without assuming real file system.
Eric Liu [Thu, 12 Jul 2018 14:54:25 +0000 (14:54 +0000)]
[Tooling] Get working directory properly without assuming real file system.

llvm-svn: 336910

6 years ago[clangd] Extract FileSystemProvider into a separate header. NFC
Sam McCall [Thu, 12 Jul 2018 14:49:52 +0000 (14:49 +0000)]
[clangd] Extract FileSystemProvider into a separate header. NFC

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: mgorny, ioeric, MaskRay, jkorous, cfe-commits

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

llvm-svn: 336909

6 years ago[ThinLTO] Escape module paths when printing
Andrew Ng [Thu, 12 Jul 2018 14:40:21 +0000 (14:40 +0000)]
[ThinLTO] Escape module paths when printing

We have located a bug in AssemblyWriter::printModuleSummaryIndex(). This
function outputs path strings incorrectly. Backslashes in the strings
are not correctly escaped.

Consequently, if a path name contains a backslash followed by two
hexadecimal characters, the sequence is incorrectly interpreted when the
output is read by another component. This mangles the path and results
in error.

This patch fixes this issue by calling printEscapedString() to output
the module paths.

Patch by Chris Jackson.

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

llvm-svn: 336908

6 years ago[DebugInfo][X86] Add start-after flags to MIR tests
Francis Visoiu Mistrih [Thu, 12 Jul 2018 14:36:48 +0000 (14:36 +0000)]
[DebugInfo][X86] Add start-after flags to MIR tests

These tests would fail with -verify-machineinstrs because the MI
generated from the IR would be merged with the one already in the MIR
files, and we get the following error:

```
*** Bad machine code: Function has NoVRegs property but there are VReg operands ***
- function:    f
```

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

llvm-svn: 336907

6 years ago[XRay] Fix machine verifier issues in X86
Francis Visoiu Mistrih [Thu, 12 Jul 2018 14:36:43 +0000 (14:36 +0000)]
[XRay] Fix machine verifier issues in X86

I'm not sure if this fix is the right thing to do, but it seemed to me
that PATCHABLE_RET and PATCHABLE_TAIL_CALL don't have any defs.

Running the following:

```
LLVM_ENABLE_MACHINE_VERIFIER=1 ./build/bin/llvm-lit -v -a test/CodeGen/X86/xray-*
```

results in the following tests to fail (along others):

```
LLVM :: CodeGen/X86/xray-attribute-instrumentation.ll
LLVM :: CodeGen/X86/xray-custom-log.ll
LLVM :: CodeGen/X86/xray-log-args.ll
LLVM :: CodeGen/X86/xray-loop-detection.ll
LLVM :: CodeGen/X86/xray-multiplerets-in-blocks.mir
LLVM :: CodeGen/X86/xray-section-group.ll
LLVM :: CodeGen/X86/xray-selective-instrumentation.ll
LLVM :: CodeGen/X86/xray-tail-call-sled.ll
LLVM :: CodeGen/X86/xray-typed-event-log.ll
```

The errors are:

```
*** Bad machine code: Explicit definition must be a register ***
- function:    fn
- basic block: %bb.0  (0x7fa31a84d908)
- instruction: PATCHABLE_RET 2560, $eax
- operand 0:   2560
```

and

```
*** Bad machine code: Explicit definition must be a register ***
- function:    caller
- basic block: %bb.0  (0x7fbff3044108)
- instruction: PATCHABLE_TAIL_CALL 3009, @callee, <regmask $bh $bl $bp $bph $bpl $bx $ebp $ebx $hbp $hbx $rbp $rbx $r12 $r13 $r14 $r15 $r12b $r13b $r14b $r15b $r12bh $r13bh $r14bh $r15bh $r12d $r13d $r14d $r15d $r12w $r13w $r14w $r15w $r12wh and 3 more...>, implicit $rsp, implicit $ssp, implicit $rsp, implicit $ssp, implicit $edi
- operand 0:   3009
```

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

llvm-svn: 336906

6 years ago[CMake] Remove unnecesary list of source files for Xray unit tests.
Dan Liew [Thu, 12 Jul 2018 13:48:18 +0000 (13:48 +0000)]
[CMake] Remove unnecesary list of source files for Xray unit tests.

The list duplicates information already available in the parent
directory so use that instead. It is unclear to me why we need
to spell out the dependencies explicitly but fixing that should
be done in a separate patch.

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

llvm-svn: 336905

6 years ago[CMake] Rename `SANITIZER_HEADERS` to `SANITIZER_IMPL_HEADERS` under `lib/sanitizer_c...
Dan Liew [Thu, 12 Jul 2018 13:36:44 +0000 (13:36 +0000)]
[CMake] Rename `SANITIZER_HEADERS` to `SANITIZER_IMPL_HEADERS` under `lib/sanitizer_common`.

The variable name `SANITIZER_HEADERS` is already used for the list of
public headers in `include/CMakeLists.txt`.  Although the previous
implementation worked it's probably best to avoid shadowing global
variables to avoid confusion.

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

llvm-svn: 336904

6 years ago[X86][SSE] Utilize ZeroableElements for canWidenShuffleElements
Simon Pilgrim [Thu, 12 Jul 2018 13:29:41 +0000 (13:29 +0000)]
[X86][SSE] Utilize ZeroableElements for canWidenShuffleElements

canWidenShuffleElements can do a better job if given a mask with ZeroableElements info. Apparently, ZeroableElements was being only used to identify AllZero candidates, but possibly we could plug it into more shuffle matchers.

Original Patch by Zvi Rackover @zvi

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

llvm-svn: 336903

6 years ago[InstCombine]add testcases for folding more SPFofSPF pattern
Chen Zheng [Thu, 12 Jul 2018 13:28:20 +0000 (13:28 +0000)]
[InstCombine]add testcases for folding more SPFofSPF pattern

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

llvm-svn: 336902

6 years ago[analyzer][UninitializedObjectChecker] Moved non-member functions out of the anonymou...
Kristof Umann [Thu, 12 Jul 2018 13:13:46 +0000 (13:13 +0000)]
[analyzer][UninitializedObjectChecker] Moved non-member functions out of the anonymous namespace

As the code for the checker grew, it became increasinly difficult to see
whether a function was global or statically defined. In this patch,
anything that isn't a type declaration or definition was moved out of the
anonymous namespace and is marked as static.

llvm-svn: 336901

6 years ago[X86][AVX] Use Zeroable mask to improve shuffle mask widening
Simon Pilgrim [Thu, 12 Jul 2018 13:03:58 +0000 (13:03 +0000)]
[X86][AVX] Use Zeroable mask to improve shuffle mask widening

Noticed while updating D42044, lowerV2X128VectorShuffle can improve the shuffle mask with the zeroable data to create a target shuffle mask to recognise more 'zero upper 128' patterns.

NOTE: lowerV4X128VectorShuffle could benefit as well but the code needs refactoring first to discriminate between SM_SentinelUndef and SM_SentinelZero for negative shuffle indices.

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

llvm-svn: 336900

6 years ago[clangd] log request/response messages with method/ID/error at INFO level
Sam McCall [Thu, 12 Jul 2018 11:52:18 +0000 (11:52 +0000)]
[clangd] log request/response messages with method/ID/error at INFO level

Summary: Bodies are logged at VERBOSE level (since r336785), tweak the formatting.

Reviewers: hokein

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

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

llvm-svn: 336899

6 years ago[ASTImporter] Fix infinite recursion on function import with struct definition in...
Gabor Marton [Thu, 12 Jul 2018 11:50:21 +0000 (11:50 +0000)]
[ASTImporter] Fix infinite recursion on function import with struct definition in parameters

Summary:
Importing a function having a struct definition in the parameter list
causes a crash in the importer via infinite recursion. This patch avoids
the crash and reports such functions as not supported. Unit tests make
sure that normal struct definitions inside function bodies work normally
on the other hand and LLDB-like type imports also do.

Reviewers: a.sidorin, martong

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

Patch by Zoltan Gera!

llvm-svn: 336898

6 years ago[UnJ] Use SmallPtrSets for block collections. NFC
David Green [Thu, 12 Jul 2018 10:44:47 +0000 (10:44 +0000)]
[UnJ] Use SmallPtrSets for block collections. NFC

We no longer care about the order of blocks in these collections,
so can change to SmallPtrSets, making contains checks quicker.

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

llvm-svn: 336897

6 years ago[ASTImporter] Refactor Decl creation
Gabor Marton [Thu, 12 Jul 2018 09:42:05 +0000 (09:42 +0000)]
[ASTImporter] Refactor Decl creation

Summary:
Generalize the creation of Decl nodes during Import.  With this patch we do the
same things after and before a new AST node is created (::Create) The import
logic should be really simple, we create the node, then we mark that as
imported, then we recursively import the parts for that node and then set them
on that node.  However, the AST is actually a graph, so we have to handle
circles.  If we mark something as imported (`MapImported()`) then we return with
the corresponding `To` decl whenever we want to import that node again, this way
circles are handled.  In order to make this algorithm work we must ensure
things, which are handled in the generic CreateDecl<> template:
* There are no `Import()` calls in between any node creation (::Create)
and the `MapImported()` call.
* Before actually creating an AST node (::Create), we must check if
the Node had been imported already, if yes then return with that one.
One very important case for this is connected to templates: we may
start an import both from the templated decl of a template and from
the template itself.

Now, the virtual `Imported` function is called in `ASTImporter::Impor(Decl *)`,
but only once, when the `Decl` is imported.  One point of this refactor is to
separate responsibilities. The original `Imported()` had 3 responsibilities:
- notify subclasses when an import happened
- register the decl into `ImportedDecls`
- initialise the Decl (set attributes, etc)
Now all of these are in separate functions:
- `Imported`
- `MapImported`
- `InitializeImportedDecl`
I tried to check all the clients, I executed tests for `ExternalASTMerger.cpp`
and some unittests for lldb.

Reviewers: a.sidorin, balazske, xazax.hun, r.stahl

Subscribers: rnkovacs, dkrupp, cfe-commits

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

llvm-svn: 336896

6 years agoFix -Wdocumentation warnings. NFCI.
Simon Pilgrim [Thu, 12 Jul 2018 09:10:55 +0000 (09:10 +0000)]
Fix -Wdocumentation warnings. NFCI.

llvm-svn: 336895

6 years ago[X86] Add UDIV by uniform/non-uniform constant tests
Simon Pilgrim [Thu, 12 Jul 2018 09:04:28 +0000 (09:04 +0000)]
[X86] Add UDIV by uniform/non-uniform constant tests

llvm-svn: 336894

6 years ago[mips] Mark standard encoded instructions as not being in MIPS16e
Simon Atanasyan [Thu, 12 Jul 2018 08:50:11 +0000 (08:50 +0000)]
[mips] Mark standard encoded instructions as not being in MIPS16e

Mark standard encoded instructions and pseudo "standard encoded"
as not being in MIPS16e by default.

Patch by Simon Dardis.

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

llvm-svn: 336893

6 years ago[ELF] - Simplify code. NFC.
George Rimar [Thu, 12 Jul 2018 08:33:02 +0000 (08:33 +0000)]
[ELF] - Simplify code. NFC.

Just use getDataAs for taking sections contents.

llvm-svn: 336892

6 years ago[ELF] - Eliminate dead code. NFC.
George Rimar [Thu, 12 Jul 2018 08:12:08 +0000 (08:12 +0000)]
[ELF] - Eliminate dead code. NFC.

Code is dead because caller of the isDuplicateArmExidxSex
(https://github.com/llvm-mirror/lld/blob/master/ELF/Writer.cpp#L1446)

explicitly does not pass sentinel. So no reason to check it.

llvm-svn: 336891

6 years ago[clangd] Simplify logging wrapper after r336888
Sam McCall [Thu, 12 Jul 2018 08:00:21 +0000 (08:00 +0000)]
[clangd] Simplify logging wrapper after r336888

llvm-svn: 336890

6 years ago[X86] Remove i128 type from FR128 regclass.
Craig Topper [Thu, 12 Jul 2018 07:30:01 +0000 (07:30 +0000)]
[X86] Remove i128 type from FR128 regclass.

i128 isn't a legal type in our x86 implementation today. So remove this and the few patterns that used it until it becomes necessary.

llvm-svn: 336889