Commit Graph

26010 Commits

Author SHA1 Message Date
David Majnemer
294255bbe4 [CodeView] Add support for dumping binary annotations
Binary annotations are encoded along the lines of UTF-8 and ECI but with
a few minor differences.

The algorithm specified in "ECMA-335 CLI Section II.3.2 - Blobs and
Signatures" is used to compress binary annotations.  Signed binary
annotations are encoded like unsigned annotations except the sign bit is
rotated left to reduce the number of bits needed to be encoded.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257742 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14 06:12:30 +00:00
Xinliang David Li
e6075bdf86 Fix comments /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257740 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14 04:22:45 +00:00
Xinliang David Li
5fd06e2add [PGO] clean up and documentation
Introduce enum for indexed format versions and 
document indexed format change history.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257737 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14 02:47:01 +00:00
David Majnemer
f7cfdf8b26 [X86] Don't alter HasOpaqueSPAdjustment after we've relied on it
We rely on HasOpaqueSPAdjustment not changing after we've calculated
things based on it.  Things like whether or not we can use 'rep;movs' to
copy bytes around, that sort of thing.  If it changes, invariants in the
backend will quietly break.  This situation arose when we had a call to
memcpy *and* a COPY of the FLAGS register where we would attempt to
reference local variables using %esi, a register that was clobbered by
the 'rep;movs'.

This fixes PR26124.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257730 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14 01:20:03 +00:00
Philip Reames
103a36146c [GC] Remove more dead code from Registry [NFCI]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14 01:06:05 +00:00
Philip Reames
3a4727c413 [GC] Remove a bunch of unused complexity from Registry and RegistryParser [NFCI]
The only two Registries we have in the system are the GCStrategy and GCMetadataPrinter ones.  Registry has a bunch of problems - for instance, order of initialization is undefined - and the code was overly general for what was actually used.  I hope to completely kill Registry in the near future, but for now, just delete all the unused listener and parsing support.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257727 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14 00:45:15 +00:00
James Y Knight
326b7ceee0 Stop increasing alignment of externally-visible globals on ELF
platforms.

With ELF, the alignment of a global variable in a shared library will
get copied into an executables linked against it, if the executable even
accesss the variable. So, it's not possible to implicitly increase
alignment based on access patterns, or you'll break existing binaries.

This happened to affect libc++'s std::cout symbol, for example. See
thread: http://thread.gmane.org/gmane.comp.compilers.clang.devel/45311

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257719 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 23:59:19 +00:00
Chih-Hung Hsieh
08ba2ca688 [TLS] New lower emutls pass, fix linkage bugs.
Previous implementation in http://reviews.llvm.org/D10522
created external references to __emutls_v.* variables.
Such references are inaccurate and cannot be handled by
all linkers, e.g. Android dynamic and gold linkers for aarch64.

Now a new LowerEmuTLS pass to go through all global variables,
and add emutls_v.* and emutls_t.* variables.
These __emutls* variables have the same linkage and
visibility as the associated user defined TLS variable.

Also removed old code that dump __emutls* variables in AsmPrinter.cpp,
and updated TLS unit tests.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257718 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 23:56:37 +00:00
Reid Kleckner
c40a833c41 Add file missing from r257712
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 23:48:32 +00:00
Reid Kleckner
13d3e2ec58 [codeview] Share more enums across the writer and the dumper
Moves some .def files into include/DebugInfo/CodeView.

Aslo remove a 'using namespace' directive from a header in readobj and
update the uses of the endian helper types to compensate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257712 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 23:44:57 +00:00
Xinliang David Li
8a0c782515 [Coverage] introduce class hierarchy (funcRecordReader) to support multiple versions of coverage data
[resubmit after fixing build bot failures: qualify make_unique and eliminate -Wcovered-switch-default warning.
With the planned size reduction change, the coverage format version is expected to be bumped up. This patch adds necessary support such that backward compatibility can be kept with maximal code sharing. Reading different versions of coverage data just requires instantiating the reader according to the version.

No functional change is intended.

Differiential Revision: http://reviews.llvm.org/D16133


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 23:29:33 +00:00
Xinliang David Li
0d31a22edd Revert r257699 -- windows buildbot failure TBI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257703 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 23:12:53 +00:00
Xinliang David Li
b68354f729 [Coverage] introduce class hierarchy (funcRecordReader) to support multiple versions of coverage data
With the planned size reduction change, the coverage format version is expected to be bumped up. This patch adds necessary support such that backward compatibility can be kept with maximal code sharing. Reading different versions of coverage data just requires instantiating the reader according to the version.

No functional change is intended.

Differiential Revision: http://reviews.llvm.org/D16133


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257699 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 22:58:42 +00:00
Rafael Espindola
fdba645465 Convert a few assert failures into proper errors.
Fixes PR25944.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257697 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 22:56:57 +00:00
Sanjay Patel
01f1e93e82 don't repeat function names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257675 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 21:36:50 +00:00
Reid Kleckner
6957121a4e Fix build of CodeView library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257662 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 19:45:06 +00:00
Reid Kleckner
fb30f09c13 [readobj] Expand CodeView dumping functionality
This rewrites and expands the existing codeview dumping functionality in
llvm-readobj using techniques similar to those in lib/Object. This defines a
number of new records and enums useful for reading memory mapped codeview
sections in COFF objects.

The dumper is intended as a testing tool for LLVM as it grows more codeview
output capabilities.

Reviewers: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257658 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 19:32:35 +00:00
Sanjay Patel
38fb5dfdd6 don't repeat function names in comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257649 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 19:01:43 +00:00
Dimitry Andric
67e14a3412 Avoid undefined behavior in LinkAllPasses.h
The LinkAllPasses.h file is included in several main programs, to force
a large number of passes to be linked in.  However, the ForcePassLinking
constructor uses undefined behavior, since it calls member functions on
`nullptr`, e.g.:

      ((llvm::Function*)nullptr)->viewCFGOnly();
      llvm::RGPassManager RGM;
      ((llvm::RegionPass*)nullptr)->runOnRegion((llvm::Region*)nullptr, RGM);

When the optimization level is -O2 or higher, the code below the first
nullptr dereference is optimized away, and replaced by `ud2` (on x86).

Therefore, the calls after that first dereference are never emitted.  In
my case, I noticed there was no call to `llvm::sys::RunningOnValgrind()`!

Replace instances of dereferencing `nullptr` with either objects on the
stack, or regular function calls.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257645 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 18:29:46 +00:00
Michael Zuckerman
8901532f08 [AVX512] Adding PMOVSXBD/W/Q , PMOVZSDQ and PMOVZSWD/Q Intrinsics .
Differential Revision: http://reviews.llvm.org/D16111 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257604 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 14:59:19 +00:00
Michael Zuckerman
d77802e710 [AVX512] Adding PMOVZXBD/W/Q , PMOVZXDQ and PMOVZXWD/Q Intrinsics
Differential Revision:http://reviews.llvm.org/D16071


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257601 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 14:25:21 +00:00
Michael Zuckerman
74012f5a19 [AVX512] adding PRORQ , PRORD , PRORLVQ and PRORLVD Intrinsics
Differential Revision: http://reviews.llvm.org/D16052


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257594 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 12:39:33 +00:00
Lang Hames
06f2160e1e [ORC] Add extra debugging output to OrcRemoteTargetServer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257577 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 06:34:57 +00:00
Lang Hames
c161401717 [ORC] Fix typo in debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257576 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 06:08:07 +00:00
Akira Hatanaka
d3a4714c99 [Inliner] Merge the attributes of the caller and callee functions
This patch turns off the fast-math optimization attribute on the caller
if the callee's fast-math attribute is not turned on.

For example,

- before inlining
 caller: "less-precise-fpmad"="true"
 callee: "less-precise-fpmad"="false"

- after inlining
 caller: "less-precise-fpmad"="false"

Alternatively, it's possible to block inlining if the caller's and
callee's attributes don't match. If this approach is preferable to the
one in this patch, we can discuss post-commit.

rdar://problem/19836465

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 06:02:45 +00:00
Michael Gottesman
2fbc59f8d0 Fix PointerIntPair so that it can use an enum class as its integer template argument.
Summary:
The problem here is that an enum class can not be implicitly converted to an
integer. That assumption snuck back into PointerIntPair. This commit fixes the
issue and more importantly adds some unittests to make sure that we do not break
this again.

rdar://23594806

Reviewers: gribozavr

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257574 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 05:59:13 +00:00
Xinliang David Li
561f3680a1 [Coverage] Refactor coverage mapping reader code
(Resubmit after fixing a typo that breaks test on big endian 
 machines)

In this refactoring, member functions are introduced to access
CovMap header/func record members and hide layout details. This
will enable further code restructuring to support reading multiple
versions of coverage mapping data with shared/templatized code. 
(When coveremap format version changes, backward compatibtility
should be preserved).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257571 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 04:36:15 +00:00
Xinliang David Li
805ea32835 Rollback r257551 -- unexpected test failures TBI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257564 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 02:46:40 +00:00
David Majnemer
812af1efba [CodeView] Improve the line table dumper
This change has us print out fields we didn't previously understand.  To
improve readability, we now group column information with it's
respective line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257552 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 01:05:16 +00:00
Xinliang David Li
2c77694774 [Coverage] Refactor coverage mapping reader code /NFC
(Resubmit after fixing build bot failures)

In this refactoring, member functions are introduced to access
CovMap header/func record members and hide layout details. This
will enable further code restructuring to support reading multiple
versions of coverage mapping data with shared/templatized code. 
(When coveremap format version changes, backward compatibtility
should be preserved).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257551 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 00:53:46 +00:00
Xinliang David Li
913815ec02 Rollback r257547 -- buildbot failure TBI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 00:27:24 +00:00
Xinliang David Li
084942c12e [Coverage] Refactor coverage mapping reader code /NFC
In this refactoring, member functions are introduced to access
CovMap header/func record members and hide layout details. This
will enable further code restructuring to support reading multiple
versions of coverage mapping data with shared/templatized code. 
(When coveremap format version changes, backward compatibtility
should be preserved).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257547 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 00:16:43 +00:00
Rui Ueyama
68e634ada8 COFF: Teach llvm-objdump how to dump DLL forwarder symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257539 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 23:28:42 +00:00
Matthias Braun
4adfe414ef RegisterPressure: Expose RegisterOperands API
Previously the RegisterOperands have only been used internally in
RegisterPressure.cpp. However this datastructure can be useful for other
tasks as well and allows refactoring of PDiff initialisation out of
RPTracker::recede().

This patch:
- Exposes RegisterOperands as public API
- Splits RPTracker::recede() into a part that skips DebugValues and
  maintains the region borders, and the core that changes register
  pressure when given a set of RegisterOperands.
- This allows to move the PDiff initialisation out recede() into a
  method of the PressureDiffs class.
- The upcoming subregister scheduling code will also use
  RegisterOperands to avoid pushing more unrelated functionality into
  recede()/advance().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257535 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 22:57:35 +00:00
Nathan Slingerland
21314fb768 [Support] Add saturating multiply-add support function
Summary: Add SaturatingMultiplyAdd convenience function template since A + (X * Y) comes up frequently when doing weighted arithmetic.

Reviewers: davidxl, silvas

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257532 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 22:34:00 +00:00
Michael Zuckerman
67f5e4f21e [AVX512] adding PROLQ and PROLD Intrinsics
Differential Revision: http://reviews.llvm.org/D16048


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257523 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 21:19:17 +00:00
Dan Gohman
b8e08438aa [WebAssembly] Add a EM_WEBASSEMBLY value, and several bits of code that use it.
A request has been made to the official registry, but an official value is
not yet available. This patch uses a temporary value in order to support
development. When an official value is recieved, the value of EM_WEBASSEMBLY
will be updated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257517 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 20:56:01 +00:00
Dan Gohman
b6ba98d0dd [WebAssembly] Add ELFRelocs/WebAssembly.def as a "textual header" to the module map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257515 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 20:51:40 +00:00
Lang Hames
05e78944a1 [ORC] More cleanup, partially aimed at working around GCC ICE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 19:01:49 +00:00
Lang Hames
9859617d8c [Orc] Replace lambda with a helper method.
This is good cleanup, but I'm also hoping it'll fix some more GCC ICEs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257498 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 18:17:23 +00:00
Sanjay Patel
bd8623ae5c function names start with a lower case letter ; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257496 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 18:03:37 +00:00
Lang Hames
09c7fb3a60 [Orc] Clang-format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257487 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 17:06:32 +00:00
Lang Hames
dab4109a7b [Orc] Take another shot at working around the GCC 4.7 ICE in
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/27486



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257486 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 17:04:12 +00:00
Keno Fischer
7125c9519f [ARM] Fix several state persistence bugs
Summary:
This fixes three bugs, in all of which state is not or incorrecly reset between
objects (i.e. when reusing the same pass manager to create multiple object
files):
1) AttributeSection needs to be reset to nullptr, because otherwise the backend
   will try to emit into the old object file's attribute section causing a
   segmentation fault.
2) MappingSymbolCounter needs to be reset, otherwise the second object file
   will start where the first one left off.
3) The MCStreamer base class resets the Streamer's e_flags settings. Since
   EF_ARM_EABI_VER5 is set on streamer creation, we need to set it again
   after the MCStreamer was rest.

Also rename Reset (uppser case) to EHReset to avoid confusion with
reset (lower case).

Reviewers: rengolin
Differential Revision: http://reviews.llvm.org/D15950

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257473 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 13:38:15 +00:00
Igor Breger
d5839e5e84 AVX512: VPMOVAPS/PD and VPMOVUPS/PD (load) intrinsic implementation.
Differential Revision: http://reviews.llvm.org/D16042

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257463 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 10:02:32 +00:00
Lang Hames
08529ecce9 [Orc] Comment out debugging output in OrcRemoteTargetClient::reserveMem to see
whether this affects the GCC 4.7 ICE on
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75 .



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257458 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 07:26:28 +00:00
Lang Hames
deddff8498 [ORC] Remove extraneous '&'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257455 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 07:10:10 +00:00
Lang Hames
86ece97a37 [ORC] Replace some more 'auto' uses with std::error_code.
One of the GCC 4.7 bots doesn't seem to like auto, and is currently suffering
from an ICE. I'm hoping this will help.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257454 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 07:09:41 +00:00
Lang Hames
d696c2c2a2 [Orc] Add overloads of RPC::handle and RPC::expect that take member functions as
handlers.

It is expected that RPC handlers will usually be member functions. Accepting them
directly in handle and expect allows for the remove of a lot of lambdas an
explicit error variables.

This patch also uses this new feature to substantially tidy up the
OrcRemoteTargetServer class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 06:48:52 +00:00
Dan Gohman
3a52c6e4b7 [WebAssembly] Define a custom segment type for function definitions.
Since function definitions are not loaded into the address space, PT_LOAD is
inappropriate. PT_WEBASSEMBLY_FUNCTIONS is used to identify where the function
definitions are so that they can be processed at program startup time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257436 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 02:58:12 +00:00