Commit Graph

236048 Commits

Author SHA1 Message Date
Saleem Abdulrasool 37bf71828b Reapply SVN r274797.
Original Commit Message

    Driver: Stop linking to C++ when using sanitizers on Darwin

    Sanitizers on Darwin are built as dynamic libraries, not static libraries.
    Sanitizers will have their C++ dependency satisfied internally (LC_LOAD_DYLIB)
    in the libclang_rt dylib. As long as the sanitizers stay dynamic and not static,
    linking against C++ when enabling a sanitizer becomes over linkage.

    Patch by Dave Lee!

llvm-svn: 275032
2016-07-10 23:24:36 +00:00
Hal Finkel e87ad547ef Add getReturnedArgOperand to Call/InvokeInst, CallSite
In order to make the optimizer smarter about using the 'returned' argument
attribute (generally, but motivated by my llvm.noalias intrinsic work), add a
utility function to Call/InvokeInst, and CallSite, to make it easy to get the
returned call argument (when one exists).

P.S. There is already an unfortunate amount of code duplication between
CallInst and InvokeInst, and this adds to it. We should probably clean that up
separately.

Differential Revision: http://reviews.llvm.org/D22204

llvm-svn: 275031
2016-07-10 23:01:32 +00:00
Jan Vesely d7e03a5bd9 AMDGPU: Export workitem builtins
Reviewers: tstellardAMD

Differential Revision: http://reviews.llvm.org/D20299

llvm-svn: 275030
2016-07-10 22:38:04 +00:00
Hal Finkel 617c962752 Update Clang tests after adding inference for the returned argument attribute
Adjusting tests after r275027.

llvm-svn: 275029
2016-07-10 22:26:52 +00:00
Simon Pilgrim ee4a33ae46 [X86][SSE] Relax type assertions for matchVectorShuffleAsInsertPS
Calls to matchVectorShuffleAsInsertPS only need to ensure the inputs are 128-bit vectors. Only lowerVectorShuffleAsInsertPS needs to ensure that they are v4f32.

llvm-svn: 275028
2016-07-10 22:26:05 +00:00
Hal Finkel d66a7b05db Let FuncAttrs infer the 'returned' argument attribute
A function can have one argument with the 'returned' attribute, indicating that
the associated argument is always the return value of the function. Add
FuncAttrs inference logic.

Differential Revision: http://reviews.llvm.org/D22202

llvm-svn: 275027
2016-07-10 22:02:55 +00:00
Hal Finkel 3b66caa290 Update the LangRef description of the 'returned' attribute
The description of the 'returned' attribute says that it is only used when
code-generating the caller. I'd like to make the optimizer smarter about
looking through functions with returned arguments (generally, but motivated by
my llvm.noalias work). As David pointed out in the review of D22202, the
LangRef should be updated to make its expanded uses clearer.

Differential Revision: http://reviews.llvm.org/D22205

llvm-svn: 275026
2016-07-10 21:52:39 +00:00
Sanjay Patel fedc01ad76 [DAG] make isConstantSplatVector() available to the rest of lowering
llvm-svn: 275025
2016-07-10 21:27:06 +00:00
Jan Vesely 2fa28c330c AMDGPU/R600: Add implicitarg.ptr intrinsic
Differential Revision: http://reviews.llvm.org/D21622

llvm-svn: 275024
2016-07-10 21:20:29 +00:00
Etienne Bergeron 07d648fcaf whitespaces + re-indent
llvm-svn: 275023
2016-07-10 21:06:06 +00:00
Simon Pilgrim 2191faa433 [X86][SSE] Add support for target shuffle combining to PSHUFLW/PSHUFHW
llvm-svn: 275022
2016-07-10 21:02:47 +00:00
Sanjay Patel 9bedcdb5f5 fix documentation comments; NFC
llvm-svn: 275021
2016-07-10 21:02:16 +00:00
Sanjay Patel ccd08fc8c4 [x86, SSE, AVX] add tests for icmp+zext (PR28484)
Note the inconsistent vpbroadcast generation for AVX2; another bug.

llvm-svn: 275020
2016-07-10 20:45:14 +00:00
Simon Pilgrim 51c786bd91 [X86][SSE] Added tests for combining shuffles to PSHUFLW/PSHUFHW
llvm-svn: 275019
2016-07-10 20:19:56 +00:00
Craig Topper 8a62061e37 [AVX512] Remove masked shufps/shudpd builtins. These are all handled with __builtin_shufflevector.
llvm-svn: 275018
2016-07-10 16:35:54 +00:00
Benjamin Kramer b308f8b812 [Support] Make helper function static. NFC.
llvm-svn: 275017
2016-07-10 16:11:53 +00:00
Marcin Koscielnicki cf7cc724a7 [SystemZ] Utilize Test Data Class instructions.
This adds a new SystemZ-specific intrinsic, llvm.s390.tdc.f(32|64|128),
which maps straight to the test data class instructions.  A new IR pass
is added to recognize instructions that can be converted to TDC and
perform the necessary replacements.

Differential Revision: http://reviews.llvm.org/D21949

llvm-svn: 275016
2016-07-10 14:41:22 +00:00
Sanjay Patel 303326541b reformat, fix comments/names; NFCI
llvm-svn: 275015
2016-07-10 13:05:57 +00:00
Benjamin Kramer 4d09892e9a Give helper classes/functions internal linkage. NFC.
llvm-svn: 275014
2016-07-10 11:28:51 +00:00
Benjamin Kramer da5b4cc339 [codeview] Drop unused private inheritance.
There is no polymorphism here, and StreamRef already contains a
StreamInterface pointer. Dropping the base class makes StreamRef more
transparent to the compiler, for example it can find unused variables.

llvm-svn: 275013
2016-07-10 10:17:36 +00:00
Craig Topper 6e76fb61a7 [X86] Use __butilin_shufflevector for 512-bit shufps intrinsics.
llvm-svn: 275012
2016-07-10 05:57:21 +00:00
Craig Topper 0b0954570a [AVX512] Add support for lowering to 512-bit SHUFPS.
llvm-svn: 275011
2016-07-10 05:55:53 +00:00
David Majnemer 1b79e9a5b9 [pdb] Sanity check the stream map
Some abstractions in LLVM "know" that they are reading in-bounds,
FixedStreamArray, and provide a simple result.  This breaks down if the
stream map is bogus.

llvm-svn: 275010
2016-07-10 05:32:05 +00:00
David Majnemer 6211b1f1f9 [llvm-pdbdump] Propagate errors a little more consistently
PDBFile::getBlockData didn't really return any indication that it
failed.  It merely returned an empty buffer.

llvm-svn: 275009
2016-07-10 03:34:47 +00:00
Michael Gottesman daaf9f1379 [cmake] Change lli-child-target to use add_llvm_utility instead of add_llvm_executable.
We are currently using add_llvm_utility for executable targets that:

1. Are built by default.
2. Used for testing.
3. Are not installed by default.

Originally, lli-child-target used add_llvm_tool instead of add_llvm_executable
directly. This was changed so that lli-child-target would not be installed. This
was good since this is only used for testing and should never be installed for
users. This also had the unfortunate side effect that one can never turn off the
building of lli-child-target by default, a regression for projects that by
default do not want to compile any LLVM tools beyond tablegen/llvm-config.

This patch changes lli-child-target to use add_llvm_utility. This makes sense
since:

1. lli-child-target matches the semantics of executables created with
add_llvm_utility.
2. We fix the regression since now one can use the flag LLVM_BUILD_UTILS to
eliminate default compilation.

llvm-svn: 275008
2016-07-10 02:43:50 +00:00
Michael Gottesman be5b7871d9 [cmake] Create the LLVM_BUILD_UTILS option.
This option is the equivalent option to LLVM_BUILD_TOOLS but for executables
created via add_llvm_utility.

This is a useful tool for improving compile time in situations where LLVM is
used as a library and no testing tools are needed.

It follows the exact same implemention model as LLVM_BUILD_TOOLS.

Since the option is by default set to on, no behavior is changed unless one sets
it from the command line to be false.

llvm-svn: 275007
2016-07-10 02:43:47 +00:00
Michael Gottesman eb396a6cbf Add CLANG_BUILD_TOOLS as a clang counterpart for LLVM_BUILD_TOOLS
LLVM_BUILD_TOOLS is a boolean variable that controls whether or not generated
targets for llvm tools are built by the "all" target. CLANG_BUILD_TOOLS is an
analogous variable for clang targets.

This is useful functionality for selectively disabling the building of clang
targets by default to speed up builds.

In terms of implementation, I just followed the model of LLVM's implementation
of this functionality.

llvm-svn: 275006
2016-07-10 01:44:00 +00:00
Sean Silva 9ac6ae2a99 Delete dead code.
We were just setting DisableUnitAtATime to its default value.

llvm-svn: 275005
2016-07-10 00:57:52 +00:00
Davide Italiano 0f03ce0c88 [SCCP] Rename undefined -> unknown.
In the solver, isUndefined() does really mean "we don't know the
value yet" rather than "this is an UndefinedValue". Discussed with
Eli Friedman.

Differential Revision:  http://reviews.llvm.org/D22192

llvm-svn: 275004
2016-07-10 00:35:15 +00:00
Rui Ueyama 89c3762a7a Update comments.
llvm-svn: 275003
2016-07-09 23:16:00 +00:00
Sean Silva 96faef21d5 [docs] Fix up a broken link.
llvm-svn: 275002
2016-07-09 23:08:14 +00:00
Rui Ueyama 0d410c265c Attempt to fix buildbots.
llvm-svn: 275001
2016-07-09 23:02:37 +00:00
Sean Silva db90d4d9c1 [PM] Port LoopVectorize to the new PM.
llvm-svn: 275000
2016-07-09 22:56:50 +00:00
Sean Silva bf71035438 Fix up an include guard.
This should have been done as part of the move in r274960.

llvm-svn: 274999
2016-07-09 22:56:39 +00:00
Rui Ueyama 95d2a9f91a Remove unused forward declarations.
llvm-svn: 274998
2016-07-09 22:54:27 +00:00
Rui Ueyama e2efadced7 Remove Target::writeThunk.
Only MipsThunk were using the function, and the way how it wrote
thunk contents was different from ARM thunks. This patch makes
them consistent.

llvm-svn: 274997
2016-07-09 22:52:32 +00:00
Rui Ueyama 3d2bbb13d0 Make ARM thunks consistent with MIPS in coding style.
Although they are in the same .cpp file, the way they were written
were slightly different, so they looked more different than they were.
This patch makes their styles consistent.

llvm-svn: 274996
2016-07-09 22:52:30 +00:00
Davide Italiano c4890705ef [SCCP] Remove wrong and misleading vector handling code.
This code was already commented out and it made some weird assumptions,
e.g. using isUndefined() as "this value is UndefValue" instead of
"we haven't computed this value is yet". Thanks to Eli Friedman for
pointing out where I was wrong (and where this code was wrong).

llvm-svn: 274995
2016-07-09 22:49:35 +00:00
Rui Ueyama ec4220d70f Instantiate Thunk classes instead of the class member functions.
llvm-svn: 274994
2016-07-09 22:06:47 +00:00
Rui Ueyama 5e3d604688 Split addThunkARM. NFC.
llvm-svn: 274993
2016-07-09 22:03:51 +00:00
Michael Gottesman ca589ccb02 Move add_clang_* entry points from the main clang CMakeLists.txt to cmake/modules/AddClang.cmake.
This matches how LLVM has its cmake files organized and is cleaner than just
shoving this business logic into the main CMakeLists.txt.

llvm-svn: 274992
2016-07-09 21:58:40 +00:00
David Majnemer 58fab355e2 [clang-cl] Add support for /Zd
MASM (ML.exe and ML64.exe) and older versions of MSVC (CL.exe) support a
flag called /Zd which is more-or-less -gline-tables-only.

It seems nicer to support this flag instead of exposing
-gline-tables-only.

llvm-svn: 274991
2016-07-09 21:49:16 +00:00
Simon Pilgrim 606126e848 [X86][SSE] Add support for target shuffle combining to INSERTPS
llvm-svn: 274990
2016-07-09 21:47:55 +00:00
Saleem Abdulrasool bcb8190f99 test: Use %clangxx in objc++ test files
These test in this change are objc++, but are built using %clang, not %clangxx.
The reason this works is the driver has been adding -lc++ for sanitizer enabled
builds. By making these tests use %clangxx, they no longer depend on the driver
linking to c++.  Doing so will allow us to prevent overlinking of libc++ for
applications.

llvm-svn: 274989
2016-07-09 21:14:36 +00:00
Simon Pilgrim 59c6a211cd [X86][SSE] Use scaleShuffleMask helper. NFCI.
llvm-svn: 274988
2016-07-09 21:12:03 +00:00
Simon Pilgrim 890b415902 [X86][SSE] Regenerate vector shift tests
llvm-svn: 274987
2016-07-09 20:55:20 +00:00
David Majnemer 28c3646f82 [COFF, Dwarf] Don't emit DW_AT_location for dllimported entities
There exists no relocation which can describe the address of a
dllimported variable: do not try to describe their location.

llvm-svn: 274986
2016-07-09 20:47:48 +00:00
Matthias Gehre a9e812b9cb clang-tidy/readability-identifier-naming: crash on DependentTemplateSpecializationType
Summary:
Previously, the added test cases crashed because the passed a null Decl
to addUsage().

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D22188

llvm-svn: 274985
2016-07-09 20:09:28 +00:00
David Majnemer 177553511d [MS ABI] Some code cleanups
Don't create unnecessary truncations if the result will not be used.
Also prefer preforming math before the truncation, it makes it a little
easier to reason about.

llvm-svn: 274984
2016-07-09 19:26:25 +00:00
David Majnemer 97d0517078 [AST] Tighten up some bitfields
Optimize the bitfield types to conserve space for the MSVC ABI.

llvm-svn: 274983
2016-07-09 19:26:19 +00:00