OSDN Git Service

android-x86/external-llvm.git
8 years agoAdd profile summary support for sample profile.
Easwaran Raman [Fri, 19 Feb 2016 03:15:33 +0000 (03:15 +0000)]
Add profile summary support for sample profile.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261304 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[SjLjEHPrepare] Don't grab pointers to functions in doInitialization
David Majnemer [Fri, 19 Feb 2016 03:13:40 +0000 (03:13 +0000)]
[SjLjEHPrepare] Don't grab pointers to functions in doInitialization

Certain optimization passes (like globaldce) can prune function
declaration that SjLjEHPrepare assumed would exit when it'd
runOnFunction.

This fixes PR26669.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261303 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AA] Preserve the AA results wrapper pass as well as BasicAA in a few
Chandler Carruth [Fri, 19 Feb 2016 03:12:14 +0000 (03:12 +0000)]
[AA] Preserve the AA results wrapper pass as well as BasicAA in a few
more places to prevent gratuitous re-"runs" of these passes.

The passes themselves don't do any work when run, but we keep spending
time scheduling and running these needlessly when we really don't need
to do so.

This is the first patch towards fixing the really horrible loop pass
pipeline fragmentation pointed out by Sanjoy in PR24804.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261302 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[llvm-nm] In C++, main implicitly returns 0. Pointed out by David Blaikie.
Davide Italiano [Fri, 19 Feb 2016 02:22:54 +0000 (02:22 +0000)]
[llvm-nm] In C++, main implicitly returns 0. Pointed out by David Blaikie.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261300 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoBug fix: use dyn_cast_or_null instead of dyn_cast
Lawrence Hu [Fri, 19 Feb 2016 02:17:07 +0000 (02:17 +0000)]
Bug fix: use dyn_cast_or_null instead of dyn_cast

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261299 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agollvm-dwp: Don't test compression when zlib isn't available
David Blaikie [Fri, 19 Feb 2016 02:03:45 +0000 (02:03 +0000)]
llvm-dwp: Don't test compression when zlib isn't available

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261298 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agollvm-dwp: Support compressed input
David Blaikie [Fri, 19 Feb 2016 01:51:44 +0000 (01:51 +0000)]
llvm-dwp: Support compressed input

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261296 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMinor code cleanups. NFC.
Junmo Park [Fri, 19 Feb 2016 01:46:04 +0000 (01:46 +0000)]
Minor code cleanups. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261294 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[sancov] widening default blacklist.
Mike Aizatsky [Fri, 19 Feb 2016 01:03:12 +0000 (01:03 +0000)]
[sancov] widening default blacklist.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261291 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[sancov] Adding covered/uncovered tables to coverage report.
Mike Aizatsky [Fri, 19 Feb 2016 00:26:20 +0000 (00:26 +0000)]
[sancov] Adding covered/uncovered tables to coverage report.

Summary:
This change adds 3 tables to html report:
- list of covered files with number of functions covered.
- list of not covered files
- list of not covered functions.

I tried to put most coverage-calculating functionality into
SourceCoverageData.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261287 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoWhen printing MIR, output to errs() rather than outs().
Justin Lebar [Fri, 19 Feb 2016 00:18:46 +0000 (00:18 +0000)]
When printing MIR, output to errs() rather than outs().

Summary:
Without this, this command

  $ llvm-run llc -stop-after machine-cp -o - <( echo '' )

outputs an error, because we close stdout twice -- once when closing the
file opened for "-o", and again when closing outs().

Also clarify in the outs() definition that you can't ever call it if you
want to open your own raw_fd_ostream on stdout.

Reviewers: jroelofs, tstellarAMD

Subscribers: jholewinski, qcolombet, dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261286 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CaptureTracking] Add a test case for pointer cmpxchg
Philip Reames [Fri, 19 Feb 2016 00:13:09 +0000 (00:13 +0000)]
[CaptureTracking] Add a test case for pointer cmpxchg

This test builds on 261250 (IR support for cmpxchg of pointers) and 261245 (capture tracking support for cmpxchg) to show that correctly analyze the capturing of pointers in a cmpxchg of pointer type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261284 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[IR] Extend cmpxchg to allow pointer type operands
Philip Reames [Fri, 19 Feb 2016 00:06:41 +0000 (00:06 +0000)]
[IR] Extend cmpxchg to allow pointer type operands

Today, we do not allow cmpxchg operations with pointer arguments. We require the frontend to insert ptrtoint casts and do the cmpxchg in integers. While correct, this is problematic from a couple of perspectives:
1) It makes the IR harder to analyse (for instance, it make capture tracking overly conservative)
2) It pushes work onto the frontend authors for no real gain

This patch implements the simplest form of IR support. As we did with floating point loads and stores, we teach AtomicExpand to convert back to the old representation. This prevents us needing to change all backends in a single lock step change. Over time, we can migrate each backend to natively selecting the pointer type. In the meantime, we get the advantages of a cleaner IR representation without waiting for the backend changes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261281 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[x86] fix initialization of PredictableSelectIsExpensive
Sanjay Patel [Thu, 18 Feb 2016 23:08:48 +0000 (23:08 +0000)]
[x86] fix initialization of PredictableSelectIsExpensive

This is effectively NFC because Atom is the only in-order x86 subtarget currently,
but the predicate would have become wrong if any other in-order CPU came along.

See related discussion in:
http://reviews.llvm.org/D16836

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261275 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CMake] Properly set CMAKE_BUILD_TYPE to Debug by default
Chris Bieneman [Thu, 18 Feb 2016 23:07:09 +0000 (23:07 +0000)]
[CMake] Properly set CMAKE_BUILD_TYPE to Debug by default

Summary:
PR26666: CMAKE_BUILD_TYPE was previously being reset to blank.

Reviewers: rnk, beanz

Subscribers: llvm-commits

Patch By: Derek Bruening

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261273 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove uses of builtin comma operator.
Richard Trieu [Thu, 18 Feb 2016 22:09:30 +0000 (22:09 +0000)]
Remove uses of builtin comma operator.

Cleanup for upcoming Clang warning -Wcomma.  No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261270 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Be less clever when using a nonce type for disambiguation.
Jordan Rose [Thu, 18 Feb 2016 22:03:23 +0000 (22:03 +0000)]
[ADT] Be less clever when using a nonce type for disambiguation.

Old compilers don't like constexpr, but we're only going to use this in one
place anyway: this file. Everyone else should go through PointerLikeTypeTraits.

Update to r261259.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261268 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] only read MaxLen bytes from every file in the corpus to speedup loading...
Kostya Serebryany [Thu, 18 Feb 2016 21:49:10 +0000 (21:49 +0000)]
[libFuzzer] only read MaxLen bytes from every file in the corpus to speedup loading the corpus

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261267 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PPCLoopDataPrefetch] Move pass to Transforms/Scalar/LoopDataPrefetch. NFC
Adam Nemet [Thu, 18 Feb 2016 21:38:19 +0000 (21:38 +0000)]
[PPCLoopDataPrefetch] Move pass to Transforms/Scalar/LoopDataPrefetch. NFC

This patch is part of the work to make PPCLoopDataPrefetch
target-independent
(http://thread.gmane.org/gmane.comp.compilers.llvm.devel/92758).

Obviously the pass still only used from PPC at this point.  Subsequent
patches will start driving this from ARM64 as well.

Due to the previous patch most lines should show up as moved lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261265 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PPCLoopDataPrefetch] Remove PPC from some of the names. NFC
Adam Nemet [Thu, 18 Feb 2016 21:37:12 +0000 (21:37 +0000)]
[PPCLoopDataPrefetch] Remove PPC from some of the names. NFC

This is done only to make the next patch that move the pass out PPC to
Transforms easier to read.  After this most line should show up as moved
lines in that patch.

This patch is part of the work to make PPCLoopDataPrefetch
target-independent
(http://thread.gmane.org/gmane.comp.compilers.llvm.devel/92758).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261264 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WinEH] Hoist state stores from successors
David Majnemer [Thu, 18 Feb 2016 21:13:35 +0000 (21:13 +0000)]
[WinEH] Hoist state stores from successors

If we know that all of our successors want to be in the exact same
state, it makes sense to hoist the state transition into their common
predecessor.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261262 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ADT] Fix PointerEmbeddedInt when the underlying type is uintptr_t.
Jordan Rose [Thu, 18 Feb 2016 21:00:08 +0000 (21:00 +0000)]
[ADT] Fix PointerEmbeddedInt when the underlying type is uintptr_t.

...and when you try to store negative values in it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261259 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[IR] Straighten out bundle overload of IRBuilder::CreateCall
Reid Kleckner [Thu, 18 Feb 2016 20:57:41 +0000 (20:57 +0000)]
[IR] Straighten out bundle overload of IRBuilder::CreateCall

IRBuilder has two ways of putting bundle operands on calls: the default
operand bundle, and an overload of CreateCall that takes an operand
bundle list.

Previously, this overload used a default argument of None. This made it
impossible to distinguish between the case were the caller doesn't care
about bundles, and the case where the caller explicitly wants no
bundles. We behaved as if they wanted the latter behavior rather than
the former, which led to problems with simplifylibcalls and WinEH.

This change fixes it by making the parameter non-optional, so we can
distinguish these two cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261258 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86ISelLowering] Use isPowerof2 instead of rewriting it. NFC.
Davide Italiano [Thu, 18 Feb 2016 20:43:15 +0000 (20:43 +0000)]
[X86ISelLowering] Use isPowerof2 instead of rewriting it. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261255 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd support for invoke/landingpad/resume in C API test
Amaury Sechet [Thu, 18 Feb 2016 20:38:32 +0000 (20:38 +0000)]
Add support for invoke/landingpad/resume in C API test

Summary: As per title. There was a lot of part missing in the C API, so I had to extend the invoke and landingpad API.

Reviewers: echristo, joker.eph, Wallbraker

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261254 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRestrict scope of variables [NFC]
Philip Reames [Thu, 18 Feb 2016 19:45:31 +0000 (19:45 +0000)]
Restrict scope of variables [NFC]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261250 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CaptureTracking] Support atomicrmw and cmpxchg
Philip Reames [Thu, 18 Feb 2016 19:23:27 +0000 (19:23 +0000)]
[CaptureTracking] Support atomicrmw and cmpxchg

These atomic operations are conceptually both a load and store from the same location. As such, we can treat them as the most conservative of those two components which in practice, means we can treat them like stores. An cmpxchg or atomicrmw captures the values, but not the locations accessed.

Note: We can probably be more aggressive about the comparison value in an cmpxhg since to have it be in memory, it must already be captured, but I figured it was better to avoid that for the moment.

Note 2: It turns out that since we don't actually support cmpxchg of pointer type, writing a negative test is impossible.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261245 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[DebugInfoPDB] Add source / line number accessors for PDB.
Zachary Turner [Thu, 18 Feb 2016 18:47:29 +0000 (18:47 +0000)]
[DebugInfoPDB] Add source / line number accessors for PDB.

This patch adds a variety of different methods to query source
and line number information from PDB files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261239 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd more triples after r261235
Hans Wennborg [Thu, 18 Feb 2016 18:44:33 +0000 (18:44 +0000)]
Add more triples after r261235

Since the behaviour is now different between Darwin and non-Darwin,
more triples are needed :-/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261238 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AArch64] Reduce vector insert/extract cost for Kryo
Matthew Simpson [Thu, 18 Feb 2016 18:35:45 +0000 (18:35 +0000)]
[AArch64] Reduce vector insert/extract cost for Kryo

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261237 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert to extend i8/i16 return values on Darwin (PR26665)
Hans Wennborg [Thu, 18 Feb 2016 18:17:05 +0000 (18:17 +0000)]
Revert to extend i8/i16 return values on Darwin (PR26665)

In r260133, LLVM was changed to no longer extend i8/i16 return values,
as it's not required by the ABI. However, code was found in the wild
that relies on the old behaviour on Darwin, so this commit reverts
back to that old behaviour for Darwin.

On other platforms, it's less likely that code would be depending on
the old behaviour, as GCC and MSVC haven't been extending such return
values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261235 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMake header self-contained. NFC.
Benjamin Kramer [Thu, 18 Feb 2016 18:02:48 +0000 (18:02 +0000)]
Make header self-contained. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261234 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Remove redundant check.
Chad Rosier [Thu, 18 Feb 2016 17:49:57 +0000 (17:49 +0000)]
[Hexagon] Remove redundant check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261232 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoStop creating covmap as note section on ELF
Xinliang David Li [Thu, 18 Feb 2016 17:20:22 +0000 (17:20 +0000)]
Stop creating covmap as note section on ELF

covmap needs to created as non allocatable, but not with
SHT_NOTE. The latter was needed to workaround a problem
of BFD linker with gc, which is no longer needed. (A more
proper longer term fix requires changing FE driver to force
referencing the section using linker script).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261228 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAMDGPU/SI: add llvm.amdgcn.image.load/store[.mip] intrinsics
Nicolai Haehnle [Thu, 18 Feb 2016 16:44:18 +0000 (16:44 +0000)]
AMDGPU/SI: add llvm.amdgcn.image.load/store[.mip] intrinsics

Summary:
These correspond to IMAGE_LOAD/STORE[_MIP] and are going to be used by Mesa
for the GL_ARB_shader_image_load_store extension.

IMAGE_LOAD is already matched by llvm.SI.image.load. That intrinsic has
a legacy name and pretends not to read memory.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261224 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Fix compilation error with GCC 6
Krzysztof Parzyszek [Thu, 18 Feb 2016 16:10:27 +0000 (16:10 +0000)]
[Hexagon] Fix compilation error with GCC 6

Compiling Hexagon target with GCC 6 produces "error: should have been
declared inside" due to GCC PR c++/69657 which was merged.

Properly wrapping operator<<() definitions within the namespace llvm
fixes the issue.

Author: domagoj.stolfa

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261220 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Implement TLS support
Krzysztof Parzyszek [Thu, 18 Feb 2016 15:42:57 +0000 (15:42 +0000)]
[Hexagon] Implement TLS support

Patch by Anand Kodnani.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261218 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReapply commit r259357 with a fix for PR26629
Matthew Simpson [Thu, 18 Feb 2016 14:14:40 +0000 (14:14 +0000)]
Reapply commit r259357 with a fix for PR26629

Commit r259357 was reverted because it caused PR26629. We were assuming all
roots of a vectorizable tree could be truncated to the same width, which is not
the case in general. This commit reapplies the patch along with a fix and a new
test case to ensure we don't regress because of this issue again. This should
fix PR26629.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261212 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips][microMIPS] Implement TLBINV and TLBINVF instructions
Zlatko Buljan [Thu, 18 Feb 2016 14:10:52 +0000 (14:10 +0000)]
[mips][microMIPS] Implement TLBINV and TLBINVF instructions
Differential Revision: http://reviews.llvm.org/D16849

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261211 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Add support for __builtin_prefetch
Krzysztof Parzyszek [Thu, 18 Feb 2016 13:58:38 +0000 (13:58 +0000)]
[Hexagon] Add support for __builtin_prefetch

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261210 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Update the callee-saved register set for EH-aware functions
Krzysztof Parzyszek [Thu, 18 Feb 2016 13:41:05 +0000 (13:41 +0000)]
[Hexagon] Update the callee-saved register set for EH-aware functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261208 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd parentheses around arithmetic in operand of '|'.
Benjamin Kramer [Thu, 18 Feb 2016 13:23:17 +0000 (13:23 +0000)]
Add parentheses around arithmetic in operand of '|'.

This avoids a operator precedence warning for mixing + and | in an
expression. I checked that this matches the definition in the Split
DWARF proposal.

Patch by Cong Liu!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261207 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PM] Port the PostOrderFunctionAttrs pass to the new pass manager and
Chandler Carruth [Thu, 18 Feb 2016 11:03:11 +0000 (11:03 +0000)]
[PM] Port the PostOrderFunctionAttrs pass to the new pass manager and
convert one test to use this.

This is a particularly significant milestone because it required
a working per-function AA framework which can be queried over each
function from within a CGSCC transform pass (and additionally a module
analysis to be accessible). This is essentially *the* point of the
entire pass manager rewrite. A CGSCC transform is able to query for
multiple different function's analysis results. It works. The whole
thing appears to actually work and accomplish the original goal. While
we were able to hack function attrs and basic-aa to "work" in the old
pass manager, this port doesn't use any of that, it directly leverages
the new fundamental functionality.

For this to work, the CGSCC framework also has to support SCC-based
behavior analysis, etc. The only part of the CGSCC pass infrastructure
not sorted out at this point are the updates in the face of inlining and
running function passes that mutate the call graph.

The changes are pretty boring and boiler-plate. Most of the work was
factored into more focused preperatory patches. But this is what wires
it all together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261203 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Improve PSHUFB shuffle mask decoding.
Simon Pilgrim [Thu, 18 Feb 2016 10:17:40 +0000 (10:17 +0000)]
[X86][SSE] Improve PSHUFB shuffle mask decoding.

In cases where the PSHUFB shuffle mask is shared it might not be bitcasted to a vXi8 byte vector. This patch adds support for decoding these wider shuffle masks from the ConstantPool.

The test case in question makes use of this to recognise the shuffle mask is an unary UNPCKL pattern and simplifies accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261201 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMinor code cleanup. NFC.
Junmo Park [Thu, 18 Feb 2016 10:09:20 +0000 (10:09 +0000)]
Minor code cleanup. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261200 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTest commit access.
Nikolay Haustov [Thu, 18 Feb 2016 10:02:12 +0000 (10:02 +0000)]
Test commit access.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261199 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AVX512][PRORQ][PRORD] Change imm8 to int
Michael Zuckerman [Thu, 18 Feb 2016 09:52:12 +0000 (09:52 +0000)]
[AVX512][PRORQ][PRORD] Change imm8 to int

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261198 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[PM/AA] Teach the new pass manager to use pass-by-lambda for registering
Chandler Carruth [Thu, 18 Feb 2016 09:45:17 +0000 (09:45 +0000)]
[PM/AA] Teach the new pass manager to use pass-by-lambda for registering
analysis passes, support pre-registering analyses, and use that to
implement parsing and pre-registering a custom alias analysis pipeline.

With this its possible to configure the particular alias analysis
pipeline used by the AAManager from the commandline of opt. I've updated
the test to show this effectively in use to build a pipeline including
basic-aa as part of it.

My big question for reviewers are around the APIs that are used to
expose this functionality. Are folks happy with pass-by-lambda to do
pass registration? Are folks happy with pre-registering analyses as
a way to inject customized instances of an analysis while still using
the registry for the general case?

Other thoughts of course welcome. The next round of patches will be to
add the rest of the alias analyses into the new pass manager and wire
them up here so that they can be used from opt. This will require
extending the (somewhate limited) functionality of AAManager w.r.t.
module passes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261197 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMake a stub version of MITests, instead of reverting.
NAKAMURA Takumi [Thu, 18 Feb 2016 07:37:17 +0000 (07:37 +0000)]
Make a stub version of MITests, instead of reverting.

Lit tends to find out-of-date unittests in the build tree.

FIXME: It may be reverted several days after.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261194 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Don't use setRequiresStructuredCFG(true).
Dan Gohman [Thu, 18 Feb 2016 06:32:53 +0000 (06:32 +0000)]
[WebAssembly] Don't use setRequiresStructuredCFG(true).

While we still do want reducible control flow, the RequiresStructuredCFG
flag imposes more strict structure constraints than WebAssembly wants.
Unsetting this flag enables critical edge splitting and tail merging.

Also, disable TailDuplication explicitly, as it doesn't support virtual
registers, and was previously only disabled by the RequiresStructuredCFG
flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261190 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "LiveIntervalAnalysis: Remove LiveVariables requirement" and LiveIntervalTest
Matthias Braun [Thu, 18 Feb 2016 05:21:43 +0000 (05:21 +0000)]
Revert "LiveIntervalAnalysis: Remove LiveVariables requirement" and LiveIntervalTest

The commit breaks stage2 compilation on PowerPC. Reverting for now while
this is analyzed. I also have to revert the LiveIntervalTest for now as
that depends on this commit.

Revert "LiveIntervalAnalysis: Remove LiveVariables requirement"
This reverts commit r260806.
Revert "Remove an unnecessary std::move to fix -Wpessimizing-move warning."
This reverts commit r260931.
Revert "Fix typo in LiveIntervalTest"
This reverts commit r260907.
Revert "Add unittest for LiveIntervalAnalysis::handleMove()"
This reverts commit r260905.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261189 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TableGen,X86] Add NDEBUG check to a variable initialization that's only used by...
Craig Topper [Thu, 18 Feb 2016 04:54:32 +0000 (04:54 +0000)]
[TableGen,X86] Add NDEBUG check to a variable initialization that's only used by asserts. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261188 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[TableGen,X86] Remove extra optional operand from RawFrm. RawFrm with 2 immediates...
Craig Topper [Thu, 18 Feb 2016 04:54:29 +0000 (04:54 +0000)]
[TableGen,X86] Remove extra optional operand from RawFrm. RawFrm with 2 immediates is handled by RawFrmImm8/RawFrmImm16.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261187 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AMDGPU] Disassembler: Added basic disassembler for AMDGPU target
Tom Stellard [Thu, 18 Feb 2016 03:42:32 +0000 (03:42 +0000)]
[AMDGPU] Disassembler: Added basic disassembler for AMDGPU target

Changes:

- Added disassembler project
- Fixed all decoding conflicts in .td files
- Added DecoderMethod=“NONE” option to Target.td that allows to
  disable decoder generation for an instruction.
- Created decoding functions for VS_32 and VReg_32 register classes.
- Added stubs for decoding all register classes.
- Added several tests for disassembler

Disassembler only supports:

- VI subtarget
- VOP1 instruction encoding
- 32-bit register operands and inline constants

[Valery]

One of the point that requires to pay attention to is how decoder
conflicts were resolved:

- Groups of target instructions were separated by using different
  DecoderNamespace (SICI, VI, CI) using similar to AssemblerPredicate
  approach.

- There were conflicts in IMAGE_<> instructions caused by two
  different reasons:

1. dmask wasn’t specified for the output (fixed)
2. There are image instructions that differ only by the number of
   the address components but have the same encoding by the HW spec. The
   actual number of address components is determined by the HW at runtime
   using image resource descriptor starting from the VGPR encoded in an
   IMAGE instruction. This means that we should choose only one instruction
   from conflicting group to be the rule for decoder. I didn’t find the way
   to disable decoder generation for an arbitrary instruction and therefore
   made a onelinear fix to tablegen generator that would suppress decoder
   generation when DecoderMethod is set to “NONE”. This is a change that
   should be reviewed and submitted first. Otherwise I would need to
   specify different DecoderNamespace for every instruction in the
   conflicting group. I haven’t checked yet if DecoderMethod=“NONE” is not
   used in other targets.
3. IMAGE_GATHER decoder generation is for now disabled and to be
   done later.

[/Valery]

Patch By: Sam Kolton

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261185 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] fix the libFuzzer bot
Kostya Serebryany [Thu, 18 Feb 2016 02:02:40 +0000 (02:02 +0000)]
[libFuzzer] fix the libFuzzer bot

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261184 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd upport for bitcast in the C API echo test
Amaury Sechet [Wed, 17 Feb 2016 23:55:59 +0000 (23:55 +0000)]
Add upport for bitcast in the C API echo test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261177 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WebAssembly] Disable register stackification and coloring when not optimizing
Derek Schuff [Wed, 17 Feb 2016 23:20:43 +0000 (23:20 +0000)]
[WebAssembly] Disable register stackification and coloring when not optimizing

These passes are optimizations, and should be disabled when not
optimizing.
Also create an MCCodeGenInfo so the opt level is correctly plumbed to
the backend pass manager.
Also remove the command line flag for disabling register coloring;
running llc with -O0 should now be useful for debugging, so it's not
necessary.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261176 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAArch64: always clear kill flags up to last eliminated copy
Tim Northover [Wed, 17 Feb 2016 23:07:04 +0000 (23:07 +0000)]
AArch64: always clear kill flags up to last eliminated copy

After r261154, we were only clearing flags if the known-zero register was
originally live-in to the basic block, but we have to do it even if not when
more than one COPY has been eliminated, otherwise the user of the first COPY
may still have <kill> marked.

E.g.

BB#N:
    %X0 = COPY %XZR
    STRXui %X0<kill>, <fi#0>
    %X0 = COPY %XZR
    STRXui %X0<kill>, <fi#1>

We can eliminate both copies, X0 is not live-in, but we must clear the kill on
the first store.

Unfortunately, I've been unable to come up with a non-fragile test for this.
I've only seen it in the wild with regalloc-created spills, and attempts to
reproduce that in a reasonable way run afoul of COPY coalescing. Even volatile
asm clobbers were moved around. Should fix the aarch64 bot though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261175 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd support for memory operations (load/store/gep) in C API echo test
Amaury Sechet [Wed, 17 Feb 2016 22:51:03 +0000 (22:51 +0000)]
Add support for memory operations (load/store/gep) in C API echo test

Summary: As per title.

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261174 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[DebugInfoPDB] A few cleanups on PDB Variant class.
Zachary Turner [Wed, 17 Feb 2016 22:46:33 +0000 (22:46 +0000)]
[DebugInfoPDB] A few cleanups on PDB Variant class.

Also implements the PDBSymbolCompilandEnv::getValue() method,
which until now had been unimplemented specifically because
variant did not support string values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261173 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMove LLVMCreateTargetData and LLVMDisposeTargetData together. NFC
Amaury Sechet [Wed, 17 Feb 2016 22:41:09 +0000 (22:41 +0000)]
Move LLVMCreateTargetData and LLVMDisposeTargetData together. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261172 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[readobj] Remove uneeded braces in case statement.
Michael J. Spencer [Wed, 17 Feb 2016 22:30:41 +0000 (22:30 +0000)]
[readobj] Remove uneeded braces in case statement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261170 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMake sure functions are generated even there is no global in the C API echo test
Amaury Sechet [Wed, 17 Feb 2016 22:30:05 +0000 (22:30 +0000)]
Make sure functions are generated even there is no global in the C API echo test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261169 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDwarfDebug: Don't drop the DIExpression just because a variable is
Adrian Prantl [Wed, 17 Feb 2016 22:20:08 +0000 (22:20 +0000)]
DwarfDebug: Don't drop the DIExpression just because a variable is
described by an immediate.

Found via http://reviews.llvm.org/D16867
Thanks to Paul Robinson for pointing this out.

<rdar://problem/24456528>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261168 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDbgVariable: Add an accessor for the common case of a single expression
Adrian Prantl [Wed, 17 Feb 2016 22:19:59 +0000 (22:19 +0000)]
DbgVariable: Add an accessor for the common case of a single expression
belonging to a single DBG_VALUE instruction.

NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261167 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd support for global variables in the C API echo test
Amaury Sechet [Wed, 17 Feb 2016 22:13:33 +0000 (22:13 +0000)]
Add support for global variables in the C API echo test

Summary: As per title

Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261164 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[sanitizer-coverage] implement -fsanitize-coverage=trace-pc. This is similar to trace...
Kostya Serebryany [Wed, 17 Feb 2016 21:34:43 +0000 (21:34 +0000)]
[sanitizer-coverage] implement -fsanitize-coverage=trace-pc. This is similar to trace-bb, but has a different API. We already use the equivalent flag in GCC for Linux kernel fuzzing. We may be able to use this flag with AFL too

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261159 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoNFC: Fix formating
Amaury Sechet [Wed, 17 Feb 2016 21:21:29 +0000 (21:21 +0000)]
NFC: Fix formating

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261156 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix warning on build without asserts
Tim Northover [Wed, 17 Feb 2016 21:16:59 +0000 (21:16 +0000)]
Fix warning on build without asserts

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261155 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAArch64: improve redundant copy elimination.
Tim Northover [Wed, 17 Feb 2016 21:16:53 +0000 (21:16 +0000)]
AArch64: improve redundant copy elimination.

Mostly, this fixes the bug that if the CBZ guaranteed Xn but Wn was used, we
didn't sort out the use-def chain properly.

I've also made it check more than just the last instruction for a compatible
CBZ (so it can cope without fallthroughs). I'd have liked to do that
separately, but it's helps writing the test.

Finally, I removed some custom loops in favour of MachineInstr helpers and
refactored the control flow to flatten it and avoid possibly quadratic
iterations in blocks with many copies. NFC for these, just a general tidy-up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261154 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[DebugInfoPDB] Raise getSymIndexId() up to PDBSymbol
Zachary Turner [Wed, 17 Feb 2016 21:13:34 +0000 (21:13 +0000)]
[DebugInfoPDB] Raise getSymIndexId() up to PDBSymbol

Every symbol, no matter what it's tag is, supports the method
getSymIndexId().  However, this was being forwarded on every
concrete symbol type, so if someone had a PDBSymbol that they
didn't know what type it was (or simply didn't have an instance
of the concrete symbol type), they would not be able to get its
index id.  This patch moves the method up to PDBSymbol, so that
no matter what type of object you have, you can always get its
id.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261153 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[DebugInfoPDB] Teach Variant to support string types.
Zachary Turner [Wed, 17 Feb 2016 21:13:15 +0000 (21:13 +0000)]
[DebugInfoPDB] Teach Variant to support string types.

The IDiaSymbol::getValue() method returns a variant.  Until now,
I had never encountered a string value, so the Variant wrapper
did not support VT_BSTR.  Now we have need to support string
values, so this patch just adds support for one extra type to
Variant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261152 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[LIR] Avoid turning non-temporal stores into memset
Haicheng Wu [Wed, 17 Feb 2016 21:00:06 +0000 (21:00 +0000)]
[LIR] Avoid turning non-temporal stores into memset

This is to fix PR26645.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261149 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDebug Info: Teach LdStHasDebugValue() (Local.cpp) about DIExpressions.
Adrian Prantl [Wed, 17 Feb 2016 20:02:25 +0000 (20:02 +0000)]
Debug Info: Teach LdStHasDebugValue() (Local.cpp) about DIExpressions.
This function is used to check whether a dbg.value intrinsic has already
been inserted, but without comparing the DIExpression, it would erroneously
fire on split aggregates and only the first scalar would survive.

Found via http://reviews.llvm.org/D16867.
<rdar://problem/24456528>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261145 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd static/const qualifiers to methods. NFC.
George Burgess IV [Wed, 17 Feb 2016 19:59:32 +0000 (19:59 +0000)]
Add static/const qualifiers to methods. NFC.

Split out this change as requested in D14933.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261144 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[libFuzzer] don't timeout when loading the corpus. Be a bit more verbose when loading...
Kostya Serebryany [Wed, 17 Feb 2016 19:42:34 +0000 (19:42 +0000)]
[libFuzzer] don't timeout when loading the corpus. Be a bit more verbose when loading large corpus.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261143 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMention 'notail' attribute in 3.9 release notes.
Akira Hatanaka [Wed, 17 Feb 2016 19:35:47 +0000 (19:35 +0000)]
Mention 'notail' attribute in 3.9 release notes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261141 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCreate masked gather and scatter intrinsics in Loop Vectorizer.
Elena Demikhovsky [Wed, 17 Feb 2016 19:23:04 +0000 (19:23 +0000)]
Create masked gather and scatter intrinsics in Loop Vectorizer.
Loop vectorizer now knows to vectorize GEP and create masked gather and scatter intrinsics for random memory access.

The feature is enabled on AVX-512 target.
Differential Revision: http://reviews.llvm.org/D15690

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261140 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix load alignement when unpacking aggregates structs
Amaury Sechet [Wed, 17 Feb 2016 19:21:28 +0000 (19:21 +0000)]
Fix load alignement when unpacking aggregates structs

Summary: Store and loads unpacked by instcombine do not always have the right alignement. This explicitely compute the alignement and set it.

Reviewers: dblaikie, majnemer, reames, hfinkel, joker.eph

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261139 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "Reapply commit r258404 with fix."
David Majnemer [Wed, 17 Feb 2016 19:02:36 +0000 (19:02 +0000)]
Revert "Reapply commit r258404 with fix."

This reverts commit r259357, it caused PR26629.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261137 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ObjCARC] Handle ARCInstKind::ClaimRV in OptimizeIndividualCalls.
Frederic Riss [Wed, 17 Feb 2016 18:51:27 +0000 (18:51 +0000)]
[ObjCARC] Handle ARCInstKind::ClaimRV in OptimizeIndividualCalls.

When support for objc_unsafeClaimAutoreleasedReturnValue has been added to the
ARC optimizer in r258970, one case was missed which would lead the optimizer
to execute an llvm_unreachable. In this case, just handle ClaimRV in the same
way we handle RetainRV.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261134 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Replacing reference/dereference with reference cast.
Colin LeMahieu [Wed, 17 Feb 2016 18:50:21 +0000 (18:50 +0000)]
[Hexagon] Replacing reference/dereference with reference cast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261133 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove superfluous semicolon.
Nico Weber [Wed, 17 Feb 2016 18:48:08 +0000 (18:48 +0000)]
Remove superfluous semicolon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261128 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert r261070, it caused PR26652 / PR26653.
Nico Weber [Wed, 17 Feb 2016 18:47:29 +0000 (18:47 +0000)]
Revert r261070, it caused PR26652 / PR26653.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261127 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WinEH] Optimize WinEH state stores
David Majnemer [Wed, 17 Feb 2016 18:37:11 +0000 (18:37 +0000)]
[WinEH] Optimize WinEH state stores

32-bit x86 Windows targets use a linked-list of nodes allocated on the
stack, referenced to via thread-local storage.  The personality routine
interprets one of the fields in the node as a 'state number' which
indicates where the personality routine should transfer control.

State transitions are possible only before call-sites which may throw
exceptions.  Our previous scheme had us update the state number before
all call-sites which may throw.

Instead, we can try to minimize the number of times we need to store by
reasoning about the nearest store which dominates the current call-site.
If the last store agrees with the current call-site, then we know that
the state-update is redundant and can be elided.

This is largely straightforward: an RPO walk of the blocks allows us to
correctly forward propagate the information when the function is a DAG.
Currently, loops are not handled optimally and may trigger superfluous
state stores.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261122 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd a profile summary class specific to instrumentation profiles.
Easwaran Raman [Wed, 17 Feb 2016 18:18:47 +0000 (18:18 +0000)]
Add a profile summary class specific to instrumentation profiles.

Modify ProfileSummary class to make it not instrumented profile specific.
Add a new InstrumentedProfileSummary class that inherits from ProfileSummary.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261119 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Loop instructions don't need special processing. Extension and fitting...
Colin LeMahieu [Wed, 17 Feb 2016 18:14:05 +0000 (18:14 +0000)]
[Hexagon] Loop instructions don't need special processing.  Extension and fitting is performed by generic code and the comment is incorrect, loops don't have a separate extended opcode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261118 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Annotate convergent intrinsics as convergent.
Justin Lebar [Wed, 17 Feb 2016 17:46:54 +0000 (17:46 +0000)]
[NVPTX] Annotate convergent intrinsics as convergent.

Summary:
Previously the machine instructions for bar.sync &co. were not marked as
convergent.  This resulted in some MI passes (such as TailDuplication,
fixed in an upcoming patch) doing unsafe things to these instructions.

Reviewers: jingyue

Subscribers: llvm-commits, tra, jholewinski, hfinkel

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261115 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Test that MachineSink won't sink across llvm.cuda.syncthreads.
Justin Lebar [Wed, 17 Feb 2016 17:46:52 +0000 (17:46 +0000)]
[NVPTX] Test that MachineSink won't sink across llvm.cuda.syncthreads.

Summary:
The syncthreads MI is modeled as mayread/maywrite -- convergence doesn't
even come into play here.  Nonetheless this property is highly implicit
in the tablegen files, so a test seems appropriate.

Reviewers: jingyue

Subscribers: llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261114 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[NVPTX] Annotate call machine instructions as calls.
Justin Lebar [Wed, 17 Feb 2016 17:46:50 +0000 (17:46 +0000)]
[NVPTX] Annotate call machine instructions as calls.

Summary:
Otherwise we'll try to do unsafe optimizations on these MIs, such as
sinking loads below calls.

(I suspect that this is not the only bug in the NVPTX instruction
tablegen files; I need to comb through them.)

Reviewers: jholewinski, tra

Subscribers: jingyue, jhen, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261113 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[IR] Add {is,set,setNot}Convergent() functions to CallSite, CallInstr, and InvokeInstr.
Justin Lebar [Wed, 17 Feb 2016 17:46:47 +0000 (17:46 +0000)]
[IR] Add {is,set,setNot}Convergent() functions to CallSite, CallInstr, and InvokeInstr.

Summary:
(CallSite already has isConvergent() and setConvergent().)

No functional changes.

Reviewers: reames

Subscribers: llvm-commits, jingyue, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261112 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUpdate langref to indicate that calls may be convergent.
Justin Lebar [Wed, 17 Feb 2016 17:46:41 +0000 (17:46 +0000)]
Update langref to indicate that calls may be convergent.

Summary:
As previously written, only functions could be convergent.  But calls
need to have a notion of convergence as well.

To see why this is important, consider an indirect call.  We may or may
not want to disable optimizations around it and behave as though we're
calling a convergent function -- it depends on the semantics of the
language we're compiling.  Thus the need for this attr on the call.

Reviewers: jingyue, joker.eph

Subscribers: llvm-commits, tra, jhen, arsenm, chandlerc, hfinkel, resistor

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261111 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix typo in comment.
Justin Lebar [Wed, 17 Feb 2016 17:46:39 +0000 (17:46 +0000)]
Fix typo in comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261110 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRepresent the dynamic table itself with a DynRegionInfo.
Rafael Espindola [Wed, 17 Feb 2016 16:48:00 +0000 (16:48 +0000)]
Represent the dynamic table itself with a DynRegionInfo.

The dynamic table is also an array of a fixed structure, so it can be
represented with a DynReginoInfo.

No major functionality change. The extra error checking is covered by
existing tests with a broken dynamic program header.

Idea extracted from r260488. I did the extra cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261107 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix some erroneous lit test failures due to unlucky name of working directory.
Mitch Bodart [Wed, 17 Feb 2016 16:35:18 +0000 (16:35 +0000)]
Fix some erroneous lit test failures due to unlucky name of working directory.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261104 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd a unwrapOrError utility and use it to simplify ELFDumper.cpp.
Rafael Espindola [Wed, 17 Feb 2016 16:21:49 +0000 (16:21 +0000)]
Add a unwrapOrError utility and use it to simplify ELFDumper.cpp.

Utility extracted from r260488.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261103 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Update pshufb mask tests.
Simon Pilgrim [Wed, 17 Feb 2016 15:52:39 +0000 (15:52 +0000)]
[X86][SSE] Update pshufb mask tests.

We are getting better at combining constant pshufb masks - use a real input instead of undef.

Add test for decoding multi-use bitcasted masks as well (actual support will come soon).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261101 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoChange how readobj stores info about dynamic symbols.
Rafael Espindola [Wed, 17 Feb 2016 15:38:21 +0000 (15:38 +0000)]
Change how readobj stores info about dynamic symbols.

We used to keep both a section and a pointer to the first symbol.

The oddity of keeping a section for dynamic symbols is because there is
a DT_SYMTAB but no DT_SYMTABZ, so to print the table we have to find the
size via a section table.

The reason for still keeping a pointer to the first symbol is because we
want to be able to print relocation tables even if the section table is
missing (it is mandatory only for files used in linking).

With this patch we keep just a DynRegionInfo. This then requires
changing a few places that were asking for a Elf_Shdr but actually just
needed the first symbol.

The test change is to delete the program header pointer.
Now that we use the information of both DT_SYMTAB and .dynsym, we don't
depend on the sh_entsize of .dynsym if we see DT_SYMTAB.

Note: It is questionable if it is worth it putting the effort to report
broken sh_entsize given that in files with no section table we have to
assume it is sizeof(Elf_Sym), but that is for another change.

Extracted from r260488.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261099 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Hexagon] Fold object construction into map::insert
Krzysztof Parzyszek [Wed, 17 Feb 2016 15:02:07 +0000 (15:02 +0000)]
[Hexagon] Fold object construction into map::insert

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261096 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86][SSE] Update pshufb mask test to use a real input instead of undef
Simon Pilgrim [Wed, 17 Feb 2016 14:56:58 +0000 (14:56 +0000)]
[X86][SSE] Update pshufb mask test to use a real input instead of undef

We are getting better at combining constant pshufb masks - this test would've failed once we decode bitcasted masks as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261095 91177308-0d34-0410-b5e6-96231b3b80d8