Commit Graph

306828 Commits

Author SHA1 Message Date
Volodymyr Sapsai
fb0e1908d4 [libcxx] Optimize vectors construction of trivial types from an iterator range with const-ness mismatch.
We already have a specialization that will use memcpy for construction
of trivial types from an iterator range like

    std::vector<int>(int *, int *);

But if we have const-ness mismatch like

    std::vector<int>(const int *, const int *);

we would use a slow path that copies each element individually. This change
enables the optimal specialization for const-ness mismatch. Fixes PR37574.

Contributions to the patch are made by Arthur O'Dwyer, Louis Dionne.

rdar://problem/40485845

Reviewers: mclow.lists, EricWF, ldionne, scanon

Reviewed By: ldionne

Subscribers: christof, ldionne, howard.hinnant, cfe-commits

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

llvm-svn: 350583
2019-01-08 00:03:16 +00:00
Jonas Devlieghere
91b43adb69 [dsymutil] Upstream unobfuscation logic.
The unobufscation support for BCSymbolMaps was the last piece of code
that hasn't been upstreamed yet. This patch contains a reworked version
of the existing code and relevant tests.

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

llvm-svn: 350580
2019-01-07 23:27:25 +00:00
Rong Xu
6f366c3a04 [PGO] Use SourceFileName rather module name in PGOFuncName
In LTO or Thin-lto mode (though linker plugin), the module
names are of temp file names which are different for
different compilations. Using SourceFileName avoids the issue.
This should not change any functionality for current PGO as
all the current callers of getPGOFuncName() is before LTO.

llvm-svn: 350579
2019-01-07 23:25:56 +00:00
Davide Italiano
bf1fdb852f [Verifier] Reject invalid type for DILocalVariable.
Reviewers: aprantl

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 350578
2019-01-07 23:09:09 +00:00
Adrian Prantl
c5e0c58875 Simplify code.
llvm-svn: 350577
2019-01-07 23:08:16 +00:00
Adrian Prantl
511d7d1fc1 Clarify comment and variable names. (NFC)
llvm-svn: 350576
2019-01-07 23:02:28 +00:00
Adrian Prantl
95280c948d Rename DWARFDIE::GetDWOContext() -> GetDeclContext() (NFC)
Despite the name, this function has nothing to do with the DWO format.

llvm-svn: 350575
2019-01-07 22:47:17 +00:00
Stephen Kelly
54272e5b66 NFC: Replace asserts with if() in SourceLocation accessors
Summary:
Nowhere else in the AST classes assert on these kinds of accessors.

This way, we can call the accessors and check the validity of the result
instead of externally duplicating the conditions.  This generality will
make it possible to introspect instances for source locations:

 http://ec2-18-191-7-3.us-east-2.compute.amazonaws.com:10240/z/iiaWhw

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 350573
2019-01-07 21:57:30 +00:00
Erik Pilkington
b460f1624c Add a __has_feature check for namespaces on #pragma clang attribute.
Support for this was added in r349845.

llvm-svn: 350572
2019-01-07 21:54:00 +00:00
Alexey Bataev
7bb3353f6a [OPENMP]Add call to __kmpc_push_target_tripcount() function.
Each we create the target regions with the teams distribute inner
region, we can better estimate number of the teams required to execute
the target region. Function __kmpc_push_target_tripcount() is used for
purpose, which accepts device_id and the number of the iterations,
performed by the associated loop.

llvm-svn: 350571
2019-01-07 21:30:43 +00:00
Jorge Gorbe Moya
347b0804bc [lldb] Fix -Wstring-plus-int warning in POSIX-DYLD/AuxVector.cpp
llvm-svn: 350570
2019-01-07 21:04:12 +00:00
Michael Ferguson
e39b614d1d [ValueTracking] Adjust comment in test
Adjusts a comment in this test to verify commit access.

llvm-svn: 350569
2019-01-07 21:02:22 +00:00
Craig Topper
cd9e232a4d Recommit r350555 "[X86] Use funnel shift intrinsics for the VBMI2 vshld/vshrd builtins."
The MSVC limit hit in AutoUpgrade.cpp has been worked around for now.

llvm-svn: 350568
2019-01-07 21:00:41 +00:00
Craig Topper
486313b5f7 Recommit r350554 "[X86] Remove AVX512VBMI2 concat and shift intrinsics. Replace with target independent funnel shift intrinsics."
The MSVC limit we hit on AutoUpgrade.cpp has been worked around for now.

llvm-svn: 350567
2019-01-07 21:00:32 +00:00
Martin Storsjo
93a7137c0a [ObjectYAML] [COFF] Support multiple symbols with the same name
Differential Revision: https://reviews.llvm.org/D56294

llvm-svn: 350566
2019-01-07 20:55:33 +00:00
Jan Vesely
e25db17104 cmake: Install libraries to DATADIR from GNUInstallDirs
This moves default installation location to /usr/share to match libclc.pc.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewer: Tom Stellard

llvm-svn: 350565
2019-01-07 20:20:37 +00:00
Craig Topper
81fe1fbf4a [X86][AutoUpgrade] Make some tweaks to reduce the number of nested if/else in the intrinsic upgrade code to avoid an MSVC compiler limit.
MSVC has a nesting limit of around 110-130. An if/else if/else if counts against this next level. The autoupgrade code consists a long chain of these checking matches against strings.

This commit moves some code to a helper function to move out a large if/else chain that was inside of one of the blocks into a separate function. There are more of these we could move or we could change some to lookup tables.

I've also merged together a few similar blocks in the outer chain. This should buy us some margin for a little bit.

llvm-svn: 350564
2019-01-07 20:13:45 +00:00
Craig Topper
33c9088783 Revert r350555 "[X86] Use funnel shift intrinsics for the VBMI2 vshld/vshrd builtins."
Had to revert the LLVM patch this depends on to fix a MSVC compiler limit in AutoUpgrade.cpp

llvm-svn: 350563
2019-01-07 19:39:25 +00:00
Craig Topper
fad1589f39 Revert r350554 "[X86] Remove AVX512VBMI2 concat and shift intrinsics. Replace with target independent funnel shift intrinsics."
The AutoUpgrade.cpp if/else cascade hit an MSVC limit again.

llvm-svn: 350562
2019-01-07 19:39:05 +00:00
Alina Sbirlea
12bbb4fe8d [MemorySSA] Add SkipSelfWalker.
Summary: Add implementation of SkipSelfWalker.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

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

llvm-svn: 350561
2019-01-07 19:38:47 +00:00
Craig Topper
826f44b550 [TargetLowering][AMDGPU] Remove the SimplifyDemandedBits function that takes a User and OpIdx. Stop using it in AMDGPU target for simplifyI24.
As we saw in D56057 when we tried to use this function on X86, it's unsafe. It allows the operand node to have multiple users, but doesn't prevent recursing past the first node when it does have multiple users. This can cause other simplifications earlier in the graph without regard to what bits are needed by the other users of the first node. Ideally all we should do to the first node if it has multiple uses is bypass it when its not needed by the user we started from. Doing any other transformation that SimplifyDemandedBits can do like turning ZEXT/SEXT into AEXT would result in an increase in instructions.

Fortunately, we already have a function that can do just that, GetDemandedBits. It will only make transformations that involve bypassing a node.

This patch changes AMDGPU's simplifyI24, to use a combination of GetDemandedBits to handle the multiple use simplifications. And then uses the regular SimplifyDemandedBits on each operand to handle simplifications allowed when the operand only has a single use. Unfortunately, GetDemandedBits simplifies constants more aggressively than SimplifyDemandedBits. This caused the -7 constant in the changed test to be simplified to remove the upper bits. I had to modify computeKnownBits to account for this by ignoring the upper 8 bits of the input.

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

llvm-svn: 350560
2019-01-07 19:30:43 +00:00
Adrian Prantl
91cb4cccae Split two sub-tests into separate top-level methods.
llvm-svn: 350559
2019-01-07 19:24:04 +00:00
Alina Sbirlea
bc8aa24c2f [MemorySSA] Refactor CachingWalker.
Summary:
Refactor caching walker to make creating a walker that skips the
starting access strightforward.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits, jfb

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

llvm-svn: 350558
2019-01-07 19:22:37 +00:00
Adrian Prantl
9e9e7b38e0 Refactor test, no changes expected.
llvm-svn: 350557
2019-01-07 19:19:34 +00:00
Julian Lettner
a6d29024ed [TSan] Support Objective-C @synchronized with tagged pointers
Summary:
Objective-C employs tagged pointers, that is, small objects/values may be encoded directly in the pointer bits. The resulting pointer is not backed by an allocation/does not point to a valid memory. TSan infrastructure requires a valid address for `Acquire/Release` and `Mutex{Lock/Unlock}`.
This patch establishes such a mapping via a "dummy allocation" for each encountered tagged pointer value.


Reviewers: dcoughlin, kubamracek, dvyukov, delcypher

Reviewed By: dvyukov

Subscribers: llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 350556
2019-01-07 19:19:23 +00:00
Craig Topper
e34f2bb807 [X86] Use funnel shift intrinsics for the VBMI2 vshld/vshrd builtins.
Differential Revision: https://reviews.llvm.org/D56365

llvm-svn: 350555
2019-01-07 19:10:22 +00:00
Craig Topper
9c4f7e9147 [X86] Remove AVX512VBMI2 concat and shift intrinsics. Replace with target independent funnel shift intrinsics.
Differential Revision: https://reviews.llvm.org/D56377

llvm-svn: 350554
2019-01-07 19:10:12 +00:00
Diogo N. Sampaio
f192cdb5c9 [ARM] ComputeKnownBits to handle extract vectors
This patch adds the sign/zero extension done by
vgetlane to ARM computeKnownBitsForTargetNode.

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

llvm-svn: 350553
2019-01-07 19:01:47 +00:00
Alina Sbirlea
f723020456 [MemorySSA] Extend the clobber walker with the option to skip the starting access.
Summary:
The option enables loop transformations to hoist accesses that do not
have clobbers in the loop. If the clobber queries skips the starting
access, the result may be outside the loop instead of the header Phi.

Adding the walker that uses this option in a separate patch.

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

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

llvm-svn: 350551
2019-01-07 18:40:27 +00:00
Eric Fiselier
389da901d0 Mark more tests as flaky
llvm-svn: 350550
2019-01-07 18:21:18 +00:00
Nikita Popov
8dd19ed3ec Revert "[DemandedBits] Use SetVector for Worklist"
This reverts commit r350547.

Seeing assertion failures on clang tests.

llvm-svn: 350549
2019-01-07 18:15:11 +00:00
Simon Pilgrim
32f77f2b52 [X86] Add OR(AND(X,C),AND(Y,~C)) bit select tests
Based off work for D55935

llvm-svn: 350548
2019-01-07 18:07:56 +00:00
Nikita Popov
353d92decb [DemandedBits] Use SetVector for Worklist
DemandedBits currently uses a simple vector for the worklist, which
means that instructions may be inserted multiple times into it.
Especially in combination with the deep lattice, this may cause
instructions too be recomputed very often. To avoid this, switch
to a SetVector.

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

llvm-svn: 350547
2019-01-07 18:03:36 +00:00
Leonard Mosescu
0d05790030 Use the minidump exception record if present
If the minidump contains a saved exception record use it automatically.

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

llvm-svn: 350546
2019-01-07 17:55:42 +00:00
Armando Montanez
488545ef15 [elfabi] Add option to manually specify file read format
Although llvm-elfabi will attempt to read input files without needing the format to be manually specified, doing so has the potential to introduce extraneous errors that can hinder debugging (since multiple readers may fail in attempts to read the file). This change allows the input file format to be manually specified to force elfabi to use a single reader. This makes it easier to test and debug errors specific to a given reader.

llvm-svn: 350545
2019-01-07 17:33:10 +00:00
Louis Dionne
1f66672515 [pstl] Avoid shadowing explicit lambda capture with lambda parameter
Summary:
Recent Clangs give an error for this. Note that the size of this diff is
caused by running clang-format on the result of removing the captures.
I guess we'll see how well that works for us.

Reviewers: jfb, rodgert

Subscribers: jkorous, dexonsmith, libcxx-commits, mclow.lists

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

llvm-svn: 350544
2019-01-07 17:31:17 +00:00
Adrian Prantl
9d5480b55f Fine-tune and document the barrier in TestQueues.
llvm-svn: 350543
2019-01-07 17:18:39 +00:00
Ilya Biryukov
47f174a2be [clangd] Fix Windows build after r350531
llvm-svn: 350542
2019-01-07 17:03:15 +00:00
Jordan Rupprecht
70038e01c8 [llvm-objcopy] Handle -O <format> flag.
Summary:
The -O flag is currently being mostly ignored; it's only checked whether or not the output format is "binary". This adds support for a few formats (e.g. elf64-x86-64), so that when specified, the output can change between 32/64 bit and sizes/alignments are updated accordingly.

This fixes PR39135

Reviewers: jakehehrlich, jhenderson, alexshap, espindola

Reviewed By: jhenderson

Subscribers: emaste, arichardson, llvm-commits

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

llvm-svn: 350541
2019-01-07 16:59:12 +00:00
Ilya Biryukov
9d96c3c7f2 [clangd] Include <cstdio> instead of <stdio.h>. NFC
This fixes the only clang-tidy check currently enabled by clangd.

llvm-svn: 350540
2019-01-07 16:55:59 +00:00
Louis Dionne
9bb9690ebf [NFC] Fix formatting of README.md for better rendering
Reviewed as https://reviews.llvm.org/D56051.

llvm-svn: 350539
2019-01-07 16:54:02 +00:00
Stefan Granitz
1f024fe6a5 [CMake] Fix standalone builds: make dependency to LLVM's count conditional
Summary:
In standalone builds of LLDB we currently have no target `count` that tests can depend on. This may be fixed in the future by exporting the target from LLVM similar to targets llvm-config, dsymutil and others.

In-tree build with this patch:
```
    $ ninja -t query tools/lldb/lit/check-lldb-lit
    tools/lldb/lit/check-lldb-lit:
    input: phony
        tools/lldb/lit/CMakeFiles/check-lldb-lit
        bin/FileCheck
        bin/clang
        bin/count
        bin/darwin-debug
        bin/debugserver
        bin/dsymutil
        bin/llc
        bin/lldb
        bin/lldb-mi
        bin/lldb-server
        bin/lldb-test
        bin/llvm-config
        bin/llvm-mc
        bin/llvm-objcopy
        bin/not
        bin/yaml2obj
        lib/liblldb.dylib
        projects/libcxx/lib/cxx
        tools/lldb/unittests/LLDBUnitTests
    outputs:
        tools/lldb/test/check-lldb
        check-lldb-lit
```

Standalone build with this patch:
```
    $ ninja -t query lit/check-lldb-lit
    lit/check-lldb-lit:
    input: phony
        lit/CMakeFiles/check-lldb-lit
        bin/darwin-debug
        bin/debugserver
        bin/lldb
        bin/lldb-mi
        bin/lldb-server
        bin/lldb-test
        lib/liblldb.dylib
        unittests/LLDBUnitTests
    outputs:
        test/check-lldb
        check-lldb-lit
```

Reviewers: davide, aprantl, JDevlieghere, alexshap

Reviewed By: davide

Subscribers: mgorny, lldb-commits, #lldb

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

llvm-svn: 350538
2019-01-07 16:43:04 +00:00
Adrian Prantl
ae9f93b4aa Simplify testcase by using lldbutil.run_to_source_breakpoint()
llvm-svn: 350537
2019-01-07 16:27:52 +00:00
David Greene
6f1394ff86 [lit] Respect PYTHONPATH
If a user has PYTHONPATH set in the environment, append new entries to
it rather than blindly setting PYTHONPATH to a fixed string. This
allows tests to, for example, find psutil if it is in
PYTHONPATH. Without this change, lit will detect psutil but then
various tests will fail because PYTHONPATH has been overwritten and
psutil cannot be found.

llvm-svn: 350536
2019-01-07 16:24:37 +00:00
Marshall Clow
4d4213f694 Add the feature test macros that were defined in p1353r0 to the headers of the appropriate tests. No actual tests yet, so NFC.
llvm-svn: 350535
2019-01-07 16:17:52 +00:00
Matt Morehouse
4d7e47a545 [llvm-demangle-fuzzer] Also fuzz microsoftDemangle().
Summary:
Use first byte of input to determine whether to call itaniumDemangle()
or microsoftDemangle().

Addresses https://bugs.llvm.org/show_bug.cgi?id=39582.

Reviewers: kcc, thakis

Reviewed By: kcc, thakis

Subscribers: mgorny, thakis, erik.pilkington, llvm-commits

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

llvm-svn: 350534
2019-01-07 16:14:00 +00:00
Sanjay Patel
47f92d3270 [x86] add more tests for LowerToHorizontalOp(); NFC
These tests show missed optimizations and a miscompile
similar to PR40243 - https://bugs.llvm.org/show_bug.cgi?id=40243

llvm-svn: 350533
2019-01-07 16:10:14 +00:00
Rhys Perry
f77e2e8406 AMDGPU: test for uniformity of branch instruction, not its condition
Summary:
If a divergent branch instruction is marked as divergent by propagation
rule 2 in DivergencePropagator::exploreSyncDependency() and its condition
is uniform, that branch would incorrectly be assumed to be uniform.

Reviewers: arsenm, tstellar

Reviewed By: arsenm

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

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

llvm-svn: 350532
2019-01-07 15:52:28 +00:00
Ilya Biryukov
f2001aa743 [clangd] Remove 'using namespace llvm' from .cpp files. NFC
The new guideline is to qualify with 'llvm::' explicitly both in
'.h' and '.cpp' files. This simplifies moving the code between
header and source files and is easier to keep consistent.

llvm-svn: 350531
2019-01-07 15:45:19 +00:00
Alexey Bataev
25d3de8a0a [OPENMP][NVPTX]Reduce number of barriers in reductions.
After the fix for the syncthreads we don't need to generate extra
barriers for the parallel reductions.

llvm-svn: 350530
2019-01-07 15:45:09 +00:00