Commit Graph

27245 Commits

Author SHA1 Message Date
John Regehr
98d359ac65 [LVI] Add an API to LazyValueInfo so that it can export ConstantRanges
that it computes. Currently this is used for testing and precision
tuning, but it might be used by optimizations later.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268291 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 19:58:00 +00:00
Reid Kleckner
0e77da267e Revert "[SimplifyCFG] Extend TryToSimplifyUncondBranchFromEmptyBlock for empty block including lifetime intrinsics"
This reverts commit r268254.

This change causes assertion failures while building Chromium. Reduced
test case coming soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268288 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 19:43:22 +00:00
Zachary Turner
f526e10c7f PDB - Instead of hardcoding stream numbers, use an enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 18:09:21 +00:00
Zachary Turner
0e6ef97ce0 Parse PDB Name Hash Table
PDB has a lot of similar data structures.  We already have code
for parsing a Name Map, but PDB seems to have a different but
very similar structure that is a hash table.  This is the
beginning of code needed in order to parse the name hash table,
but it is not yet complete.  It parses the basic metadata of
the hash table, the bucket array, and the names buffer, but
doesn't use any of these fields yet as the data structure
requires a non-trivial amount of work to understand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268268 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 18:09:14 +00:00
Derek Schuff
1e477250a6 [WebAssembly] Rename memory_size intrinsic to current_memory
This follows the recent renaming in the wasm spec.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268255 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 17:25:22 +00:00
Hans Wennborg
0c15a0b738 [SimplifyCFG] Extend TryToSimplifyUncondBranchFromEmptyBlock for empty block including lifetime intrinsics
Make it possible that TryToSimplifyUncondBranchFromEmptyBlock merges empty
basic block including lifetime intrinsics as well as phi nodes and
unconditional branch into its successor or predecessor(s).

If successor of empty block has single predecessor, all contents including
lifetime intrinsics are sinked into the successor. Otherwise, they are
hoisted into its predecessor(s) and then merged into the predecessor(s).

Patch by Josh Yoon <josh.yoon@samsung.com>!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268254 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 17:22:54 +00:00
Rafael Espindola
4c7d166c37 Expose a getFullName for thin archive members.
It will be used in lld.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268226 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 13:45:06 +00:00
Craig Topper
b5bf834f5d [CodeGen] Add OPC_MoveChild0-OPC_MoveChild7 opcodes to isel matching tables to optimize table size. Shaves about 12K off the X86 matcher table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 01:53:30 +00:00
Amaury Sechet
58e9430c5d Properly name LLVMSetIsInBounds's argument. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268176 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-01 02:23:14 +00:00
Amaury Sechet
3f89ecd798 Capitalize align argument in the C API as per convention. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268175 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-01 01:42:34 +00:00
Lang Hames
6706c34b89 [ORC] Save AArch64 NEON state in the JIT reentry block.
The earlier version of the resolver code did not save NEON state, so it would
have broken any callees that used floating point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-01 00:14:45 +00:00
Sriraman Tallam
540bb24384 Differential Revision: http://reviews.llvm.org/D19753
Delete Target Option PositionIndependentExecutable as PIE is now part of module flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268155 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-30 04:18:52 +00:00
Lang Hames
1c7deb2e11 [Orc] Fix the AArch64 resolver size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-30 00:50:26 +00:00
Vedant Kumar
9759276c58 Fix a typo (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268144 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-30 00:32:54 +00:00
Xinliang David Li
2f3e898b66 Reapply r268107 after fixing a bug breaks debug build.
Makes the new method to set data needed by debug dump.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 22:59:36 +00:00
Sanjay Patel
0ac37a4267 clean up documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 22:03:27 +00:00
Xinliang David Li
05d883a443 Revert r268107 -- debug build failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268116 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:43:28 +00:00
Lang Hames
d53ff2dcbd [Orc] Add ORC lazy-compilation support for AArch64.
The ORC compile callbacks and indirect stubs APIs will now work for AArc64,
allowing functions to be lazily compiled and/or updated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268112 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:32:00 +00:00
Lang Hames
2534484e89 [Orc] Make sure we don't drop the internal error in OrcRemoteTargetClient when
the constructor fails, as this would lead to an 'unchecked error' crash.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268111 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:29:48 +00:00
Xinliang David Li
8c53c612ef [inliner]: Refactor inline deferring logic into its own method /NFC
The implemented heuristic has a large body of code which better sits
in its own function for better readability. It also allows adding more
heuristics easier in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268107 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:21:44 +00:00
Sriraman Tallam
7eaa51e95d Differential Revision: http://reviews.llvm.org/D19733
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268106 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:19:16 +00:00
Matt Arsenault
de6dea1afa AMDGPU: Add kernarg.segment.ptr intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268105 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:16:52 +00:00
Matt Arsenault
7d02fd4418 Fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268102 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:02:04 +00:00
Easwaran Raman
a96d5370cb Move coverage related code into a separate library.
Differential Revision: http://reviews.llvm.org/D19333



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268089 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 18:53:05 +00:00
Zachary Turner
a91bcf5593 Put PDB parsing code into a pdb namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268072 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:28:47 +00:00
Zachary Turner
64cc1b2eb3 Refactor the PDB Stream reading interface.
The motivation for this change is that PDB has the notion of
streams and substreams.  Substreams often consist of variable
length structures that are convenient to be able to treat as
guaranteed, contiguous byte arrays, whereas the streams they
are contained in are not necessarily so, as a single stream
could be spread across many discontiguous blocks.

So, when processing data from a substream, we want to be able
to assume that we have a contiguous byte array so that we can
cast pointers to variable length arrays and such.

This leads to the question of how to be able to read the same
data structure from either a stream or a substream using the
same interface, which is where this patch comes in.

We separate out the stream's read state from the underlying
representation, and introduce a `StreamReader` class.  Then
we change the name of `PDBStream` to `MappedBlockStream`, and
introduce a second kind of stream called a `ByteStream` which is
simply a sequence of contiguous bytes.  Finally, we update all
of the std::vectors in `PDBDbiStream` to use `ByteStream` instead
as a proof of concept.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268071 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:22:58 +00:00
Filipe Cabecinhas
034b92a7c3 Add operator- to Path's reverse_iterator. Needed for D19666
Reviewers: rafael, craig.topper, bogner

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268062 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:48:07 +00:00
Filipe Cabecinhas
2fd54348ae Unify XDEBUG and EXPENSIVE_CHECKS (into the latter), and add an option to the cmake build to enable them.
Summary:
Historically, we had a switch in the Makefiles for turning on "expensive
checks". This has never been ported to the cmake build, but the
(dead-ish) code is still around.

This will also make it easier to turn it on in buildbots.

Reviewers: chandlerc

Subscribers: jyknight, mzolotukhin, RKSimon, gberry, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268050 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 15:22:48 +00:00
Sanjay Patel
432a66529d fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268045 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 14:53:54 +00:00
David Majnemer
3047183427 [GlobalOpt] Propagate operand bundles
We neglected to transfer operand bundles for some transforms.  These
were found via inspection, I'll try to come up with some test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268011 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 08:07:22 +00:00
Zachary Turner
5515858465 Read the rest of the DBI substreams, and parse source info.
We now read out the rest of the substreams from the DBI streams.  One of
these substreams, the FileInfo substream, contains information about which
source files contribute to each module (aka compiland).  This patch
additionally parses out the file information from that substream, and
dumps it in llvm-pdbdump.

Differential Revision: http://reviews.llvm.org/D19634
Reviewed by: ruiu

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267928 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 20:05:18 +00:00
Krzysztof Parzyszek
6af1d8fce6 Reset the TopRPTracker's position in ScheduleDAGMILive::initQueues
ScheduleDAGMI::initQueues changes the RegionBegin to the first non-debug
instruction. Since it does not track register pressure, it does not affect
any RP trackers. ScheduleDAGMILive inherits initQueues from ScheduleDAGMI,
and it does reset the TopTPTracker in its schedule method. Any derived,
target-specific scheduler will need to do it as well, but the TopRPTracker
is only exposed as a "const" object to derived classes. Without the ability
to modify the tracker directly, this leaves a derived scheduler with a
potential of having the TopRPTracker out-of-sync with the CurrentTop.

The symptom of the problem:
  void llvm::ScheduleDAGMILive::scheduleMI(llvm::SUnit *, bool):
  Assertion `TopRPTracker.getPos() == CurrentTop && "out of sync"' failed.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 19:17:44 +00:00
Eugene Zelenko
b116cf62de Fix builds broken in r267910.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267915 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 18:27:35 +00:00
Sriraman Tallam
d41672fa69 Add "PIE Level" metadata to module flags.
http://reviews.llvm.org/D19671

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 18:15:44 +00:00
Eugene Zelenko
aaf3f0426b Fix some Clang-tidy modernize and Include What You Use warnings.
Differential revision: http://reviews.llvm.org/D19673


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267910 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 18:04:41 +00:00
Chad Rosier
c831d1b1ef [GVN] Minor code cleanup. NFC.
Differential Revision: http://reviews.llvm.org/D18828
Patch by Aditya Kumar!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 16:00:15 +00:00
Matthias Braun
e5c4e28d9c CodeGen: Add DetectDeadLanes pass.
The DetectDeadLanes pass performs a dataflow analysis of used/defined
subregister lanes across COPY instructions and instructions that will
get lowered to copies. It detects dead definitions and uses reading
undefined values which are obscured by COPY and subregister usage.

These dead definitions cause trouble in the register coalescer which
cannot deal with definitions suddenly becoming dead after coalescing
COPY instructions.

For now the pass only adds dead and undef flags to machine operands. It
should be possible to extend it in the future to remove the dead
instructions and redo the analysis for the affected virtual
registers.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267851 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 03:07:16 +00:00
Matthias Braun
baad40b586 TableGen: Produce CoveredBySubRegs summary for register classes
This will be used in the upcoming "DetectDeadLanes" pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267850 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 03:07:11 +00:00
Matthias Braun
89abe6466a TargetRegisterInfo: Introduce reverseComposeSubRegIndexLaneMask()
This function performs the reverse computation of
composeSubRegIndexLaneMask().

It will be used in the upcoming "DetectDeadLanes" pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267849 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 03:07:07 +00:00
Matthias Braun
3b74a145c8 TableGen: Support lanemasks for classes without subregisters
Previously using lanemasks on registers without any subregisters was not
well defined. This commit extends TargetRegisterInfo/tablegen to:
- Report a lanemask of 1 for regclasses without subregisters
- Do the right thing when mapping a 0/1 lanemask from a class without
  subregisters into a class with subregisters in
  TargetRegisterInfo::composeSubRegIndexLaneMasks().

This will be used in the upcoming "DetectDeadLanes" patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 03:07:04 +00:00
Richard Smith
b012212af7 Fix bogus documentation for StringRef::slice in the End < Start case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 00:57:14 +00:00
Zachary Turner
4a4743c8af Parse module information from DBI stream.
This gets more data out of the DBI strema of the PDB.  In
particular it extracts the metadata for the list of modules
(compilands) that this PDB contains info about, and adds support
for dumping these fields to llvm-pdbdump.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 23:41:42 +00:00
Rong Xu
1564d12c82 [PGO] Promote indirect calls to conditional direct calls with value-profile
This patch implements the transformation that promotes indirect calls to
conditional direct calls when the indirect-call value profile meta-data is
available.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267815 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 23:20:27 +00:00
Colin LeMahieu
a6e18c129a [MCAssembler] Allow backend to finalize layout post-relaxation.
Differential revision: http://reviews.llvm.org/D19429

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 21:26:13 +00:00
Lang Hames
54b806a776 [RuntimeDyld] Plumb Error/Expected through the internals of RuntimeDyld.
Also replaces a number of calls to report_fatal_error with Error returns.

The plumbing will make it easier to return errors originating in libObject.

Replacing report_fatal_errors with Error returns will give JIT clients the
opportunity to recover gracefully when the JIT is unable to produce/relocate
code, as well as providing meaningful error messages that can be used to file
bug reports.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267776 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 20:24:48 +00:00
Justin Lebar
ae889d3672 Add TargetMachine::addEarlyAsPossiblePasses, and call it from opt.
Summary:
This is a hook to allow TargetMachine to install passes at the
EP_EarlyAsPossible PassManagerBuilder extension point.

Reviewers: chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:08:24 +00:00
Ahmed Bougacha
76739f43a9 [TLI] Unify LibFunc attribute inference. NFCI.
Now the pass is just a tiny wrapper around the util. This lets us reuse
the logic elsewhere (done here for BuildLibCalls) instead of duplicating
it.

The next step is to have something like getOrInsertLibFunc that also
sets the attributes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267759 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:04:40 +00:00
Ahmed Bougacha
8a8efec992 [TLI] Unify LibFunc signature checking. NFCI.
I tried to be as close as possible to the strongest check that
existed before; cleaning these up properly is left for future work.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 19:04:35 +00:00
Gerolf Hoflehner
69bf036617 [DAGCombiner] Follow coding convention for function name (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267745 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 17:27:16 +00:00
Nicolai Haehnle
0493c734a2 AMDGPU/SI: Add llvm.amdgcn.s.waitcnt.all intrinsic
Summary:
So it appears that to guarantee some of the ordering requirements of a GLSL
memoryBarrier() executed in the shader, we need to emit an s_waitcnt.

(We can't use an s_barrier, because memoryBarrier() may appear anywhere in
the shader, in particular it may appear in non-uniform control flow.)

Reviewers: arsenm, mareko, tstellarAMD

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-27 15:46:01 +00:00