Commit Graph

216059 Commits

Author SHA1 Message Date
Aaron Ballman f71c9661df Test to ensure the function does not have an unresolved or unevaluated exception specification before testing whether the function throws or not. Fixes PR25574.
llvm-svn: 253598
2015-11-19 20:45:35 +00:00
Dehao Chen 014fb55711 Fix the debug build breakage that getDiscriminator is called by mistake.
llvm-svn: 253597
2015-11-19 20:29:27 +00:00
Michael Zolotukhin 6c11c04db3 Revert r253253 and r253126: "Don't recompute LCSSA after loop-unrolling when possible."
The change exposed a bug in IndVarSimplify (PR25578), which led to a
failure (PR25538). When the bug is fixed, this patch can be reapplied.

The tests are kept in tree, as they're useful anyway, and will not break
with this revert.

llvm-svn: 253596
2015-11-19 20:28:32 +00:00
Dehao Chen b85fc5c799 Update clang tests to accomendate discriminator changes.
Summary: The discriminator change in http://reviews.llvm.org/D14738 will fail these clang tests. Update the test to accomendate the discriminator change.

Reviewers: dblaikie, davidxl, dnovillo

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

llvm-svn: 253595
2015-11-19 19:53:16 +00:00
Dehao Chen 23e2278e27 Reimplement discriminator assignment algorithm.
Summary: The new algorithm is more efficient (O(n), n is number of basic blocks). And it is guaranteed to cover all cases of multiple BB mapped to same line.

Reviewers: dblaikie, davidxl, dnovillo

Subscribers: llvm-commits

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

llvm-svn: 253594
2015-11-19 19:53:05 +00:00
Marshall Clow bfb3f2bf7d Fix some mistakes in the <utility> and <tuple> synopses. No functional change. Thannks to K-ballo for the patch
llvm-svn: 253593
2015-11-19 19:45:29 +00:00
Marshall Clow 5fcc8169ed Fix some mistakes in the <array> synopsis. No functional change. Thanks to K-ballo for the patch
llvm-svn: 253592
2015-11-19 19:41:04 +00:00
Davide Italiano 193c4edffb [AddressSanitizer] assert(false) -> llvm_unreachable and remove return.
llvm-svn: 253591
2015-11-19 19:28:23 +00:00
Faisal Vali 48401eb18a Change the expression evaluation context from Unevaluated to ConstantEvaluated while substituting into non-type template argument defaults.
Also address a typo from a prior patch that performed a similar fix during Parsing of default non-type template arguments.  I left the RAII ExpressionEvaluationContext variable Name as Unevaluated though we had switched the context to ConstantEvaluated.

There should be no functionality change here - since when expression evaluation context is popped off, for the most part these two contexts currently behave similarly in regards to lambda diagnostics and odr-use tracking.

Like its parsing counterpart, this patch presages the advent of constexpr lambda patches...

llvm-svn: 253590
2015-11-19 19:20:17 +00:00
Zachary Turner 7aac24805b Pass -fms-compatibility-version when building test inferiors.
-fms-compatibility-version defaults to VS 2013.  When using
VS 2015, this will lead to compilation failures of the test
inferiors in the C++ standard library for language conformance
reasons.

The fix here is to simply pass -fms-compatibility-version=19.0 when
we detect that a VS 2015 compiler is present.  Even though we're
actually using clang to do the compilation, clang uses this same
detection algorithm to determine the location of the standard
library.  So this check is tantanmount to saying "If clang is going
to find MSVC 2015's standard library, then pass 19.0 for
-fms-compatibility-version.

llvm-svn: 253589
2015-11-19 19:10:54 +00:00
Igor Kudrin 4bc5ad4c37 [ELF] Prevent SEGFAULT in case of conflict with an internally defined symbol.
Differential Revision: http://reviews.llvm.org/D14832

llvm-svn: 253588
2015-11-19 19:08:45 +00:00
Jun Bum Lim c12c2790e1 [AArch64] Refactoring aarch64-ldst-opt. NCF.
Summary :
 * Rename isSmallTypeLdMerge() to isNarrowLoad().
 * Rename NumSmallTypeMerged to NumNarrowTypePromoted.
 * Use Subtarget defined as a member variable.

llvm-svn: 253587
2015-11-19 18:41:27 +00:00
Chad Rosier 3ecc8d8d83 [LIR] Fix 80-column from previous commit.
llvm-svn: 253586
2015-11-19 18:25:11 +00:00
Chad Rosier fddc01f393 [LIR] Sink checks into function to enable future refactoring. NFC.
The purpose of this change is help delineate the memset and memcpy
optimizations with the overall goal of resolving PR25520.

llvm-svn: 253585
2015-11-19 18:22:21 +00:00
James Molloy 1d695a09dd [GlobalOpt] Localize some globals that have non-instruction users
We currently bail out of global localization if the global has non-instruction users. However, often these can be simple bitcasts or constant-GEPs, which we can easily turn into instructions before localizing. Be a bit more aggressive.

llvm-svn: 253584
2015-11-19 18:04:33 +00:00
Kuba Brecka c7157bfd55 [tsan] Replace new/delete with a local variable in ThreadSpecificDtors unit test
On OS X, this unit test (ThreadSpecificDtors) fails, because the new and delete operators actually call the overridden operators, which end up using TLVs and crash. Since C++'s new and delete is not important in this test, let's just replace them with a local variable. This fixes the test on OS X.

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

llvm-svn: 253583
2015-11-19 17:50:07 +00:00
Hans Wennborg 2763dc29a5 clang-cl: Make /W4 imply -Wall -Wextra (PR25563)
llvm-svn: 253582
2015-11-19 17:49:59 +00:00
Sanjay Patel 2fe7728233 update comment and error message; NFC
'notail' was added in:
http://reviews.llvm.org/rL252368

llvm-svn: 253580
2015-11-19 17:35:55 +00:00
Kuba Brecka 153594694b [tsan] Implement "%env_tsan_opts" substitution to inherit default TSAN_OPTIONS
We already have %env_asan_opts for ASan, let's implement the same for TSan.

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

llvm-svn: 253579
2015-11-19 17:28:46 +00:00
Chad Rosier 85c21f0a6e [LIR] Use the more appropriate method. NFC.
llvm-svn: 253578
2015-11-19 17:27:28 +00:00
Jun Bum Lim 4c35ccac91 [AArch64]Extend merging narrow loads into a wider load
This change extends r251438 to handle more narrow load promotions
including byte type, unscaled, and signed. For example, this change will
convert :
  ldursh w1, [x0, #-2]
  ldurh  w2, [x0, #-4]
into
  ldur  w2, [x0, #-4]
  asr   w1, w2, #16
  and   w2, w2, #0xffff

llvm-svn: 253577
2015-11-19 17:21:41 +00:00
Alexey Samsonov 89d7ff5de6 [LSan] Fix tests with some libstdc++ implementations.
Summary:
Newer libstdc++ has global pool, which is filled with objects
allocated during libstdc++ initialization, and never released.
Using use_globals=0 in the lit tests results in these objects
being treated as leaks.

Fix this by porting several tests to plain C, and introducing
a simple sanity test case for __lsan::ScopedDisabler.

Reviewers: kcc, ygribov

Subscribers: llvm-commits

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

llvm-svn: 253576
2015-11-19 17:18:02 +00:00
Todd Fiala f6508db485 Revert "prepare_bindings.py: enable static bindings"
This reverts commit 40f789f2dc6bb80fd25a33f91e452d081ed9d0ee.

llvm-svn: 253575
2015-11-19 16:56:12 +00:00
Sanjay Patel ae3680cbcd this new test file was accidentally left out of r253573
llvm-svn: 253574
2015-11-19 16:39:00 +00:00
Sanjay Patel 4699b8ab6a [CGP] despeculate expensive cttz/ctlz intrinsics
This is another step towards allowing SimplifyCFG to speculate harder, but then have 
CGP clean things up if the target doesn't like it.

Previous patches in this series:
http://reviews.llvm.org/D12882
http://reviews.llvm.org/D13297

D13297 should catch most expensive ops, but speculation of cttz/ctlz requires special
handling because of weirdness in the intrinsic definition for handling a zero input 
(that definition can probably be blamed on x86).

For example, if we have the usual speculated-by-select expensive op pattern like this:

  %tobool = icmp eq i64 %A, 0
  %0 = tail call i64 @llvm.cttz.i64(i64 %A, i1 true)   ; is_zero_undef == true
  %cond = select i1 %tobool, i64 64, i64 %0
  ret i64 %cond

There's an instcombine that will turn it into:

  %0 = tail call i64 @llvm.cttz.i64(i64 %A, i1 false)   ; is_zero_undef == false

This CGP patch is looking for that case and despeculating it back into:

  entry:
    %tobool = icmp eq i64 %A, 0
    br i1 %tobool, label %cond.end, label %cond.true

  cond.true:
    %0 = tail call i64 @llvm.cttz.i64(i64 %A, i1 true)    ; is_zero_undef == true
    br label %cond.end

  cond.end:
    %cond = phi i64 [ %0, %cond.true ], [ 64, %entry ]
    ret i64 %cond

This unfortunately may lead to poorer codegen (see the changes in the existing x86 test), 
but if we increase speculation in SimplifyCFG (the next step in this patch series), then
we should avoid those kinds of cases in the first place.

The need for this patch was originally mentioned here:
http://reviews.llvm.org/D7506
with follow-up here:
http://reviews.llvm.org/D7554

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

llvm-svn: 253573
2015-11-19 16:37:10 +00:00
Hans Wennborg dcc2500452 X86: More efficient legalization of wide integer compares
In particular, this makes the code for 64-bit compares on 32-bit targets
much more efficient.

Example:

  define i32 @test_slt(i64 %a, i64 %b) {
  entry:
    %cmp = icmp slt i64 %a, %b
    br i1 %cmp, label %bb1, label %bb2
  bb1:
    ret i32 1
  bb2:
    ret i32 2
  }

Before this patch:

  test_slt:
          movl    4(%esp), %eax
          movl    8(%esp), %ecx
          cmpl    12(%esp), %eax
          setae   %al
          cmpl    16(%esp), %ecx
          setge   %cl
          je      .LBB2_2
          movb    %cl, %al
  .LBB2_2:
          testb   %al, %al
          jne     .LBB2_4
          movl    $1, %eax
          retl
  .LBB2_4:
          movl    $2, %eax
          retl

After this patch:

  test_slt:
          movl    4(%esp), %eax
          movl    8(%esp), %ecx
          cmpl    12(%esp), %eax
          sbbl    16(%esp), %ecx
          jge     .LBB1_2
          movl    $1, %eax
          retl
  .LBB1_2:
          movl    $2, %eax
          retl

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

llvm-svn: 253572
2015-11-19 16:35:08 +00:00
NAKAMURA Takumi 768579c409 TargetParser.cpp: Fixup -- StringRef::startswith() is better here. NFC.
llvm-svn: 253570
2015-11-19 15:42:52 +00:00
Mehdi Amini 0027c1d21b Remove unused function parameter (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 253569
2015-11-19 15:42:34 +00:00
Diego Novillo ef548d2918 SamplePGO - Sort samples by source location when emitting as text.
When dumping function samples or writing them out as text format, it
helps if the samples are emitted sorted by source location. The sorting
of the maps is a bit slow, so we only do it on demand.

llvm-svn: 253568
2015-11-19 15:33:08 +00:00
Zoran Jovanovic 307f80eab1 [mips] Add tests for ROL and ROR macros expansion
Author: obucina
llvm-svn: 253567
2015-11-19 15:04:31 +00:00
NAKAMURA Takumi b6b254582f llvm/lib/Support/TargetParser.cpp: Rework llvm::ARM::getArchExtFeature() to avoid abuse of Twine in r253470.
llvm-svn: 253566
2015-11-19 15:03:11 +00:00
Chad Rosier 33efdf810f [LV] Add a helper function, isReductionVariable. NFC.
llvm-svn: 253565
2015-11-19 14:19:06 +00:00
Zoran Jovanovic 00f998b440 [mips] Expansion of ROL and ROR macros
Author: obucina

Reviewers: dsanders

Subscribers: dsanders, llvm-commits

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

llvm-svn: 253564
2015-11-19 14:15:03 +00:00
Elena Demikhovsky 7c2c9fd243 AVX-512: Fixed COPY_TO_REGCLASS for mask registers
Copying one mask register to another under BW should be done with kmovq instruction, otherwise we can loose some bits.
Copying 8 bits under DQ may be done with kmovb.

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

llvm-svn: 253563
2015-11-19 13:13:00 +00:00
Artyom Skrobov 444d544e9d Removing specific target from the generic test
llvm-svn: 253562
2015-11-19 12:24:47 +00:00
Simon Pilgrim 846b64e17a [X86][AVX] Fix lowering of X86ISD::VZEXT_MOVL for 128-bit -> 256-bit extension
The lowering patterns for X86ISD::VZEXT_MOVL for 128-bit to 256-bit vectors were just copying the lower xmm instead of actually masking off the first scalar using a blend.

Fix for PR25320.

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

llvm-svn: 253561
2015-11-19 12:18:37 +00:00
Kuba Brecka f503d51e5b [tsan] For OS X thread finalization, remove g_thread_finalize_key in favor of libpthread hooks
On OS X, the thread finalization is fragile due to thread-local variables destruction order. I've seen cases where the we destroy the ThreadState too early and subsequent thread-local values' destructors call interceptors again. Let's replace the TLV-based thread finalization method with libpthread hooks. The notification PTHREAD_INTROSPECTION_THREAD_TERMINATE is called *after* all TLVs have been destroyed.

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

llvm-svn: 253560
2015-11-19 12:06:20 +00:00
Kuba Brecka 9eb6df9f1e [tsan] Recognize frames coming from "libclang_rt.tsan_*" module as internal
On OS X, we build a dylib of the TSan runtime, which doesn't necessarily need to contain debugging symbols (and file and line information), so llvm-symbolizer might not be able to find file names for TSan internal frames.  FrameIsInternal currently only considers filenames, but we should simply treat all frames within `libclang_rt.tsan_osx_dynamic.dylib` as internal.  This patch treats all modules starting with `libclang_rt.tsan_` as internal, because there may be more runtimes for other platforms in the future.

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

llvm-svn: 253559
2015-11-19 12:03:48 +00:00
Kuba Brecka 6e90edf803 [tsan] Mark tests that need pthread barriers with "UNSUPPORTED: darwin"
Several testcases need pthread barriers (e.g. all bench_*.cc which use test/tsan/bench.h) which are not available on OS X. Let's mark them with "UNSUPPORTED: darwin".

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

llvm-svn: 253558
2015-11-19 12:02:02 +00:00
Alexey Bataev b7b82bf33e Alternative to long nops for X86 CPUs, by Andrey Turetsky
Make X86AsmBackend generate smarter nops instead of a bunch of 0x90 for code alignment for CPUs which don't support long nop instructions.
Differential Revision: http://reviews.llvm.org/D14178

llvm-svn: 253557
2015-11-19 11:44:35 +00:00
Dan Liew 26da45c2bb [lit] Fix bug when using Python3 where a failing test would not show
the script when running a ShTest with an external or internal shell.

This bug is caused by use of the ``map`` function in Python 3 which
returns an iterable (rather than a list in Python 2). After the iterable
is exhausted it won't return any more output and consequently when
``_runShTest()`` tries to access the ``script`` which has already been
iterated over it is empty. Converting to a list immediatley after
calling ``map()`` fixes this.

This fixes the ``tests/shtest-format.py`` test when running under
Python3 which was previously failing.

llvm-svn: 253556
2015-11-19 11:35:42 +00:00
Sagar Thakur 9bf1528573 [LLDB][MIPS] Fix lldbplatformutil.py Failure
Patch by Nitesh Jain

Summary: This patch check whether first register is readable.

Subscribers: lldb-commits, mohit.bhakkad, sagar, bhushan
Reviewers: clayborg, ovyalov, jaydeep
Differential: http://reviews.llvm.org/D14635
llvm-svn: 253555
2015-11-19 11:01:21 +00:00
NAKAMURA Takumi 8153a24a84 clangFrontend: [PR25565] Quick fix for dependencies on Attributes.inc.
FIXME: Attributes.inc may be an independent target.

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

llvm-svn: 253554
2015-11-19 10:59:48 +00:00
NAKAMURA Takumi b13e63ce08 gold-plugin.cpp: Fix diagnosticHandler corresponding to r253540.
llvm-svn: 253553
2015-11-19 10:43:44 +00:00
Kuba Brecka efd92b3d16 [tsan] Handle dispatch_once on OS X
Reimplement dispatch_once in an interceptor to solve these issues that may produce false positives with TSan on OS X:

1) there is a racy load inside an inlined part of dispatch_once,
2) the fast path in dispatch_once doesn't perform an acquire load, so we don't properly synchronize the initialization and subsequent uses of whatever is initialized,
3) dispatch_once is already used in a lot of already-compiled code, so TSan doesn't see the inlined fast-path.

This patch uses a trick to avoid ever taking the fast path (by never storing ~0 into the predicate), which means the interceptor will always be called even from already-compiled code. Within the interceptor, our own atomic reads and writes are not written into shadow cells, so the race in the inlined part is not reported (because the accesses are only loads).

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

llvm-svn: 253552
2015-11-19 10:35:35 +00:00
Alexey Bataev f278eb10b7 PR10235: support for vector mode attributes + warning, by Dmitry Polukhin.
Add support for vector mode attributes like "attribute((mode(V4SF)))". Also add warning about deprecated vector modes like GCC does.
Differential Revision: http://reviews.llvm.org/D14744

llvm-svn: 253551
2015-11-19 10:13:11 +00:00
James Molloy 0ecdbe7d6b [FunctionAttrs] Provide a mechanism for adding function attributes from the command line
This provides a way to force a function to have certain attributes from the command line. This can be useful when debugging or doing workload exploration, where manually editing IR is tedious or not possible (due to build systems etc).

The syntax is -force-attribute=function_name:attribute_name

All function attributes are parsed except alignstack as it requires an argument.

llvm-svn: 253550
2015-11-19 08:49:57 +00:00
Yury Gribov dd679b334b [asan] Enable halt_on_error tests on ARM targets.
Differential Revision: http://reviews.llvm.org/D14751

llvm-svn: 253549
2015-11-19 08:36:26 +00:00
Igor Breger 1f78296869 AVX512: Implemented encoding, intrinsics and DAG lowering for VMOVDDUP instructions.
Differential Revision: http://reviews.llvm.org/D14702

llvm-svn: 253548
2015-11-19 08:26:56 +00:00
Igor Breger 4424aaa28e AVX512: Implemented encoding for the vmovss.s and vmovsd.s instructions.
Differential Revision: http://reviews.llvm.org/D14771

llvm-svn: 253547
2015-11-19 07:58:33 +00:00