Commit Graph

131130 Commits

Author SHA1 Message Date
Matt Arsenault
c10caa3301 AMDGPU: Fix crash with unreachable terminators.
If a block has no successors because it ends in unreachable,
this was accessing an invalid iterator.

Also stop counting instructions that don't emit any
real instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268119 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:52:13 +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
Simon Pilgrim
63a5b4c179 [InstCombine][SSE] PSHUFB to shuffle combine to use general aggregate elements. NFCI.
Make use of Constant::getAggregateElement instead of checking constant types - first step towards adding support for UNDEF mask elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268115 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:34:54 +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
Chris Bieneman
f8bfee254f [Docs] Refer to the CMakePrimer from CMake doc
The "Building LLVM with CMake" document should have a reference to the CMakePrimer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:23:24 +00:00
David Majnemer
c1284a6b7e [ValueTracking] Make the code in lookThroughCast
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:22:04 +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
Chad Rosier
1fc7fa1469 [InstCombine] Determine the result of a select based on a dominating condition.
Differential Revision: http://reviews.llvm.org/D19550

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268104 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 21:12:31 +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
Sanjay Patel
a5edb789b1 [InstCombine] clean up; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268099 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 20:54:56 +00:00
Chris Bieneman
ae143ce4db [Docs] Add CMake Primer document
This document is intended to provide a basic overview of the CMake scripting language for LLVM developers. It was unorthodoxly reviewed for accuracy and content on the CMake developer list:

http://public.kitware.com/pipermail/cmake-developers/2016-April/028300.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268096 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 20:34:54 +00:00
Matt Arsenault
44f78713bc AMDGPU/SI: Move post regalloc run of SIShrinkInstructions
Move to addPreEmitPass. This is so it runs after post-RA
scheduling so we can merge s_nops emitted by the scheduler
and hazard recognizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268095 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 20:23:42 +00:00
Matt Arsenault
6d8c39b760 DAGCombiner: Reduce truncated shl width
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268094 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 19:53:16 +00:00
Kostya Serebryany
da55e69f83 [libFuzzer] fix docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268092 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 19:28:24 +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
Kostya Serebryany
168e51186d [libFuzzer] enable detect_leaks=1, add proper docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 18:49:55 +00:00
George Burgess IV
d798caf71d [MemorySSA] Fix bugs in walker; refactor unittests a bit.
This patch fixes two somewhat related bugs in MemorySSA's caching
walker. These bugs were found because D19695 brought up the problem
that we'd have defs cached to themselves, which is incorrect.

The bugs this fixes are:

- We would sometimes skip the nearest clobber of a MemoryAccess, because
  we would query our cache for a given potential clobber before
  checking if the potential clobber is the clobber we're looking for.
  The cache entry for the potential clobber would point to the nearest
  clobber *of the potential clobber*, so if that was a cache hit, we'd
  ignore the potential clobber entirely.

- There are times (sometimes in DFS, sometimes in the getClobbering...
  functions) where we would insert cache entries that say a def
  clobbers itself.

There's a bit of common code between the fixes for the bugs, so they
aren't split out into multiple commits.

This patch also adds a few unit tests, and refactors existing tests a
bit to reduce the duplication of setup code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268087 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 18:42:55 +00:00
David Majnemer
359298ea08 [ValueTracking] matchSelectPattern needs to be more careful around FP
matchSelectPattern attempts to see through casts which mask min/max
patterns from being more obvious.  Under certain circumstances, it would
misidentify a sequence of instructions as a min/max because it assumed
that folding casts would preserve the result.  This is not the case for
floating point <-> integer casts.

This fixes PR27575.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268086 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 18:40:34 +00:00
Zachary Turner
29c529c419 Fix crash in PDB when loading corrupt file.
There are probably hundreds of crashers we can find by fuzzing
more.  For now we do the simplest possible validation of the
block size.  Later, more complicated validations can verify that
other fields of the super block such as directory size, number
of blocks, agree with the size of the file etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268084 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 18:09:19 +00:00
Simon Pilgrim
34d5a9f606 Use SelectionDAG::getTargetConstant* helper functions. NFC.
Instead of SelectionDAG::getConstant directly to make it more obvious that we're creating target constants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268074 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:42:45 +00:00
Artem Tamazov
39e28634ef [AMDGPU][llvm-mc] Add some missing testcases to trap.s
Differential Revision: http://reviews.llvm.org/D19602

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268073 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:41:44 +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
Dehao Chen
89509a341b Do not read callee name when matching IR to profile as it is not used.
Summary: Callee name is not used to identify a callsite now, so do not read it during annotation.

Reviewers: davidxl, dnovillo

Subscribers: dnovillo, danielcdh, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268069 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:19:10 +00:00
Geoff Berry
4c9f41e56f [BasicAA] Treat llvm.assume as not accessing memory in getModRefBehavior(Function)
Reviewers: dberlin, chandlerc, hfinkel, reames, sanjoy

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:18:28 +00:00
Haicheng Wu
c4cd817ade [MBP] Split placement and alignment into two functions. NFC.
Cut and Paste.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268067 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:06:44 +00:00
Artem Tamazov
f3487e82c4 Fixed/Recommitted r267733 "[AMDGPU][llvm-mc] Add support of TTMP quads. Rework M0 exclusion for SMRD."
Previously reverted by r267752.

r267733 review:
Differential Revision: http://reviews.llvm.org/D19342

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268066 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:04:50 +00:00
Guozhi Wei
d707220214 [PPC] Enable shuffling of VSX vectors
This patch fixes PR27078 by enabling shuffling of vectors if VSX is available.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268064 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 17:00:54 +00:00
Amjad Aboud
2f41b0fa11 Fixed LIT tests that was broken after change in r268054.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268063 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:54:18 +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
Sanjay Patel
6881bc84c4 auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268061 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:39:37 +00:00
Sanjay Patel
f5874ed5da [InstCombine] add helper function for ICmp with constant canonicalization; NFCI
As suggested in http://reviews.llvm.org/D17859 , we should enhance this
to support vectors.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268059 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:22:25 +00:00
Daniel Sanders
334e32689e [mips][ias] Move createCpRestoreMemOp to MipsTargetStreamer. NFC.
Summary:
This removes the temporary call to isIntegratedAssemblerRequired() which was
added recently. It's effect is now acheived directly in the MipsTargetStreamer
hierarchy.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268058 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:16:49 +00:00
Krzysztof Parzyszek
7ec8f078dd Fix NDEBUG build: variables used only in debug code causing compile error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268057 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:14:00 +00:00
Amjad Aboud
36853e8292 Recommitted r264280 "Supporting all entities declared in lexical scope in LLVM debug info."
After fixing PR26942 in r267004.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268054 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:07:55 +00:00
Simon Dardis
260e00965a [mips][FastISel] A store is not a load.
Correct trivial error. One of the failing tests from PR/27458.

Reviewers: dsanders, vkalintiris, mcrosier

Differential Review: http://reviews.llvm.org/D19726



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268053 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:07:47 +00:00
Simon Dardis
3cc6d4647c [PATCH] [mips] Fix forbidden slot hazard handling
MipsHazardSchedule has to determine what the next physical machine instruction
is to decide whether to insert a nop. In case where a branch with a forbidden
slot appears at the end of a basic block, first *real* instruction of the next
physical basic block was determined using getFirstNonDebugInstr().

Unfortunately this only considers DBG_VALUEs and not other transient opcodes
such as EHLABEL. As EHLABEL passes the SafeInForbiddenSlot predicate and the
instruction after the EHLABEL can be a CTI, we observed test failures in the
LNT testsuite.

Reviewers: dsanders

Differential Review: http://reviews.llvm.org/D19051



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268052 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 16:04:18 +00:00
Krzysztof Parzyszek
744cc49078 [Hexagon] Optimize addressing modes for load/store
Patch by Jyotsna Verma.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268051 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 15:49:13 +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
Tobias Grosser
55d3dc177e Remove leftover
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268049 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 15:08:05 +00:00
Tobias Grosser
a4c2f26e2e cmake: Set LINK_POLLY_INTO_TOOLS to ON (v2)
This is the second try. This time we disable this feature if no Polly checkout
is available. For this to work we need to check if tools/polly is present
early enough that our decision is known before cmake generates Config/config.h.

With Polly checked into LLVM it was since a long time possible to compile
clang/opt/bugpoint with Polly support directly linked in, instead of only
providing Polly as a separate loadable module. This commit switches the
default from providing Polly as a module to linking Polly into tools, such
that it becomes unnecessary to load the Polly module when playing with Polly.
Such configuration has shown a lot more convenient for day-to-day Polly use.

This change does not impact the default behavior of any tool, if Polly is not
explicitly enabled when calling clang/opt/bugpoint Polly does not affect
compilation.

This change also does not impact normal LLVM/clang checkouts that do not
contain Polly.

Reviewers: jdoerfert, Meinersbur

Subscribers: pollydev, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 15:07:22 +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
Piotr Padlewski
dca9796216 Add credit [Test commit]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268044 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 14:52:12 +00:00
Tom Stellard
ac19ae8d63 AMDGPU/SI: Add offset field to ds_permute/ds_bpermute instructions
Summary:
These instructions can add an immediate offset to the address, like other
ds instructions.

Reviewers: arsenm

Subscribers: arsenm, scchan

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268043 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 14:34:26 +00:00
Daniel Sanders
f4d5a508ae [mips][ias] Split expandMemInst between MipsAsmParser and MipsTargetStreamer. Almost NFC.
Summary:
The portion in MipsAsmParser is responsible for figuring out which expansion to
use, while the portion in MipsTargetStreamer is responsible for emitting it.

This allows us to remove the call to isIntegratedAssemblerRequired() which is
currently ensuring the effect of .cprestore only occurs when writing objects.

The small functional change is that the memory offsets are now correctly
printed as signed values.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268042 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 13:43:45 +00:00
Daniel Sanders
a0e83333a7 [mips][ias] Moved most instruction emission helpers to MipsTargetStreamer. NFC.
Summary:
* Moved all the emit*() helpers to MipsTargetStreamer.
* Moved createNop() to MipsTargetStreamer as emitNop() and emitEmptyDelaySlot().
  This instruction has been split to distinguish between the 'nop' instruction
  and the nop used in delay slots which is sometimes a different nop to the
  'nop' instruction (e.g. for short delay slots on microMIPS).
* Moved createAddu() to MipsTargetStreamer as emitAddu().
* Moved createAppropriateDSLL() to MipsTargetStreamer as emitDSLL().

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268041 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 13:33:12 +00:00
Tobias Grosser
b5a82b6983 cmake: Fix grammar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268038 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29 13:03:40 +00:00