Commit Graph

232144 Commits

Author SHA1 Message Date
Samuel Antao d486f84c57 [OpenMP] Add support for the 'private pointer' flag to signal variables captured in target regions and used in first-private clauses.
Summary: If a variable is implicitly mapped (doesn't show in a map clause), the runtime library has to be informed if the corresponding capture shows up in first-private clause, so that the storage previously allocated in the device is used. This patch adds the support for that.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: caomhin, cfe-commits

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

llvm-svn: 270870
2016-05-26 16:53:38 +00:00
Greg Clayton 6c42e06312 Guard against the C++ destructor chain by not letting the debugger list clean up after itself in the C++ destructor chain.
If users call "static void lldb::SBDebugger::Terminate()" we will clean up the debugger list, and users can individually destroy debugger instances with "static void lldb::SBDebugger::Destroy(SBDebugger &)". But if we let the C++ destructor chain tear down this list, other threads that might still be running as the main thread exits can now crash if they access the debugger list. We stop this by leaking the debugger list and its mutex.

<rdar://problem/26372169>

llvm-svn: 270869
2016-05-26 16:51:23 +00:00
Samuel Antao 6782e944d2 [OpenMP] Adjust map type bits according to latest spec and use zero size array sections for pointers.
Summary: This patch changes the bits used to specify the map types according to the latest version of the libomptarget document and add the support for zero size array section when pointers are being implicitly mapped. This completes the missing new 4.5 map semantics.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: caomhin, cfe-commits

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

llvm-svn: 270868
2016-05-26 16:48:10 +00:00
Hal Finkel 0a665a83da Add a test case for microtask dispatch with many arguments
This is a cleaned-up version of the test case posted in the D19879 review.

llvm-svn: 270867
2016-05-26 16:34:05 +00:00
Chris Bieneman 1bc0f4395c [CMake] Restrict libxar linkage to just llvm-objdump
At some point we're going to need libObject to have this dependency, but as it is now this is causing too many headaches. This commit will reduce the linkage to just llvm-objdump where it is strictly needed, and we'll cross the libObject bridge later when we need it.

llvm-svn: 270866
2016-05-26 16:32:40 +00:00
Xinliang David Li 0777a93bee Use new interface in Triple /NFC
llvm-svn: 270865
2016-05-26 16:28:01 +00:00
Xinliang David Li a290c9b47a Fix windows bot failure
llvm-svn: 270864
2016-05-26 16:21:11 +00:00
Pavel Labath a0adeb69ab [cmake] Remove the LLDB versions of the exception-controlling variables
Summary:
One can still use the LLVM variables to control this: LLVM_ENABLE_EH, LLVM_ENABLE_RTTI. It's not
clear to me why one would want to control these at lldb level and it's generally not even a good
idea to compile parts of the same binary with different values of these flags.

Reviewers: zturner, tfiala

Subscribers: lldb-commits

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

llvm-svn: 270863
2016-05-26 16:11:04 +00:00
Xinliang David Li 555cf5efbd [profile] pre-allocate a small counter set in profile runtime
Tested with relavant benchmarks in SPEC2006

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

llvm-svn: 270862
2016-05-26 16:06:36 +00:00
Adrian Prantl aa9d6c3630 Undo a suboptimal clang-format decision. NFC
llvm-svn: 270861
2016-05-26 16:06:04 +00:00
Ismail Donmez a1c8c60e20 Since some time clang itself figures out the default for ms-compatibility-version and uses it. Trying to figure it out during build is redundant and also will not work when the environment variable VSINSTALLDIR is not defined (which is not defined if you don't install whole Visual Studio but use Visual C++ Build Tools package).
Tested by bootstrapping clang with clang-cl.

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

llvm-svn: 270860
2016-05-26 15:52:23 +00:00
Artem Tamazov b49c3361e5 Fix build warning introduced in r270552 "[AMDGPU][llvm-mc] Disassembler: support for TTMP/TBA/TMA registers."
llvm-svn: 270859
2016-05-26 15:52:16 +00:00
Simon Pilgrim cf340bd9c1 [X86][SSE] When lowering a 256-bit shuffle as PMOVZX, reduce the input vector to the lower 128-bit subvector.
Most often as not this is what it started out as, the extraction is zero-cost on AVX and the PMOVZX/PMOVSX folding logic is based around 128-bit loads.

llvm-svn: 270858
2016-05-26 15:40:36 +00:00
Krzysztof Parzyszek de37cfb596 [Hexagon] Select the aggressive anti-dependency breaker
llvm-svn: 270857
2016-05-26 15:38:50 +00:00
Diana Picus 81bc3170e8 [AMDGPU] Remove exit-on-error flag from test (PR27762)
Similar to r269948, but for argument lowering.

Fixes PR27762

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

llvm-svn: 270856
2016-05-26 15:24:55 +00:00
Diana Picus 20a8d8e97e [BPF] Remove exit-on-error flag in test (PR27767)
The exit-on-error flag is needed to avoid an assert where
llvm::SelectionDAGISel::LowerArguments doesn't create enough arguments. Fill up
with zeroes to reach the right number of args.

Fixes PR27767.

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

llvm-svn: 270855
2016-05-26 15:23:50 +00:00
Pavel Labath 95d6c7731c [cmake] Add a big warning about a libstdc++ issue
Summary:
Recent increase in the usage of std::weak_ptr has caused us to rediscover an issue in libstdc++
versions prior to 4.9 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59656>, which make this class
unusable without exceptions in the presence of multiple threads. It's virtualy impossible to work
around this issue without implementing our own shared_ptr/weak_ptr substitutes, which does not
seem like a good idea.

Therefore, I am adding a big CMake warning which warns you about this issue if you're attempting
a to do a build which is suceptible to this problem and suggests possible alternatives. Right
now, nothing spectacular will happen if you ignore this warning (all the crashes I have seen
occur during process shutdown), but there's no guarantee the situation will not change in the
future.

Reviewers: tberghammer, tfiala, nitesh.jain, omjavaid, emaste, krytarowski

Subscribers: lldb-commits

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

llvm-svn: 270854
2016-05-26 15:16:11 +00:00
Chad Rosier e5819e2732 [InstCombine] Catch more bswap cases missed due to zext and truncs.
Fixes PR27824.
Differential Revision: http://reviews.llvm.org/D20591.

llvm-svn: 270853
2016-05-26 14:58:51 +00:00
Simon Pilgrim 50c37ceb3b [X86][SSE] Added load_zext_16i8_to_8i32 test
Odd issue with input vector not being folded into pmovzx on AVX2+ targets

llvm-svn: 270852
2016-05-26 14:45:30 +00:00
Michael Zuckerman 22c47e606a Adding missing _mm512_castsi512_si256 intrinsic.
llvm-svn: 270851
2016-05-26 14:32:11 +00:00
Teresa Johnson 28c03b56ec [ThinLTO] Resolve LinkOnceAny
Summary:
Ensure we keep prevailing copy of LinkOnceAny by converting it to
WeakAny.

Rename odr_resolution test to the now more appropriate weak_resolution
(weak in the linker sense includes linkonce).

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

llvm-svn: 270850
2016-05-26 14:16:52 +00:00
Sean Eveson c24501dd13 [Analyzer] Correct stack address escape diagnostic
Summary:
Leaking a stack address via a static variable refers to it in the diagnostic as a 'global'. This patch corrects the diagnostic for static variables.


Patch by Phil Camp, SN Systems

Reviewers: dcoughlin, zaks.anna

Subscribers: xazax.hun, cfe-commits

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

Patch by Phil Camp

llvm-svn: 270849
2016-05-26 14:02:17 +00:00
Todd Fiala 94eb010fe9 Add "-gmodules" support to the test suite.
This change adds the capability of building test inferiors
with the -gmodules flag to enable module debug info support.
Windows is excluded per @zturner.

Reviewers: granata.enrico, aprantl, zturner, labath

Subscribers: zturner, labath, lldb-commits

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

llvm-svn: 270848
2016-05-26 13:57:03 +00:00
George Rimar a8f9cf18ad Removed redundant argument. NFC.
llvm-svn: 270847
2016-05-26 13:37:12 +00:00
Chad Rosier 816a67da49 [AArch64] Generate a BFI/BFXIL from 'or (and X, MaskImm), OrImm'.
If and only if the value being inserted sets only known zero bits.

This combine transforms things like

  and w8, w0, #0xfffffff0
  movz w9, #5
  orr w0, w8, w9

into

  movz w8, #5
  bfxil w0, w8, #0, #4

The combine is tuned to make sure we always reduce the number of instructions.
We avoid churning code for what is expected to be performance neutral changes
(e.g., converted AND+OR to OR+BFI).

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

llvm-svn: 270846
2016-05-26 13:27:56 +00:00
Olivier Goffart eeba9e4066 Fix crash while parsing variable template with variadic template arguments
It is only a crash if the compiler optimize for this!=nullptr because
LocalInstantiationScope::getPartiallySubstitutedPack checks if 'this' is null
(This is crashing when clang is compiled with GCC6)

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

llvm-svn: 270845
2016-05-26 12:55:34 +00:00
Rafael Espindola a224de06bc Use shouldAssumeDSOLocal on AArch64.
This reduces code duplication and now AArch64 also handles PIE.

llvm-svn: 270844
2016-05-26 12:42:55 +00:00
Igor Breger 8437bb70fd [AVX512] Fix intrinsic cmp{sd|ss} lowering.
Differential Revision: http://reviews.llvm.org/D20615

llvm-svn: 270843
2016-05-26 12:42:25 +00:00
Simon Atanasyan dc6e951860 [driver][mips] Specify stdlib used in the tests explicitly
That allows to pass the tests even if default stdlib is not libstdc++.

llvm-svn: 270842
2016-05-26 11:32:19 +00:00
NAKAMURA Takumi 201c955fbc clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-type-vararg.cpp: Tweak for r270775.
llvm-svn: 270841
2016-05-26 11:20:54 +00:00
Kuba Brecka 6d8873b8bc [sanitizer] Fix a typo in config-ix.cmake causing all Darwin embedded platforms to be built with the 'iossim' SDK.
llvm-svn: 270840
2016-05-26 11:18:22 +00:00
John Brawn 3546c2f158 Add auto-exporting of symbols from tools so that plugins work on Windows
The problem with plugins on Windows is that when building a plugin DLL it needs
to explicitly link against something (an exe or DLL) if it uses symbols from
that thing, and that thing must explicitly export those symbols. Also there's a
limit of 65535 symbols that can be exported. This means that currently plugins
only work on Windows when using BUILD_SHARED_LIBS, and that doesn't work with
MSVC.

This patch adds an LLVM_EXPORT_SYMBOLS_FOR_PLUGINS option, which when enabled
automatically exports from all LLVM tools the symbols that a plugin could want
to use so that a plugin can link against a tool directly. Plugins can specify
what tool they link against by using PLUGIN_TOOL argument to llvm_add_library.
The option can also be enabled on Linux, though there all it should do is
restrict the set of symbols that are exported as by default all symbols are
exported.

This option is currently OFF by default, as while I've verified that it works
with MSVC, linux gcc, and cygwin gcc, I haven't tried mingw gcc and I have no
idea what will happen on OSX. Also unfortunately we can't turn on
LLVM_ENABLE_PLUGINS when the option is ON as bugpoint-passes needs to be
loaded by both bugpoint.exe and opt.exe which is incompatible with this
approach. Also currently clang plugins don't work with this approach, which
will be fixed in future patches.

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

llvm-svn: 270839
2016-05-26 11:16:43 +00:00
Alexey Bataev c6bd8917f2 [OPENMP] Add option '-fopenmp-version=[31|40|45]' allowing choosing
OpenMP version.

If '-fopenmp' option is provided '-fopenmp-version=' allows to control,
which version of OpenMP must be supported. Currently it affects only the
value of _OPENMP define.

llvm-svn: 270838
2016-05-26 11:10:11 +00:00
Simon Pilgrim ab3809193c [X86][F16C] Added F16C fast-isel tests to match clang/test/CodeGen/f16c-builtins.c
llvm-svn: 270837
2016-05-26 10:26:56 +00:00
Simon Pilgrim 1fdfbf6941 [X86][F16C] Improved f16c intrinsics checks
Added checks for upper elements being zero'd in scalar conversions

llvm-svn: 270836
2016-05-26 10:20:25 +00:00
Simon Pilgrim 0e4fdc0842 [X86][AVX2] Added gather fast-isel tests to match clang/test/CodeGen/avx2-builtins.c
llvm-svn: 270835
2016-05-26 10:07:05 +00:00
Andrey Bokhanko 67a4186ee6 [MSVC] Support for __unaligned qualifier in functions
This implements support for MS-specific __unaligned qualifier in functions and
makes the following test case both compile and mangle correctly:

struct S {
    void f() __unaligned;
};
void S::f() __unaligned {
}

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

llvm-svn: 270834
2016-05-26 10:06:01 +00:00
Simon Pilgrim 57446efaa9 [X86][AVX2] Improved checks for float/double mask generation for non-masked gathers
llvm-svn: 270833
2016-05-26 09:56:50 +00:00
Pavel Labath 23ef3695d4 [cmake] Add ability to customize (and skip) debugserver codesign
Summary:
This adds the ability to customize the debugserver codesign process via cmake cache variable. The
user can set the codesign indentity (with the default being the customary lldb_codesign), and if
the identity is set to a empty string, the codesign step is skipped completely.

We needed the last feature to enable building lldb on buildservers which do not have the right
certificates installed.

Reviewers: sas, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 270832
2016-05-26 08:38:10 +00:00
Pavel Labath 0314b00daa Avoid using stdio in TestVirtual
Summary:
using stdio in tests does not work on windows, and it is not completely reliable on linux.
Avoid using stdio in this test, as it is not necessary for this purpose.

Reviewers: clayborg

Subscribers: lldb-commits, zturner

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

llvm-svn: 270831
2016-05-26 08:38:02 +00:00
Michael Zuckerman eb5f178c4b Fix instrinsics names:
_mm128_cmp_ps_mask-->_mm_cmp_ps_mask
_mm128_mask_cmp_ps_mask-->_mm_mask_cmp_ps_mask
_mm128_cmp_pd_mask-->_mm_cmp_pd_mask
_mm128_mask_cmp_pd_mask-->_mm_mask_cmp_pd_mask

llvm-svn: 270830
2016-05-26 08:10:12 +00:00
Chris Dewhurst 9013d069b0 [Sparc] Extend the assembler printing support for Sparc back-end.
Allows display of floating-point registers and display of assembler meta-data output.

llvm-svn: 270829
2016-05-26 07:28:31 +00:00
David Majnemer 474512576e [MergedLoadStoreMotion] Don't transform across may-throw calls
It is unsafe to hoist a load before a function call which may throw, the
throw might prevent a pointer dereference.

Likewise, it is unsafe to sink a store after a call which may throw.
The caller might be able to observe the difference.

This fixes PR27858.

llvm-svn: 270828
2016-05-26 07:11:09 +00:00
Adam Nemet 4f7bbf617b [ConstantFold] NFC cleanup after previous change.
Merge two conditions.

llvm-svn: 270827
2016-05-26 07:08:09 +00:00
Adam Nemet c68534bd13 [ConstantFold] Fix incorrect index rewrites for GEPs
Summary:
If an index for a vector or array type is out-of-range GEP constant
folding tries to factor it into preceding dimensions.  The code however
does not consider addressing of structure field padding which should not
qualify as out-of-range index.

As demonstrated by the testcase, this can occur if the indexing
performed on a vector type and the preceding index is an array type.

SROA generates GEPs for example involving padding bytes as it slices an
alloca.

My fix disables this folding if the element type is a vector type.  I
believe that this is the only way we can end up with padding.  (We have
no access to DataLayout so I am not sure if there is actual robust way
of actually checking the presence of padding.)

Reviewers: majnemer

Subscribers: llvm-commits, Gerolf

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

llvm-svn: 270826
2016-05-26 07:08:05 +00:00
Michael Zuckerman 6f08cebf36 [Clang][AVX512][BUILTIN] Adding intrinsics for set1
Differential Revision: http://reviews.llvm.org/D20562

llvm-svn: 270825
2016-05-26 06:54:52 +00:00
David Majnemer 8cce333abd [MergedLoadStoreMotion] Small cleanup
No functional change is intended.

llvm-svn: 270824
2016-05-26 05:43:12 +00:00
Peter Collingbourne b9aa1f4a03 MemorySSA: Revert r269678 and r268068; replace with special casing in MemorySSA.
It turns out that too many passes are relying on alias analysis results
for control dependencies. Until we fix that by introducing a more accurate
modelling of control dependencies, special case assume in MemorySSA instead.

Also introduce tests to ensure we don't regress the FunctionAttrs or LICM
passes.

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

llvm-svn: 270823
2016-05-26 04:58:46 +00:00
Alexey Bataev 3bfedcffe0 [OPENMP] Set '_OPENMP' macro to '201511' value to reflect support for
OpenMP 4.5.

According to OpenMP 4.5 the _OPENMP macro name is defined to have the decimal value yyyymm where yyyy and mm are the year and month designations of the version of the OpenMP API that the implementation supports. Clang supports OpenMP 4.5 so updated value of _OPENMP macro to 201511.

llvm-svn: 270822
2016-05-26 04:56:05 +00:00
Hal Finkel 91e19a3de4 Add an assembly __kmp_invoke_microtask for ppc64[le]
Clang no longer restricts itself to generating microtasks with a small number
of arguments, and so an assembly implementation is required to prevent hitting
the parameter limit present in the C implementation. This adds an
implementation for ppc64[le].

llvm-svn: 270821
2016-05-26 04:48:14 +00:00