167131 Commits

Author SHA1 Message Date
Nekotekina
be9f7bfe20 MCJIT: don't finalize modules on symbol lookup (workaround)
This is extremely slow yet unnecessary with manual finalization.
In LLVM 6 this wasn't a problem.
2018-07-21 12:11:58 +03:00
Nekotekina
e93052441f X86: improve SUBUS pattern (select-based)
Add AVX512BW variant
Add 32-bit variant replaced with sub + umin
2018-07-21 12:11:58 +03:00
Nekotekina
1f2844cb22 X86: detect pattern for variable SHL/SRL shifts (AVX2+)
Remove VSELECT instruction which zeroes their result on exceeding shift amount
2018-07-21 12:11:58 +03:00
Nekotekina
61c9cde6f5 X86: add pattern for X86ISD::ADDUS
combineSelect: detect unsigned overflow check
2018-07-21 12:11:58 +03:00
Nekotekina
e81012adaf X86: add pattern for X86ISD::VSRAV
Detect clamping ashr shift amount to max legal value
2018-07-21 12:11:58 +03:00
Nekotekina
64b2970f1f X86: expand detectAVGPattern()
Allow all integer widths in the pattern, allow ashr
Handle signed and mixed cases, allowing to replace truncation
2018-07-21 12:11:57 +03:00
Nekotekina
34361c3068 X86: optimize VSELECT for v16i8 with shl + sign bit test 2018-07-21 12:11:57 +03:00
Nekotekina
8330420b3a X86: change v64i8 sar by 7
Use ADDUS (add with unsigned saturation)
addus(0, 0) = 0
addus(0x80, 0x80) = 0xff
2018-07-21 12:11:57 +03:00
Nekotekina
633c9ace49 X86: combine inversion of VPTERNLOG 2018-07-21 12:11:57 +03:00
Nekotekina
683229e9e7 X86: LowerShift: new algorithm for vector-vector shifts
Emit pair of shifts of double size if possible
2018-07-21 12:11:57 +03:00
Nekotekina
879833a553 X86: Fix/workaround Small Code Model for JIT
Force RIP-relative jump tables and global values
Force RIP-relative all zeros / all ones constants
These things were causing crashes due to use of absolute addressing
2018-07-21 12:11:57 +03:00
Nekotekina
07e0f4a7a6 Remove trailing space 2018-07-21 12:11:57 +03:00
Nekotekina
f6e89adcad Appveyor + Travis 2018-07-21 12:11:57 +03:00
Aaron Smith
1d13545e10 [DebugInfo] Add a new DI flag to record if a C++ record is a trivial type
Summary:
This flag is used when emitting debug info and is needed to initialize subprogram and member function attributes (function options) for Codeview. These function options are used to create an accurate compiler type for UDT symbols (class/struct/union) from PDBs.

It is not easy to determine if a C++ record is trivial or not based on the current DICompositeType flags and other accessible debug information from Codeview. For example, without this flag the metadata for a non-trivial C++ record with user-defined ctor and a trivial one with a defaulted ctor are the same.

    struct S { S(); }
    struct S { S() = default; }

This change introduces a new DI flag and corresponding clang::CXXRecordDecl::isTrivial method to set the flag in the frontend.

Reviewers: rnk, zturner, llvm-commits, dblaikie, aleksandr.urakov, deadalnix

Reviewed By: rnk

Subscribers: asmith, probinson, aprantl, JDevlieghere

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337641 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-21 05:42:13 +00:00
Lang Hames
9d8e9ef491 [ORC] Re-apply r336760 with fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337637 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-21 00:12:05 +00:00
Lang Hames
845fa153ca Re-apply r337595 with fix for LLVM_ENABLE_THREADS=Off.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337626 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 22:22:19 +00:00
Benjamin Kramer
c53ade08d7 [ADT] Only run death tests in !NDEBUG
These invoke undefined behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337625 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 22:15:09 +00:00
Krzysztof Parzyszek
15f33310a8 [Hexagon] Disable packets in test to avoid ordering issues in checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337624 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 21:55:55 +00:00
Peter Collingbourne
43c7ac5894 Change the cap on the amount of padding for each vtable to 32-byte (previously it was 128-byte)
We tested different cap values with a recent commit of Chromium. Our results show that the 32-byte cap yields the smallest binary and all the caps yield similar performance.
Based on the results, we propose to change the cap value to 32-byte.

Patch by Zhaomo Yang!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337622 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 21:43:20 +00:00
Matt Arsenault
8f2b72e7d1 AMDGPU: Use existing function to check for VGPRs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337621 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 21:20:36 +00:00
Benjamin Kramer
a69ec545d2 Revert "[X86][AVX] Convert X86ISD::VBROADCAST demanded elts combine to use SimplifyDemandedVectorElts"
This reverts commit r337547. It triggers an infinite loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337617 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 20:59:46 +00:00
Martin Storsjo
9f7b7482cb [llvm-undname] Remove a superfluous semicolon. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337615 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 20:48:36 +00:00
Martin Storsjo
337fc79e64 [COFF] Use symbolic constants instead of hardcoded numbers. NFCI.
Patch by Martell Malone.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337614 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 20:48:33 +00:00
Martin Storsjo
3631b66408 [COFF] Adjust how we flag weak externals
This fixes PR36096.

Originally based on a patch by Martell Malone.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337613 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 20:48:29 +00:00
George Karpenkov
4571da68d1 [FileCheck] Provide an option for FileCheck to dump original input to stderr on failure
The option can be either set using environment variable (e.g. env
FILECHECK_DUMP_INPUT_ON_FAILURE=1 ninja check-fuzzer) or with a
FileCheck flag.

This can be extremely useful for debugging, cf.
https://groups.google.com/forum/#!topic/llvm-dev/kLrzg8OM_h8 for
discussion.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337609 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 20:21:57 +00:00
Reid Kleckner
1f565f54cd Revert r337595 "[ORC] Add new symbol lookup methods to ExecutionSessionBase in preparation for"
Breaks the build with LLVM_ENABLE_THREADS=OFF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337608 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 20:20:45 +00:00
Roman Tereshin
6bb56ed117 Reapply "[LSV] Refactoring + supporting bitcasts to a type of different size"
This reapplies commit r337489 reverted by r337541
Additionally, this commit contains a speculative fix to the issue reported in r337541
(the report does not contain an actionable reproducer, just a stack trace)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337606 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 20:10:04 +00:00
Joel E. Denny
a46c1d6b58 [FileCheck] Fix search ranges for DAG-NOT-DAG
A DAG-NOT-DAG is a CHECK-DAG group, X, followed by a CHECK-NOT group,
N, followed by a CHECK-DAG group, Y.  Let y be the initial directive
of Y.  This patch makes the following changes to the behavior:

    1. Directives in N can no longer match within part of Y's match
       range just because y happens not to be the earliest match from
       Y.  Specifically, this patch withdraws N's search range end
       from y's match range start to Y's match range start.

    2. y can no longer match within X's match range, where a y match
       produced a reordering complaint, which is thus no longer
       possible.  Specifically, this patch withdraws y's search range
       start from X's permitted range start to X's match range end,
       which was already the search range start for other members of
       Y.

Both of these changes can only increase the number of test passes: #1
constrains the ability of CHECK-NOTs to match, and #2 expands the
ability of CHECK-DAGs to match without complaints.

These changes are based on discussions at:

   <http://lists.llvm.org/pipermail/llvm-dev/2018-May/123550.html>
   <https://reviews.llvm.org/D47106>

which conclude that:

    1. These changes simplify the FileCheck conceptual model.  First,
       it makes search ranges for DAG-NOT-DAG more consistent with
       other cases.  Second, it was confusing that y was treated
       differently from the rest of Y.

    2. These changes add theoretical use cases for DAG-NOT-DAG that
       had no obvious means to be expressed otherwise.  We can justify
       the first half of this assertion with the observation that
       these changes can only increase the number of test passes.

    3. Reordering detection for DAG-NOT-DAG had no obvious real
       benefit.

We don't have evidence from real uses cases to help us debate
conclusions #2 and #3, but #1 at least seems intuitive.

Reviewed By: probinson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337605 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 20:09:56 +00:00
Jordan Rupprecht
ff83113c2f [llvm-objcopy] Add basic support for --rename-section
Summary:
Add basic support for --rename-section=old=new to llvm-objcopy.

A full replacement for GNU objcopy requires also modifying flags (i.e. --rename-section=old=new,flag1,flag2); I'd like to keep that in a separate change to keep this simple.

Reviewers: jakehehrlich, alexshap

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337604 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 19:54:24 +00:00
Reid Kleckner
502e1bf614 And add a lit substitution for llvm-undname, as the comment says to
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337600 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 18:45:01 +00:00
Martin Storsjo
bc0cffa673 Remove a superfluous semicolon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337599 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 18:43:42 +00:00
Reid Kleckner
5f6eec8ceb Make check-llvm depend on llvm-undname
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337597 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 18:42:19 +00:00
Zachary Turner
3dd57df1d1 [Demangler] Correctly factor in assignment when allocating.
Incidentally all allocations that we currently perform were
properly aligned, but this was only an accident.

Thanks to Erik Pilkington for catching this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337596 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 18:35:06 +00:00
Lang Hames
7891d706da [ORC] Add new symbol lookup methods to ExecutionSessionBase in preparation for
deprecating SymbolResolver and AsynchronousSymbolQuery.

Both lookup overloads take a VSO search order to perform the lookup. The first
overload is non-blocking and takes OnResolved and OnReady callbacks. The second
is blocking, takes a boolean flag to indicate whether to wait until all symbols
are ready, and returns a SymbolMap. Both overloads take a RegisterDependencies
function to register symbol dependencies (if any) on the query.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337595 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 18:31:53 +00:00
Lang Hames
ec3e95710f [ORC] Simplify VSO::lookupFlags to return the flags map.
This discards the unresolved symbols set and returns the flags map directly
(rather than mutating it via the first argument).

The unresolved symbols result made it easy to chain lookupFlags calls, but such
chaining should be rare to non-existant (especially now that symbol resolvers
are being deprecated) so the simpler method signature is preferable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337594 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 18:31:52 +00:00
Lang Hames
cea401e58a [ORC] Replace SymbolResolvers in the new ORC layers with search orders on VSOs.
A search order is a list of VSOs to be searched linearly to find symbols. Each
VSO now has a search order that will be used when fixing up definitions in that
VSO. Each VSO's search order defaults to just that VSO itself.

This is a first step towards removing symbol resolvers from ORC altogether. In
practice symbol resolvers tended to be used to implement a search order anyway,
sometimes with additional programatic generation of symbols. Now that VSOs
support programmatic generation of definitions via fallback generators, search
orders provide a cleaner way to achieve the desired effect (while removing a lot
of boilerplate).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337593 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 18:31:50 +00:00
Benjamin Kramer
70215f556f [Demangler] Add missing overrides
-Winconsistent-missing-override complains about this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337592 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 18:22:12 +00:00
Zachary Turner
aeb65f137a Fix a few warnings and style issues in MS demangler.
Also remove a broken test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337591 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 18:07:33 +00:00
Craig Topper
34f6b250b3 [X86] Remove isel patterns for MOVSS/MOVSD ISD opcodes with integer types.
Ideally our ISD node types going into the isel table would have types consistent with their instruction domain. This prevents us having to duplicate patterns with different types for the same instruction.

Unfortunately, it seems our shuffle combining is currently relying on this a little remove some bitcasts. This seems to enable some switching between shufps and shufd. Hopefully there's some way we can address this in the combining.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337590 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 17:57:53 +00:00
Craig Topper
a7a130cbf7 [X86] Remove what appear to be unnecessary uses of DCI.CombineTo
CombineTo is most useful when you need to replace multiple results, avoid the worklist management, or you need to something else after the combine, etc. Otherwise you should be able to just return the new node and let DAGCombiner go through its usual worklist code.

All of the places changed in this patch look to be standard cases where we should be able to use the more stand behavior of just returning the new node.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337589 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 17:57:42 +00:00
Zachary Turner
32922e691b Fix linker failure with Any.
This is due to a difference in MS ABI which is why I didn't see
it locally.  The included fix should work on all compilers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337588 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 17:50:53 +00:00
Simon Pilgrim
7d1ac03f35 [llvm-mca][x86] Add movsx/movzx instructions to general x86_64 resource tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337586 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 17:43:42 +00:00
Zachary Turner
42e40ea33e Add a Microsoft Demangler.
This adds initial support for a demangling library (LLVMDemangle)
and tool (llvm-undname) for demangling Microsoft names.  This
doesn't cover 100% of cases and there are some known limitations
which I intend to address in followup patches, at least until such
time that we have (near) 100% test coverage matching up with all
of the test cases in clang/test/CodeGenCXX/mangle-ms-*.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337584 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 17:27:48 +00:00
Philip Pfaffe
3dac3fac6c [Any] Fix a typo: didn't use the correct argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337583 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 17:24:11 +00:00
Alina Sbirlea
c2a416a076 [MemorySSA] Add API to update MemoryPhis, following CFG changes.
Summary:
When splitting predecessors in BasicBlockUtils, we create a new block as an immediate predecessor of the original BB, then we connect a given set of predecessors to the new block.
The API in this patch will be used to update MemoryPhis for this CFG change.
If all predecessors are being moved, we move the MemoryPhi directly. Otherwise we create a new MemoryPhi in the NewBB and populate its incoming values, while deleting them from BB's Phi.
[Split from D45299 for easier review]

Reviewers: george.burgess.iv

Subscribers: sanjoy, jlebar, Prazek, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337581 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 17:13:05 +00:00
Simon Pilgrim
354367414b [X86][XOP] Fix SUB constant folding for VPSHA/VPSHL shift lowering
We can safely use getConstant here as we're still lowering, which allows constant folding to kick in and simplify the vector shift codegen.

Noticed while working on D49562.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337578 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 16:55:18 +00:00
Alexander Potapenko
86a77cda68 [MSan] Hotfix compilation
Make sure NewSI is used in materializeStores()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337577 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 16:52:12 +00:00
Zachary Turner
ee762a8b97 Change bool_constant to integral_constant.
bool_constant is C++17.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337576 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 16:51:55 +00:00
Evandro Menezes
6649de34e9 [ARM] Add new feature to enable optimizing the VFP registers
Enable the optimization of operations on DPR and SPR via a feature instead
of checking the target.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337575 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 16:49:28 +00:00
Zachary Turner
cd6f3910e9 Add llvm::Any.
This is analogous to std::any which is only available in C++17.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337573 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-20 16:39:32 +00:00