Saleem Abdulrasool [Tue, 4 Aug 2015 03:57:52 +0000 (03:57 +0000)]
ARM: make Darwin libcall registration table driven (NFC)
Make the libcall updating table driven similar to the approach that the Linux
and Windows codepath does below. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243951
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 4 Aug 2015 03:48:26 +0000 (03:48 +0000)]
[UB] Don't allocate space for contained types and then try to copy the
contained types into the space when we have no contained types. This
fixes the UB stemming from a call to memcpy with a null pointer. This
also reduces the calls to allocate because this actually happens in
a notable client - Clang.
Found by UBSan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243944
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Tue, 4 Aug 2015 03:12:33 +0000 (03:12 +0000)]
[GettingStarted.rst] Commit the right patch.
Looks like the rebased version that Mehdi committed didn't incorporate
the latest changes.
Patch by Erik de Castro Lopo <erikd@mega-nerd.com>!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243942
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Tue, 4 Aug 2015 01:52:05 +0000 (01:52 +0000)]
Revert "[LSR] Generate and use zero extends"
This reverts commit r243348 and r243357. They caused PR24347.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243939
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Tue, 4 Aug 2015 01:38:08 +0000 (01:38 +0000)]
[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
Ahmed Bougacha [Tue, 4 Aug 2015 01:29:38 +0000 (01:29 +0000)]
[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
Chandler Carruth [Tue, 4 Aug 2015 01:00:56 +0000 (01:00 +0000)]
[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
Ahmed Bougacha [Tue, 4 Aug 2015 00:55:11 +0000 (00:55 +0000)]
[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
Chandler Carruth [Tue, 4 Aug 2015 00:53:01 +0000 (00:53 +0000)]
[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
Ahmed Bougacha [Tue, 4 Aug 2015 00:49:08 +0000 (00:49 +0000)]
[AArch64] Remove unnecessary "break". NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243931
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Tue, 4 Aug 2015 00:48:02 +0000 (00:48 +0000)]
[AArch64] Use SDValue bool operator. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243930
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Tue, 4 Aug 2015 00:47:58 +0000 (00:47 +0000)]
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
Chandler Carruth [Tue, 4 Aug 2015 00:44:07 +0000 (00:44 +0000)]
[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
Ahmed Bougacha [Tue, 4 Aug 2015 00:42:34 +0000 (00:42 +0000)]
[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
Ahmed Bougacha [Tue, 4 Aug 2015 00:32:55 +0000 (00:32 +0000)]
[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
Alex Lorenz [Tue, 4 Aug 2015 00:24:45 +0000 (00:24 +0000)]
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
Adam Nemet [Mon, 3 Aug 2015 23:33:03 +0000 (23:33 +0000)]
[LAA] Remove unused needsAnyChecking(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243921
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Mon, 3 Aug 2015 23:32:57 +0000 (23:32 +0000)]
[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
Mehdi Amini [Mon, 3 Aug 2015 23:25:46 +0000 (23:25 +0000)]
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
Mehdi Amini [Mon, 3 Aug 2015 23:17:47 +0000 (23:17 +0000)]
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
Mehdi Amini [Mon, 3 Aug 2015 23:17:44 +0000 (23:17 +0000)]
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
Alex Lorenz [Mon, 3 Aug 2015 23:08:19 +0000 (23:08 +0000)]
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
Justin Bogner [Mon, 3 Aug 2015 22:43:14 +0000 (22:43 +0000)]
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
David Blaikie [Mon, 3 Aug 2015 22:33:50 +0000 (22:33 +0000)]
Update/correct comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243910
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 3 Aug 2015 22:30:24 +0000 (22:30 +0000)]
-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
Tim Northover [Mon, 3 Aug 2015 22:19:08 +0000 (22:19 +0000)]
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
Davide Italiano [Mon, 3 Aug 2015 21:46:32 +0000 (21:46 +0000)]
[llvm-objdump] Range-loopify. NFC intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243905
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Mon, 3 Aug 2015 21:23:51 +0000 (21:23 +0000)]
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
David Blaikie [Mon, 3 Aug 2015 20:55:00 +0000 (20:55 +0000)]
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
Chandler Carruth [Mon, 3 Aug 2015 20:32:27 +0000 (20:32 +0000)]
[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
David Blaikie [Mon, 3 Aug 2015 20:30:53 +0000 (20:30 +0000)]
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
Renato Golin [Mon, 3 Aug 2015 20:19:35 +0000 (20:19 +0000)]
[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
David Blaikie [Mon, 3 Aug 2015 20:12:58 +0000 (20:12 +0000)]
-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
David Blaikie [Mon, 3 Aug 2015 20:08:41 +0000 (20:08 +0000)]
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
Pete Cooper [Mon, 3 Aug 2015 19:04:32 +0000 (19:04 +0000)]
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
Lang Hames [Mon, 3 Aug 2015 18:03:40 +0000 (18:03 +0000)]
[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
Derek Schuff [Mon, 3 Aug 2015 18:01:50 +0000 (18:01 +0000)]
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
Reid Kleckner [Mon, 3 Aug 2015 17:36:22 +0000 (17:36 +0000)]
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
Duncan P. N. Exon Smith [Mon, 3 Aug 2015 17:26:41 +0000 (17:26 +0000)]
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
Tim Northover [Mon, 3 Aug 2015 17:20:10 +0000 (17:20 +0000)]
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
Duncan P. N. Exon Smith [Mon, 3 Aug 2015 17:09:38 +0000 (17:09 +0000)]
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
Tobias Grosser [Mon, 3 Aug 2015 16:37:12 +0000 (16:37 +0000)]
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
JF Bastien [Mon, 3 Aug 2015 15:29:47 +0000 (15:29 +0000)]
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
Artur Pilipenko [Mon, 3 Aug 2015 14:31:49 +0000 (14:31 +0000)]
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
Silviu Baranga [Mon, 3 Aug 2015 14:00:58 +0000 (14:00 +0000)]
[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
John Brawn [Mon, 3 Aug 2015 12:13:33 +0000 (12:13 +0000)]
[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
John Brawn [Mon, 3 Aug 2015 12:08:41 +0000 (12:08 +0000)]
[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
Alexander Kornienko [Mon, 3 Aug 2015 11:59:45 +0000 (11:59 +0000)]
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
James Molloy [Mon, 3 Aug 2015 09:24:48 +0000 (09:24 +0000)]
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
Alexander Kornienko [Mon, 3 Aug 2015 09:13:19 +0000 (09:13 +0000)]
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
Duncan P. N. Exon Smith [Mon, 3 Aug 2015 03:45:32 +0000 (03:45 +0000)]
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
Duncan P. N. Exon Smith [Mon, 3 Aug 2015 03:27:12 +0000 (03:27 +0000)]
ValueMapper: Use a range-based for, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243865
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 3 Aug 2015 03:24:28 +0000 (03:24 +0000)]
ValueMapper: Reuse local variable, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243864
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Mon, 3 Aug 2015 00:10:33 +0000 (00:10 +0000)]
Use early return NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243863
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Mon, 3 Aug 2015 00:10:31 +0000 (00:10 +0000)]
[dwarfdump] Add support for dumping mach-o universal objectfiles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243862
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Mon, 3 Aug 2015 00:10:25 +0000 (00:10 +0000)]
[dwarfdump] Move dumping to a helper function NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243861
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Mon, 3 Aug 2015 00:00:11 +0000 (00:00 +0000)]
WebAssembly: implement getScalarShiftAmountTy so we can shift by amount, with type
Summary: This currently sets the shift amount RHS to the same type as the LHS, and assumes that the LHS is a simple type. This isn't currently the case e.g. with weird integers sizes, but will eventually be true and will assert if not. That's what you get for having an experimental backend: break it and you get to keep both pieces. Most backends either set the RHS to MVT::i32 or MVT::i64, but WebAssembly is a virtual ISA and tries to have regular-looking binary operations where both operands are the same type (even if a 64-bit RHS shifter is slightly silly, hey it's free!).
Subscribers: llvm-commits, sunfish, jfb
Differential Revision: http://reviews.llvm.org/D11715
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243860
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 2 Aug 2015 22:34:02 +0000 (22:34 +0000)]
Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243859
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 2 Aug 2015 20:54:50 +0000 (20:54 +0000)]
AsmPrinter: Stop inheriting from DIE
Change `DIELoc` and `DIEBlock` to stop inheriting from `DIE`, instead
inheriting from `DIEValueList` to share the value storage API. This
awkward bit of code-sharing was also fairly confusing: neither `DIELoc`
nor `DIEBlock` represents a `DIE`, so why would they inherit from it?
Aside from the API cleanup, this should improve debug info memory usage
in the backend, since it shaves five pointers off of every `DIELoc` and
`DIEBlock`. I haven't bothered to measure the savings, though.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243858
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 2 Aug 2015 20:48:47 +0000 (20:48 +0000)]
DwarfLinker: Use DIEValueList instead of DIE, NFC
Use `DIEValueList` as a pointer to either `DIEBlock` or `DIELoc` instead
of `DIE`, since soon they won't inherit from the latter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243857
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 2 Aug 2015 20:46:49 +0000 (20:46 +0000)]
AsmPrinter: Split out non-DIE printing from DIE::print(), NFC
Split out a helper `printValues()` for printing `DIEBlock` and `DIELoc`,
instead of relying on `DIE::print()`. The shared code was actually
fairly small there. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243856
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 2 Aug 2015 20:44:46 +0000 (20:44 +0000)]
AsmPrinter: Take DIEValueList in some DwarfUnit API, NFC
Take `DIEValueList` instead of `DIE` so that `DIEBlock` and `DIELoc` can
stop inheriting from `DIE` in a future commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243855
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 2 Aug 2015 20:42:45 +0000 (20:42 +0000)]
AsmPrinter: Change DIEValueList to a subclass of DIE, NFC
Rewrite `DIEValueList` as a subclass of `DIE`, renaming its API to match
`DIE`'s. This is preparation for changing `DIEBlock` and `DIELoc` to
stop inheriting from `DIE` and inherit directly from `DIEValueList`.
I thought about leaving this as a has-a relationship (and changing
`DIELoc` and `DIEBlock` to also have-a `DIEValueList`), but that seemed
to require a fair bit more boilerplate and I think it needed more
changes to the `DwarfUnit` API than this will.
No functionality change intended here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243854
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sun, 2 Aug 2015 20:40:05 +0000 (20:40 +0000)]
Remove dead code, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243853
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 2 Aug 2015 15:23:53 +0000 (15:23 +0000)]
[X86][SSE] Refreshed sse2 vector shift tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243850
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Wilkins [Sun, 2 Aug 2015 12:16:57 +0000 (12:16 +0000)]
Add support to set/get ordering for load/store from the C API
Summary: As per title
Reviewers: chandlerc, bogner, majnemer, axw
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11141
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243847
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 1 Aug 2015 22:52:12 +0000 (22:52 +0000)]
Mark CompositeType::getTypeAtIndex as const. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243845
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 1 Aug 2015 22:20:31 +0000 (22:20 +0000)]
Mark Type::getPointerTo as const. Unfortunately, this requires a const_cast inside, but at least it makes all methods on Type const. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243844
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 1 Aug 2015 22:20:27 +0000 (22:20 +0000)]
Merge the const and non-const Type::getScalarType to a const version that returns a non-const pointer. Since we don't put const on Types all places were already calling the non-const version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243843
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 1 Aug 2015 22:20:21 +0000 (22:20 +0000)]
De-constify pointers to Type since they can't be modified. NFC
This was already done in most places a while ago. This just fixes the ones that crept in over time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243842
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Sat, 1 Aug 2015 18:02:12 +0000 (18:02 +0000)]
[NVPTX] allow register copy between float and int
Summary:
Fixes PR24303. With Bruno's WIP (D11197) on PeepholeOptimizer, across-class
register copying (e.g. i32 to f32) becomes possible. Enhance
NVPTXInstrInfo::copyPhysReg to handle these cases.
Reviewers: jholewinski
Subscribers: eliben, jholewinski, llvm-commits, bruno
Differential Revision: http://reviews.llvm.org/D11622
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243839
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 1 Aug 2015 17:06:47 +0000 (17:06 +0000)]
Remove trailing whitespace. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243838
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 1 Aug 2015 17:05:50 +0000 (17:05 +0000)]
Use SDValue bool check. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243837
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Sat, 1 Aug 2015 15:50:53 +0000 (15:50 +0000)]
Provide move constructor to appease Visual C++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243836
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Sat, 1 Aug 2015 12:02:02 +0000 (12:02 +0000)]
[Mips] Support DT_MIPS_RLD_MAP_REL dynamic section tag in the llvm-readobj
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243833
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 1 Aug 2015 10:01:46 +0000 (10:01 +0000)]
[DAGCombiner] Convert constant AND masks to shuffle clear masks down to the byte level
The XformToShuffleWithZero method currently checks AND masks at the per-lane level for all-one and all-zero constants and attempts to convert them to legal shuffle clear masks.
This patch generalises XformToShuffleWithZero, splitting and checking the sub-lanes of the constants down to the byte level to see if any legal shuffle clear masks are possible. This allows a lot of masks (often from legalization or truncation) to be folded into existing shuffle patterns and removes a lot of constant mask loading.
There are a few examples of poor shuffle lowering that are exposed by this patch that will be cleaned up in future patches (e.g. merging shuffles that are separated by bitcasts, x86 legalized v8i8 zero extension uses PMOVZX+AND+AND instead of AND+PMOVZX, etc.)
Differential Revision: http://reviews.llvm.org/D11518
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243831
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 1 Aug 2015 05:31:27 +0000 (05:31 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
Remove some unnecessary explicit special members in Hexagon that, once
removed, allow the other implicit special members to be used without
depending on deprecated features.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243825
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 1 Aug 2015 05:10:40 +0000 (05:10 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243824
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 1 Aug 2015 05:10:37 +0000 (05:10 +0000)]
Workaround some compilers that give a stricter throw spec to = default than implicit dtors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243823
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Sat, 1 Aug 2015 04:48:44 +0000 (04:48 +0000)]
WebAssembly: handle more than int32 argument/return
Summary: Also test 64-bit integers, except shifts for now which are broken because isel dislikes the 32-bit truncate that precedes them.
Reviewers: sunfish
Subscribers: llvm-commits, jfb
Differential Revision: http://reviews.llvm.org/D11699
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243822
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 1 Aug 2015 04:42:53 +0000 (04:42 +0000)]
Missing formatting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243821
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 1 Aug 2015 04:40:41 +0000 (04:40 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
Various targets use std::swap on specific MCAsmOperands (ARM and
possibly Hexagon as well). It might be helpful to mark those subclasses
as final, to ensure that the availability of move/copy operations can't
lead to slicing. (same sort of requirements as the non-vitual dtor -
protected or a final class)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243820
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Sat, 1 Aug 2015 02:23:06 +0000 (02:23 +0000)]
[libFuzzer] more refactoring of the Mutator and adding tests to it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243818
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Sat, 1 Aug 2015 01:42:51 +0000 (01:42 +0000)]
[libFuzzer] start refactoring the Mutator and adding tests to it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243817
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 1 Aug 2015 01:08:30 +0000 (01:08 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243816
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Fri, 31 Jul 2015 23:30:09 +0000 (23:30 +0000)]
AMDGPU/SI: Add implicit register operands in the correct order.
This commit fixes a bug in the class 'SIInstrInfo' where the implicit register
machine operands were added to a machine instruction in an incorrect order -
the implicit uses were added before the implicit defs.
I found this bug while working on moving the implicit register operand
verification code from the MIR parser to the machine verifier.
This commit also makes the method 'addImplicitDefUseOperands' in the machine
instruction class public so that it can be reused in the 'SIInstrInfo' class.
Reviewers: Matt Arsenault
Differential Revision: http://reviews.llvm.org/D11689
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243799
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Fri, 31 Jul 2015 23:13:23 +0000 (23:13 +0000)]
MIR Parser: Report an error when a jump table entry is redefined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243798
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Fri, 31 Jul 2015 22:59:20 +0000 (22:59 +0000)]
MIR Parser: Remove unused variable.
This variable is unused as of r243572.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243796
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 31 Jul 2015 22:07:17 +0000 (22:07 +0000)]
[libFuzzer] limit the size of the inputs printed to stderr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243795
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 31 Jul 2015 21:48:10 +0000 (21:48 +0000)]
[libFuzzer] minimal documentation on data-flow-guided fuzzing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243793
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 31 Jul 2015 21:47:07 +0000 (21:47 +0000)]
Fix an MSVC build break since it can't synthesize move ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243792
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 31 Jul 2015 21:47:04 +0000 (21:47 +0000)]
Fix a GCC buildbot that seemed to be having trouble producing the implicit move ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243791
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Fri, 31 Jul 2015 21:44:14 +0000 (21:44 +0000)]
[NVPTX] convert pointers in byval kernel arguments to global
Summary:
For example, in
struct S {
int *x;
int *y;
};
__global__ void foo(S s) {
int *b = s.y;
// use b
}
"b" is guaranteed to point to global. NVPTX should emit ld.global/st.global for
accessing "b".
Reviewers: jholewinski
Subscribers: llvm-commits, jholewinski
Differential Revision: http://reviews.llvm.org/D11505
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243790
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 31 Jul 2015 21:37:58 +0000 (21:37 +0000)]
Fix some formatting from a recent commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243789
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 31 Jul 2015 21:37:09 +0000 (21:37 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243788
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 31 Jul 2015 21:26:16 +0000 (21:26 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243786
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Fri, 31 Jul 2015 21:04:18 +0000 (21:04 +0000)]
WebAssembly: handle `ret void`.
Summary:
Use -1 as numoperands for the return SDTypeProfile, denoting that return is variadic. Note that the patterns in InstrControl.td still need to match the inputs, so this ins't an "anything goes" variadic on ret!
The next step will be to handle other local types (not just int32).
Reviewers: sunfish
Subscribers: llvm-commits, jfb
Differential Revision: http://reviews.llvm.org/D11692
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243783
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 31 Jul 2015 20:58:55 +0000 (20:58 +0000)]
[libFuzzer] make sure that 2-byte arguments of switch() are handled properly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243781
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Fri, 31 Jul 2015 20:49:21 +0000 (20:49 +0000)]
MIR Serialization: Serialize the floating point immediate machine operands.
Reviewers: Duncan P. N. Exon Smith
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243780
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 31 Jul 2015 20:44:32 +0000 (20:44 +0000)]
IR: Add a broad bitcode compatibility test
Successive versions of LLVM should retain the ability to parse bitcode
generated by old releases of the compiler. This adds a bitcode format
compatibility test, which is intended to provide good (albeit not
entirely exhaustive) coverage of the current LangRef.
This also includes compatibility tests for LLVM 3.6. After every 3.X.0
release, the compatibility.ll file from the 3.X branch should be copied
to compatibility-3.X.ll on trunk, and the 3.X.0 release used to generate
a corresponding bitcode file.
Patch by Vedant Kumar!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243779
91177308-0d34-0410-b5e6-
96231b3b80d8