Commit Graph

225151 Commits

Author SHA1 Message Date
Nico Weber 1f8bad5198 clang-cl: Add a test for the interaction of /Yc and /showIncludes.
We almost get this right, but not completely (see FIXME).  It looks like /FI
headers generally aren't included in /showIncludes yet, but they should be.
But it seems good to have test coverage for the bits that already work.

llvm-svn: 263344
2016-03-12 19:55:59 +00:00
Sanjay Patel 5658b58936 remove unnecessary cast; NFC
llvm-svn: 263343
2016-03-12 18:17:41 +00:00
Sanjay Patel 2e0027706a fix formatting; NFC
llvm-svn: 263342
2016-03-12 18:05:53 +00:00
Sanjay Patel 5781d840dd use range loops; NFCI
llvm-svn: 263341
2016-03-12 16:52:17 +00:00
Sanjay Patel c4acbae63f [x86, InstCombine] delete x86 SSE2 masked store with zero mask
This follows up on the related AVX instruction transforms, but this
one is too strange to do anything more with. Intel's behavioral
description of this instruction in its Software Developer's Manual
is tragi-comic.

llvm-svn: 263340
2016-03-12 15:16:59 +00:00
Simon Atanasyan 92a32559fd [ELF][MIPS] Put type of symbol (local/global) to the findMipsPairedReloc and call it from the single place. NFC.
llvm-svn: 263339
2016-03-12 11:58:15 +00:00
Nemanja Ivanovic bd56e4e25a Fix for PR 26378
This patch corresponds to review:
http://reviews.llvm.org/D17712

We were not clearing the TOC vector in PPCAsmPrinter when initializing it. This
caused duplicate definition asserts when the pass is reused on the module
(i.e. with -compile-twice or in JIT contexts).

llvm-svn: 263338
2016-03-12 10:23:07 +00:00
George Rimar 777f96304e Recommit of r263252, [ELF] - Change all messages to lowercase to be consistent.
which was reverted because included
unrelative changes by mistake.

Original commit message:

[ELF] - Change all messages to lowercase to be consistent.

That is directly opposite to http://reviews.llvm.org/D18045,
which was reverted.

This patch changes all messages to start from lowercase letter if
they were not before.

That is done to be consistent with clang.

Differential revision: http://reviews.llvm.org/D18085

llvm-svn: 263337
2016-03-12 08:31:34 +00:00
Rui Ueyama 02aa766897 Update the documents of the new LLD.
This patch merges the documents for ELF and COFF into one
and puts it into docs directory.

llvm-svn: 263336
2016-03-12 06:06:40 +00:00
Teresa Johnson 8fc20ade65 Use default destructor and remove unnecessary virtual destructor
Only the virtual destructor in the base class is needed, and can use the
default.

llvm-svn: 263335
2016-03-12 05:38:22 +00:00
Jim Ingham 190636bcc1 Let's not convert from UINT32_MAX to the std::numeric_limits version.
llvm-svn: 263333
2016-03-12 03:33:36 +00:00
Kostya Serebryany 241fb61fdb [libFuzzer] refresh docs more
llvm-svn: 263332
2016-03-12 03:23:02 +00:00
Kostya Serebryany 7ead926582 [libFuzzer] refresh docs more
llvm-svn: 263331
2016-03-12 03:11:27 +00:00
Kostya Serebryany abca88e481 [libFuzzer] refresh docs more
llvm-svn: 263330
2016-03-12 03:05:37 +00:00
Chandler Carruth 4a543cc7a1 [lit] Hack lit to allow a test suite to request that it is run "early".
This lets us for example start running the unit test suite early. For
'check-llvm' on my machine, this drops the tim e from 44s to 32s!!!!!

It's pretty ugly. I barely know how to write Python, so feel free to
just tell me how I should write it instead. =D Thanks to Filipe and
others for help.

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

llvm-svn: 263329
2016-03-12 03:03:31 +00:00
Kostya Serebryany d11dc176b1 [libFuzzer] refresh docs
llvm-svn: 263328
2016-03-12 02:56:25 +00:00
Sanjoy Das ecf96c9516 Make gc relocates more strongly typed; NFC
Don't use a `Value *` where we can use a stronger `GCRelocateInst *`
type.

llvm-svn: 263327
2016-03-12 02:54:27 +00:00
Jim Ingham 8d94ba0fb1 This change introduces a "ExpressionExecutionThread" to the ThreadList.
Turns out that most of the code that runs expressions (e.g. the ObjC runtime grubber) on
behalf of the expression parser was using the currently selected thread.  But sometimes,
e.g. when we are evaluating breakpoint conditions/commands, we don't select the thread
we're running on, we instead set the context for the interpreter, and explicitly pass
that to other callers.  That wasn't getting communicated to these utility expressions, so
they would run on some other thread instead, and that could cause a variety of subtle and
hard to reproduce problems.  

I also went through the commands and cleaned up the use of GetSelectedThread.  All those
uses should have been trying the thread in the m_exe_ctx belonging to the command object
first.  It would actually have been pretty hard to get misbehavior in these cases, but for
correctness sake it is good to make this usage consistent.

<rdar://problem/24978569>

llvm-svn: 263326
2016-03-12 02:45:34 +00:00
Quentin Colombet cf9732b417 [X86] Make sure we do not clobber RBX with cmpxchg when used as a base pointer.
cmpxchg[8|16]b uses RBX as one of its argument.
In other words, using this instruction clobbers RBX as it is defined to hold one
the input. When the backend uses dynamically allocated stack, RBX is used as a
reserved register for the base pointer. 

Reserved registers have special semantic that only the target understands and
enforces, because of that, the register allocator don’t use them, but also,
don’t try to make sure they are used properly (remember it does not know how
they are supposed to be used).

Therefore, when RBX is used as a reserved register but defined by something that
is not compatible with that use, the register allocator will not fix the
surrounding code to make sure it gets saved and restored properly around the
broken code. This is the responsibility of the target to do the right thing with
its reserved register.

To fix that, when the base pointer needs to be preserved, we use a different
pseudo instruction for cmpxchg that save rbx.
That pseudo takes two more arguments than the regular instruction:
- One is the value to be copied into RBX to set the proper value for the
  comparison.
- The other is the virtual register holding the save of the value of RBX as the
  base pointer. This saving is done as part of isel (i.e., we emit a copy from
  rbx).

cmpxchg_save_rbx <regular cmpxchg args>, input_for_rbx_reg, save_of_rbx_as_bp

This gets expanded into:
rbx = copy input_for_rbx_reg
cmpxchg <regular cmpxchg args>
rbx = save_of_rbx_as_bp

Note: The actual modeling of the pseudo is a bit more complicated to make sure
the interferes that appears after the pseudo gets expanded are properly modeled
before that expansion.

This fixes PR26883.

llvm-svn: 263325
2016-03-12 02:25:27 +00:00
Nico Weber 39a02a7bed Fix bad regression from r263077 when building with MSVC.
That change did:

  -#if defined(__BIG_ENDIAN__)
  +#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__

If __BYTE_ORDER__ and __ORDER_BIG_ENDIAN__ aren't defined, like
they are with MSVC, this condition is true (0 == 0).

Fixes PR26919.

llvm-svn: 263324
2016-03-12 01:57:31 +00:00
Kostya Serebryany 64d24578d8 [libFuzzer] try to use max_len based on the items of the corpus instead of blindly defaulting to 64 bytes.
llvm-svn: 263323
2016-03-12 01:57:04 +00:00
David Blaikie a0d9990c59 Revert "Update Polly for the removal of PreserveNames from IRBuilder stuff"
The original r263258 was reverted in r263321 due to issues with Release
testing.

This reverts commit r263296.

llvm-svn: 263322
2016-03-12 01:53:28 +00:00
Eric Christopher 35abd051c0 Temporarily revert:
commit ae14bf6488e8441f0f6d74f00455555f6f3943ac
Author: Mehdi Amini <mehdi.amini@apple.com>
Date:   Fri Mar 11 17:15:50 2016 +0000

    Remove PreserveNames template parameter from IRBuilder

    Summary:
    Following r263086, we are now relying on a flag on the Context to
    discard Value names in release builds.

    Reviewers: chandlerc

    Subscribers: mzolotukhin, llvm-commits

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

    From: Mehdi Amini <mehdi.amini@apple.com>

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263258
    91177308-0d34-0410-b5e6-96231b3b80d8

until we can figure out what to do about clang and Release build testing.

This reverts commit 263258.

llvm-svn: 263321
2016-03-12 01:47:22 +00:00
Eric Christopher 02e3dd4b2e Temporarily revert these patches:
commit 60d9845f6a037122d9be9a6d92d4de617ef45b04
Author: Mehdi Amini <mehdi.amini@apple.com>
Date:   Fri Mar 11 18:48:02 2016 +0000

    Fix clang crash: when CodeGenAction is initialized without a
    context, use the member and not the parameter

    From: Mehdi Amini <mehdi.amini@apple.com>

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263273
    91177308-0d34-0410-b5e6-96231b3b80d8

commit af7ce3bf04a75ad5124b457b805df26006bd215b
Author: Mehdi Amini <mehdi.amini@apple.com>
Date:   Fri Mar 11 17:32:58 2016 +0000

    Fix build: use -> with pointers and not .

    Silly typo.

    From: Mehdi Amini <mehdi.amini@apple.com>

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263267
    91177308-0d34-0410-b5e6-96231b3b80d8

commit d0eea119192814954e7368c77d0dc5a9eeec1fbb
Author: Mehdi Amini <mehdi.amini@apple.com>
Date:   Fri Mar 11 17:15:44 2016 +0000

    Remove compile time PreserveName switch based on NDEBUG

    Summary:
    Following r263086, we are now relying on a flag on the Context to
    discard Value names in release builds.

    Reviewers: chandlerc

    Subscribers: cfe-commits

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

    From: Mehdi Amini <mehdi.amini@apple.com>

    git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263257
    91177308-0d34-0410-b5e6-96231b3b80d8

until we can fix the Release builds.

This reverts commits 263257, 263267, 263273

llvm-svn: 263320
2016-03-12 01:47:11 +00:00
Eric Christopher b3965fef56 Add Lanai.def to the module map.
llvm-svn: 263319
2016-03-12 01:31:53 +00:00
Michael Zolotukhin 789ac4531c [LoopUnroll] Convert some existing tests to unit-tests.
Summary: As we now have unit-tests for UnrollAnalyzer, we can convert some existing tests to this format. It should make the tests more robust.

Reviewers: chandlerc, sanjoy

Subscribers: llvm-commits

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

llvm-svn: 263318
2016-03-12 01:28:56 +00:00
Teresa Johnson 071509c22a Fix a memory leak due to missing virtual destructors
Caused a couple of sanitizer bot failures in ThinLTO tests due to
r263275.

llvm-svn: 263317
2016-03-12 01:23:57 +00:00
Samuel Antao 11e4c539f4 Initialize two variables in kmp_tasking.
Summary:
Two initialized local variables are causing clang to produce warnings:

```
./src/projects/openmp/runtime/src/kmp_tasking.c:3019:5: error: variable 'num_tasks' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
    default:
    ^~~~~~~
./src/projects/openmp/runtime/src/kmp_tasking.c:3027:21: note: uninitialized use occurs here
    for( i = 0; i < num_tasks; ++i ) {
                    ^~~~~~~~~
./src/projects/openmp/runtime/src/kmp_tasking.c:2968:28: note: initialize the variable 'num_tasks' to silence this warning
    kmp_uint64 i, num_tasks, extras;
                           ^
                            = 0
./src/projects/openmp/runtime/src/kmp_tasking.c:3019:5: error: variable 'extras' is used uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized]
    default:
    ^~~~~~~
./src/projects/openmp/runtime/src/kmp_tasking.c:3022:52: note: uninitialized use occurs here
    KMP_DEBUG_ASSERT(tc == num_tasks * grainsize + extras);
                                                   ^~~~~~
./src/projects/openmp/runtime/src/kmp_debug.h:62:60: note: expanded from macro 'KMP_DEBUG_ASSERT'
        #define KMP_DEBUG_ASSERT( cond )       KMP_ASSERT( cond )
                                                           ^
./src/projects/openmp/runtime/src/kmp_debug.h:60:51: note: expanded from macro 'KMP_ASSERT'
        #define KMP_ASSERT( cond )             ( (cond) ? 0 : __kmp_debug_assert( #cond, __FILE__, __LINE__ ) )
                                                  ^
./src/projects/openmp/runtime/src/kmp_tasking.c:2968:36: note: initialize the variable 'extras' to silence this warning
    kmp_uint64 i, num_tasks, extras;
                                   ^
                                    = 0
2 errors generated.
```

This patch initializes these two variables.

Reviewers: tlwilmar, jlpeyton

Subscribers: tlwilmar, openmp-commits

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

llvm-svn: 263316
2016-03-12 00:55:17 +00:00
Wilfred Hughes 73a0dac96d Updating source languages entry in FAQ.
Dragonegg is no longer actively maintained[1], and the Pypy team is not
actively pursuing LLVM[2].

1: http://reviews.llvm.org/D9331
2: http://rpython.readthedocs.org/en/latest/faq.html#could-we-use-llvm
llvm-svn: 263314
2016-03-12 00:43:26 +00:00
Eugene Zelenko 0e28a19683 Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.
llvm-svn: 263312
2016-03-12 00:31:13 +00:00
Nico Weber 4b4e75886c Disable a test that started failing recently; see PR26919.
llvm-svn: 263311
2016-03-12 00:23:33 +00:00
Evgeniy Stepanov 1bc0e399ee Disable CFI checks in std::addressof.
std::addressof may be used on a storage of an object before the start
of its lifetime (see std::allocate_shared for example). CFI flags the
C-style cast as invalid in that case.

llvm-svn: 263310
2016-03-11 23:50:57 +00:00
Chris Matthews 7d0ec128c9 Fix the docs I broke
llvm-svn: 263309
2016-03-11 23:31:02 +00:00
Mike Aizatsky 037fee594b [sancov] using md5 for anchors in attempt to reduce file size.
Differential Revision: http://reviews.llvm.org/D18102

llvm-svn: 263308
2016-03-11 23:28:28 +00:00
Mike Aizatsky 22973fd00e Don't crash sancov if file is unreadable.
Summary:
Caller can provides the list of .so files where some files are
unreadable (e.g linux-vdso.so.1). It's more convenient to handler this in
sancov with warning then making all callers to check files.

Reviewers: aizatsky

Subscribers: llvm-commits

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

llvm-svn: 263307
2016-03-11 23:26:41 +00:00
Chris Matthews 5c605d7943 Extend test-suite docs to describe how to run test-suite with cmake+lit
llvm-svn: 263305
2016-03-11 22:33:36 +00:00
Mehdi Amini 33661070c5 Minor cleanup and documentation to IRMover (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263304
2016-03-11 22:19:06 +00:00
Simon Pilgrim 33d57c7547 [X86][SSE] Simplify vector LOAD + EXTEND on pre-SSE41 hardware
Improve vector extension of vectors on hardware without dedicated VSEXT/VZEXT instructions.

We already convert these to SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG but can further improve this by using the legalizer instead of prematurely splitting into legal vectors in the combine as this only properly helps for lowering to VSEXT/VZEXT.

Removes a lot of unnecessary any_extend + mask pattern - (Fix for PR25718).

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

llvm-svn: 263303
2016-03-11 22:18:05 +00:00
Daniel Jasper be50836514 Make functions in altivec.h be __inline__. As they are all also marked
__always_inline__, this has likely been meant from the start.

Review: http://reviews.llvm.org/D18015
llvm-svn: 263302
2016-03-11 22:13:28 +00:00
Ahmed Bougacha 171f7b9986 [AArch64] Don't blindly lower f16/f128 FCCMPs.
Instead, extend f16 (like we do when lowering a standalone SETCC),
and let f128 be legalized to the RT calls.

Fixes PR26803.

llvm-svn: 263301
2016-03-11 22:02:58 +00:00
Eugene Zelenko 8918372dd3 Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.
llvm-svn: 263300
2016-03-11 21:55:47 +00:00
Bob Wilson cf2cf0dba4 Add fix-it for format-security warnings.
llvm-svn: 263299
2016-03-11 21:55:37 +00:00
Teresa Johnson f2bc850ee8 Initialize CalleeInfo to fix bot after r263275
Hopefully will fix garbage output in
http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/6901

llvm-svn: 263297
2016-03-11 21:34:45 +00:00
David Blaikie e16dc34e97 Update Polly for the removal of PreserveNames from IRBuilder stuff
llvm-svn: 263296
2016-03-11 21:33:58 +00:00
Jordan Rose 31cf7d49db Fix ObjCMethodDecl::findPropertyDecl for class properties.
This affects code completion and a few other things; hopefully the code completion
test is sufficient to catch regressions.

llvm-svn: 263295
2016-03-11 21:14:40 +00:00
Reid Kleckner 60e53cdcb7 Fix order of arguments to fputs
This time actually tested on Linux, where the test is not XFAILed.

llvm-svn: 263294
2016-03-11 21:07:48 +00:00
Reid Kleckner 3b07caef66 Switch to fputs stderr to try to fix output buffering issues
llvm-svn: 263293
2016-03-11 20:54:14 +00:00
Rui Ueyama 634ddf0bec ELF: Implement --build-id.
This patch implements --build-id. After the linker creates an output file
in the memory buffer, it computes the FNV1 hash of the resulting file
and set the hash to the .note section as a build-id.

GNU ld and gold have the same feature, but their default choice of the
hash function is different. Their default is SHA1.

We made a deliberate choice to not use a secure hash function for the
sake of performance. Computing a secure hash is slow -- for example,
MD5 throughput is usually 400 MB/s or so. SHA1 is slower than that.

As a result, if you pass --build-id to gold, then the linker becomes about
10% slower than that without the option. We observed a similar degradation
in an experimental implementation of build-id for LLD. On the other hand,
we observed only 1-2% performance degradation with the FNV hash.

Since build-id is not for digital certificate or anything, we think that
a very small probability of collision is acceptable.

We considered using other signals such as using input file timestamps as
inputs to a secure hash function. But such signals would have an issue
with build reproducibility (if you build a binary from the same source
tree using the same toolchain, the build id should become the same.)

GNU linkers accepts --build-id=<style> option where style is one of
"MD5", "SHA1", or an arbitrary hex string. That option is out of scope
of this patch.

http://reviews.llvm.org/D18091

llvm-svn: 263292
2016-03-11 20:51:53 +00:00
Jonathan Peyton 495e153ff9 [STATS] change TASK_execution name to OMP_task
llvm-svn: 263291
2016-03-11 20:23:05 +00:00
Jonathan Peyton e2554af857 [STATS] Add a total statistics count
This change removes synthesized stats and instead has all timers print out a
total which is the aggregate statistics across threads. This is displayed as
"Total_foo" at the end of program. The stats_flags_e::synthesized flag is
removed and the printStats() function is split into two separate functions:
printTimerStats() which can display the aggregate total and printCounterStats().

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

llvm-svn: 263290
2016-03-11 20:20:49 +00:00