27621 Commits

Author SHA1 Message Date
David Majnemer
2be59141b8 An empty record cannot be null-terminated
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271104 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 05:59:22 +00:00
Petr Hosek
27f2fb013f [MC] Support symbolic expressions in assembly directives
This matches the behavior of GNU assembler which supports symbolic
expressions in absolute expressions used in assembly directives.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271102 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 05:57:48 +00:00
Zachary Turner
5cfb6469b8 [pdb] Finish conversion to zero copy pdb access.
This converts remaining uses of ByteStream, which was still
left in the symbol stream and type stream, to using the new
StreamInterface zero-copy classes.

RecordIterator is finally deleted, so this is the only way left
now.  Additionally, more error checking is added when iterating
the various streams.

With this, the transition to zero copy pdb access is complete.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271101 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 05:21:57 +00:00
Matt Arsenault
14cb586d5e AMDGPU: Add fract intrinsic
Remove broken patterns matching it. This was matching the
unsafe math pattern and expanding the fix for the buggy instruction
from the pattern. The problems are also on CI. Remove the workarounds
and only use fract with unsafe math or from the intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271078 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-28 00:19:52 +00:00
Xinliang David Li
bc6df7a799 [PM] Port the Sample FDO to new PM (part-2)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271072 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 23:20:16 +00:00
Evgeny Stupachenko
1369b53da1 The patch refactors unroll pass.
Summary:
Unroll factor (Count) calculations moved to a new function.
Early exits on pragma and "-unroll-count" defined factor added.
New type of unrolling "Force" introduced (previously used implicitly).
New unroll preference "AllowRemainder" introduced and set "true" by default.
(should be set to false for architectures that suffers from it).

Reviewers: hfinkel, mzolotukhin, zzheng

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

From: Evgeny Stupachenko <evstupac@gmail.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271071 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 23:15:06 +00:00
Vitaly Buka
5683aa8247 [asan] Add option to enable asan-use-after-scope from clang.
Clang will have -fsanitize-address-use-after-scope flag.

PR27453

Reviewers: kcc, eugenis, aizatsky

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271067 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 22:55:10 +00:00
Xinliang David Li
329be24262 [PM] Port the Sample FDO to new PM (part-1)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271062 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 22:30:44 +00:00
Matthias Braun
a827bf1ce5 MachineScheduler: Introduce ONLY1 reason to improve debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271058 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 22:14:26 +00:00
David Majnemer
1fd36bf601 Don't iterate endlessly if an error occurs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 21:25:05 +00:00
Davide Italiano
59250f2810 [Timer] Add missing slash in doxygen commit.
Pointed out by: Sean Silva.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271039 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 20:04:16 +00:00
Petr Hosek
6cc1a144bd Revert "[MC] Support symbolic expressions in assembly directives"
This reverts commit r271028, it causes the directive_fill.s to fail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271038 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 19:58:05 +00:00
Davide Italiano
775400f2fb [Timer] Expose an API to check if the timer is running.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271037 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 19:12:26 +00:00
David Blaikie
91b286fa88 SmallVector: Replace some pre-C++11 move helpers with standard algorithms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271036 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 19:05:14 +00:00
David Majnemer
6dc6bd932d Avoid overflow when computing the size of an array
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271031 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 18:50:00 +00:00
David Majnemer
ff1f0398f1 Don't assume that there will be enough padding bytes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271030 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 18:49:58 +00:00
David Majnemer
cb3c571452 Don't assume that there will be another null byte
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271029 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 18:49:51 +00:00
Petr Hosek
1ae94e2387 [MC] Support symbolic expressions in assembly directives
This matches the behavior of GNU assembler which supports symbolic
expressions in absolute expressions used in assembly directives.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271028 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 18:49:44 +00:00
Zachary Turner
e8799b644b Resubmit "[pdb] Allow zero-copy read support for symbol streams.""
Due to differences in template instantiation rules, it is not
portable to static_assert(false) inside of an invalid specialization
of a template.  Instead I just =delete the method so that it can't
be used, and leave a comment that it must be explicitly specialized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271027 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 18:47:20 +00:00
Chad Rosier
1f37794220 Revert "[pdb] Allow zero-copy read support for symbol streams."
This reverts commit r271024 due to error: static_assert failed
"You must either provide a specialization of VarStreamArrayExtractor
or a custom extractor"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271026 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 18:31:02 +00:00
Zachary Turner
6e1b1bf7c7 [pdb] Allow zero-copy read support for symbol streams.
This reduces the amount of memory used by llvm-pdbdump by roughly
1/3 of the size of the PDB file.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271025 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 18:20:20 +00:00
Benjamin Kramer
c4a6700e58 [ProfData] Remove global constructor from ProfileSummaryBuilder.
No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271021 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 17:38:16 +00:00
Benjamin Kramer
c023921b38 Make header self-contained. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 15:21:30 +00:00
Benjamin Kramer
14aae01bc3 Apply clang-tidy's misc-move-constructor-init throughout LLVM.
No functionality change intended, maybe a tiny performance improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270997 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 14:27:24 +00:00
George Rimar
ec285af61c 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 12:27:32 +00:00
George Rimar
8ab5c74bc0 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270978 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 10:06:16 +00:00
George Rimar
dd4101a976 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 09:58:08 +00:00
Simon Pilgrim
3808026456 Revert: r270973 - [X86][SSE] Replace (V)PMOVSX and (V)PMOVZX integer extension intrinsics with generic IR (llvm)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270976 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 09:02:25 +00:00
Simon Pilgrim
337a02bbe0 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270973 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 08:49:15 +00:00
Peter Collingbourne
b7bfc99302 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270967 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 05:21:35 +00:00
Zachary Turner
9cc0faee65 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270960 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 03:51:53 +00:00
Pete Cooper
1544fa2368 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 03:42:17 +00:00
Rui Ueyama
8ffa3d6fab 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270957 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 02:47:38 +00:00
Lang Hames
691c7bb303 [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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270956 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 02:43:15 +00:00
Zachary Turner
42ebca4e61 [codeview] #include missing header breaking builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270954 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 02:12:35 +00:00
Zachary Turner
0212bc82e0 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270951 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 01:54:44 +00:00
Lang Hames
c93d4ea0e3 [Support] Rename unconvertibleErrorCode to inconvertibleErrorCode.
Based on a totally scientific, 30 second google search "in-" appears to be the
preferred prefix.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270950 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 01:54:25 +00:00
Lang Hames
5083fc5573 [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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270948 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 01:37:32 +00:00
Rui Ueyama
4c87e7cf1a pdbdump: print out the name of the stream 0.
Differential Revision: http://reviews.llvm.org/D20712

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 00:32:07 +00:00
Chris Bieneman
7593509c1b [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270920 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:29:39 +00:00
Lang Hames
40407440a4 [Error] Make ECError only constructible via errorCodeToError.
This enforces idiomatic usage of ECError removing the option to construct them
using make_error.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:15:58 +00:00
Chris Bieneman
429d7a4cff [obj2yaml][yaml2obj] Support for MachO weak bindings
This adds support for YAML round tripping dyld info weak bindings. The storage and format of these is the same as regular bind opcodes, they are just interpreted differently by dyld.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:50:05 +00:00
Lang Hames
f8e8d07f49 [Orc] Don't create empty globals modules in the CompileOnDemandLayer.
Global variables and aliases are emitted eagerly, but there may not be any in
the incoming module. In that case, we can save some memory and compile time by
not building, emitting and tracking an empty globals module.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:33:37 +00:00
Richard Smith
60364032ef Don't use recursion to print out the PrettyStackTrace after a crash. If the
crash was due to a stack overflow, chances are good that this would also cause
a stack overflow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270903 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:21:55 +00:00
Richard Smith
baaf0f7642 Add new .def file to module map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:13:50 +00:00
Chris Bieneman
7ad3d3b16b [obj2yaml][yaml2obj] Support for MachO bind opcodes
This adds support for YAML round tripping dyld info bind opcodes. Bind opcodes can have signed or unsigned LEB128 data, and they can have symbols associated with them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 20:06:14 +00:00
Michael Kuperstein
b80d8daba8 [BasicAA] Extend inbound GEP negative offset logic to GlobalVariables
r270777 improved the precision of alloca vs. inbounbds GEP alias queries: if
we have (a) an inbounds GEP and (b) a pointer based on an alloca, and the
beginning of the object the GEP points to would have a negative offset with
respect to the alloca, then the GEP can not alias pointer (b).

This makes the same logic fire when (b) is based on a GlobalVariable instead
of an alloca.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270893 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 19:30:49 +00:00
Lang Hames
69bb6054b5 [Orc] Merge some common code for creating CompileCallbackManagers and
IndirectStubsManagers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270874 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 17:20:35 +00:00
Rafael Espindola
22f5417147 Use shouldAssumeDSOLocal on AArch64.
This reduces code duplication and now AArch64 also handles PIE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270844 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 12:42:55 +00:00
Peter Collingbourne
1f1c7c746f MemorySSA: Remove argument to createNewAccess function.
There is only one caller of MemorySSA::createNewAccess, and it passes true
as the IgnoreNonMemory argument. Remove that argument and fold its behavior
into createNewAccess.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 01:19:17 +00:00