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

132489 Commits

Author SHA1 Message Date
Benjamin Kramer
a855b3205f Apply clang-tidy's misc-move-constructor-init throughout LLVM.
No functionality change intended, maybe a tiny performance improvement.

llvm-svn: 270997
2016-05-27 14:27:24 +00:00
Simon Dardis
18b7d75488 [mips] Weaken asm predicate for memory offsets
The isMemWithSimmOffset predicate rejects relocations which is incorrect
behaviour. Linkers and other tools should handle|warn|error when the
field overflows.

Reviewers: dsanders, vkalintiris

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

llvm-svn: 270995
2016-05-27 13:56:36 +00:00
Igor Laevsky
0ac606967a [RewriteStatepointsForGC] All constant should have null base pointer
Currently we consider that each constant has itself as a base value. I.e "base(const) = const". 
This introduces couple of problems when we are trying to avoid reporting constants in statepoint live sets:

1. When querying "base( phi(const1, const2) )" we will get "phi(const1, const2)" as a base pointer. Since 
   it's not a constant we will record it in a stack map. However on practice we don't want this to happen
   (constant are never relocated).
2. base( phi(const, gc ptr) ) = phi( const, base(gc ptr) ). This particular case imposes challenge on our 
   runtime - we don't expect to see constant base pointers other than null. This problems can be avoided 
   by treating all constant as if they were derived from null pointer base. I.e in a first case we will 
   not include constant pointer in a stack map at all. In a second case we will get "phi(null, base(gc ptr))" 
   as a base pointer which is a lot more convenient.

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

llvm-svn: 270993
2016-05-27 13:13:59 +00:00
George Rimar
661afe1c63 Attemp to fix build bot after r270987
It was: "Recommit 270977 - [llvm-mc] - Teach llvm-mc to generate zlib styled compression sections."

Fix:
since test requires no zlib available and r270987 changed the 
compression flag for llvm-mc to mandatory specify the compression style,
then just add 2 available styles to this test.

llvm-svn: 270992
2016-05-27 12:52:30 +00:00
Artem Tamazov
7523016960 [AMDGPU][llvm-mc] Square-braced-syntax for registers - make ":expr2" optional.
Register numbers may be specified as assembly-time expressions.
This feature can be useful in macros and alike. However, expressions
are supported within sqare braces only.

Sqare braces were initially intended to support specifying of multiple
(pairs/quads...) registers. Syntax like v[8:8] which specifies single register
is also supported. That allows expressions but looks a bit unnatural.

This change supports syntax REG[EXPR].
Tests added.

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

llvm-svn: 270990
2016-05-27 12:50:13 +00:00
Benjamin Kramer
63c3e24c6a Avoid some copies by using const references.
clang-tidy's performance-unnecessary-copy-initialization with some manual
fixes. No functional changes intended.

llvm-svn: 270988
2016-05-27 12:30:51 +00:00
George Rimar
f1afe1c451 Recommit 270977 - [llvm-mc] - Teach llvm-mc to generate zlib styled compression sections.
Fix: updated clang code which was not updated by mistake.

Original commit message:
[llvm-mc] - Teach llvm-mc to generate zlib styled compression sections.

This patch is strongly based on previously reverted D20331.
(because of gnuutils < 2.26 does not support compressed debug sections in non zlib-gnu style)

Difference that this patch supports both zlib and zlib-gnu styles.

-compress-debug-sections option now supports next values:

-compress-debug-sections=zlib-gnu
-compress-debug-sections=zlib
-compress-debug-sections=none
Previously specifying -compress-debug-sections enabled zlib-gnu compression,
so anyone can put "-compress-debug-sections=zlib-gnu" to restore the behavior
that was before this patch for case when compression was enabled.

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

llvm-svn: 270987
2016-05-27 12:27:32 +00:00
Benjamin Kramer
284d6ac8f3 Apply clang-tidy's misc-static-assert where it makes sense.
Also fold conditions into assert(0) where it makes sense. No functional
change intended.

llvm-svn: 270982
2016-05-27 11:36:04 +00:00
Benjamin Kramer
5a2861b1b6 [sparc] Remove some unused (and undefined) declarations.
No functionality change.

llvm-svn: 270981
2016-05-27 10:19:03 +00:00
Benjamin Kramer
e944e2f178 [hexagon] Move BlockRanges and RDF stuff into the llvm namespace.
No functional change intended.

llvm-svn: 270980
2016-05-27 10:06:40 +00:00
Benjamin Kramer
1879abe239 [sparc] Move LEON passes into llvm namespace.
Also give them library visiblity while there.

llvm-svn: 270979
2016-05-27 10:06:27 +00:00
George Rimar
58775f45b6 Revert r270977 ([llvm-mc] - Teach llvm-mc to generate zlib styled compression sections.)
It broke buildbot:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/13585/steps/build/logs/stdio

Initial commit message:
[llvm-mc] - Teach llvm-mc to generate zlib styled compression sections.

This patch is strongly based on previously reverted D20331.
(because of gnuutils < 2.26 does not support compressed debug sections in non zlib-gnu style)

Difference that this patch supports both zlib and zlib-gnu styles.

-compress-debug-sections option now supports next values:

-compress-debug-sections=zlib-gnu
-compress-debug-sections=zlib
-compress-debug-sections=none
Previously specifying -compress-debug-sections enabled zlib-gnu compression,
so anyone can put "-compress-debug-sections=zlib-gnu" to restore the behavior
that was before this patch for case when compression was enabled.

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

llvm-svn: 270978
2016-05-27 10:06:16 +00:00
George Rimar
e48e2c996b [llvm-mc] - Teach llvm-mc to generate zlib styled compression sections.
This patch is strongly based on previously reverted D20331.
(because of gnuutils < 2.26 does not support compressed debug sections in non zlib-gnu style)

Difference that this patch supports both zlib and zlib-gnu styles.

-compress-debug-sections option now supports next values:

-compress-debug-sections=zlib-gnu
-compress-debug-sections=zlib
-compress-debug-sections=none
Previously specifying -compress-debug-sections enabled zlib-gnu compression,
so anyone can put "-compress-debug-sections=zlib-gnu" to restore the behavior
that was before this patch for case when compression was enabled.

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

llvm-svn: 270977
2016-05-27 09:58:08 +00:00
Simon Pilgrim
99e3cf65ff Revert: r270973 - [X86][SSE] Replace (V)PMOVSX and (V)PMOVZX integer extension intrinsics with generic IR (llvm)
llvm-svn: 270976
2016-05-27 09:02:25 +00:00
Simon Pilgrim
c8925e270b [X86][SSE] Replace (V)PMOVSX and (V)PMOVZX integer extension intrinsics with generic IR (llvm)
This patch removes the llvm intrinsics VPMOVSX and (V)PMOVZX sign/zero extension intrinsics and auto-upgrades to SEXT/ZEXT calls instead. We already did this for SSE41 PMOVSX sometime ago so much of that implementation can be reused.

A companion patch (D20684) removes/auto-upgrade the clang intrinsics.

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

llvm-svn: 270973
2016-05-27 08:49:15 +00:00
Peter Collingbourne
31d9449ed2 Linker: teach the IR mover to return llvm::Error.
This will be needed in order to consistently return an Error
to clients of the API being developed in D20268.

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

llvm-svn: 270967
2016-05-27 05:21:35 +00:00
Zachary Turner
adc0d69155 [codeview] Remove StreamReader copying method.
Since we want to move toward zero-copy access to stream data, we
want to remove all instances of copying operations.  So get rid
of some of those here.

Differential Revision: http://reviews.llvm.org/D20720
Reviewed By: ruiu

llvm-svn: 270960
2016-05-27 03:51:53 +00:00
Pete Cooper
96fc7f8340 Don't allocate unnecessarily in APInt::operator[+-]. NFC.
APInt::operator+(uint64_t) just forwarded to operator+(const APInt&).

Constructing the APInt for the RHS takes an allocation which isn't
required.  Also, for APInt's in the slow path, operator+ would
call add() internally which iterates over both arrays of values.  Instead
we can use add_1 and sub_1 which only iterate while there is something to do.

Using the memory for 'opt -O2 verify-uselistorder.lto.opt.bc -o opt.bc'
(see r236629 for details), this reduces the number of allocations from
23.9M to 22.7M.

llvm-svn: 270959
2016-05-27 03:42:17 +00:00
Dan Liew
d14bf97a6e [LibFuzzer] Refactor declaration of tests in CMake.
Add a new CMake function (``add_libfuzzer_test()``) to simplify
declaration of executables for testing LibFuzzer and use it to
reorganise how tests are declared.

Note that configuration of the lit configuration files has been moved
as late as possible because we are going to need to disable some tests
for some platforms and we will need to propagate this information into
the lit configuration.

Note the code for custom mains was removed because no tests are
currently written for this and Kostya seems happy to remove this.

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

llvm-svn: 270958
2016-05-27 03:14:40 +00:00
Rui Ueyama
5295a83f17 Remove use of is_trivially_constructible.
type_traits header in libstdc++ 4.8 does not define is_trivially_contructible
so the code doesn't compile with it.

In this file we are using the trait for assertion to provide a better
error message. Removing it doesn't change the meaning of the code.

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

llvm-svn: 270957
2016-05-27 02:47:38 +00:00
Lang Hames
e634ecfd7e [Support] Remove a stale comment.
This comment was included in Peter Collingbourne's original version of
StringError (see http://reviews.llvm.org/D20550), where it made sense. It was
accidentally copied over with the rest of the class, but no longer applies.

llvm-svn: 270956
2016-05-27 02:43:15 +00:00
Pete Cooper
604ae0b712 Form objc_storeStrong in the presence of bitcasts.
objc_storeStrong can be formed from a sequence such as

  %0 = tail call i8* @objc_retain(i8* %p) nounwind
  %tmp = load i8*, i8** @x, align 8
  store i8* %0, i8** @x, align 8
  tail call void @objc_release(i8* %tmp) nounwind

The code was already looking through bitcasts for most of the values
involved, but had missed one case where the pointer operand for the
store was a bitcast.  Ultimately the pointer for the load and store
have to be the same value, after stripping casts.

llvm-svn: 270955
2016-05-27 02:13:53 +00:00
Zachary Turner
6fd1e53381 [codeview] #include missing header breaking builds.
llvm-svn: 270954
2016-05-27 02:12:35 +00:00
Zachary Turner
f070dd590e [codeview,pdb] Try really hard to conserve memory when reading.
PDBs can be extremely large.  We're already mapping the entire
PDB into the process's address space, but to make matters worse
the blocks of the PDB are not arranged contiguously.  So, when
we have something like an array or a string embedded into the
stream, we have to make a copy.  Since it's convenient to use
traditional data structures to iterate and manipulate these
records, we need the memory to be contiguous.

As a result of this, we were using roughly twice as much memory
as the file size of the PDB, because every stream was copied
out and re-stitched together contiguously.

This patch addresses this by improving the MappedBlockStream
to allocate from a BumpPtrAllocator only when a read requires
a discontiguous read.  Furthermore, it introduces some data
structures backed by a stream which can iterate over both
fixed and variable length records of a PDB.  Since everything
is backed by a stream and not a buffer, we can read almost
everything from the PDB with zero copies.

Differential Revision: http://reviews.llvm.org/D20654
Reviewed By: ruiu

llvm-svn: 270951
2016-05-27 01:54:44 +00:00
Lang Hames
ddc9000626 [Support] Rename unconvertibleErrorCode to inconvertibleErrorCode.
Based on a totally scientific, 30 second google search "in-" appears to be the
preferred prefix.

llvm-svn: 270950
2016-05-27 01:54:25 +00:00
Lang Hames
776aaf18f4 [Support] Add a StringError convenience class to Error.h
StringError can be used to represent Errors that aren't recoverable based on
the error type, but that have a useful error message that can be reported to
the user or logged.

llvm-svn: 270948
2016-05-27 01:37:32 +00:00
Kostya Serebryany
902fe15d1a [libFuzzer] make check-fuzzer a bit faster
llvm-svn: 270947
2016-05-27 01:12:21 +00:00
Michael Zolotukhin
1c074e07a1 [LoopUnrollAnalyzer] Bail out instead of dying with assert when facing huge index.
This fixes PR27902.

llvm-svn: 270946
2016-05-27 00:55:16 +00:00
Kostya Serebryany
9f5eabe7a7 [libFuzzer] make OOM-handling more portable. Instead of sending a signal to the main fuzzing thread, print the message in the getrusage thread and exit.
llvm-svn: 270945
2016-05-27 00:54:15 +00:00
Mehdi Amini
9f7e3b1af1 ValueMapper: fix typo in minor optimization on constant mapping (NFC)
If every operands of a constant are mapping to themselves, and the
type does not change, we have an early exit as acknowledged in the
comment:

  // Otherwise, we have some other constant to remap.  Start by checking to see
  // if all operands have an identity remapping.

However instead of checking for identity the code was checking if the
operands were mapped to the constant itself, which is rarely true.

As a consequence, the coverage report showed that the early exit was
never taken.

llvm-svn: 270944
2016-05-27 00:32:12 +00:00
Rui Ueyama
bec79eea24 pdbdump: print out the name of the stream 0.
Differential Revision: http://reviews.llvm.org/D20712

llvm-svn: 270943
2016-05-27 00:32:07 +00:00
Kostya Serebryany
becd6c1393 [libFuzzer] more refactoring: make sure CurrentUnitData is awlays a valid pointer to read from
llvm-svn: 270942
2016-05-27 00:21:33 +00:00
Rui Ueyama
2377837e57 pdbdump: Add -raw-all to enable all -raw-* flags.
Differential Revision: http://reviews.llvm.org/D20707

llvm-svn: 270937
2016-05-26 23:26:55 +00:00
Hans Wennborg
0ad4be44f3 Sort my entry in CODE_OWNERS.TXT
llvm-svn: 270936
2016-05-26 23:10:37 +00:00
Mitch Bodart
8ebfa4a476 [CodeGen] Fix problem with X86 byte registers in CriticalAntiDepBreaker
CriticalAntiDepBreaker was not correctly tracking defs of the high X86 byte
registers, leading to incorrect use of a busy register to break an
antidependence.

Fixes pr27681, and its duplicates pr27580, pr27804.

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

llvm-svn: 270935
2016-05-26 23:08:52 +00:00
Rui Ueyama
236464f52f Fix typo.
llvm-svn: 270934
2016-05-26 23:01:05 +00:00
Easwaran Raman
cf39437fc9 Attach profile summary in IR based instrumentation pass.
Differential revision: http://reviews.llvm.org/D20655

llvm-svn: 270933
2016-05-26 22:57:11 +00:00
Justin Bogner
cec66e3e56 SDAG: Use an Optional<> instead of a sigil value. NFC
This just makes it a bit more clear that we don't intend to use a
deleted node for anything here.

llvm-svn: 270931
2016-05-26 22:29:34 +00:00
Kostya Serebryany
c5d4c0f8da [libFuzzer] more refactoring around CurrentUnit. Also add a threading test on which we currently have a race (when reporting bugs from multiple threads)
llvm-svn: 270929
2016-05-26 22:17:32 +00:00
Dan Liew
c35cbd3461 [LibFuzzer] Add missing #include<string>
This partially fixes the compilation of the LibFuzzer unit test
on OSX using AppleClang.

llvm-svn: 270926
2016-05-26 21:54:25 +00:00
Michael Zolotukhin
99ecc2d594 [LoopUnrollAnalyzer] Fix a crash in analyzeLoopUnrollCost.
Condition might be simplified to a Constant, but it doesn't have to be
ConstantInt, so we should dyn_cast, instead of cast.

This fixes PR27886.

llvm-svn: 270924
2016-05-26 21:42:51 +00:00
Adrian Prantl
d54d3a3a6d PR26055: Speed up LiveDebugValues::transferDebugValue()
This patch builds upon r270776 and speeds up
LiveDebugValues::transferDebugValue() by adding an index that maps each
DebugVariable to its open VarLoc.

The transferDebugValue() function needs to close all open ranges for a
given DebugVariable. Iterating over the set bits of OpenRanges is
prohibitively slow in practice. I experimented with using the sorted map
of VarLocs in the UniqueVector to iterate only over the range of VarLocs
with a given DebugVariable, but the binary search turned out to be even
more expensive than just iterating over the set bits in OpenRanges.
Instead, this patch exploits the fact that there can only be one open
location for each DebugVariable and redundantly stores this location in a
DenseMap.

This patch brings the time spent in the LiveDebugValues pass down to an
almost neglectiable amount.

http://llvm.org/bugs/show_bug.cgi?id=26055
http://reviews.llvm.org/D20636
rdar://problem/24091200

llvm-svn: 270923
2016-05-26 21:42:47 +00:00
Kostya Serebryany
14432c81d1 [libFuzzer] refactor: hide CurrentUnitData inside an interface function. NFC
llvm-svn: 270922
2016-05-26 21:32:30 +00:00
Chris Bieneman
875fc32428 [Docs][WritingAnLLVMBackend] Makefiles are deprecated
Summary: * docs/WritingAnLLVMBackend.rst: Makefiles are no longer used. The users should use CMakeLists.txt. In order to add the target, the TARGETS_TO_BUILD is replaced with LLVM_ALL_TARGETS.

Reviewers: gribozavr, void, beanz

Subscribers: llvm-commits

Patch By: Visoiu Mistrih Francis (thegameg)

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

llvm-svn: 270921
2016-05-26 21:31:56 +00:00
Chris Bieneman
51f9af7db5 [obj2yaml][yaml2obj] Support for MachO lazy bindings
This adds support for YAML round tripping dyld info lazy bindings. The storage and format of these is the same as regular bind opcodes, they are just interpreted differently by dyld, and can have DONE opcodes in the middle of the opcode lists.

llvm-svn: 270920
2016-05-26 21:29:39 +00:00
Lang Hames
e814994c80 [Kaleidoscope][BuildingAJIT] Remove leftover debugging output statements.
llvm-svn: 270919
2016-05-26 21:27:52 +00:00
Lang Hames
e9c7d869d1 [Kaleidoscope][BuildingAJIT] Fix strong emphasis markup by removing whitespace.
llvm-svn: 270918
2016-05-26 21:21:18 +00:00
Lang Hames
fff5c0ec1c [Kaleidoscope][BuildingAJIT] Add docs for Chapter 3 of the Building A JIT
tutorial.

llvm-svn: 270917
2016-05-26 21:17:06 +00:00
Lang Hames
de66f5adb4 [Error] Make ECError only constructible via errorCodeToError.
This enforces idiomatic usage of ECError removing the option to construct them
using make_error.

llvm-svn: 270916
2016-05-26 21:15:58 +00:00
Sanjoy Das
ad303a5ebd Add myself as the code owner for SCEV and IndVarSimplify
llvm-svn: 270915
2016-05-26 21:12:44 +00:00