1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

2834 Commits

Author SHA1 Message Date
Michael Gottesman
faf00da81c [ilist_node] Add a getReverseIterator() method and a unittest for it.
This is the reverse_iterator analogue of getIterator().

llvm-svn: 285780
2016-11-02 00:59:58 +00:00
Peter Collingbourne
dad5df2ecb Support: Remove MemoryObject and DataStreamer interfaces.
These interfaces are no longer used.

Differential Revision: https://reviews.llvm.org/D26222

llvm-svn: 285774
2016-11-02 00:08:37 +00:00
Peter Collingbourne
352f695def Bitcode: Change reader interface to take memory buffers.
As proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/106595.html

This change also fixes an API oddity where BitstreamCursor::Read() would
return zero for the first read past the end of the bitstream, but would
report_fatal_error for subsequent reads. Now we always report_fatal_error
for all reads past the end. Updated clients to check for the end of the
bitstream before reading from it.

I also needed to add padding to the invalid bitcode tests in
test/Bitcode/. This is because the streaming interface was not checking that
the file size is a multiple of 4.

Differential Revision: https://reviews.llvm.org/D26219

llvm-svn: 285773
2016-11-02 00:08:19 +00:00
George Burgess IV
1f539103d7 [MemorySSA] Tighten up types to make our API prettier. NFC.
Patch by bryant.

Differential Revision: https://reviews.llvm.org/D26126

llvm-svn: 285750
2016-11-01 21:17:46 +00:00
Alex Bradbury
4a18531531 [RISCV] Recognise riscv32 and riscv64 in triple parsing code
This is the first in a series of 10 initial patches that incrementally add an 
MC layer for RISC-V to LLVM. See 
<http://lists.llvm.org/pipermail/llvm-dev/2016-August/103748.html> for more 
discussion.

Differential Revision: https://reviews.llvm.org/D23557

llvm-svn: 285707
2016-11-01 16:47:54 +00:00
Serge Pavlov
1fe9a11b5d Attempt to pacify buildbot
llvm-svn: 285676
2016-11-01 07:52:10 +00:00
Serge Pavlov
aa12d5f188 Allow resolving response file names relative to including file
If a response file included by construct @file itself includes a response file
and that file is specified by relative file name, current behavior is to resolve
the name relative to the current working directory. The change adds additional
flag to ExpandResponseFiles that may be used to resolve nested response file
names relative to including file. With the new mode a set of related response
files may be kept together and reference each other with short position
independent names.

Differential Revision: https://reviews.llvm.org/D24917

llvm-svn: 285675
2016-11-01 06:53:29 +00:00
Sanjoy Das
8c2e102e22 Make a test case more rigorous; NFC
llvm-svn: 285536
2016-10-31 03:32:45 +00:00
Sanjoy Das
44d495281b [SCEV] Try to order n-ary expressions in CompareValueComplexity
llvm-svn: 285535
2016-10-31 03:32:43 +00:00
Sanjoy Das
ef49cb2026 [SCEV] Reduce boilerplate in unit tests
llvm-svn: 285534
2016-10-31 03:32:39 +00:00
Sanjoy Das
c5ce7d0a21 [SCEV] In CompareValueComplexity, order global values by their name
llvm-svn: 285529
2016-10-30 23:52:56 +00:00
Sanjoy Das
24665376d6 Clean up test a little bit; NFC
llvm-svn: 285527
2016-10-30 23:52:50 +00:00
Zachary Turner
ffabf1c406 Resubmit "Add support for advanced number formatting."
This resubmits r284436 and r284437, which were reverted in
r284462 as they were breaking the AArch64 buildbot.

The breakage on AArch64 turned out to be a miscompile which is
still not fixed, but is actively tracked at llvm.org/pr30748.

This resubmission re-writes the code in a way so as to make the
miscompile not happen.

llvm-svn: 285483
2016-10-29 00:27:22 +00:00
Greg Clayton
c59e887dd6 Switch all DWARF variables for tags, attributes and forms over to use the llvm::dwarf enumerations instead of using raw uint16_t values. This allows easier debugging as users can see the values of the enumerations in the variables view that will show the enumeration string instead of just a number.
https://reviews.llvm.org/D26013

llvm-svn: 285309
2016-10-27 16:32:04 +00:00
Victor Leschuk
8e524a13df DebugInfo: fix incorrect alignment type (NFC)
Change type of some missed DebugInfo-related alignment variables,
that are still uint64_t, to uint32_t.

Original change introduced in r284482.

llvm-svn: 285242
2016-10-26 21:32:29 +00:00
Peter Collingbourne
f4cf97ceb0 Cloning: Also clone global variable attached metadata.
llvm-svn: 285161
2016-10-26 02:57:33 +00:00
Vedant Kumar
89649e6bdb [unittests] STLExtrasTest: Remove an MSVC 2013 workaround, NFCI.
Let's see what the bots have to say about this...

llvm-svn: 285091
2016-10-25 18:11:17 +00:00
Vedant Kumar
2cbace1580 [unittests] Remove an MSVC 2013 workaround, NFCI.
Let's see what the bots have to say about this...

llvm-svn: 285090
2016-10-25 17:58:25 +00:00
Benjamin Kramer
45f4714955 [Support] Fix AlignOf test on i386-linux.
On i386 alignof(double) = 8 is not the same as alignof(struct { double
}) = 4. This used to be not an issue because the old implementation
always measured alignment inside of structs. Wrap a dummy struct around
the test to avoid this issue.

llvm-svn: 284812
2016-10-21 09:15:57 +00:00
Daniel Berlin
aabe0b98f9 [MSSA] Avoid unnecessary use walks when calling getClobberingMemoryAccess
Summary:
This allows us to mark when uses have been optimized.
This lets us avoid rewalking (IE when people call getClobberingAccess on everything), and also
enables us to later relax the requirement of use optimization during updates with less cost.

Reviewers: george.burgess.iv

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25172

llvm-svn: 284771
2016-10-20 20:13:45 +00:00
Benjamin Kramer
b471938ca6 [Support] Remove llvm::alignOf now that all uses are gone.
Also clean up the legacy hacks for AlignedCharArray. I'm keeping
LLVM_ALIGNAS alive for a bit longer because GCC 4.8.0 (which we still
support apparently) shipped a buggy alignas(). All other supported
compilers have a working alignas.

llvm-svn: 284736
2016-10-20 15:36:38 +00:00
Benjamin Kramer
7999e6045a Retire llvm::alignOf in favor of C++11 alignof.
No functionality change intended.

llvm-svn: 284733
2016-10-20 15:02:18 +00:00
Pavel Labath
ca99da74b1 Reapply "Add Chrono.h - std::chrono support header"
This is a resubmission of r284590. The mingw build should be fixed now. The
problem was we were matching time_t with _localtime_64s, which was incorrect on
_USE_32BIT_TIME_T systems. Instead I use localtime_s, which should always
evaluate to the correct function.

llvm-svn: 284720
2016-10-20 12:05:50 +00:00
Victor Leschuk
dc86c51611 DebugInfo: preparation to implement DW_AT_alignment
- Add alignment attribute to DIVariable family
 - Modify bitcode format to match new DIVariable representation
 - Update tests to match these changes (also add bitcode upgrade test)
 - Expect that frontend passes non-zero align value only when it is not default
   (was forcibly aligned by alignas()/_Alignas()/__atribute__(aligned())

Differential Revision: https://reviews.llvm.org/D25073

llvm-svn: 284678
2016-10-20 00:13:12 +00:00
Mehdi Amini
fc6ad6010e Add computeHostNumPhysicalCores() implementation for Darwin
Differential Revision: https://reviews.llvm.org/D25800

llvm-svn: 284656
2016-10-19 22:36:07 +00:00
Mehdi Amini
f7a229fb6c [ADT] Zip range adapter
This augments the STLExtras toolset with a zip iterator and range
adapter. Zip comes in two varieties: `zip`, which will zip to the
shortest of the input ranges, and `zip_first`, which limits its
`begin() == end()` checks to just the first range.

Recommit r284035 after MSVC2013 support has been dropped.

Patch by: Bryant Wong <github.com/bryant>

Differential Revision: https://reviews.llvm.org/D23252

llvm-svn: 284623
2016-10-19 18:02:21 +00:00
Pavel Labath
72bcdae4fb Revert "Add Chrono.h - std::chrono support header"
This reverts commit r284590 as it fails on the mingw buildbot. I think I know the
fix, but I cannot test it right now. Will reapply when I verify it works ok.

This reverts r284590.

llvm-svn: 284615
2016-10-19 17:17:53 +00:00
Artur Pilipenko
6a0a975738 Introduce ConstantRange.addWithNoSignedWrap
To be used by upcoming change to IndVarSimplify

Reviewed By: sanjoy

Differential Revision: https://reviews.llvm.org/D25732

llvm-svn: 284597
2016-10-19 14:44:23 +00:00
Pavel Labath
79a60cfd95 Add Chrono.h - std::chrono support header
Summary:
std::chrono mostly covers the functionality of llvm::sys::TimeValue and
lldb_private::TimeValue. This header adds a bit of utility functions and
typedefs, which make the usage of the library and porting code from TimeValues
easier.

Rationale:
- TimePoint typedef - precision of system_clock is implementation defined -
  using a well-defined precision helps maintain consistency between platforms,
  makes it interact better with existing TimeValue classes, and avoids cases
  there a time point is implicitly convertible to a specific precision on some
  platforms but not on others.
- system_clock::to_time_t only accepts time_points with the default system
  precision (even though time_t has only second precision on all platforms we
  support). To avoid the need for explicit casts, I have added a toTimeT()
  wrapper function. toTimePoint(time_t) was not strictly necessary, but I have
  added it for symmetry.

Reviewers: zturner, mehdi_amini

Subscribers: beanz, mgorny, llvm-commits, modocache

Differential Revision: https://reviews.llvm.org/D25416

llvm-svn: 284590
2016-10-19 13:58:55 +00:00
Vitaly Buka
53f2da3ddf [asan] Simplify calculation of stack frame layout extraction calculation of stack description into separate function.
Reviewers: eugenis

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25754

llvm-svn: 284547
2016-10-18 23:29:52 +00:00
Vitaly Buka
c8fcecb754 [asan] Append line number to variable name if line is available and in the same file as the function.
PR30498

Reviewers: eugenis

Differential Revision: https://reviews.llvm.org/D25715

llvm-svn: 284546
2016-10-18 23:29:41 +00:00
Justin Lebar
99da2a4624 [ADT] Remove CachedHash<T>.
Nobody is using it.

Differential Revision: https://reviews.llvm.org/D25630

llvm-svn: 284503
2016-10-18 17:50:39 +00:00
Sanjoy Das
b8470ee37b [SCEV] Make CompareValueComplexity a little bit smarter
This helps canonicalization in some cases.

Thanks to Pankaj Chawla for the investigation and the test case!

llvm-svn: 284501
2016-10-18 17:45:16 +00:00
Victor Leschuk
7f37d10b43 DebugInfo: change alignment type from uint64_t to uint32_t to save space.
In futher patches we shall have alignment field added to DIVariable family
and switching from uint64_t to uint32_t will save 4 bytes per variable.

Differential Revision: https://reviews.llvm.org/D25620

llvm-svn: 284482
2016-10-18 14:31:22 +00:00
Renato Golin
0f7aee9eaa Revert "Resubmit "Add support for advanced number formatting.""
This reverts commits 284436 and 284437 because they still break AArch64 bots:

Value of: format_number(-10, IntegerStyle::Integer, 1)
  Actual: "-0"
  Expected: "-10"

llvm-svn: 284462
2016-10-18 09:30:18 +00:00
Zachary Turner
7471bcddec Rename HexStyle -> HexFormatStyle, and remove a constexpr.
This should fix the remaining broken builds.

llvm-svn: 284437
2016-10-17 23:08:47 +00:00
Zachary Turner
149b69c384 Resubmit "Add support for advanced number formatting."
This resubmits commits 284425 and r284428, which were reverted
in r284429 due to some infinite recursion caused by an incorrect
selection of function overloads.  Reproduced the failure on Linux
using GCC 4.8.4, and confirmed that with the new patch the tests
path on GCC as well as MSVC.  So hopefully this fixes everything.

llvm-svn: 284436
2016-10-17 22:49:24 +00:00
Justin Lebar
75fea7eeef [ADT] Move CachedHashString to its own header in ADT, and rename to CachedHashStringRef.
Summary:
Reclaiming the name 'CachedHashString' will let us add a type with that
name that owns its value.

Reviewers: timshen

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25644

llvm-svn: 284434
2016-10-17 22:24:36 +00:00
Justin Lebar
a5139fe1d8 [ADT] Add an initializer_list constructor to {Small,}DenseSet.
Reviewers: timshen

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25629

llvm-svn: 284433
2016-10-17 22:24:32 +00:00
Justin Lebar
af9f288629 [ADT] Add SmallDenseSet.
Summary: This matches SmallDenseMap.

Reviewers: timshen

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25628

llvm-svn: 284432
2016-10-17 22:24:28 +00:00
Zachary Turner
d265446db4 Revert formatting changes.
This reverts r288425 and r284428 as they are causing test crashes
on some systems.

llvm-svn: 284429
2016-10-17 21:25:41 +00:00
Zachary Turner
d60dce16ae Try to fix build after invalid pointer conversion.
llvm-svn: 284428
2016-10-17 21:14:27 +00:00
Zachary Turner
1a9ea1b68a [Support] Add support for "advanced" number formatting.
raw_ostream has not afforded a lot of flexibility in terms of
how to format numbers when outputting.  Wrap this all up into
a set of low level helper functions that can be used to output
numbers with arbitrary precision, alignment, format, etc and
then update raw_ostream to use these functions.

This will be useful for upcoming improvements to llvm's string
formatting libraries, but are still useful independently.

Differential Revision: https://reviews.llvm.org/D25497

llvm-svn: 284425
2016-10-17 20:57:45 +00:00
Teresa Johnson
61cd8d0bb8 Rename interface for querying physical hardware concurrency
Based on post-commit review for D25585/r284180, rename
hardware_physical_concurrency to heavyweight_hardware_concurrency,
to better reflect what type of tasks it should be used for and
to enable other systems to map this to something other than the
number of physical cores.

llvm-svn: 284390
2016-10-17 14:56:53 +00:00
Benjamin Kramer
d49808acaf [Support] remove_dots: Remove windows test.
Windows doesn't have roots, so I think this test doesn't make sense
there.

llvm-svn: 284386
2016-10-17 13:57:16 +00:00
Benjamin Kramer
dbfa1b204a [Support] remove_dots: Remove .. from absolute paths.
/../foo is still a proper path after removing the dotdot. This should
now finally match https://9p.io/sys/doc/lexnames.html [Cleaning names].

llvm-svn: 284384
2016-10-17 13:28:21 +00:00
Justin Bogner
5e39c399de unittests: Explicitly ignore some return values in crash tests
Ideally these would actually check that the results are reasonable,
but given that we're looping over so many different kinds of path that
isn't really practical.

llvm-svn: 284350
2016-10-16 22:09:24 +00:00
Richard Smith
9a14f428e4 PR30711: Fix incorrect profiling of 'long long' in FoldingSet, then use it to
fix TBAA violation in profiling of pointers.

llvm-svn: 284336
2016-10-16 17:49:09 +00:00
Tim Northover
dc91ae935f GlobalISel: rename legalizer components to match others.
The previous names were both misleading (the MachineLegalizer actually
contained the info tables) and inconsistent with the selector & translator (in
having a "Machine") prefix. This should make everything sensible again.

The only functional change is the name of a couple of command-line options.

llvm-svn: 284287
2016-10-14 22:18:18 +00:00
Vedant Kumar
163ed3d9fd [Coverage] Support loading multiple binaries into a CoverageMapping
Add support for loading multiple coverage readers into a single
CoverageMapping instance. This should make it easier to prepare a
unified coverage report for multiple binaries.

Differential Revision: https://reviews.llvm.org/D25535

llvm-svn: 284251
2016-10-14 17:16:53 +00:00
David L Kreitzer
96ecdb67e0 Define "contiki" OS specifier.
Patch by Michael LeMay

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

llvm-svn: 284240
2016-10-14 14:41:46 +00:00
Diana Picus
e2ef35cd54 [GlobalISel] Get the AArch64 tests to work on Linux
Mostly this just means changing the triple from aarch64-apple-ios to the generic
aarch64--. Only one test needs more significant changes, but GlobalISel already
does the right thing so it's ok to just change the checks.

Differential Revision: https://reviews.llvm.org/D25532

llvm-svn: 284223
2016-10-14 10:19:40 +00:00
Teresa Johnson
6b1749d39a Add interface for querying physical hardware concurrency
Summary:
This will be used by ThinLTO to set the amount of backend
parallelism, which performs better when restricted to the number
of physical cores (on X86 at least, where getHostNumPhysicalCores is
currently defined). If not available this falls back to
thread::hardware_concurrency.

Note I didn't add to the thread class since that is a typedef to
std::thread where available.

Reviewers: mehdi_amini

Subscribers: beanz, llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D25585

llvm-svn: 284180
2016-10-14 00:13:59 +00:00
Teresa Johnson
d495533497 Add interface to compute number of physical cores on host system
Summary:
For now I have only added support for x86_64 Linux, but other systems
can be added incrementally.

This is to be used for setting the default parallelism for ThinLTO
backends (instead of thread::hardware_concurrency which includes
hyperthreading and is too aggressive). I'll send this as a follow-on
patch, and it will fall back to hardware_concurrency when the new
getHostNumPhysicalCores returns -1 (when not supported for a given
host system).

I also added an interface to MemoryBuffer to force reading a file
as a stream - this is required for /proc/cpuinfo which is a special
file that looks like a normal file but appears to have 0 size.
The existing readers of this file in Host.cpp are reading the first
1024 or so bytes from it, because the necessary info is near the top.
But for the new functionality we need to be able to read the entire
file. I can go back and change the other readers to use the new
getFileAsStream as a follow-on patch since it seems much more robust.

Added a unittest.

Reviewers: mehdi_amini

Subscribers: beanz, mgorny, llvm-commits, modocache

Differential Revision: https://reviews.llvm.org/D25564

llvm-svn: 284138
2016-10-13 17:43:20 +00:00
Vedant Kumar
62517999f4 [unittests] Remove a redundant test fixture (NFC)
llvm-svn: 284135
2016-10-13 17:22:44 +00:00
Eric Liu
d7954a6a21 Do not delete leading ../ in remove_dots.
Reviewers: bkramer

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25561

llvm-svn: 284129
2016-10-13 15:07:14 +00:00
Diana Picus
a80f335f61 Remove a FIXME that I forgot about. NFC.
Sorry about the noise.

llvm-svn: 284103
2016-10-13 05:28:55 +00:00
Vedant Kumar
e38a46f1f9 [unittests] Delete even more copy constructors (NFC)
llvm-svn: 284069
2016-10-12 22:44:50 +00:00
Vedant Kumar
4d1a28e2f8 [unittests] Delete some copy constructors (NFC)
llvm-svn: 284066
2016-10-12 22:27:54 +00:00
Vedant Kumar
0ec55f6781 [unittest] Pass a reference instead of making a copy (NFC)
llvm-svn: 284065
2016-10-12 22:27:52 +00:00
Mehdi Amini
d0fe06cc25 Revert "[ADT] Zip range adapter"
This reverts commit r284035, which breaks with MSVC 2013.

llvm-svn: 284037
2016-10-12 19:54:08 +00:00
Mehdi Amini
679ff92d07 [ADT] Zip range adapter
This augments the STLExtras toolset with a zip iterator and range
adapter. Zip comes in two varieties: `zip`, which will zip to the
shortest of the input ranges, and `zip_first`, which limits its
`begin() == end()` checks to just the first krange.

Patch by: Bryant Wong <github.com/bryant>

Differential Revision: https://reviews.llvm.org/D23252

llvm-svn: 284035
2016-10-12 19:43:02 +00:00
Diana Picus
2f31822cdb Add AArch64 unit tests
Add unit tests for checking a few tricky instruction sizes. Also remove the old
tests for the instruction sizes, which were clunky and brittle.

Since this is the first set of target-specific unit tests, we need to add some
CMake plumbing. In the future, adding unit tests for a given target will be as
simple as creating a directory with the same name as the target under
unittests/Target. The tests are only run if the target is enabled in
LLVM_TARGETS_TO_BUILD.

Differential Revision: https://reviews.llvm.org/D24548

llvm-svn: 283990
2016-10-12 09:00:44 +00:00
Chandler Carruth
aa9da3439e [LCG] Add the necessary functionality to the LazyCallGraph to support inlining.
The basic inlining operation makes the following changes to the call graph:
1) Add edges that were previously transitive edges. This is always trivial and
   this patch gives the LCG helper methods to make this more convenient.
2) Remove the inlined edge. We had existing support for this, but it contained
   bugs that needed to be fixed. Testing in the same pattern as the inliner
   exposes these bugs very nicely.
3) Delete a function when it becomes dead because it is internal and all calls
   have been inlined. The LCG had no support at all for this operation, so this
   adds that support.

Two unittests have been added that exercise this specific mutation pattern to
the call graph. They were extremely effective in uncovering bugs. Sadly,
a large fraction of the code here is just to implement those unit tests, but
I think they're paying for themselves. =]

This was split out of a patch that actually uses the routines to
implement inlining in the new pass manager in order to isolate (with
unit tests) the logic that was entirely within the LCG.

Many thanks for the careful review from folks! There will be a few minor
follow-up patches based on the comments in the review as well.

Differential Revision: https://reviews.llvm.org/D24225

llvm-svn: 283982
2016-10-12 07:59:56 +00:00
Jordan Rose
201cd0c255 Re-apply "Disallow ArrayRef assignment from temporaries."
This re-applies r283798, disabled in r283803, with the static_assert
tests disabled under MSVC. The deleted functions still seem to catch
mistakes in MSVC, so it's not a significant loss.

Part of rdar://problem/16375365

llvm-svn: 283935
2016-10-11 20:39:16 +00:00
Reid Kleckner
356339ee08 Avoid unnecessary constexpr to appease MSVC 2013
llvm-svn: 283916
2016-10-11 18:35:13 +00:00
Mehdi Amini
ab3e424eed Make RandomNumberGenerator compatible with <random>
LLVM's RandomNumberGenerator wasn't compatible with
the random distribution from <random>.

Fixes PR25105

Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu>

Differential Revision: https://reviews.llvm.org/D25443

llvm-svn: 283854
2016-10-11 07:13:01 +00:00
Zachary Turner
14d2c535cb Revert "Disallow ArrayRef assignment from temporaries."
This reverts commit r283798, as it causes static asserts on
MSVC 2015 with the following errors:

ArrayRefTest.cpp(38): error C2338: Assigning from single prvalue element
ArrayRefTest.cpp(41): error C2338: Assigning from single xvalue element
ArrayRefTest.cpp(47): error C2338: Assigning from an initializer list

llvm-svn: 283803
2016-10-10 21:36:23 +00:00
Zachary Turner
80d8c682d7 Rename llvm::apply -> llvm::apply_tuple.
llvm::cl already has a function called llvm::apply() so this is
causing an ODR violation.  The STLExtras version should win the
vote on which one gets to be called apply() since it is named
after the equivalent STL function, but since renaiming the cl
version is more difficult, let's do this for now to get the
bots green.

llvm-svn: 283800
2016-10-10 21:24:34 +00:00
Jordan Rose
b52b42ffac Disallow ArrayRef assignment from temporaries.
Without this, the following statements will create ArrayRefs that
refer to temporary storage that goes out of scope by the end of the
line:

  someArrayRef = getSingleElement();
  someArrayRef = {elem1, elem2};

Note that the constructor still has this problem:

  ArrayRef<Element> someArrayRef = getSingleElement();
  ArrayRef<Element> someArrayRef = {elem1, elem2};

but that's a little harder to get rid of because we want to be able to
use this in calls:

  takesArrayRef(getSingleElement());
  takesArrayRef({elem1, elem2});

Part of rdar://problem/16375365. Reviewed by Duncan Exon Smith.

llvm-svn: 283798
2016-10-10 20:57:33 +00:00
Justin Lebar
96d7bc1342 [ADT] Don't use make_pointee_iterator in IteratorTest.
llvm-svn: 283794
2016-10-10 19:56:52 +00:00
Zachary Turner
4022c2b021 Add llvm::apply to STLExtras.
This is equivalent to the C++14 std::apply().  Since we are not
using C++14 yet, this allows us to still make use of apply anyway.

Differential revision: https://reviews.llvm.org/D25100

llvm-svn: 283779
2016-10-10 16:44:09 +00:00
Justin Lebar
02ac32407b [ADT] Add make_pointe{e,r}_iterator.
Reviewers: timshen

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25418

llvm-svn: 283765
2016-10-10 16:26:03 +00:00
Justin Lebar
8960a1706e [ADT] Let MapVector handle non-copyable values.
Summary: The keys must still be copyable, because we store two copies of them.

Reviewers: timshen

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25404

llvm-svn: 283764
2016-10-10 16:25:59 +00:00
Javed Absar
636ccd32c2 [ARM]: Add Cortex-R52 target to LLVM
This patch adds Cortex-R52, the new ARM real-time processor, to LLVM. 
Cortex-R52 implements the ARMv8-R architecture.

llvm-svn: 283542
2016-10-07 12:06:40 +00:00
Mehdi Amini
eb017ddb32 Use StringReg in TargetParser APIs (NFC)
llvm-svn: 283527
2016-10-07 08:37:29 +00:00
Tim Northover
f96ee643d4 GlobalISel: fix misuse of using declaration in test.
Clang didn't diagnose it before. Oops.

llvm-svn: 283451
2016-10-06 13:57:31 +00:00
Petr Hosek
994e0d12ef [Triple] Add triple for Fuchsia
Fuchsia is a new operating system.

Differential Revision: https://reviews.llvm.org/D25116

llvm-svn: 283419
2016-10-06 05:17:26 +00:00
Reid Kleckner
96b15fe0ad Remove extra semicolon
llvm-svn: 283395
2016-10-05 21:46:56 +00:00
Reid Kleckner
4f9ae05be2 Fix the build with MSVC 2013, still cannot default move ctors yet
Ten days.

llvm-svn: 283394
2016-10-05 21:44:46 +00:00
David Callahan
8669fd34a9 Modify df_iterator to support post-order actions
Summary: This makes a change to the state used to maintain visited information for depth first iterator. We know assume a method "completed(...)" which is called after all children of a node have been visited. In all existing cases, this method does nothing so this patch has no functional changes.  It will however allow a client to distinguish back from cross edges in a DFS tree.

Reviewers: nadav, mehdi_amini, dberlin

Subscribers: MatzeB, mzolotukhin, twoh, freik, llvm-commits

Differential Revision: https://reviews.llvm.org/D25191

llvm-svn: 283391
2016-10-05 21:36:16 +00:00
Vitaly Buka
ef86d65751 [ADT] Add missing const_iterator DenseSet::find() const
Summary: Probably overlooked.

Reviewers: eugenis, dblaikie

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D24689

llvm-svn: 283377
2016-10-05 20:36:39 +00:00
Zachary Turner
c9a75c816c Fix build due to comparison of std::pairs.
llvm-svn: 283342
2016-10-05 17:04:36 +00:00
Zachary Turner
10f9def152 Add llvm::enumerate() range adapter.
This allows you to enumerate over a range using a range-based
for while the return type contains the index of the enumeration.

Differential revision: https://reviews.llvm.org/D25124

llvm-svn: 283337
2016-10-05 16:54:09 +00:00
Mehdi Amini
b4869611fc Re-commit "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283285 and re-commit r283275 with
a fix for format("%s", Str); where Str is a StringRef.

llvm-svn: 283298
2016-10-05 05:59:29 +00:00
Dean Michael Berris
05e79dbe22 [Support][CommandLine] Add cl::getRegisteredSubcommands()
This should allow users of the library to get a range to iterate through
all the subcommands that are registered to the global parser. This
allows users to define subcommands in libraries that self-register to
have dispatch done at a different stage (like main). It allows for
writing code like the following:

    for (auto *S : cl::getRegisteredSubcommands()) {
      if (*S) {
	// Dispatch on S->getName().
      }
    }

This change also contains tests that show this usage pattern.

Reviewers: zturner, dblaikie, echristo

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D24489

llvm-svn: 283296
2016-10-05 05:20:08 +00:00
Mehdi Amini
c494f9f824 Revert "Re-commit "Use StringRef in Support/Darf APIs (NFC)""
One test seems randomly broken: DebugInfo/X86/gnu-public-names.ll

llvm-svn: 283285
2016-10-05 01:04:02 +00:00
Mehdi Amini
89a7bf7e21 Re-commit "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283278 and re-commit r283275 with
the update to fix the build on the LLDB side.

llvm-svn: 283281
2016-10-05 00:37:18 +00:00
Mehdi Amini
65317a7af9 Revert "Use StringRef in Support/Darf APIs (NFC)"
This reverts commit r283275, it broke LLDB Android debug server.

llvm-svn: 283278
2016-10-05 00:21:14 +00:00
Mehdi Amini
37c7e3e805 Use StringRef in Support/Darf APIs (NFC)
llvm-svn: 283275
2016-10-04 23:55:40 +00:00
Rafael Espindola
c0ce1c5675 Misc improvements to StringTableBuilder.
This patch adds write methods to StringTableBuilder so that it is
easier to change the underlying implementation.

Using the write methods, avoid creating a temporary buffer when using
mmaped output.

It also uses a more compact key in the DenseMap. Overall this produces
a slightly faster lld:

firefox
  master 6.853419709
  patch  6.841968912 1.00167361138x faster
chromium
  master 4.297280174
  patch  4.298712163 1.00033323147x slower
chromium fast
  master 1.802335952
  patch  1.806872459 1.00251701521x slower
the gold plugin
  master 0.3247149
  patch  0.321971644 1.00852017888x faster
clang
  master 0.551279945
  patch  0.543733194 1.01387951128x faster
llvm-as
  master 0.032743458
  patch  0.032143478 1.01866568391x faster
the gold plugin fsds
  master 0.350814247
  patch  0.348571741 1.00643341309x faster
clang fsds
  master 0.6281672
  patch  0.621130222 1.01132931187x faster
llvm-as fsds
  master 0.030168899
  patch  0.029797155 1.01247582194x faster
scylla
  master 3.104222518
  patch  3.059590248 1.01458766252x faster

llvm-svn: 283266
2016-10-04 22:43:25 +00:00
Zachary Turner
cc36037bff [Support] Add case-insensitive versions of StringSwitch members.
This adds support for CaseLower, CasesLower, StartsWithLower, and
EndsWithLower.

Differential revision: https://reviews.llvm.org/D24686

llvm-svn: 283244
2016-10-04 19:33:13 +00:00
George Burgess IV
5a9f438e2e [MSSA] Allow unittests to use BasicAA when building.
We now build MemorySSA in its ctor, instead of waiting until the user
calls MemorySSA::getWalker. This silently changed our unittests, since
we add BasicAA to AAResults *after* constructing MemorySSA (...but
before calling MemorySSA::getWalker).

None of them broke because we do most of our "did this get optimized
correctly?" tests in .ll files.

llvm-svn: 283158
2016-10-03 23:12:35 +00:00
Zachary Turner
9dbed92a4a Add unit tests for StringSwitch.
Differential revision: https://reviews.llvm.org/D25205

llvm-svn: 283138
2016-10-03 19:56:50 +00:00
Sanjoy Das
26178861cc [ConstantRange] Make getEquivalentICmp smarter
This change teaches getEquivalentICmp to be smarter about generating
ICMP_NE and ICMP_EQ predicates.

An earlier version of this change was landed as rL283057 which had a
use-after-free bug.  This new version has a fix for that bug, and a (C++
unittests/) test case that would have triggered it rL283057.

llvm-svn: 283078
2016-10-02 20:59:05 +00:00
Sanjoy Das
ce09fb6c0a Revert r283057 and r283058
They've broken the sanitizer-bootstrap bots.  Reverting while I investigate.

Original commit messages:

r283057: "[ConstantRange] Make getEquivalentICmp smarter"

r283058: "[SCEV] Rely on ConstantRange instead of custom logic; NFCI"
llvm-svn: 283062
2016-10-02 02:40:27 +00:00
Sanjoy Das
2915cf67fe [ConstantRange] Make getEquivalentICmp smarter
This change teaches getEquivalentICmp to be smarter about generating
ICMP_NE and ICMP_EQ predicates.

llvm-svn: 283057
2016-10-02 00:09:49 +00:00
Mehdi Amini
8e17aa9287 Use StringRef in CommandLine Options handling (NFC)
llvm-svn: 283007
2016-10-01 03:43:20 +00:00
Joerg Sonnenberger
100750a643 Turn LLVM_ENABLE_ABI_BREAKING_CHECKS into a 0/1 definition like
LLVM_ENABLE_THREADS. Include llvm-config.h explicitly in headers to make
sure that the definition is available.

llvm-svn: 282907
2016-09-30 19:52:27 +00:00
Zachary Turner
afdf5e3940 Resubmit "Add llvm::enumerate() to STLExtras."
The CL was originally failing due to the use of some C++14
specific features, so I've removed those.  Hopefully this will
satisfy the bots.

llvm-svn: 282867
2016-09-30 15:43:59 +00:00