Commit Graph

120255 Commits

Author SHA1 Message Date
Ahmed Bougacha
3e59e1aa47 [AArch64] Rename FP formats to be more consistent. NFC.
Some are named "FP", others "SD", others still "FP*SD".
Rename all this to just use "FP", which, except for conversions
(which don't use this format naming scheme), implies "SD" anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243936 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-04 01:38:08 +00:00
Ahmed Bougacha
09ae369f4f [AArch64] Add isel support for f16 indexed LD/ST.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243935 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-04 01:29:38 +00:00
Chandler Carruth
4f2a94439a [UB] Fix yet another use of memcpy with a null pointer argument. I think
this is the last of them in my build of LLVM. Haven't tried Clang yet.

Found via UBSan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243934 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-04 01:00:56 +00:00
Ahmed Bougacha
d35480e9b1 [AArch64][v8.1a] The "pan" sysreg isn't MSR-specific. NFCI.
It's already in SysRegMappings, no need to also have it in MSRMappings:
the latter is only used if we didn't find a match in the former.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243933 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-04 00:55:11 +00:00
Chandler Carruth
d86ea34863 [UB] Fix another place where we would pass a null pointer to memcpy.
This too was found by UBSan. Down to 35 failures for me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243932 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-04 00:53:01 +00:00
Ahmed Bougacha
6c2eae9338 [AArch64] Remove unnecessary "break". NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243931 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-04 00:49:08 +00:00
Ahmed Bougacha
d51a68a542 [AArch64] Use SDValue bool operator. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243930 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-04 00:48:02 +00:00
Hans Wennborg
2dc8e2aa97 Add a -revert option to utils/release/merge.sh
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243929 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-04 00:47:58 +00:00
Chandler Carruth
25daca787a [UB] Fix a nasty place where we would pass null pointers to memcpy.
This happens to work, but is not guaranteed to work. Indeed, most memcpy
interfaces in Linux-land annotate these arguments as nonnull, and GCC
and LLVM both can and do optimized based upon that. When they do so,
they might legitimately have miscompiled code calling this routine with
two valid iterators, 'nullptr' and 'nullptr'. There was even code doing
precisely this because StringRef().begin() and StringRef().end() both
produce null pointers.

This was found by UBSan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243927 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-04 00:44:07 +00:00
Ahmed Bougacha
a05d8be1a2 [AArch64] Vector FCOPYSIGN supports Custom-lowering: mark it as such.
There's a bunch of code in LowerFCOPYSIGN that does smart lowering, and
is actually already vector-aware; let's use it instead of scalarizing!

The only interesting change is that for v2f32, we previously always used
use v4i32 as the integer vector type.
Use v2i32 instead, and mark FCOPYSIGN as Custom.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243926 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-04 00:42:34 +00:00
Ahmed Bougacha
5ce70cc2c1 [CodeGen] Fix FCOPYSIGN legalization to account for mismatched types.
We used to legalize it like it's any other binary operations.  It's not,
because it accepts mismatched operand types.  Because of that, we used
to hit various asserts and miscompiles.

Specialize vector legalizations to, in the worst case, unroll, or, when
possible, to just legalize the operand that needs legalization.

Scalarization isn't covered, because I can't think of a target where
some but not all of the 1-element vector types are to be scalarized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243924 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-04 00:32:55 +00:00
Alex Lorenz
1731b66081 MIR Serialization: Serialize the 'volatile' machine memory operand flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243923 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-04 00:24:45 +00:00
Adam Nemet
ea0f5e2108 [LAA] Remove unused needsAnyChecking(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243921 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 23:33:03 +00:00
Adam Nemet
f6b29bc36c [LoopVer] Remove unused needsRuntimeChecks(), NFC
The previous commits moved this functionality into the client.

Also remove the now unused member variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243920 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 23:32:57 +00:00
Mehdi Amini
ec0bf42c16 Docs: s/Sanitiser/Sanitizer/ for consistency
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243918 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 23:25:46 +00:00
Mehdi Amini
736c685c65 GettingStarted.rst: Add info about building sanitizers
From: Erik de Castro Lopo <erikd@qti.qualcomm.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243917 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 23:17:47 +00:00
Mehdi Amini
5d9068c949 docs/GettingStarted.rst: Whitespace only
From: Erik de Castro Lopo <erikd@qti.qualcomm.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243916 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 23:17:44 +00:00
Alex Lorenz
3db44ce9a8 MIR Serialization: Initial serialization of the machine memory operands.
Reviewers: Duncan P. N. Exon Smith


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243915 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 23:08:19 +00:00
Justin Bogner
7e6adbea62 lto: Avoid relying on the environment for this test
It's better to pass libLTO to ld64 via the command line flag than rely
on setting DYLD_LIBRARY_PATH.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243911 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 22:43:14 +00:00
David Blaikie
5aac19286a Update/correct comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243910 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 22:33:50 +00:00
David Blaikie
c4423f0478 -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
Various value handles needed to be copy constructible and copy
assignable (mostly for their use in DenseMap). But to avoid an API that
might allow accidental slicing, make these members protected in the base
class and make derived classes final (the special members become
implicitly public there - but disallowing further derived classes that
might be sliced to the intermediate type).

Might be worth having a warning a bit like -Wnon-virtual-dtor that
catches public move/copy assign/ctors in classes with virtual functions.
(suppressable in the same way - by making them protected in the base,
and making the derived classes final) Could be fancier and only diagnose
them when they're actually called, potentially.

Also allow a few default implementations where custom implementations
(especially with non-standard return types) were implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243909 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 22:30:24 +00:00
Tim Northover
5647cdb099 ARM: remove horrible printf left over from debugging
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243907 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 22:19:08 +00:00
Davide Italiano
c83882c394 [llvm-objdump] Range-loopify. NFC intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243905 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 21:46:32 +00:00
Derek Schuff
83e36d9d45 Fix memory leak in unit test of Bitcode/BitReaderTest.cpp
Fixes obvious memory leak in test
TestForEofAfterReadFailureOnDataStreamer.  Also removes constexpr use
from same test.

Patch by Karl Schimpf.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243904 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 21:23:51 +00:00
David Blaikie
a590533767 Fix with a bit more care. (but only a bit)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243903 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 20:55:00 +00:00
Chandler Carruth
6e3744f374 [Unroll] Improve the brute force loop unroll estimate by propagating
through PHI nodes across iterations.

This patch teaches the new advanced loop unrolling heuristics to propagate
constants into the loop from the preheader and around the backedge after
simulating each iteration. This lets us brute force solve simple recurrances
that aren't modeled effectively by SCEV. It also makes it more clear why we
need to process the loop in-order rather than bottom-up which might otherwise
make much more sense (for example, for DCE).

This came out of an attempt I'm making to develop a principled way to account
for dead code in the unroll estimation. When I implemented
a forward-propagating version of that it produced incorrect results due to
failing to propagate *cost* between loop iterations through the PHI nodes, and
it occured to me we really should at least propagate simplifications across
those edges, and it is quite easy thanks to the loop being in canonical and
LCSSA form.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243900 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 20:32:27 +00:00
David Blaikie
5b8c55e5b6 Try to fix the build for C++ standard libraries missing std::map::emplace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243899 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 20:30:53 +00:00
Renato Golin
f3f35ecb54 [Release Script] Check for correct symlink name
While checking for the existence of the clang-tools-extra directory,
the script was not checking for its destination name, "extra", and
the script was failing when re-running without checking out new
sources.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243898 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 20:19:35 +00:00
David Blaikie
43247f1977 -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
Some functions return concrete ByteStreamers by value - explicitly
support that in the base class. (dtor can be virtual, no one seems to be
polymorphically owning/destroying them)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243897 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 20:12:58 +00:00
David Blaikie
afb53796b8 Recommit r243824: -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
This reverts commit r243888, recommitting r243824.

This broke the Windows build due to a difference in the C++ standard
library implementation. Using emplace/forward_as_tuple should ensure
there's no need to copy ValIDs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243896 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 20:08:41 +00:00
Pete Cooper
9223402bae Convert some AArch64 code to foreach loops. NFC.
Also converted a cast<> to dyn_cast while i was working on the same
line of code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243894 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 19:04:32 +00:00
Lang Hames
7973eb9ff8 [MCJIT] Fix a cast warning in the unit-test introduced in r243589.
Thanks to Aaron Ballman for spotting this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243891 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 18:03:40 +00:00
Derek Schuff
f96e27f256 Fix testing for end of stream in bitstream reader.
This fixes a bug found while working on the bitcode reader. In
particular, the method BitstreamReader::AtEndOfStream doesn't always
behave correctly when processing a data streamer. The method
fillCurWord doesn't properly set CurWord/BitsInCurWord if the data
streamer was already at eof, but GetBytes had not yet set the
ObjectSize field of the streaming memory object.

This patch fixes this problem, and provides a test to show that
this problem has been fixed.

Patch by Karl Schimpf.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243890 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 18:01:50 +00:00
Reid Kleckner
5027260ce6 Revert "-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11"
This reverts commit r243824.

It broke the build on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243888 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 17:36:22 +00:00
Duncan P. N. Exon Smith
c61bc48acb DI: Disallow uniquable DICompileUnits
Since r241097, `DIBuilder` has only created distinct `DICompileUnit`s.
The backend is liable to start relying on that (if it hasn't already),
so make uniquable `DICompileUnit`s illegal and automatically upgrade old
bitcode.  This is a nice cleanup, since we can remove an unnecessary
`DenseSet` (and the associated uniquing info) from `LLVMContextImpl`.

Almost all the testcases were updated with this script:

    git grep -e '= !DICompileUnit' -l -- test |
    grep -v test/Bitcode |
    xargs sed -i '' -e 's,= !DICompileUnit,= distinct !DICompileUnit,'

I imagine something similar should work for out-of-tree testcases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243885 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 17:26:41 +00:00
Tim Northover
8927f6cd0f ARM: prefer allocating VFP regs at stride 4 on Darwin.
This is necessary for WatchOS support, where the compact unwind format assumes
this kind of layout. For now we only want this on Swift-like CPUs though, where
it's been the Xcode behaviour for ages. Also, since it can expand the prologue
we don't want it at -Oz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243884 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 17:20:10 +00:00
Duncan P. N. Exon Smith
268a755585 Linker: Move distinct MDNodes instead of cloning
Instead of cloning distinct `MDNode`s when linking in a module, just
move them over.  The module linker destroys the source module, so the
old node would otherwise just be leaked on the context.  Create the new
node in place.  This also reduces the number of cloned uniqued nodes
(since it's less likely their operands have changed).

This mapping strategy is only correct when we're discarding the source,
so the linker turns it on via a ValueMapper flag, `RF_MoveDistinctMDs`.

There's nothing observable in terms of `llvm-link` output here: the
linked module should be semantically identical.

I'll be adding more 'distinct' nodes to the debug info metadata graph in
order to break uniquing cycles, so the benefits of this will partly come
in future commits.  However, we should get some gains immediately, since
we have a fair number of 'distinct' `DILocation`s being linked in.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243883 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 17:09:38 +00:00
Tobias Grosser
1c12df14a6 Allow derived DOTViewers to choose the functions to illustrate
Instead of always showing/printing all functions, a class derived from
the DOTViewer class can overwrite the set of functions that will be
processed.

This will be used (and tested) by Polly's scop viewers, but other users
can be imagined as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243881 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 16:37:12 +00:00
JF Bastien
ca0cc47046 Refactor AtomicExpand::expandAtomicRMWToCmpXchg into a standalone function.
Summary:
This is useful for PNaCl's `RewriteAtomics` pass. NaCl intrinsics don't exist for some of the more exotic RMW instructions, so by refactoring this function into its own, `RewriteAtomics` can share code rewriting those atomics with `AtomicExpand` while additionally saving a few cycles by generating the `cmpxchg` NaCl-specific intrinsic with the callback. Without this patch, `RewriteAtomics` would require two extra passes over functions, by first requiring use of the full `AtomicExpand` pass to just expand the leftover exotic RMWs and then running itself again to expand resulting `cmpxchg`s.

NFC

Reviewers: jfb

Subscribers: jfb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243880 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 15:29:47 +00:00
Artur Pilipenko
9987cb60ba Currently string attributes on function arguments/return values can be generated using LLVM API. However they are not supported in parser. So, the following scenario will fail:
* generate function with string attribute using API,
* dump it in LL format,
* try to parse.
Add parser support for string attributes to fix the issue.

Reviewed By: reames, hfinkel

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243877 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 14:31:49 +00:00
Silviu Baranga
b65ab9a410 [TTI] Fix default costs for interleaved accesses
Summary:
Modify the cost calculation function for interleaved accesses
to use the target-specific costs for insert/extract element and
memory operations.

This better models the case where the backend can't match
the interleaved group, and we are forced to use a wide load
and shuffle vectors.

Interleaved accesses are not enabled by default, so this shouldn't
cause a performance change.

Reviewers: jmolloy

Subscribers: jmolloy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243875 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 14:00:58 +00:00
John Brawn
d58af05fd8 [ARM] Make GlobalMerge merge extern globals by default
Enabling merging of extern globals appears to be generally either beneficial or
harmless. On some benchmarks suites (on Cortex-M4F, Cortex-A9, and Cortex-A57)
it gives improvements in the 1-5% range, but in the rest the overall effect is
zero.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243874 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 12:13:33 +00:00
John Brawn
583fe8f203 [GlobalMerge] Allow targets to enable merging of extern variables, NFC.
Adjust the GlobalMergeOnExternal option so that the default behaviour is to
do whatever the Target thinks is best. Explicitly enabled or disabling the
option will override this default.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243873 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 12:08:41 +00:00
Alexander Kornienko
de5e9119ce Don't use test inputs from other directories.
The test/DebugInfo/dwarfdump-macho-universal.test test added in r243862 uses
an input from another test's directory (test/tools/dsymutil/Inputs/fat-test.o)
which breaks our test setup.

Copying the required test input to the test's Input directory to fix the issue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243872 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 11:59:45 +00:00
James Molloy
ae8ffe0977 Be less conservative about forming IT blocks.
In http://reviews.llvm.org/rL215382, IT forming was made more conservative under
the belief that a flag-setting instruction was unpredictable inside an IT block on ARMv6M.

But actually, ARMv6M doesn't even support IT blocks so that's impossible. In the ARMARM for
v7M, v7AR and v8AR it states that the semantics of such an instruction changes inside an
IT block - it doesn't set the flags. So actually it is fine to use one inside an IT block
as long as the flags register is dead afterwards.

This gives significant performance improvements in a variety of MPEG based workloads.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243869 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 09:24:48 +00:00
Alexander Kornienko
21481e0320 Fix the test added at r243777.
When RUN: lines are split into multiple lines, each one must be prefixed with
RUN:.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243868 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 09:13:19 +00:00
Duncan P. N. Exon Smith
836170e4d5 ValueMapper: Only check for cycles if operands change
This is a minor optimization to only check for unresolved operands
inside `mapDistinctNode()` if the operands have actually changed.  This
shouldn't really cause any change in behaviour.  I didn't actually see a
slowdown in a profile, I was just poking around nearby and saw the
opportunity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243866 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 03:45:32 +00:00
Duncan P. N. Exon Smith
dae8660f5e ValueMapper: Use a range-based for, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243865 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 03:27:12 +00:00
Duncan P. N. Exon Smith
7b16662127 ValueMapper: Reuse local variable, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243864 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 03:24:28 +00:00
Frederic Riss
379e328355 Use early return NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243863 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-03 00:10:33 +00:00