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

794 Commits

Author SHA1 Message Date
Evandro Menezes
d6a1cb395c Add support for Samsung Exynos M3 (NFC)
llvm-svn: 289613
2016-12-13 23:31:41 +00:00
Pavel Labath
9de81b0187 Fix MSCV compilation broken by r289040
I wanted to use the "not" keyword to make sure it does not get lost in between
other checks. MSVC does not like that.

llvm-svn: 289041
2016-12-08 11:45:38 +00:00
Pavel Labath
883b408865 Improve format member detection in llvm::formatv
Summary:
The existing detection of a format member function has a couple of deficiencies:
- the member function does not get detected if one calls formatv with an lvalue,
  because the template parameter gets deduced as T&, which fails the is_class
  check.
- it also did not work if the function was called with a const variable because
  the template parameter would get deduced as const T&, again failing the
  is_class check.

This fixes the problem by stripping the references in the uses_format_member
template, to make sure the type is correctly detected as class. It also provides
specializations of the has_FormatMember template for const and non-const members
of the types in order to enable declaring the format member as a "const"
function. I have added tests that verify that formatv can be now called in these
scenarios. As some scenarios could not be verified at runtime (e.g. making sure
that calling a non-const format member on a const object does *not* compile), I
have also added some static_asserts which test the behaviour of the template
classes used internally by formatv().

Reviewers: zturner

Subscribers: llvm-commits

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

llvm-svn: 289040
2016-12-08 11:31:19 +00:00
Zijiao Ma
23426877f4 Refactor TargetParserTests.
The TargetParser tests are a bit redundant. Refactor them in a more
repeatable way.

llvm-svn: 288758
2016-12-06 02:22:08 +00:00
Ivan Krasin
fa2581bf2f Support escaping in TrigramIndex.
Summary:
This is a follow up to r288303, where I have introduced TrigramIndex
to speed up SpecialCaseList for the cases when all rules are
simple wildcards, like *hello*wor.d*.

Here, I add support for escaping, so that it's possible to
specify rules like *c\+\+abi*.

Reviewers: pcc

Subscribers: llvm-commits

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

llvm-svn: 288553
2016-12-02 23:30:16 +00:00
Ivan Krasin
a46f4c6583 Use trigrams to speed up SpecialCaseList.
Summary:
it's often the case when the rules in the SpecialCaseList
are of the form hel.o*bar. That gives us a chance to build
trigram index to quickly discard 99% of inputs without
running a full regex. A similar idea was used in Google Code Search
as described in the blog post:
https://swtch.com/~rsc/regexp/regexp4.html

The check is defeated, if there's at least one regex
more complicated than that. In this case, all inputs
will go through the regex. That said, the real-world
rules are often simple or can be simplied. That considerably
speeds up compiling Chromium with CFI and UBSan.

As measured on Chromium's content_message_generator.cc:

before, CFI: 44 s
after, CFI: 23 s
after, CFI, no blacklist: 23 s (~1% slower, but 3 runs were unable to show the difference)
after, regular compilation to bitcode: 23 s

Reviewers: pcc

Subscribers: mgorny, llvm-commits

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

llvm-svn: 288303
2016-12-01 02:54:54 +00:00
Mehdi Amini
795ba2efa7 Fix macro check for ABI breacking check: should use #if instead of #ifndef
llvm-svn: 288265
2016-11-30 19:08:41 +00:00
Mehdi Amini
0242771a6d Change Error unittest to use the LLVM_ENABLE_ABI_BREAKING_CHECKS instead of NDEBUG
This is consistent with the header (after r288087) and fixes the
test for the configuration:
  -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF

llvm-svn: 288196
2016-11-29 20:45:48 +00:00
Mehdi Amini
59c07301c1 Improve error handling in YAML parsing
Some scanner errors were not checked and reported by the parser.

Fix PR30934. Recommit r288014 after fixing unittest.

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

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

llvm-svn: 288071
2016-11-28 21:38:52 +00:00
Davide Italiano
24691c7655 [ThreadPool] Rollback recent changes until I figure out the breakage.
llvm-svn: 288018
2016-11-28 09:17:12 +00:00
Davide Italiano
ada55c7225 [ThreadPool] Simplify the interface. NFCI.
The callers don't use the return value. Found by Michael
Spencer.

llvm-svn: 288016
2016-11-28 08:53:41 +00:00
Mehdi Amini
00d03454ba Revert "Improve error handling in YAML parsing"
This reverts commit r288014, the unittest isn't passing

llvm-svn: 288015
2016-11-28 04:57:04 +00:00
Mehdi Amini
9c02412ec8 Improve error handling in YAML parsing
Some scanner errors were not checked and reported by the parser.

Fix PR30934

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

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

llvm-svn: 288014
2016-11-28 04:44:13 +00:00
Rui Ueyama
e33d058f16 Add convenient functions to compute hashes of byte vectors.
In many sitautions, you just want to compute a hash for one chunk
of data. This patch adds convenient functions for that purpose.

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

llvm-svn: 287726
2016-11-23 00:46:09 +00:00
Matthias Braun
bcd40e41de Timer: Track name and description.
The previously used "names" are rather descriptions (they use multiple
words and contain spaces), use short programming language identifier
like strings for the "names" which should be used when exporting to
machine parseable formats.

Also removed a unused TimerGroup from Hexxagon.

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

llvm-svn: 287369
2016-11-18 19:43:18 +00:00
Pavel Labath
19ad867b59 Remove TimeValue class
Summary:
All uses have been replaced by appropriate std::chrono types, and the class is
now unused.

Reviewers: zturner, mehdi_amini

Subscribers: llvm-commits, mgorny

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

llvm-svn: 287094
2016-11-16 10:46:48 +00:00
Chad Rosier
43ed029160 [AArch64] Add support for Qualcomm's Falkor CPU.
Differential Revision: https://reviews.llvm.org/D26673

llvm-svn: 287036
2016-11-15 21:34:12 +00:00
Chad Rosier
7d1c3127d1 [AArch64] Refactor test per Matthias' request.
llvm-svn: 287031
2016-11-15 21:18:18 +00:00
Zachary Turner
1cad744181 [Support] Introduce llvm::formatv() function.
This introduces a new type-safe general purpose formatting
library.  It provides compile-time type safety, does not require
a format specifier (since the type is deduced), and provides
mechanisms for extending the format capability to user defined
types, and overriding the formatting behavior for existing types.

This patch additionally adds documentation for the API to the
LLVM programmer's manual.

Mailing List Thread:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105836.html

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

llvm-svn: 286682
2016-11-11 23:57:40 +00:00
Mehdi Amini
71e37b10ff Prevent at compile time converting from Error::success() to Expected<T>
This would trigger an assertion at runtime otherwise.

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

llvm-svn: 286562
2016-11-11 04:29:25 +00:00
Mehdi Amini
3d0dd0ec2c Make the Error class constructor protected
This is forcing to use Error::success(), which is in a wide majority
of cases a lot more readable.

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

llvm-svn: 286561
2016-11-11 04:28:40 +00:00
Davide Italiano
13a1ee50ea [ADT/MathExtras] Make buildbot happy again.
llvm-svn: 286559
2016-11-11 04:03:29 +00:00
Davide Italiano
99d50aaa8a [ADT/MathExtras] Add tests for PowerOf2Floor (previously untested).
llvm-svn: 286551
2016-11-11 02:38:24 +00:00
Davide Italiano
160c3e1fee [ADT/MathExtras] Introduce PowerOf2Ceil.
To be used in lld (and probably somewhere else in llvm).

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

llvm-svn: 286549
2016-11-11 02:22:16 +00:00
Zachary Turner
cd93c0e109 [Support] Improve flexibility of binary blob formatter.
This makes it possible to indent a binary blob by a certain
number of bytes, and also makes some things more idiomatic.
Finally, it integrates this binary blob formatter into ScopedPrinter
which used to have its own implementation of this algorithm.

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

llvm-svn: 286495
2016-11-10 20:16:45 +00:00
Greg Clayton
8ad43c1b44 Added the ability to dump hex bytes easily into a raw_ostream.
Unit tests were added to verify this functionality keeps working correctly.

Example output for raw hex bytes:
llvm::ArrayRef<uint8_t> Bytes = ...;
llvm::outs() << format_hex_bytes(Bytes);
554889e5 4881ec70 04000048 8d051002
00004c8d 05fd0100 004c8b0d d0020000

Example output for raw hex bytes with offsets:
llvm::outs() << format_hex_bytes(Bytes, 0x100000d10);
0x0000000100000d10: 554889e5 4881ec70 04000048 8d051002
0x0000000100000d20: 00004c8d 05fd0100 004c8b0d d0020000

Example output for raw hex bytes with ASCII with offsets:
llvm::outs() << format_hex_bytes_with_ascii(Bytes, 0x100000d10);
0x0000000100000d10: 554889e5 4881ec70 04000048 8d051002 |UH.?H.?p...H....|
0x0000000100000d20: 00004c8d 05fd0100 004c8b0d d0020000 |..L..?...L..?...|

The default groups bytes into 4 byte groups, but this can be changed to 1 byte:
llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 16 /*NumPerLine*/, 1 /*ByteGroupSize*/);
0x0000000100000d10: 55 48 89 e5 48 81 ec 70 04 00 00 48 8d 05 10 02
0x0000000100000d20: 00 00 4c 8d 05 fd 01 00 00 4c 8b 0d d0 02 00 00

llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 16 /*NumPerLine*/, 2 /*ByteGroupSize*/);
0x0000000100000d10: 5548 89e5 4881 ec70 0400 0048 8d05 1002
0x0000000100000d20: 0000 4c8d 05fd 0100 004c 8b0d d002 0000

llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 8 /*NumPerLine*/, 1 /*ByteGroupSize*/);
0x0000000100000d10: 55 48 89 e5 48 81 ec 70
0x0000000100000d18: 04 00 00 48 8d 05 10 02
0x0000000100000d20: 00 00 4c 8d 05 fd 01 00
0x0000000100000d28: 00 4c 8b 0d d0 02 00 00

https://reviews.llvm.org/D26405

llvm-svn: 286316
2016-11-09 00:15:54 +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
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
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
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
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
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
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
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
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
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
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
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