Commit Graph

129871 Commits

Author SHA1 Message Date
Elena Demikhovsky
55991dff37 AVX-512: Load and Extended Load for i1 vectors
Implemented load+{sign|zero}_extend for i1 vectors
Fixed failures in i1 vector load.
Covered loading of v2i1, v4i1, v8i1, v16i1, v32i1, v64i1 vectors for KNL and SKX.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265259 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-03 08:41:12 +00:00
Davide Italiano
4e5a97a04b [SimplifyLibCalls] Garbage collect dead code.
We already skip optimizations if the return value
of printf() is used, so CI->use_empty() is always
true.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265253 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-03 01:46:52 +00:00
Jacques Pienaar
5a07bd0af6 [lanai] Fix for LanaiDelaySlotFiller and LanaiMCInstLower.cpp
Summary:
* Fix to stop delay slot filler from inserting SP modifying instructions in the newly expanded call/return instructions.
* In LowerSymbol the outermost type was not LanaiMCExpr if there was a binary expression
* Remove printExpr in LanaiInstPrinter

Subscribers: joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265251 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-03 00:49:27 +00:00
Zoran Jovanovic
3d20af9dc6 [mips][microMIPS] Revert commits r264245 and r264248.
Commit r264245 was the reason for failing tests in LLVM test suite.
Commit r264248 depends on the first one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 23:06:13 +00:00
Simon Pilgrim
3021e4235e [X86][SSE] Added 1024-bit vector comparison tests
More examples of PR22603, poor vector splitting for AVX512F targets as well as missing uses of PACKSS/MOVMSK

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265248 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 21:33:09 +00:00
Simon Pilgrim
6bf924bfe8 [X86][AVX512] Added AVX512 comparison tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265247 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 21:24:42 +00:00
Saleem Abdulrasool
3aae1a6760 AArch64: support .cpu directive
Add support for the AArch64 .cpu directive.  This is a slightly involved
directive since the parameter is actually a variable encoded string.  The
general structure is:

  <cpu>[[+-]<feature>]*

We now map some of the supported string names for features for internal
representation of feature flags.  If we encounter one which we do not support,
bail out as we cannot validate the assembly any longer.

Resolves PR27010.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265240 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 19:29:52 +00:00
Duncan P. N. Exon Smith
715c242f51 Linker: Split mapUnneededSubprograms into two; almost NFC
Split the loop through compile units in mapUnneededSubprograms in two.
First, visit imported entities to ensure that we've visited all need
subprograms.  Second, visit subprograms, and drop the ones we don't
need.

Hypothetically this protects against a subprogram from one compile unit
being referenced from an imported entity in a different compile unit.  I
don't think that's valid IR (a debug info expert could confirm), but I
think the refactor makes the code more clear.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265233 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 17:54:01 +00:00
Duncan P. N. Exon Smith
75949bd2ce Remove redundant assertion after cast, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 17:41:52 +00:00
Duncan P. N. Exon Smith
dcf3121094 Linker: Avoid unnecessary work when moving named metadata
IRLinker::mapUnneededSubprograms has to be sure that any "needed"
subprograms get linked in.  Rather than traversing through imported
entities using llvm::getSubprogram, call MapMetadata.  The latter
memoizes the result in the ValueMap (sharing work with
IRLinker::linkNamedMDNodes proper), and makes the local SmallPtrSet
redundant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265231 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 17:39:31 +00:00
Mehdi Amini
1cb85674c6 Rename FunctionIndex into GlobalValueIndex to reflect the recent changes (NFC)
The index used to contain only Function, but now contains GlobalValue
in general.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265230 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 17:29:47 +00:00
Duncan P. N. Exon Smith
f9fa1559e5 Linker: Remove IRMover::isMetadataUnneeded indirection; almost NFC
Instead of checking live during MapMetadata whether a subprogram is
needed, seed the ValueMap with `nullptr` up-front.

There is a small hypothetical functionality change.  Previously, calling
MapMetadataOp on a node whose "scope:" chain led to an unneeded
subprogram would return nullptr.  However, if that were ever called,
then the subprogram would be needed; a situation that the IRMover is
supposed to avoid a priori!

Besides cleaning up the code a little, this restores a nice property:
MapMetadataOp returns the same as MapMetadata.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265229 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 17:12:00 +00:00
Duncan P. N. Exon Smith
eeb2c7e32c ValueMapper: Add support for seeding metadata with nullptr
Support seeding a ValueMap with nullptr for Metadata entries, a
situation I didn't consider in the Metadata/Value split.

I added a ValueMapper::getMappedMD accessor that returns an
Optional<Metadata*> with the mapped (possibly null) metadata.  IRMover
needs to use this to avoid modifying the map when it's checking for
unneeded subprograms.  I updated a call from bugpoint since I find the
new code clearer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265228 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 17:04:38 +00:00
Duncan P. N. Exon Smith
ec78cb05a0 Document end of anonymous namespaces, NFC
Prevent clang-format from deleting the preceding newline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265227 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 16:45:51 +00:00
Duncan P. N. Exon Smith
be4ea76eaa Bitcode: Try to emit metadata in function blocks
Whenever metadata is only referenced by a single function, emit the
metadata just in that function block.  This should improve lazy-loading
by reducing the amount of metadata in the global block.

For now, this should catch all DILocations, and anything else that
happens to be referenced only by a single function.

It's also a first step toward a couple of possible future directions
(which this commit does *not* implement):

 1. Some debug info metadata is only referenced from compile units and
    individual functions.  If we can drop the link from the compile
    unit, this optimization will get more powerful.

 2. Any uniqued metadata that isn't referenced globally can in theory be
    emitted in every function block that references it (trading off
    bitcode size and full-parse time vs. lazy-load time).

Note: this assumes the new BitcodeReader error checking from r265223.
The metadata stored in function blocks gets purged after parsing each
function, which means unresolved forward references will get lost.
Since all the global metadata should have already been resolved by the
time we get to the function metadata blocks we just need to check for
that case.  (If for some reason we need to handle bitcode that fails the
checks in r265223, the fix is to store about-to-be-dropped unresolved
nodes in MetadataList::shrinkTo until they can be handled succesfully by
a future call to MetadataList::tryToResolveCycles.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265226 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 15:22:57 +00:00
Duncan P. N. Exon Smith
40247d2622 Fix doxygen comments from r265224, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 15:16:56 +00:00
Duncan P. N. Exon Smith
91ae2398b9 BitcodeWriter: Further unify function metadata, NFC
Further unify the handling of function-local metadata with global
metadata, by exposing the same interface in ValueEnumerator.  Both
contexts use the same accessors:

  - getMDStrings(): get the strings for this block.
  - getNonMDStrings(): get the non-strings for this block.

A future commit will start adding strings to the function-block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265224 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 15:09:42 +00:00
Duncan P. N. Exon Smith
bfce5b2915 BitcodeReader: Check for unresolved function metadata
A follow-up commit will start using function metadata blocks more
heavily.  This commit adds some error checking to confirm that metadata
is fully resolved before (and after) materializing each function.

This is valid even when reading very old bitcode from before the
metadata/value split.  The global metadata block always came before the
function blocks.  However, in case somehow this causes a regression
(i.e., an old LLVM did produce such bitcode after all) I'm committing
separately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 14:55:01 +00:00
Simon Pilgrim
c3ddf2dea3 [X86][AVX] Added vector float truncation (double2float) tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265222 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 14:09:17 +00:00
Mehdi Amini
c03999349e Reverts r265219.
Unintentionally commited... time to call the day off!

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265221 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 05:35:03 +00:00
Mehdi Amini
47f754ab87 Fix "warning: variabl 'XX’ set but not used" in release build (variable used in assertion, NFC)
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265220 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 05:34:19 +00:00
Mehdi Amini
f4510007c7 wip
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265219 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 05:34:14 +00:00
Mehdi Amini
398341689b constify GlobalValue::getGUID() and GlobalValue::getGlobalIdentifier() (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265217 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 05:25:27 +00:00
Mehdi Amini
b659366e9e Revert "ThinLTO: add module caching handling."
This reverts commit r265214, unintentionally commited.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265216 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 05:08:18 +00:00
Mehdi Amini
5f76ad9dd7 Create a typedef GlobalValue::GUID for uint64_t and RAUW (NFC)
Summary: This should make the code more readable, especially all the map declarations.

Reviewers: tejohnson

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265215 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 05:07:53 +00:00
Mehdi Amini
4ac4b88b38 ThinLTO: add module caching handling.
Reviewers: tejohnson

Subscribers: llvm-commits, joker.eph

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265214 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 05:07:08 +00:00
Mehdi Amini
b3cb9bc147 80 lines column after renaming "shouldDiscardValueNames" (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265212 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 03:59:58 +00:00
Mehdi Amini
64a77d0033 Rename Context::discardValueNames() to shouldDiscardValueNames() (NFC)
Suggested by Sean Silva.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 03:46:17 +00:00
Mehdi Amini
22706dc4c0 Add Cache Pruning support
Incremental LTO will usea cache to store object files.
This patch handles the pruning part of the cache, exposing
a few knobs:

- Pruning interval: the implementation keeps a "timestamp" file in the
  directory and will scan it only after a given interval since the
  last modification of the timestamp file. This is for performance
  purpose, we don't want to scan continuously the folder.
- Entry expiration: this is the time after which a file that hasn't
  been used is remove from the cache.
- Maximum size: expressed in percentage of the available disk space,
  it helps to avoid that we blow up the disk space.

http://reviews.llvm.org/D18422

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 03:28:26 +00:00
Hans Wennborg
88fbbb352c Fix -Wpedantic warning about extra semi-colon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-02 01:03:41 +00:00
Rong Xu
e7eaa873ce [PGO] Use a helper function to find all indirect call-sites
Use a helper function to find all the direct-calls-sites in a function.
Also split the code into a separated file as this will be use by
indirect-call-promotion transformation.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265199 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 23:16:44 +00:00
Tim Northover
01dde4144a AArch64: avoid clobbering SP for dead MOVimm pseudos.
We were producing ORR, which actually defines a GPR32sp rather than a GPR32.

Should fix PR23209.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265198 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 23:14:52 +00:00
Nico Weber
6bde7e452f Make DIASession work if msdia*.dll isn't registered.
This fixes various symbolization test failures for me when I build with a
hermetic VS2015 without having run the 2015 installer.

http://reviews.llvm.org/D18707


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265193 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 22:21:51 +00:00
Adrian Prantl
fbce329a31 Add missing emissionKind flags to the DICompileUnits of several old testcases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 22:18:43 +00:00
Mehdi Amini
03669a56fb ThinLTO: special handling for LinkOnce functions
These function can be dropped by the compiler if they are no longer
referenced in the current module. However there is a change that
another module is still referencing them because of the import.

Multiple solutions can be used:

- Always import LinkOnce when a caller is imported. This ensure that
  every module with a call to a LinkOnce has the definition and will
  be able to emit it if it emits the call.
- Turn the LinkOnce into Weak, so that it is always emitted.
- Turn all LinkOnce into available_externally and come back after all
  modules are codegen'ed to emit only one copy of the linkonce, when
  there is still a reference to it.

This patch implement the second option, with am optimization that
only *one* module will turn the LinkOnce into Weak, while the others
will turn it into available_externally, so that there is exactly one
copy emitted for the whole compilation.

http://reviews.llvm.org/D18346

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 21:53:50 +00:00
Manman Ren
4bda882517 Swift Calling Convention: add swifterror attribute.
A ``swifterror`` attribute can be applied to a function parameter or an
AllocaInst.

This commit does not include any target-specific change. The target-specific
optimization will come as a follow-up patch.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265189 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 21:41:15 +00:00
Simon Pilgrim
44e6fffbb4 [X86][SSE] Regenerated vector float tests - fabs / floor(etc.) / fneg / float2double
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 21:30:48 +00:00
Simon Pilgrim
e4a978783a [X86][SSE] Vector i64 load tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 21:06:17 +00:00
Simon Pilgrim
68b3b2c3e2 [X86][SSE] Regenerated comparison mask and float immediate tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 21:00:00 +00:00
Simon Pilgrim
047f650a3c [X86][SSE] Regenerated the vec_extract tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 20:55:19 +00:00
David Blaikie
130ab6b212 Update owners to reflect recent changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265182 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 20:40:49 +00:00
Rong Xu
ba623ac1b5 Fix buildbot lldb-amd64-ninja-netbsd7 failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 20:15:04 +00:00
Simon Pilgrim
c9b8f68005 [X86][SSE] Regenerated the vec_insert tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265179 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 19:42:23 +00:00
James Y Knight
07284c3594 Remove useless check for ThreadModel==Single in ARMISelLowering. NFC.
ThreadModel::Single is already handled already by ARMPassConfig adding
LowerAtomicPass to the pass list, which lowers all atomics to non-atomic
ops and deletes fences.

So by the time we get to ISel, there's no atomic fences left, so they
don't need special handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265178 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 19:33:19 +00:00
Peter Collingbourne
302882987a LowerBitSets: Move declarations to separate namespace.
Should fix modules build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265176 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 18:46:50 +00:00
Mike Aizatsky
f4643f6392 [libfuzzer] adding license headers to cpp files
Differential Revision: http://reviews.llvm.org/D18705

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265174 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 18:38:58 +00:00
Simon Pilgrim
1bb3a19ffc [X86][SSE] Regenerated vec_partial tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 18:30:29 +00:00
Sanjay Patel
31624e4275 [x86] add an SSE2 + fast-unaligned accesses run for memset nonzero tests
Was there really no other way to splat a byte in SSE2?
    punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
    pshuflw {{.*#+}} xmm0 = xmm0[0,0,0,0,4,5,6,7]
    pshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 18:29:25 +00:00
Simon Pilgrim
22b6378a9f [X86][SSE] Regenerated vec_logical tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265171 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 18:28:23 +00:00
Tom Stellard
059753cf8e AMDGPU: Implement {BUFFER,FLAT}_ATOMIC_CMPSWAP{,_X2}
Summary:
Implement BUFFER_ATOMIC_CMPSWAP{,_X2} instructions on all GCN targets, and FLAT_ATOMIC_CMPSWAP{,_X2} on CI+.

32-bit instruction variants tested manually on Kabini and Bonaire. Tests and parts of code provided by Jan Veselý.

Patch by: Vedran Miletić

Reviewers: arsenm, tstellarAMD, nhaehnle

Subscribers: jvesely, scchan, kanarayan, arsenm

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

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