129230 Commits

Author SHA1 Message Date
Mehdi Amini
e6cda0e9bc Expose IRBuilder::CreateAtomicCmpXchg as LLVMBuildAtomicCmpXchg in the C API.
Summary: Also expose getters and setters in the C API, so that the change can be tested.

Reviewers: nhaehnle, axw, joker.eph

Subscribers: llvm-commits

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

From: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263886 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 21:28:28 +00:00
Mehdi Amini
14e4632794 Const-correctness in libLTO
Looks like I was sloppy when bridging to C.
Thanks D. Blaikie for noticing!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263885 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 21:28:18 +00:00
Saleem Abdulrasool
b6275da485 CodeGen: use range based for loop
Convert a loop to use a range based style loop.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263884 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 16:35:32 +00:00
David Majnemer
649040b838 [SimplifyLibCalls] Only consider sinpi/cospi functions within the same function
The sinpi/cospi can be replaced with sincospi to remove unnecessary
computations.  However, we need to make sure that the calls are within
the same function!

This fixes PR26993.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 04:53:02 +00:00
David Majnemer
20e3af6f8a [InstCombine] Don't insert instructions before a catch switch
CatchSwitches are not splittable, we cannot insert casts, etc. before
them.

This fixes PR26992.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263874 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 04:39:52 +00:00
Mehdi Amini
4392249e77 Add a dependency from llvm-link to TransformUtils following r263860
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263873 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 03:12:54 +00:00
Davide Italiano
fef7414d58 [gold] Use early return to simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263872 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 02:34:33 +00:00
Simon Pilgrim
0dac9cf06f Removed trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 02:05:33 +00:00
Mehdi Amini
8ff9043ade Fix a const_cast related warning in GCC in the C API for libLTO
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263870 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 01:24:23 +00:00
Mehdi Amini
991382f4d8 Add a comment on partial hashing of Metadata
Following r263866, on D. Blaikie suggestion.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263869 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 01:06:24 +00:00
Kostya Serebryany
bccbdac96f [libFuzzer] one more trophie
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 01:05:33 +00:00
Mehdi Amini
bef5d7af6b Hash Metadata using pointer for MDString argument instead of value (NFC)
MDString are uniqued in the Context on creation, hashing the
pointer is less expensive than hashing the String itself.

Reviewers: dexonsmith
Differential Revision: http://reviews.llvm.org/D16560

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 01:02:34 +00:00
Mehdi Amini
343753f293 Compute some Debug Info Metadata hash key partially (NFC)
Summary:
This patch changes the computation of the hash key for DISubprogram to
be computed on a small subset of the fields. The hash is computed a
lot faster, but there might be more collision in the table.
However by carefully selecting the fields, colisions should be rare.

Using `opt` to load the IR for FastISelEmitter.cpp.o, with this patch:
 - DISubprogram::getImpl() goes from 28ms to 15ms.
 - DICompositeType::getImpl() goes from 6ms to 2ms
 - DIDerivedType::getImpl() goes from 18 to 12ms

Reviewers: dexonsmith

Subscribers: llvm-commits

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 00:59:26 +00:00
Mehdi Amini
8268477130 Rework linkInModule(), making it oblivious to ThinLTO
Summary:
ThinLTO is relying on linkInModule to import selected function.
However a lot of "magic" was hidden in linkInModule and the IRMover,
who would rename and promote global variables on the fly.

This is moving to an approach where the steps are decoupled and the
client is reponsible to specify the list of globals to import.
As a consequence some test are changed because they were relying on
the previous behavior which was importing the definition of *every*
single global without control on the client side.
Now the burden is on the client to decide if a global has to be imported
or not.

Reviewers: tejohnson

Subscribers: joker.eph, llvm-commits

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263863 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 00:40:31 +00:00
Mehdi Amini
e314781f09 Add a test for r263577: "Add missing error handling in llvm-lto"
On Rafael's suggestion!
(also fix a discrepancy between this error message format and the others)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263860 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-19 00:17:32 +00:00
Manman Ren
d63e0d2742 [CXX_FAST_TLS] Fix issues in ARM.
We need to be careful on which registers can be explicitly handled
via copies. Prologue, Epilogue use physical registers and if one belongs
to the set of CSRsViaCopy, it will no longer be CSRed, since PEI overwrites
it after the explicit copies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263857 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 23:44:37 +00:00
Manman Ren
6b646dc5c5 [CXX_FAST_TLS] Disable tail call when calling conventions are mismatched.
Since CXX_FAST_TLS has a bigger set of CSRs, we don't tail call when caller
and callee have mismatched calling conventions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263856 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 23:41:51 +00:00
Manman Ren
2dadc1aa4d [CXX_FAST_TLS] fix issues with O0 on ARM, AArch64 and X86.
Since at O0, explicit copies via SplitCSR may not be removed even if
they are unnecessary, we choose not to use SplitCSR at O0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263855 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 23:38:49 +00:00
Duncan P. N. Exon Smith
a41843d067 AArch64: Don't modify other modules in AArch64PromoteConstant
Avoid modifying other modules in `AArch64PromoteConstant` when the
constant is `ConstantData` (a horrible accident, I'm sure, caught by an
experimental follow-up to r261464).

Previously, this walked through all the users of a constant, but that
reaches into other modules when the constant doesn't depend transitively
on a `GlobalValue`!  Since we're walking instructions anyway, just
modify the instructions we actually see.

As a drive-by, instead of storing `Use` and getting the instructions
again via `Use::getUser()` (which is not a constantant time lookup),
store `std::pair<Instruction, unsigned>`.  Besides being cheaper, this
makes it easier to drop use-lists form `ConstantData` in the future.
(I threw this in because I was touching all the code anyway.)

Because the patch completely changes the traversal logic, it looks
like a rewrite of the pass, but the core logic is all the same (or
should be, minus the out-of-module changes).  In other words, there
should be NFC as long as the LLVMContext only has a single Module.

I didn't think of a good way to test this, but I hope to submit a patch
eventually that makes walking these use-lists illegal/impossible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263853 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 23:30:54 +00:00
Mike Aizatsky
dc0299a744 [sancov] clang-formatting SanitizerCoverage.cpp and fully pleasing clang-tidy.
Differential Revision: http://reviews.llvm.org/D18288

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263852 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 23:29:29 +00:00
Michael Kuperstein
03a784fdb1 Have DataLayout::isLegalInteger() accept uint64_t
While not strictly necessary, since we don't support large integer
types, this avoids bugs due to silent truncation from uint64_t to a
32-bit unsigned (e.g. DL.isLegalInteger(DL.getTypeSizeInBits(Ty) )

This fixes PR26972.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263850 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 23:19:29 +00:00
Mike Aizatsky
a87dfbab4c [sancov] typo fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263849 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 22:46:10 +00:00
Lang Hames
2bf0347835 [Support] Update comment to match actual behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 22:44:16 +00:00
Chandler Carruth
07cfdc8cd0 Revert "Revert "[sancov] specifying sanitizer coverage dependencies.""
This reverts commit r263825, re-instating r263797.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263847 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 22:43:42 +00:00
Mike Aizatsky
e3eb88f3f7 [sancov] reformat & 1 clang-tidy warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263846 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 22:40:52 +00:00
Chandler Carruth
6b13fc7693 [sancov] Fix the sancov pass to initialize itself inside its
constructor. This should fix the recent crashes on certain
architectures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263845 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 22:35:58 +00:00
Chris Bieneman
07799b24b7 Fixing autocorrect changing cmake->make
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263843 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 22:11:51 +00:00
Alexei Starovoitov
2462cfbd35 BPF: emit an error message for unsupported signed division operation
Signed-off-by: Yonghong Song <yhs@plumgrid.com>
Signed-off-by: Alexei Starovoitov <ast@fb.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 22:02:47 +00:00
Chris Bieneman
fd9f306bd8 Missed a few non-ascii characters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263841 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 21:59:33 +00:00
Chris Bieneman
eceee13676 Updates based on post-commit review of r263834
* Renamed to be camel case, consistent with other docs.
* Fixed non-ascii characters (this is what I get for writing docs on an iPad).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 21:57:51 +00:00
David Majnemer
cb980bd3e2 [obj2yaml, COFF] Assert that the alignment is not bogus
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263839 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 21:51:14 +00:00
Easwaran Raman
af640bffc2 Interface to get/set profile summary metadata to module
Differential Revision: http://reviews.llvm.org/D17894


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263835 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 21:29:30 +00:00
Chris Bieneman
3600511689 [Docs] New documentation for advanced build configurations
This document covers how to use some of the new complex build configurations CMake supports.

Feedback and improvements welcomed!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263834 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 21:16:26 +00:00
Kostya Serebryany
4aa62c5d17 [libFuzzer] add a flag close_fd_mask so that we can silence spammy targets by closing stderr/stdout
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 20:58:29 +00:00
Matthias Braun
69f715827d MILexer: Add ErrorCallbackType typedef; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263829 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 20:41:11 +00:00
Sanjoy Das
953ce8c534 [IndVars] Make the fix for PR26973 more obvious; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 20:37:11 +00:00
Sanjoy Das
b289a83438 [IndVars] Pass the right loop to isLoopInvariantPredicate
The loop on IVOperand's incoming values assumes IVOperand to be an
induction variable on the loop over which `S Pred X` is invariant;
otherwise loop invariant incoming values to IVOperand are not guaranteed
to dominate the comparision.

This fixes PR26973.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 20:37:07 +00:00
Mike Aizatsky
643e47a345 Revert "[sancov] specifying sanitizer coverage dependencies."
This fails on arm.

This reverts commit 52c8e0f7119d1ea1050c0708565a8c92b73386d2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 20:34:58 +00:00
Nicolai Haehnle
1dd82f9e2a AMDGPU: add missing braces around multi-line if block
This fixes an issue with rL263658 pointed out by Tom Stellard.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263823 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 20:32:04 +00:00
Mike Spertus
67bf5dd452 Typesafe visualization of PointerIntPairs in Visual Studio
In the <DisplayString> of PointerIntPair , I cast the pointer to the actual type, so VS can leverage it while visualizing, not unlike the recent change to PointerUnion visualization.
In the expansion, the current code is casting to the incorrect type (wrong number of stars), so I fixed that as well.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 20:06:16 +00:00
Chad Rosier
b0c326b0a1 [AArch64] Enable more load clustering in the MI Scheduler.
This patch adds unscaled loads and sign-extend loads to the TII
getMemOpBaseRegImmOfs API, which is used to control clustering in the MI
scheduler. This is done to create more opportunities for load pairing.  I've
also added the scaled LDRSWui instruction, which was missing from the scaled
instructions. Finally, I've added support in shouldClusterLoads for clustering
adjacent sext and zext loads that too can be paired by the load/store optimizer.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263819 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 19:21:02 +00:00
Reid Kleckner
a868bb3b4e [codeview] Only emit function ids for inlined functions
We aren't referencing any other kind of function currently.
Should save a bit on our debug info size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263817 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 18:54:32 +00:00
Colin LeMahieu
8b96439e72 [MCParser] Accept uppercase radix variants 0X and 0B
Differential Revision: http://reviews.llvm.org/D14781

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263802 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 18:22:07 +00:00
Mike Aizatsky
645ba4e0b9 [sancov] specifying sanitizer coverage dependencies.
Summary:
These dependencies would be used in the future to reduce the number
of instrumented blocks(http://reviews.llvm.org/rL262103)

This is submitted as a separate CL because of previous problems with
ARM.

Subscribers: aemerson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263797 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 17:33:21 +00:00
Colin LeMahieu
1661683468 [llvm-objdump] Print <unknown> in place of instruction text if it couldn't be disassembled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263793 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 16:26:48 +00:00
Nicolai Haehnle
a99f51df81 AMDGPU: Overload return type of llvm.amdgcn.buffer.load.format
Summary:
Allow the selection of BUFFER_LOAD_FORMAT_x and _XY. Do this now before
the frontend patches land in Mesa. Eventually, we may want to automatically
reduce the size of loads at the LLVM IR level, which requires such overloads,
and in some cases Mesa can generate them directly.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263792 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 16:24:40 +00:00
Nicolai Haehnle
e9f50a4929 AMDGPU/SI: Add llvm.amdgcn.buffer.atomic.* intrinsics
Summary:
These intrinsics expose the BUFFER_ATOMIC_* instructions and will be used
by Mesa to implement atomics with buffer semantics. The intrinsic interface
matches that of buffer.load.format and buffer.store.format, except that the
GLC bit is not exposed (it is automatically deduced based on whether the
return value is used).

The change of hasSideEffects is required for TableGen to accept the pattern
that matches the intrinsic.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm, rivanvx, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263791 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 16:24:31 +00:00
Nicolai Haehnle
71acdb08db AMDGPU: use ComplexPattern for offsets in llvm.amdgcn.buffer.load/store.format
Summary:
We cannot easily deduce that an offset is in an SGPR, but the Mesa frontend
cannot easily make use of an explicit soffset parameter either. Furthermore,
it is likely that in the future, LLVM will be in a better position than the
frontend to choose an SGPR offset if possible.

Since there aren't any frontend uses of these intrinsics in upstream
repositories yet, I would like to take this opportunity to change the
intrinsic signatures to a single offset parameter, which is then selected
to immediate offsets or voffsets using a ComplexPattern.

Reviewers: arsenm, tstellarAMD, mareko

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263790 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 16:24:20 +00:00
Sam Kolton
5460c31240 [AMDGPU] Assembler: Change dpp_ctrl syntax to match sp3
Review: http://reviews.llvm.org/D18267

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263789 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 15:35:51 +00:00
Benjamin Kramer
3ac2aa592d [Fuzzer] Guard no_sanitize_memory attributes behind __has_feature.
Otherwise GCC fails to build it because it doesn't know the attribute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263787 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 14:19:19 +00:00