Commit Graph

258814 Commits

Author SHA1 Message Date
Olga Malysheva dbdcfa127f Reset cancellation status for 'parallel', 'sections' and 'for' constracts.
Without this fix cancellation status for parallel, sections and for persists 
across construct boundaries.

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

llvm-svn: 299434
2017-04-04 13:56:50 +00:00
Daniel Sanders db7ed37c7a [globalisel][tablegen] Try to make MSVC happy with r299430
Fix other cases of 'const StringRef' creeping back in at the same time.

This should fix the llvm-clang-x86_64-expensive-checks-win buildbot.

llvm-svn: 299433
2017-04-04 13:52:00 +00:00
Michael Zuckerman 88fb171015 [X86][LLVM] Converting __mm{|256|512}_movm_epi{8|16|32|64} LLVMIR call into generic intrinsics.
This patch is a part one of two reviews, one for the clang and the other for LLVM. 
The patch deletes the back-end intrinsics and adds support for them in the auto upgrade.

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

llvm-svn: 299432
2017-04-04 13:32:14 +00:00
Michael Zuckerman 755a13db3d [X86][Clang] Converting __mm{|256|512}_movm_epi{8|16|32|64} LLVMIR call into generic intrinsics.
This patch is a part two of two reviews, one for the clang and the other for LLVM. 
In this patch, I covered the clang side, by introducing the intrinsic to the front end. 
This is done by creating a generic replacement.

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

llvm-svn: 299431
2017-04-04 13:29:53 +00:00
Daniel Sanders bee5739a7c [tablegen][globalisel] Add support for nested instruction matching.
Summary:
Lift the restrictions that prevented the tree walking introduced in the
previous change and add support for patterns like:
  (G_ADD (G_MUL (G_SEXT $src1), (G_SEXT $src2)), $src3) -> SMADDWrrr $dst, $src1, $src2, $src3
Also adds support for G_SEXT and G_ZEXT to support these cases.

One particular aspect of this that I should draw attention to is that I've
tried to be overly conservative in determining the safety of matches that
involve non-adjacent instructions and multiple basic blocks. This is intended
to be used as a cheap initial check and we may add a more expensive check in
the future. The current rules are:
* Reject if any instruction may load/store (we'd need to check for intervening
  memory operations.
* Reject if any instruction has implicit operands.
* Reject if any instruction has unmodelled side-effects.
See isObviouslySafeToFold().

Reviewers: t.p.northover, javed.absar, qcolombet, aditya_nandakumar, ab, rovka

Reviewed By: ab

Subscribers: igorb, dberris, llvm-commits, kristof.beyls

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

llvm-svn: 299430
2017-04-04 13:25:23 +00:00
Siddharth Bhat bcbfdade41 [Polly] [DependenceInfo] change WAR, WAW generation to correct semantics
= Change of WAR, WAW generation: =

- `buildFlow(Sink, MustSource, MaySource, Sink)` treates any flow of the form
    `sink <- may source <- must source` as a *may* dependence.

- we used to call:
```lang=cpp, name=old-flow-call.cpp
Flow = buildFlow(MustWrite, MustWrite, Read, Schedule);
WAW = isl_union_flow_get_must_dependence(Flow);
WAR = isl_union_flow_get_may_dependence(Flow);
```

- This caused some WAW dependences to be treated as WAR dependences.
- Incorrect semantics.

- Now, we call WAR and WAW correctly.

== Correct WAW: ==
```lang=cpp, name=new-waw-call.cpp
   Flow = buildFlow(Write, MustWrite, MayWrite, Schedule);
   WAW = isl_union_flow_get_may_dependence(Flow);
   isl_union_flow_free(Flow);
```

== Correct WAR: ==
```lang=cpp, name=new-war-call.cpp
    Flow = buildFlow(Write, Read, MustaWrite, Schedule);
    WAR = isl_union_flow_get_must_dependence(Flow);
    isl_union_flow_free(Flow);
```

- We want the "shortest" WAR possible (exact dependences).
- We mark all the *must-writes* as may-source, reads as must-souce.
- Then, we ask for *must* dependence.
- This removes all the reads that flow through a *must-write*
  before reaching a sink.
- Note that we only block ealier writes with *must-writes*. This is
  intuitively correct, as we do not want may-writes to block
  must-writes.
- Leaves us with direct (R -> W).

- This affects reduction generation since RED is built using WAW and WAR.

= New StrictWAW for Reductions: =

- We used to call:
```lang=cpp,name=old-waw-war-call.cpp
      Flow = buildFlow(MustWrite, MustWrite, Read, Schedule);
      WAW = isl_union_flow_get_must_dependence(Flow);
      WAR = isl_union_flow_get_may_dependence(Flow);
```

- This *is* the right model of WAW we need for reductions, just not in general.
- Reductions need to track only *strict* WAW, without any interfering reductions.

= Explanation: Why the new WAR dependences in tests are correct: =

- We no longer set WAR = WAR - WAW
- Hence, we will have WAR dependences that were originally removed.
- These may look incorrect, but in fact make sense.

== Code: ==
```lang=llvm, name=new-war-dependence.ll
  ;    void manyreductions(long *A) {
  ;      for (long i = 0; i < 1024; i++)
  ;        for (long j = 0; j < 1024; j++)
  ; S0:          *A += 42;
  ;
  ;      for (long i = 0; i < 1024; i++)
  ;        for (long j = 0; j < 1024; j++)
  ; S1:          *A += 42;
  ;
```
=== WAR dependence: ===
  {  S0[1023, 1023] -> S1[0, 0] }

- Between `S0[1023, 1023]` and `S1[0, 0]`, we will have the dependences:

```lang=cpp, name=dependence-incorrect, counterexample
        S0[1023, 1023]:
    *-- tmp = *A (load0)--*
WAR 2   add = tmp + 42    |
    *-> *A = add (store0) |
                         WAR 1
        S1[0, 0]:         |
        tmp = *A (load1)  |
        add = tmp + 42    |
        A = add (store1)<-*
```

- One may assume that WAR2 *hides* WAR1 (since store0 happens before
  store1). However, within a statement, Polly has no idea about the
  ordering of loads and stores.

- Hence, according to Polly, the code may have looked like this:
```lang=cpp, name=dependence-correct
    S0[1023, 1023]:
    A = add (store0)
    tmp = A (load0) ---*
    add = A + 42       |
                     WAR 1
    S1[0, 0]:          |
    tmp = A (load1)    |
    add = A + 42       |
    A = add (store1) <-*
```

- So, Polly  generates (correct) WAR dependences. It does not make sense
  to remove these dependences, since they are correct with respect to
  Polly's model.

    Reviewers: grosser, Meinersbur

    tags: #polly

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

llvm-svn: 299429
2017-04-04 13:08:23 +00:00
Olga Malysheva b7784ebdf7 Test check-in, comment changed
llvm-svn: 299428
2017-04-04 12:56:55 +00:00
Simon Dardis 0a47edb153 [mips] Deal with empty blocks in the mips hazard scheduler
This patch teaches the hazard scheduler how to handle empty blocks
when search for the next real instruction when dealing with forbidden
slots.

Reviewers: slthakur

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

llvm-svn: 299427
2017-04-04 11:28:53 +00:00
Krasimir Georgiev d7f1512897 [clangd] Remove private vector fields from completion test.
llvm-svn: 299426
2017-04-04 10:42:22 +00:00
Oren Ben Simhon 568fb197da [X86] Add 64 bit pattern matching for PSADBW
PSADBW pattern currently supports the 32 bit IR pattern and only GLT (greather than) comparison.
The patch extends the pattern to catch also 64 bit IR pattern and includes all other comparison types (not only GLT).

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

llvm-svn: 299425
2017-04-04 10:23:18 +00:00
Philip Pfaffe 447f175eb5 Fix formatting in LoopGenerators
llvm-svn: 299424
2017-04-04 10:22:17 +00:00
Philip Pfaffe 2d950f36ee [Polly][NewPM] Pull references to the legacy PM interface from utilities and helpers
Summary:
A couple of the utilities used to analyze or build IR make explicit use of the legacy PM on their interface, to access analysis results. This patch removes the legacy PM from the interface, and just passes the required results directly.

This shouldn't introduce any function changes, although the API technically allowed to obtain two different analysis results before, one passed by reference and one through the PM. I don't believe that was ever intended, however.

Reviewers: grosser, Meinersbur

Reviewed By: grosser

Subscribers: nemanjai, pollydev, llvm-commits

Tags: #polly

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

llvm-svn: 299423
2017-04-04 10:01:53 +00:00
Haojian Wu 43ba525357 Fix windows buildbot error.
llvm-svn: 299422
2017-04-04 09:53:55 +00:00
Krasimir Georgiev 6d2131a04c [clangd] Add code completion support
Summary: Adds code completion support to clangd.

Reviewers: bkramer, malaperle-ericsson

Reviewed By: bkramer, malaperle-ericsson

Subscribers: stanionascu, malaperle-ericsson, cfe-commits

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

llvm-svn: 299421
2017-04-04 09:46:39 +00:00
James Henderson b7a90ef48e [ELF] Fail the link early if the map file path is invalid
As with the changes made in r297645, we do not want a potentially long link to
be run, if it will ultimately fail because the map file is not writable. This
change reuses the same functionality as the output file path check. See
https://reviews.llvm.org/D30449 for further justification and explanations.

Reviewers: ruiu

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

llvm-svn: 299420
2017-04-04 09:42:24 +00:00
Haojian Wu 74f823a045 [clang-rename] Support renaming qualified symbol
Summary:
The patch adds a new feature for renaming qualified symbol references.
Unlike orginal clang-rename behavior, when renaming a qualified symbol to a new
qualified symbol (e.g "A::Foo" => "B::Bar"), this new rename behavior will
consider the prefix qualifiers of the symbol, and calculate the new prefix
qualifiers.  It aims to add as few additional qualifiers as possible.

As this is an early version (only supports renaming classes), I don't change
current clang-rename interfaces at the moment, and would like to keep its
(command-line tool) behavior. So I added new interfaces for the prototype.
In the long run, these interfaces should be unified.

No functionality changes in original clang-rename command-line tool.

This patch also contains a few bug fixes of clang-rename which are discovered by
the new unittest:

* fix a potential nullptr accessment when class declaration doesn't have definition.
* add USRs of nested declartaions in "getNamedDeclFor".

Reviewers: ioeric

Reviewed By: ioeric

Subscribers: alexfh, cfe-commits, mgorny

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

llvm-svn: 299419
2017-04-04 09:30:06 +00:00
Peter Smith 6308ac2254 [ELF] Rename ARM Thunks in anticipation of Range Thunks
The existing names for the ARM and Thumb Thunks highlight their current
use as interworking Thunks. These Thunks can also be used for range
extension Thunks where there is no state change. This change makes the name
more generic so it is suitable for range extension.

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

llvm-svn: 299418
2017-04-04 09:29:36 +00:00
Ilia K a97973ab4e Enable lldm-mi commands -stack-list-locals -stack-list-variables and -var-create to work only with variables in scope
Patch by ayuckhulk

Reviewers: abidh, lldb-commits, ki.stfu

Reviewed By: ki.stfu

Tags: #lldb

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

llvm-svn: 299417
2017-04-04 08:00:28 +00:00
Craig Topper 451eedd3b6 [X86] Remove some code that tries to disable HLE feature. This feature flag was removed from the backend.
llvm-svn: 299416
2017-04-04 06:38:44 +00:00
Jonas Hahnfeld 1f9b00117c Align all scalar numbers to LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR
Otherwise, yamlize in YAMLTraits.h might be wrongly defined.
This makes some AMDGPU tests fail when LLVM_LINK_LLVM_DYLIB is set.

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

llvm-svn: 299415
2017-04-04 06:02:32 +00:00
Mehdi Amini 5a403580e3 Uses quote to include cxxabi.h to make sure the local one is included
llvm-svn: 299414
2017-04-04 05:38:38 +00:00
Craig Topper e06b6bcfa1 [InstCombine] Use setAllBits in place of getAllOnesValue since we know the bitwidths are the same. NFCI
llvm-svn: 299413
2017-04-04 05:03:02 +00:00
Zvi Rackover 82bf48d8b9 InstCombine: Use the InstSimplify hook for shufflevector
Summary: Start using the recently added InstSimplify hook for shuffles in the respective InstCombine visitor.

Reviewers: spatel, RKSimon, craig.topper, majnemer

Reviewed By: majnemer

Subscribers: majnemer, llvm-commits

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

llvm-svn: 299412
2017-04-04 04:47:57 +00:00
Eric Fiselier 61329522af Fix more -Wshadow warnings introduced by recent Clang change
llvm-svn: 299411
2017-04-04 02:54:27 +00:00
Galina Kistanova 53ddd72595 Modules/builtins.m requires shell.
llvm-svn: 299410
2017-04-04 02:50:40 +00:00
Jason Molenda 498ff61e2d Skip three test cases that are asserting on macosx as of r299199. A quick
look showed that the target's arch has no core / byte order and so when
AuxVector::AuxVector calls into a dataextractor and sets the byte size to 0,
it asserts.  e.g.

  m_arch = {
    m_triple = (Data = "x86_64--linux", Arch = x86_64, SubArch = NoSubArch, Vendor = UnknownVendor, OS = Linux, Environment = UnknownEnvironment, ObjectFormat = ELF)
    m_core = kCore_invalid
    m_byte_order = eByteOrderInvalid
    m_flags = 0x00000000
    m_distribution_id = <no value available>
  }

<rdar://problem/31380097> 

llvm-svn: 299408
2017-04-04 01:09:20 +00:00
Eric Fiselier 3896bf7453 Work around recent -Wshadow changes in Clang
llvm-svn: 299407
2017-04-04 01:05:59 +00:00
Reid Kleckner 13fc411e39 [PDB] Save one type record copy
Summary:
The TypeTableBuilder provides stable storage for type records. We don't
need to copy all of the bytes into a flat vector before adding it to the
TpiStreamBuilder.

This makes addTypeRecord take an ArrayRef<uint8_t> and a hash code to go
with it, which seems like a simplification.

Reviewers: ruiu, zturner, inglorion

Subscribers: llvm-commits

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

llvm-svn: 299406
2017-04-04 00:56:34 +00:00
Reid Kleckner c4b5d794f1 [codeview] Cope with unsorted streams in type merging
Summary:
MASM can produce type streams that are not topologically sorted. It can
even produce type streams with circular references, but those are not
common in practice.

Reviewers: inglorion, ruiu

Subscribers: llvm-commits

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

llvm-svn: 299403
2017-04-03 23:58:15 +00:00
Sean Callanan 48a15fd9f1 Add CPlusPlusNameParser to the xcodeproj
llvm-svn: 299402
2017-04-03 23:56:41 +00:00
Eric Fiselier 66f1ec46c6 Fix C++17 dylib build
llvm-svn: 299401
2017-04-03 23:23:44 +00:00
Reid Kleckner 67cecd1e1c [Fuzzer] Flush std::cout before aborting in CxxStringEqTest
On Windows, abort() does not appear to flush std::cout. Should fix red
sanitizer-windows bot.

llvm-svn: 299398
2017-04-03 23:00:25 +00:00
Craig Topper 01bba17819 Recommit r299321 '[X86] Add __extension__ to f16c macro intrinsics to suppress warnings about compound literals when compiled for with earlier language standards enabled.'
The bot didn't recover after the revert. So it looks like this wasn't the issue.

llvm-svn: 299397
2017-04-03 22:59:30 +00:00
Sanjay Patel a4546efbc8 add/move codegen tests for and/or of setcc; NFC
llvm-svn: 299396
2017-04-03 22:45:46 +00:00
Tim Northover 4e3cc794d5 Update stale doxygen links in ProgrammersManual.rst
Patch by Wei-Ren Chen.

llvm-svn: 299395
2017-04-03 22:24:32 +00:00
Jason Molenda a4039a024c The LIBLLDB_LOG_TEMPORARY channel got lost at some point where
Logging.cpp was being changed in the past.  Re-add it.

llvm-svn: 299394
2017-04-03 22:23:01 +00:00
Zvi Rackover 8f460655a2 InstSimplify: Add a hook for shufflevector
Summary:
Add a hook for simplification of shufflevector's with the following rules:
- Constant folding - NFC, as it was already being done by the default handler.
-  If only one of the operands is constant, constant fold the shuffle if the
    mask does not select elements from the variable operand -  to show the hook is firing and affecting the test-cases.

Reviewers: RKSimon, craig.topper, spatel, sanjoy, nlopes, majnemer

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 299393
2017-04-03 22:05:30 +00:00
Weiming Zhao 74a7fa0594 Reland r298901 with modifications (reverted in r298932)
Dont emit Mapping symbols for sections that contain only data.

Summary:
Dont emit mapping symbols for sections that contain only data.

Reviewers: rengolin, weimingz, kparzysz, t.p.northover, peter.smith

Reviewed By: t.p.northover

Patched by Shankar Easwaran <shankare@codeaurora.org>

Subscribers: alekseyshl, t.p.northover, llvm-commits

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

llvm-svn: 299392
2017-04-03 21:50:04 +00:00
Matt Arsenault b600e138cc AMDGPU: Remove llvm.SI.vs.load.input
llvm-svn: 299391
2017-04-03 21:45:13 +00:00
Rui Ueyama 6ea72527e0 Change the error message format for an incompatible relocation.
Previous error message style:

  error: /home/alice/src/bar.c:12: relocation R_X86_64_PLT32 cannot refer to absolute symbol 'answer' defined in /home/alice/src/foo.o

New error message style:

  error: relocation R_X86_64_PLT32 cannot refer to absolute symbol: foo
  >>> defined in /home/alice/src/foo.o
  >>> referenced by bar.c:12 (/home/alice/src/bar.c:12)
  >>>               /home/alice/src/bar.o:(.text+0x1)

llvm-svn: 299390
2017-04-03 21:36:31 +00:00
Matt Arsenault c82768290d DAG: Fix missing legalization for any_extend_vector_inreg operands
llvm-svn: 299389
2017-04-03 21:28:13 +00:00
Reid Kleckner 1c3b5087b7 [codeview] Add support for label type records
MASM can produce these type records.

llvm-svn: 299388
2017-04-03 21:25:20 +00:00
Simon Pilgrim af33757b5d [X86][SSE]] Lower BUILD_VECTOR with repeated elts as BUILD_VECTOR + VECTOR_SHUFFLE
It can be costly to transfer from the gprs to the xmm registers and can prevent loads merging.

This patch splits vXi16/vXi32/vXi64 BUILD_VECTORS that use the same operand in multiple elements into a BUILD_VECTOR with only a single insertion of each of those elements and then performs an unary shuffle to duplicate the values.

There are a couple of minor regressions this patch unearths due to some missing MOVDDUP/BROADCAST folds that I will address in a future patch.

Note: Now that vector shuffle lowering and combining is pretty good we should be reusing that instead of duplicating so much in LowerBUILD_VECTOR - this is the first of several patches to address this.

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

llvm-svn: 299387
2017-04-03 21:06:51 +00:00
Gabor Horvath 3b392bb8d8 Revert r299355 "[ASTImporter] Fix for importing unnamed structs"
It breaks windows bots. 

llvm-svn: 299386
2017-04-03 21:06:45 +00:00
Eric Fiselier e4bda11453 suppress GCC warning about noexcept functions changing mangling
llvm-svn: 299385
2017-04-03 20:53:15 +00:00
Craig Topper 1604f0773b [InstCombine] Remove canonicalization for (X & C1) | C2 --> (X | C2) & (C1|C2) when C1 & C2 have common bits.
It turns out that SimplifyDemandedInstructionBits will get called earlier and remove bits from C1 first. Effectively doing (X & (C1&C2)) | C2. So by the time it got to this check there could be no common bits.

I think the DAGCombiner has the same check but its check can be executed because it handles demanded bits later. I'll look at it next.

llvm-svn: 299384
2017-04-03 20:41:47 +00:00
Amjad Aboud 0389f62879 x86 interrupt calling convention: re-align stack pointer on 64-bit if an error code was pushed
The x86_64 ABI requires that the stack is 16 byte aligned on function calls. Thus, the 8-byte error code, which is pushed by the CPU for certain exceptions, leads to a misaligned stack. This results in bugs such as Bug 26413, where misaligned movaps instructions are generated.

This commit fixes the misalignment by adjusting the stack pointer in these cases. The adjustment is done at the beginning of the prologue generation by subtracting another 8 bytes from the stack pointer. These additional bytes are popped again in the function epilogue.

Fixes Bug 26413

Patch by Philipp Oppermann.

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

llvm-svn: 299383
2017-04-03 20:28:45 +00:00
Craig Topper 27b71e5b1b Revert r299321 '[X86] Add __extension__ to f16c macro intrinsics to suppress warnings about compound literals when compiled for with earlier language standards enabled.' to see if recovers a fuzzer bot.
llvm-svn: 299382
2017-04-03 19:43:47 +00:00
Jonathan Roelofs 978da1f4f6 Try to trigger the new docs builder. NFC
llvm-svn: 299381
2017-04-03 19:23:11 +00:00
Eric Fiselier bee782bb92 [coroutines] Fix rebuilding of implicit and dependent coroutine statements.
Summary:
Certain implicitly generated coroutine statements, such as the calls to 'return_value()' or `return_void()` or `get_return_object_on_allocation_failure()`, cannot be built until the promise type is no longer dependent. This means they are not built until after the coroutine body statement has been transformed.

This patch fixes an issue where these statements would never be built for coroutine templates.

It also fixes a small issue where diagnostics about `get_return_object_on_allocation_failure()` were incorrectly suppressed. 

Reviewers: rsmith, majnemer, GorNishanov, aaron.ballman

Reviewed By: GorNishanov

Subscribers: cfe-commits

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

llvm-svn: 299380
2017-04-03 19:21:00 +00:00