Commit Graph

272915 Commits

Author SHA1 Message Date
Dehao Chen f464627f28 Update getMergedLocation to check the instruction type and merge properly.
Summary: If the merged instruction is call instruction, we need to set the scope to the closes common scope between 2 locations, otherwise it will cause trouble when the call is getting inlined.

Reviewers: dblaikie, aprantl

Reviewed By: dblaikie, aprantl

Subscribers: llvm-commits, sanjoy

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

llvm-svn: 314694
2017-10-02 18:13:14 +00:00
Marc-Andre Laperle bf11424b7f [clangd] Handle workspace/didChangeWatchedFiles
Summary:
The client can send notifications when it detects watched files have
changed. This patch adds the protocol handling for this type of notification.
For now, the notification will be passed down to the ClangdServer, but it will
not be acted upon. However, this will become useful for the indexer to react
to file changes.
The events could also potentially be used to invalidate other caches
(compilation database, etc).

This change also updates the VSCode extension so that it sends the events.

Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>

Reviewers: ilya-biryukov, Nebiroth

Subscribers: ilya-biryukov

Tags: #clang-tools-extra

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

llvm-svn: 314693
2017-10-02 18:00:37 +00:00
George Karpenkov a807660918 [Analyzer] Make testing scripts flake8 compliant
Differential Review: https://reviews.llvm.org/D38213

llvm-svn: 314692
2017-10-02 17:59:12 +00:00
Jonas Hahnfeld f21a60233c [CUDA] Fix name of __activemask()
The name has two underscores in the official CUDA documentation:
http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#warp-vote-functions

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

llvm-svn: 314691
2017-10-02 17:50:11 +00:00
Hans Wennborg ea89ff7c25 CodeView symbol dumper: use symbolic names for registers
https://reviews.llvm.org/D38469

llvm-svn: 314690
2017-10-02 17:44:47 +00:00
Reid Kleckner a3fe27f6b5 Revert "[Sema] Warn on attribute nothrow conflicting with language specifiers"
This reverts r314461.

It is warning on user code that uses END_COM_MAP(), which expands to
declare QueryInterface with conflicting exception specifers. I've spent
a while trying to understand why, but haven't been able to extract a
reduced test case. Let's revert and I'll keep trying.

llvm-svn: 314689
2017-10-02 17:16:14 +00:00
Stanislav Mekhanoshin 6deb212522 Eliminate ftrunc if source is know to be rounded
Differential Revision: https://reviews.llvm.org/D38421

llvm-svn: 314688
2017-10-02 16:57:07 +00:00
Erich Keane fcdf09e04b Update IUnknown lit test to pass on Win32
llvm-svn: 314687
2017-10-02 16:49:32 +00:00
Alexey Bataev 931e19bf51 [OPENMP] Capture argument of `device` clause for target-based
directives.

The argument of the `device` clause in target-based executable
directives must be captured to support codegen for the `target`
directives with the `depend` clauses.

llvm-svn: 314686
2017-10-02 16:32:39 +00:00
Jonas Devlieghere f91dc28b7b [dwarfdump] Add -show-form
This enables printing of DWARF form types after the DWARF attribute
types.

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

llvm-svn: 314685
2017-10-02 16:02:04 +00:00
Francis Ricci b7055bb813 Revert "Add support for custom loaders to the sanitizer symbolizer"
This reverts commit r314671, which hangs on the gcc sanitizer buildbot.

llvm-svn: 314684
2017-10-02 15:55:11 +00:00
Krasimir Georgiev 6a1c9d51fa [clang-format] Fix regression about short functions after #else
Summary:
This patch fixes a regression introduced in r312904, where the formatter confuses
the `else` in `#else` with an `else` of an `if-else` statement.
For example, formatting this code with google style
```
#ifdef A
int f() {}
#else
int f() {}
#endif
```
resulted in
```
#ifdef A
int f() {}
#else
int f() {
}
#endif
```

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: klimek, cfe-commits

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

llvm-svn: 314683
2017-10-02 15:53:37 +00:00
Simon Pilgrim 65bde8806f [X86][SSE] Add PACKSS/PACKUS constant folding tests
llvm-svn: 314682
2017-10-02 15:43:26 +00:00
Simon Pilgrim ec528b2cb6 Regenerate test (missing broadcast constant comments). NFCI.
Still avoiding the floating point comments to prevent linux/windows discrepancies.

llvm-svn: 314681
2017-10-02 15:22:35 +00:00
Simon Pilgrim 050f60370c Regenerate test (missing broadcast constant comments). NFCI.
llvm-svn: 314680
2017-10-02 15:21:14 +00:00
Simon Pilgrim 037f6d10d5 Regenerate test. NFCI.
llvm-svn: 314679
2017-10-02 15:16:30 +00:00
Ilya Biryukov 0c1ca6be96 [clangd] Command line arg to specify compile_commands.json path
Summary: Adds compileCommands command line argument to specify an absolute path directly to the requested compile_commands.json for flags.

Reviewed By: ilya-biryukov

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

llvm-svn: 314678
2017-10-02 15:13:20 +00:00
Ilya Biryukov a91eaeb9ba [clangd] Run clang-format on the source code. NFC.
llvm-svn: 314677
2017-10-02 15:10:41 +00:00
Sanjay Patel 232669d6b3 use range-for-loops; NFCI
llvm-svn: 314676
2017-10-02 15:02:06 +00:00
Simon Atanasyan 649e4d328f [MIPS] Fix PLT entries generation in case of linking regular and microMIPS code
Currently LLD calls the `isMicroMips` routine to determine type of PLT entries
needs to be generated: regular or microMIPS. This routine checks ELF
header flags in the `FirstObj` to retrieve type of linked object files.
So if the first file does not contain microMIPS code, LLD will generate
PLT entries with regular (non-microMIPS) code only.

Ideally, if a PLT entry is referenced by microMIPS code only this entry
should contain microMIPS code, if a PLT entry is referenced by regular
code this entry should contain regular code. In a "mixed" case the PLT
entry can be either microMIPS or regular, but each "cross-mode-call" has
additional cost.

It's rather difficult to implement this ideal solution. But we can
assume that if there is an input object file with microMIPS code, the
most part of the code is microMIPS too. So we need to deduce type of PLT
entries based on finally calculated ELF header flags and do not check
only the first input object file.

This change implements this.
  - The `getMipsEFlags` renamed to the `calcMipsEFlags`. The function
    called from the `LinkerDriver::link`. Result is stored in
    the Configuration::MipsEFlags field.
  - The `isMicroMips` and `isMipsR6` routines access the `MipsEFlags`
    field to get and check calculated ELF flags.
  - New types of PLT records created when necessary.

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

llvm-svn: 314675
2017-10-02 14:56:41 +00:00
Coby Tayree 01e5320c48 [AsmParser] Support GAS's .print directive
Differential Revision: https://reviews.llvm.org/D38448

llvm-svn: 314674
2017-10-02 14:36:31 +00:00
Alexey Bataev 5dadb79fcd [OPENMP] Fix test, NFC.
llvm-svn: 314673
2017-10-02 14:35:31 +00:00
Ed Maste d13f691f41 Improve FreeBSD kernel debugging
FreeBSD kernel modules are actually relocatable (.o) ELF files and this
previously caused some issues for LLDB. This change addresses these when
using lldb to symbolicate FreeBSD kernel backtraces. 

The major problems:

- Relocations were not being applied to the DWARF debug info despite
  there being code to do this. Several issues prevented it from working:

  - Relocations are computed at the same time as the symbol table, but
    in the case of split debug files, symbol table parsing always
    redirects to the primary object file, meaning that relocations would
    never be applied in the debug file.

  - There's actually no guarantee that the symbol table has been parsed
    yet when trying to parse debug information.

  - When actually applying relocations, it will segfault because the
    object files are not mapped with MAP_PRIVATE and PROT_WRITE.

- LLDB returned invalid results when performing ordinary address-to-
  symbol resolution. It turned out that the addresses specified in the
  section headers were all 0, so LLDB believed all the sections had
  overlapping "file addresses" and would sometimes return a symbol from
  the wrong section.

Patch by Brian Koropoff

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

llvm-svn: 314672
2017-10-02 14:35:07 +00:00
Francis Ricci e2aa5b2ace Add support for custom loaders to the sanitizer symbolizer
Summary:
Adds a fallback mode to procmaps when the symbolizer
fails to locate a module for a given address by using
dl_iterate_phdr.

Reviewers: kubamracek, rnk, vitalybuka, eugenis

Reviewed By: eugenis

Subscribers: srhines, llvm-commits

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

llvm-svn: 314671
2017-10-02 14:30:58 +00:00
Alexey Bataev 2a007e05a0 [OPENMP] Simplify codegen for non-offloading code.
Simplified and generalized codegen for non-offloading part that works if
offloading is failed or condition of the `if` clause is `false`.

llvm-svn: 314670
2017-10-02 14:20:58 +00:00
Sanjay Patel 7998d37076 remove duplicate comments, reposition related functions; NFC
llvm-svn: 314669
2017-10-02 14:03:17 +00:00
Andrew Gozillon 25b16572e9 Dependent Address Space Support Test Fix
Modifying a non-type template integer arguement that is causing errors 
in some builds as it's too large for 32-bit longs. This hopefully (and 
seems to when testing) should fix all of the build bot errors relating 
to this test. I also modified the name of the function call to be more 
apt.

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

llvm-svn: 314668
2017-10-02 13:32:59 +00:00
Bjorn Pettersson 8e978c0151 [X86][SSE] Fix -Wsign-compare problems introduced in r314658
The refactoring in
"[X86][SSE] Add createPackShuffleMask helper function. NFCI."
resulted in warning when compiling the code (seen in build bots).

This patch restores some types from int to unsigned to avoid
those warnings.

llvm-svn: 314667
2017-10-02 12:46:38 +00:00
Bjorn Pettersson 839775a277 [Debug info] Handle endianness when moving debug info for split integer values
Summary:
Take the target's endianness into account when splitting the
debug information in DAGTypeLegalizer::SetExpandedInteger.

This patch fixes so that, for big-endian targets, the fragment
expression corresponding to the high part of a split integer
value is placed at offset 0, in order to correctly represent
the memory address order.

I have attached a PPC32 reproducer where the resulting DWARF
pieces for a 64-bit integer were incorrectly reversed.

Patch by: dstenb

Reviewers: JDevlieghere, aprantl, dblaikie

Reviewed By: JDevlieghere, aprantl, dblaikie

Subscribers: nemanjai

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

llvm-svn: 314666
2017-10-02 12:46:32 +00:00
Michael Kruse 4ee19603e9 [ScopBuilder] Iterate over statement instructions. NFC.
Iterate over statement instructions instead over basic block
instructions when creating MemoryAccesses. It allows making the creation
of MemoryAccesses independent of how the basic blocks are split into
multiple ScopStmts.

llvm-svn: 314665
2017-10-02 11:41:33 +00:00
Michael Kruse f5745b4e7d [ScopBuilder] Build invariant loads separately.
Create the MemoryAccesses of invariant loads separately and before
all other MemoryAccesses.

Invariant loads are classified as synthesizable and therefore are not
contained in any statement. When iterating over all instructions of all
statements, the invariant loads are consequently not processed and
iterating over them separately becomes necessary.

This patch can change the order in which MemoryAccesses are created, but
otherwise has no functional change.

Some temporary code is introduced to ensure correctness, but will be
removed in the next commit.

llvm-svn: 314664
2017-10-02 11:41:27 +00:00
Michael Kruse 89a6f3db02 [ScopBuilder] Build escaping dependencies separately.
Instructions that compute escaping values might be synthesizable and
therefore not contained in any ScopStmt. When buildAccessFunctions is
changed to only iterate over the instruction list of statement,
"free" instructions still need to be written. We do this after the
main MemoryAccesses have been created.

This can change the order in which MemoryAccesses are created, but has
otherwise no functional change.

llvm-svn: 314663
2017-10-02 11:41:19 +00:00
Michael Kruse 0bedec0e65 [ScopBuilder] Specialize exit block handling. NFC.
Decouple handling of exit block PHIs and other MemoryAccesses. Exit PHIs
only need the PHI handling part of buildAccessFunctions but requires
code for skipping them in while creating other MemoryAcesses.

This change will make it easier to modify how statement MemoryAccesses
are created without considering the exit block special case.

llvm-svn: 314662
2017-10-02 11:41:12 +00:00
Michael Kruse e276e9f324 [ForwardOpTree] Fix out-of-quota in assertion.
llvm-svn: 314661
2017-10-02 11:41:06 +00:00
Ivan A. Kosarev 5c8e7596e6 [CodeGen] Have a special function to get TBAA info for may-alias accesses
This is part of D37826 reworked to be a separate patch to
simplify review.

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

llvm-svn: 314660
2017-10-02 11:10:04 +00:00
Filipe Cabecinhas 3ccd23e116 Use %run for running CFI tests
Reviewers: pcc, krasin, eugenis

Subscribers: llvm-commits

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

llvm-svn: 314659
2017-10-02 10:21:26 +00:00
Simon Pilgrim e2e27aff9b [X86][SSE] Add createPackShuffleMask helper function. NFCI.
llvm-svn: 314658
2017-10-02 10:12:51 +00:00
Ivan A. Kosarev 289574edc0 [CodeGen] Do not refer to complete TBAA info where we actually deal with just TBAA access types
This patch fixes misleading names of entities related to getting,
setting and generation of TBAA access type descriptors.

This is effectively an attempt to provide a review for D37826 by
breaking it into smaller pieces.

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

llvm-svn: 314657
2017-10-02 09:54:47 +00:00
Simon Pilgrim c04c7443ea [X86][SSE] matchBinaryVectorShuffle - add support for different src/dst value shuffle types
Preparation for support for combining to PACKSS/PACKUS

llvm-svn: 314656
2017-10-02 09:45:08 +00:00
Hiroshi Inoue dcedd66b00 [PowerPC] support ZERO_EXTEND in tryBitPermutation
This patch add a support of ISD::ZERO_EXTEND in PPCDAGToDAGISel::tryBitPermutation to increase the opportunity to use rotate-and-mask by reordering ZEXT and ANDI.
Since tryBitPermutation stops analyzing nodes if it hits a ZEXT node while traversing SDNodes, we want to avoid ZEXT between two nodes that can be folded into a rotate-and-mask instruction.

For example, we allow these nodes

      t9: i32 = add t7, Constant:i32<1>
    t11: i32 = and t9, Constant:i32<255>
  t12: i64 = zero_extend t11
t14: i64 = shl t12, Constant:i64<2>

to be folded into a rotate-and-mask instruction.
Such case often happens in array accesses with logical AND operation in the index, e.g. array[i & 0xFF];

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

llvm-svn: 314655
2017-10-02 09:24:00 +00:00
George Rimar ba45584c4b [ELF] - Stop removing sections in removeUnusedSyntheticSections().
That makes code a bit more consistent. Instead of removing sections there
we can just mark them as dead. So that removeEmptyCommands() will
handle the rest.

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

llvm-svn: 314654
2017-10-02 09:11:13 +00:00
Simon Pilgrim 3bbbf31590 Fix typo in comment. NFCI.
llvm-svn: 314653
2017-10-02 09:10:50 +00:00
Simon Pilgrim e575651370 [X86] Cleanup uses of computeKnownBits by using MaskedValueIsZero helper instead. NFCI.
llvm-svn: 314652
2017-10-02 09:08:45 +00:00
Michael Zuckerman e4084f6bdb [X86][LLVM]Expanding Supports lowerInterleaved{store|load}() in X86InterleavedAccess (VF64 stride 3-4)
I continue to support different VF interleaved and in this pass for this patch,
I added the vf64 stride3 support for both load and store.
I also added support fot the stride4 store.

Reviewers:
1. zvi
2. dorit
3. igorb
4. guyblank

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

Change-Id: I3d238efedf217d1768b348d710de1efa2f19d27b
llvm-svn: 314651
2017-10-02 07:35:25 +00:00
Andrew Gozillon 0cd141ba9d Dependent Address Space Support Test File
Adding regression test for Dependent Address Spaces in relation to
https://reviews.llvm.org/D33666 I forgot to svn add the test file 
before commiting the prior changes. I appologies. 

llvm-svn: 314650
2017-10-02 06:31:25 +00:00
Andrew Gozillon 572bbb0754 Dependent Address Space Support
This patch relates to: https://reviews.llvm.org/D33666 This adds support
for template parameters to be passed to the address_space attribute. 
The main goal is to add further flexibility to the attribute and allow 
for it to be used easily with templates.

The main additions are a new type (DependentAddressSpaceType) alongside 
its TypeLoc and its mangling. As well as the logic required to support 
dependent address spaces which mainly resides in TreeTransform.h and 
SemaType.cpp.

llvm-svn: 314649
2017-10-02 06:25:51 +00:00
Craig Topper d37625859a [X86] Fix copy pasto in X86FastISel::fastEmitInst_rrrr.
The 4th operand was not being constrained and the third operand was being constrained twice.

llvm-svn: 314648
2017-10-02 05:46:53 +00:00
Craig Topper bb7866162c [X86] Use a bool flag instead of assigning an unsigned to two different values that we only use in an equality comparison.
llvm-svn: 314647
2017-10-02 05:46:52 +00:00
Michal Gorny 806b8d56a2 [cmake] Add a separate CMake var to control profile runtime
Make it possible to control building profile runtime separately from
other options. Before r313549, the profile runtime building was
controlled along with sanitizers. However, since that commit it is built
unconditionally which results in multiple builds for people building
different runtimes separately.

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

llvm-svn: 314646
2017-10-02 05:03:55 +00:00
Rui Ueyama daf5adc6c1 Update for LLVM change.
r314639 ([X86] Change register&memory TEST instructions from MRMSrcMem
to MRMDstMem) broke the test.

llvm-svn: 314645
2017-10-02 02:09:58 +00:00