Commit Graph

306753 Commits

Author SHA1 Message Date
Craig Topper 1ac0839098 [X86] Update VBMI2 vshld/vshrd tests to use an immediate that doesn't require a modulo.
Planning to replace these with funnel shift intrinsics which would mask out the extra bits. This will help minimize test diffs.

llvm-svn: 350504
2019-01-07 05:58:53 +00:00
Chandler Carruth 363ac68374 [CallSite removal] Migrate all Alias Analysis APIs to use the newly
minted `CallBase` class instead of the `CallSite` wrapper.

This moves the largest interwoven collection of APIs that traffic in
`CallSite`s. While a handful of these could have been migrated with
a minorly more shallow migration by converting from a `CallSite` to
a `CallBase`, it hardly seemed worth it. Most of the APIs needed to
migrate together because of the complex interplay of AA APIs and the
fact that converting from a `CallBase` to a `CallSite` isn't free in its
current implementation.

Out of tree users of these APIs can fairly reliably migrate with some
combination of `.getInstruction()` on the `CallSite` instance and
casting the resulting pointer. The most generic form will look like `CS`
-> `cast_or_null<CallBase>(CS.getInstruction())` but in most cases there
is a more elegant migration. Hopefully, this migrates enough APIs for
users to fully move from `CallSite` to the base class. All of the
in-tree users were easily migrated in that fashion.

Thanks for the review from Saleem!

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

llvm-svn: 350503
2019-01-07 05:42:51 +00:00
Chandler Carruth f6f134e4d4 [CallSite removal] Add `CallBase` support to the `InstVisitor` in such
a way that it still supports `CallSite` but users can be ported to rely
on `CallBase` instead.

This will unblock the ports across the analysis and transforms libraries
(and out-of-tree users) and once done we can clean this up by removing
the `CallSite` layer.

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

llvm-svn: 350502
2019-01-07 05:15:49 +00:00
Brian Gesiak 7dda73a223 [SemaCXX] Fix ICE for unexpanded parameter pack
Summary:
The documentation for RecursiveASTVisitor::TraverseDecl states that the
Decl being traversed may be null. In fact, this is the case when a
CXXCatchStmt with no exception decl is traversed. Because the visitor
for diagnosing unexpanded parameter packs does not check for null, it
ends up crashing when it attempts to call the Decl::isParameterPack
method on a null Decl pointer.

Add a null check to prevent an ICE, and a test case that would crash
otherwise. Also, because the test requires C++ exceptions and C++14,
change the test parameters for the entire test file. (Alternatively, I
thought about adding a new test file, but went with this approach for my
own convenience.)

Co-authored-by: Andreas Molzer <andreas.molzer@gmx.de>
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 350501
2019-01-07 03:25:59 +00:00
Nico Weber a3077e6fb6 [gn build] Add build files for llvm/lib/Target/ARM + tests
The ARM target itself is similar to the X86 target in https://reviews.llvm.org/rL348903
The llvm-exegesis unittests ARM bits are similar to the X86 bits in https://reviews.llvm.org/rL350413
Both are similar to the corresponding AArch64 bits in https://reviews.llvm.org/rL350499 too

After this, everything in my local GN branch is upstreamed to LLVM.

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

llvm-svn: 350500
2019-01-07 01:26:12 +00:00
Nico Weber 9b3348ad92 [gn build] Add build files for llvm/lib/Target/AArch64 + tests
The AArch64 target itself is similar to the X86 target in https://reviews.llvm.org/rL348903
The llvm-exegesis AArch64 bits are similar to the X86 bits in http://reviews.llvm.org/rL350184
The llvm-exegesis unittests AArch64 bits are similar to the X86 bits in https://reviews.llvm.org/rL350413

llvm/unittests/Target/AArch64 doesn't have an equivalent since the X86 Target
only has lit tests, no unittests.

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

llvm-svn: 350499
2019-01-07 01:23:11 +00:00
Craig Topper 6ffeeb705f [X86] Add support for matching vector funnel shift to AVX512VBMI2 instructions.
Summary: AVX512VBMI2 supports a funnel shift by immediate and a funnel shift by a variable vector.

Reviewers: spatel, RKSimon

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 350498
2019-01-06 18:10:18 +00:00
Lama Saba f385c21f79 Revert "Resubmit rL345008 "Split MachinePipeliner code into header and cpp files""
This reverts commit rL350493
issues related to modules  still appear in http://green.lab.llvm.org/green/job/lldb-cmake

llvm-svn: 350497
2019-01-06 16:39:14 +00:00
Sanjay Patel 8f12e8f3f6 [x86] explicitly set cost of integer add/sub
There are no test changes here in the existing cost model
regression tests because integer add/sub have a default
legal cost of 1 already. This would break, however, if
we custom lower those ops because the default cost model
assumes that custom-lowered ops are more expensive.

This is similar to the change in rL350403. See discussion
in D56011 for more details. When we enhance that patch to
handle integer ops, we need this cost model change to avoid
unintended diffs here from the custom lowering.

llvm-svn: 350496
2019-01-06 16:21:42 +00:00
Nico Weber 7d34906f31 Fix bug in test found by the diagnostic added in r350340.
I meant to commit this change in 350341 but failed to do so (since it's
in test/CodeGenCXX, not in test/Frontend).

llvm-svn: 350495
2019-01-06 15:57:18 +00:00
Nico Weber 08df157aac [gn build] Merge r350341
Adds a build file for llvm-elfabi and makes check-llvm depend on it.

llvm-svn: 350494
2019-01-06 15:49:10 +00:00
Lama Saba ea9d555b83 Resubmit rL345008 "Split MachinePipeliner code into header and cpp files"
Resubmitted in rL345290 and reverted in rL350345 due to failures in
http://green.lab.llvm.org/green/job/lldb-cmake/
Resubmitting after a workaround to lldb-cmake failure was
committed in rL350346, more info in https://reviews.llvm.org/D56084

llvm-svn: 350493
2019-01-06 15:45:40 +00:00
Nico Weber 2cce1fa0f9 [gn build] Add build files for LLVM unittests with a custom main() function
Differential Revision: https://reviews.llvm.org/D56219

llvm-svn: 350492
2019-01-06 15:09:22 +00:00
Petr Hosek 0f65ac2aee [CMake] Use hidden visibility for static libc++ in Fuchsia
This is enables the use of libc++ in contexts such as device drivers.

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

llvm-svn: 350491
2019-01-06 08:23:56 +00:00
Craig Topper 57fc891c1b [LegalizeVectorOps] Add FSHL/FSHR to the list of vector operations that should be handled.
The FSHL/FSHR nodes are handled in the expand function, but they need to also be listed in the code that queries for the operation action too.

llvm-svn: 350490
2019-01-06 07:06:35 +00:00
Petr Hosek a2685cd6dc [libcxx] Support building hermetic static library
This is useful when static libc++ library is being linked into
shared libraries that may be used in combination with libraries.
We want to avoid we exporting libc++ symbols in those cases where
this option is useful. This is provided as a CMake option and can
be enabled by libc++ vendors as needed.

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

llvm-svn: 350489
2019-01-06 06:14:31 +00:00
Petr Hosek 5c43496fa3 [compiler-rt][Fuchsia] Replace _zx_vmar_allocate_old call
This is the deprecated legacy interface, replace it with the current
_zx_vmar_allocate one.

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

llvm-svn: 350488
2019-01-06 05:19:05 +00:00
Mike Spertus 4fc8c44382 Have MSVC Visualizer for DeducedTemplateSpecializationType show both the original template and deduced specialization
Now appears in the Autos window something like

- MyType	DeducedTemplateSpecializationType  {struct Y<int>}
|- Template	template<typename T> struct Y;
|- Deduced As	struct Y<int>
|- isDeduced	true	bool
|- TypeClass	DeducedTemplateSpecialization (36)
|- Flags	No TypeBits set beyond TypeClass
|- Canonical	RecordType  {struct Y<int>}

Also changed QualType visualization to auto-expand the BaseType

llvm-svn: 350487
2019-01-06 04:58:48 +00:00
Petr Hosek 42af135e0d [CMake][Fuchsia] Enable build ID, relaxations for first stage
We want these to be used for the second stage compiler as well.

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

llvm-svn: 350486
2019-01-06 04:14:51 +00:00
Eric Fiselier b168a7c660 Fix PR39749 - Headers containing just #error harm __has_include.
This patch changes <experimental/foo> to use #warning instead of
is harmful to common feature detection idioms.

We should also consider only emitting the warning when __DEPRECATED is
defined, like we do in the <ext/foo> headers. Users may want to specify
"-Werror=-W#warnings" while still ignoring the libc++ warnings.

llvm-svn: 350485
2019-01-06 00:37:31 +00:00
Petr Hosek 9dabf6ac70 Revert "[CMake][Fuchsia] Enable experimental new pass manager by default"
This reverts commit r350461 as it causes many of the Clang tests to fail.

llvm-svn: 350484
2019-01-05 23:45:31 +00:00
Craig Topper 1187991bcf [X86][AsmParser] Don't allow X86::DX in CheckBaseRegAndIndexRegAndScale.
This was here because out and in instructions allow '(%dx)' even though its not a memory reference. To handle this we build a special operand for the DX register reference before we get to the call to CheckBaseRegAndIndexRegAndScale. So we no longer need this special case.

llvm-svn: 350483
2019-01-05 23:30:28 +00:00
Mike Spertus b25ced7480 Fix MSVC Visualization for TemplateTypeParmType and TemplateTypeParmDecl
llvm-svn: 350482
2019-01-05 23:15:30 +00:00
Craig Topper d0ba531a0c [X86] Use two pmovmskbs in combineBitcastvxi1 for (i64 (bitcast (v64i1 (truncate (v64i8)))) on KNL.
llvm-svn: 350481
2019-01-05 22:42:58 +00:00
Craig Topper 46f8b4a11e [X86] Allow combinevxi1Bitcast to use pmovmskb on avx512 targets if the input is a truncate from v16i8/v32i8.
This is especially helpful on targets without avx512bw since we don't have a good way to convert from v16i8/v32i8 to v16i1/v32i1 for the truncate anyway. If we're just going to convert it to a GPR we might as well use pmovmskb to accomplish both.

llvm-svn: 350480
2019-01-05 21:40:07 +00:00
Jan Kratochvil 005a43e7c4 Fix symbols.enable-external-lookup description wording
D55859 changed "external tools or libraries" to "external sources" according to
Pavel Labath.  Now it is changed sort of back to "external tools and
repositories" according to Adrian Prantl.
	https://reviews.llvm.org/D55859#1345881

llvm-svn: 350479
2019-01-05 21:39:03 +00:00
Eric Fiselier 5792cf42b7 Fix flaky symlink access time test.
last_write_time(sym, new_time) changes the modification time of the file
referenced by the symlink. But reading through the symlink may change the
symlinks's access time.

This meant the previous test that checked that the symlinks access
time was unchanged was incorrect and made the test flaky.

This patch removes this test (there really is no non-flaky way
to test that the new access time coorisponds to the time at which
the symlink was last dereferenced). This should unflake the test.

llvm-svn: 350478
2019-01-05 21:18:10 +00:00
Kamil Rytarowski 74b936ec98 Revert "D56064: More tolerance for flaky tests in libc++ on NetBSD"
Requested by EricWF.

llvm-svn: 350477
2019-01-05 20:11:54 +00:00
Saleem Abdulrasool 175890e1eb CodeGen: fix autolink emission on ELF
The autolinking extension for ELF uses a slightly different format for
encoding the autolink information compared to COFF and MachO.  Account
for this in the CGM to ensure that we do not assert when emitting
assembly or an object file.

llvm-svn: 350476
2019-01-05 19:27:12 +00:00
Stanislav Mekhanoshin 35a3a3bd11 Added single use check to ShrinkDemandedConstant
Fixes cvt_f32_ubyte combine. performCvtF32UByteNCombine() could shrink
source node to demanded bits only even if there are other uses.

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

llvm-svn: 350475
2019-01-05 19:20:00 +00:00
Craig Topper 27406e1f9e [X86] Regenerate test to merge 32-bit and 64-bit check lines. NFC
llvm-svn: 350474
2019-01-05 19:19:37 +00:00
Craig Topper 3f48dbf72e [X86] Allow LowerTRUNCATE to use PACKUS/PACKSS for v16i16->v16i8 truncate when -mprefer-vector-width-256 is in effect and BWI is not available.
llvm-svn: 350473
2019-01-05 18:48:11 +00:00
Saleem Abdulrasool da32d7f147 CodeGen: switch iteration to range based for loop (NFC)
Change a loop to range based instead while working on cleaning up some
modules autolinking issues on Linux.  NFC.

llvm-svn: 350472
2019-01-05 18:39:32 +00:00
Nikita Popov 25a02c12f1 [InstCombine] Improve cttz/ctlz + icmp tests; NFC
Change part of the tests to use vectors (I'm using scalar for ugt
and vector for ult), add multiuse variations, rename %lz to %tz
for the cttz tests.

llvm-svn: 350471
2019-01-05 17:36:05 +00:00
Mike Spertus 4f95b9cc29 Improve MSVC type visualizations
Display TypeBits in a single line. 
Fix bit rot in template visualizations
Rudimentary support for deduced types

llvm-svn: 350470
2019-01-05 17:01:34 +00:00
Mike Spertus 6fe3886f7e Enhance MSVC visualization of PointerUnions
Add a "deref" view that displays the pointed to objects since
other visualizers often need to display data reference by internal
PointerUnions

llvm-svn: 350469
2019-01-05 16:59:27 +00:00
Nikita Popov b46680407d [InstCombine] Add cttz/ctlz + icmp ugt/ult tests; NFC
llvm-svn: 350468
2019-01-05 15:51:59 +00:00
Serge Guelton e8775ad169 [python] Make the collections import future-proof
On Python 3.7 the old code raises a warning:

	DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
    	class ArgumentsIterator(collections.Sequence):

On Python 3.8 it wouldn't work anymore.

Commited on behalf of Jakub Stasiak.

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

llvm-svn: 350467
2019-01-05 12:07:36 +00:00
Jonas Toth 964f816dba [Documentation] fix order of checks in checks/list.rst
llvm-svn: 350466
2019-01-05 11:40:05 +00:00
Martin Storsjo 17fb13bb40 [docs] Add a known limitation to the comment about lld supporting GCC/MinGW object files. NFC.
Differential Revision: https://reviews.llvm.org/D56335

llvm-svn: 350465
2019-01-05 10:44:03 +00:00
Martin Storsjo 5abe10ac21 [MinGW] Expand comment for MinGW driver. NFC.
Originally authored by Rui Ueyama.

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

llvm-svn: 350464
2019-01-05 10:43:59 +00:00
Nikita Popov 65038515ee [InstCombine] Relax cttz/ctlz with select on zero
The cttz/ctlz intrinsics have a parameter specifying whether the
result is undefined for zero. cttz(x, false) can be relaxed to
cttz(x, true) if x is known non-zero, and in fact such an optimization
is already performed. However, this currently doesn't work if x is
non-zero as a result of a select rather than an explicit branch.
This patch adds handling for this case, thus allowing
x != 0 ? cttz(x, false) : y to simplify to x != 0 ? cttz(x, true) : y.

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

llvm-svn: 350463
2019-01-05 09:48:16 +00:00
Nikita Popov 7bd4900ba0 [InstCombine] Add vector tests for select + ctlz/cttz; NFC
llvm-svn: 350462
2019-01-05 09:48:05 +00:00
Petr Hosek 43fc2e4590 [CMake][Fuchsia] Enable experimental new pass manager by default
This change enableds experimental new pass manager.

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

llvm-svn: 350461
2019-01-05 07:57:53 +00:00
Petr Hosek 97a245f8e7 [CMake][Fuchsia] Enable x86 relaxation by default
This enables x86 relaxation by default. This depends on a linker new
enough to support the new reloc types but since we default to lld we
don't worry about host system linkers that might be too old to support
the new reloc types.

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

llvm-svn: 350460
2019-01-05 07:57:46 +00:00
Petr Hosek 4bb647d2a3 [CMake][Fuchsia] Enable --build-id linker flag by default
This enables passing --build-id to linker by default.

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

llvm-svn: 350459
2019-01-05 07:57:38 +00:00
Nico Weber 777c17f738 [gn build] Merge r350423
llvm-svn: 350458
2019-01-05 05:01:20 +00:00
Nico Weber 1620162b07 [gn build] Add build files for unittests under llvm/unittests/ExecutionEngine
Differential Revision: https://reviews.llvm.org/D56328

llvm-svn: 350457
2019-01-05 04:05:25 +00:00
Easwaran Raman 366a873f14 [Inliner] Optimize shouldBeDeferred
This has some minor optimizations to shouldBeDeferred. This is not
strictly NFC because the early exit inside the loop assumes
TotalSecondaryCost is monotonically non-decreasing, which is not true if
the threshold used by CostAnalyzer is negative. AFAICT the thresholds do
not go below 0 for the default values of the various options we use.

llvm-svn: 350456
2019-01-05 02:26:29 +00:00
Craig Topper 45ec002e25 [X86] Require second operand of X86vshiftuniform to be an integer. NFC
We don't need to require the first operand to be an integer because we already said it was the same type as the result which we also constrained to an integer.

llvm-svn: 350455
2019-01-05 01:40:29 +00:00