oota-llvm.git
8 years ago[PM/AA] Try to fix libc++ build bots which require the type used in
Chandler Carruth [Wed, 22 Jul 2015 11:10:41 +0000 (11:10 +0000)]
[PM/AA] Try to fix libc++ build bots which require the type used in
std::list to be complete by hoisting the entire definition into the
class. Ugly, but hopefully works.

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

8 years ago[X86] Add .intel_syntax noprefix directive to intel-syntax x86 asm output
Michael Kuperstein [Wed, 22 Jul 2015 10:49:44 +0000 (10:49 +0000)]
[X86] Add .intel_syntax noprefix directive to intel-syntax x86 asm output

Patch by: michael.zuckerman@intel.com
Differential Revision: http://reviews.llvm.org/D11223

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

8 years agoFix mem2reg to correctly handle allocas only used in a single block
Michael Kuperstein [Wed, 22 Jul 2015 10:29:29 +0000 (10:29 +0000)]
Fix mem2reg to correctly handle allocas only used in a single block

Currently, a load from an alloca that is used in as single block and is not preceded
by a store is replaced by undef. This is not always correct if the single block is
inside a loop.
Fix the logic so that:
1) If there are no stores in the block, replace the load with an undef, as before.
2) If there is a store (regardless of where it is in the block w.r.t the load), bail
out, and let the rest of mem2reg handle this alloca.

Patch by: gil.rapaport@intel.com
Differential Revision: http://reviews.llvm.org/D11355

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

8 years ago[asan] Improve moving of non-instrumented allocas
Kuba Brecka [Wed, 22 Jul 2015 10:25:38 +0000 (10:25 +0000)]
[asan] Improve moving of non-instrumented allocas

In r242510, non-instrumented allocas are now moved into the first basic block.  This patch limits that to only move allocas that are present *after* the first instrumented one (i.e. only move allocas up).  A testcase was updated to show behavior in these two cases.  Without the patch, an alloca could be moved down, and could cause an invalid IR.

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

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

8 years ago[PM/AA] Remove all of the dead AliasAnalysis pointers being threaded
Chandler Carruth [Wed, 22 Jul 2015 09:52:54 +0000 (09:52 +0000)]
[PM/AA] Remove all of the dead AliasAnalysis pointers being threaded
through APIs that are no longer necessary now that the update API has
been removed.

This will make changes to the AA interfaces significantly less
disruptive (I hope). Either way, it seems like a really nice cleanup.

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

8 years ago[PM/AA] Remove the last of the legacy update API from AliasAnalysis as
Chandler Carruth [Wed, 22 Jul 2015 09:49:59 +0000 (09:49 +0000)]
[PM/AA] Remove the last of the legacy update API from AliasAnalysis as
part of simplifying its interface and usage in preparation for porting
to work with the new pass manager.

Note that this will likely expose that we have dead arguments, members,
and maybe even pass requirements for AA. I'll be cleaning those up in
seperate patches. This just zaps the actual update API.

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

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

8 years ago[PM/AA] Switch to an early-exit. NFC. This was split out of another
Chandler Carruth [Wed, 22 Jul 2015 09:44:54 +0000 (09:44 +0000)]
[PM/AA] Switch to an early-exit. NFC. This was split out of another
change because the diff is *useless*. I assure you, I just switched to
early-return in this function.

Cleanup in preparation for my next commit, as requested in code review!

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

8 years ago[PM/AA] Put the 'final' keyword in the correct place. And actually
Chandler Carruth [Wed, 22 Jul 2015 09:34:18 +0000 (09:34 +0000)]
[PM/AA] Put the 'final' keyword in the correct place. And actually
succeed at compiling my change before committing it too!

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

8 years ago[PM/AA] Replace the only use of the AliasAnalysis::deleteValue API (in
Chandler Carruth [Wed, 22 Jul 2015 09:27:58 +0000 (09:27 +0000)]
[PM/AA] Replace the only use of the AliasAnalysis::deleteValue API (in
GlobalsModRef) with CallbackVHs that trigger the same behavior.

This is technically more expensive, but in benchmarking some LTO runs,
it seems unlikely to even be above the noise floor. The only way I was
able to measure the performance of GMR at all was to run nothing else
but this one analysis on a linked clang bitcode file. The call graph
analysis still took 5x more time than GMR, and this change at most made
GMR 2% slower (this is well within the noise, so its hard for me to be
sure that this is an actual change). However, in a real LTO run over the
same bitcode, the GMR run takes so little time that the pass timers
don't measure it.

With this, I can remove the last update API from the AliasAnalysis
interface, but I'll actually remove the interface hook point in
a follow-up commit.

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

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

8 years agoAVX-512: Added intrinsics for VCVT* instructions.
Elena Demikhovsky [Wed, 22 Jul 2015 08:56:00 +0000 (08:56 +0000)]
AVX-512: Added intrinsics for VCVT* instructions.
All SKX forms. All VCVT instructions for float/double/int/long types.

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

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

8 years ago[LoopUnswitch] Code refactoring to separate trivial loop unswitch and non-trivial...
Chen Li [Wed, 22 Jul 2015 05:26:29 +0000 (05:26 +0000)]
[LoopUnswitch] Code refactoring to separate trivial loop unswitch and non-trivial loop unswitch in processCurrentLoop()

Summary: The current code in LoopUnswtich::processCurrentLoop() mixes trivial loop unswitch and non-trivial loop unswitch together. It goes over all basic blocks in the loop and checks if a condition is trivial or non-trivial unswitch condition. However, trivial unswitch condition can only occur in the loop header basic block (where it controls whether or not the loop does something at all). This refactoring separate trivial loop unswitch and non-trivial loop unswitch. Before going over all basic blocks in the loop, it checks if the loop header contains a trivial unswitch condition. If so, unswitch it. Otherwise, go over all blocks like before but don't check trivial condition any more since they are not possible to be in the other blocks. This code has no functionality change.

Reviewers: meheff, reames, broune

Subscribers: llvm-commits

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

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

8 years ago[BranchFolding] do not iterate the aliases of virtual registers
Jingyue Wu [Wed, 22 Jul 2015 04:16:52 +0000 (04:16 +0000)]
[BranchFolding] do not iterate the aliases of virtual registers

Summary:
MCRegAliasIterator only works for physical registers. So, do not run it
on virtual registers.

With this issue fixed, we can resurrect the BranchFolding pass in NVPTX
backend.

Reviewers: jholewinski, bkramer

Subscribers: henryhu, meheff, llvm-commits, jholewinski

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

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

8 years ago[SROA] Fix a nasty pile of bugs to do with big-endian, different alloca
Chandler Carruth [Wed, 22 Jul 2015 03:32:42 +0000 (03:32 +0000)]
[SROA] Fix a nasty pile of bugs to do with big-endian, different alloca
types and loads, loads or stores widened past the size of an alloca,
etc.

This started off with a bug report about big-endian behavior with
bitfields and loads and stores to a { i32, i24 } struct. An initial
attempt to fix this was sent for review in D10357, but that didn't
really get to the root of the problem.

The core issue was that canConvertValue and convertValue in SROA were
handling different bitwidth integers by doing a zext of the integer. It
wouldn't do a trunc though, only a zext! This would in turn lead SROA to
form an i24 load from an i24 alloca, zext it to i32, and then use it.
This would at least produce the wrong value for big-endian systems.

One of my many false starts here was to correct the computation for
big-endian systems by shifting. But this doesn't actually work because
the original code has a 64-bit store to the entire 8 bytes, and a 32-bit
load of the last 4 bytes, and because the alloc size is 8 bytes, we
can't lose that last (least significant if bigendian) byte! The real
problem here is that we're forming an i24 load in SROA which is actually
not sufficiently wide to load all of the necessary bits here. The source
has an i32 load, and SROA needs to form that as well.

The straightforward way to do this is to disable the zext logic in
canConvertValue and convertValue, forcing us to actually load all
32-bits. This seems like a really good change, but it in turn breaks
several other parts of SROA.

First in the chain of knock-on failures, we had places where we were
doing integer-widening promotion even though some of the integer loads
or stores extended *past the end* of the alloca's memory! There was even
a comment about preventing this, but it only prevented the case where
the type had a different bit size from its store size. So I added checks
to handle the cases where we actually have a widened load or store and
to avoid trying to special integer widening promotion in those cases.

Second, we actually rely on the ability to promote in the face of loads
past the end of an alloca! This is important so that we can (for
example) speculate loads around PHI nodes to do more promotion. The bits
loaded are garbage, but as long as they aren't used and the alignment is
suitable high (which it wasn't in the test case!) this is "fine". And we
can't stop promoting here, lots of things stop working well if we do. So
we need to add specific logic to handle the extension (and truncation)
case, but *only* where that extension or truncation are over bytes that
*are outside the alloca's allocated storage* and thus totally bogus to
load or store.

And of course, once we add back this correct handling of extension or
truncation, we need to correctly handle bigendian systems to avoid
re-introducing the exact bug that started us off on this chain of misery
in the first place, but this time even more subtle as it only happens
along speculated loads atop a PHI node.

I've ported an existing test for PHI speculation to the big-endian test
file and checked that we get that part correct, and I've added several
more interesting big-endian test cases that should help check that we're
getting this correct.

Fun times.

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

8 years agoSetVector: add reverse_iterator support.
Richard Smith [Wed, 22 Jul 2015 01:30:58 +0000 (01:30 +0000)]
SetVector: add reverse_iterator support.

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

8 years ago[Fuzzer] Rely on $PATH expansion instead of hardcoding paths in tests. NFC.
Alexey Samsonov [Tue, 21 Jul 2015 22:51:55 +0000 (22:51 +0000)]
[Fuzzer] Rely on $PATH expansion instead of hardcoding paths in tests. NFC.

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

8 years ago[Fuzzer] Clearly separate regular and DFSan tests. NFC.
Alexey Samsonov [Tue, 21 Jul 2015 22:51:49 +0000 (22:51 +0000)]
[Fuzzer] Clearly separate regular and DFSan tests. NFC.

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

8 years ago[dsymutil] Implement ODR uniquing for C++ code.
Frederic Riss [Tue, 21 Jul 2015 22:41:43 +0000 (22:41 +0000)]
[dsymutil] Implement ODR uniquing for C++ code.

This optimization allows the DWARF linker to reuse definition of
types it has emitted in previous CUs rather than reemitting them
in each CU that references them. The size and link time gains are
huge. For example when linking the DWARF for a debug build of
clang, this generates a ~150M dwarf file instead of a ~700M one
(the numbers date back a bit and must not be totally accurate
these days).

As with all the other parts of the llvm-dsymutil codebase, the
goal is to keep bit-for-bit compatibility with dsymutil-classic.
The code is littered with a lot of FIXMEs that should be
addressed once we can get rid of the compatibilty goal.

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

8 years agoMIR Serialization: Start serializing the CFI operands with .cfi_def_cfa_offset.
Alex Lorenz [Tue, 21 Jul 2015 22:28:27 +0000 (22:28 +0000)]
MIR Serialization: Start serializing the CFI operands with .cfi_def_cfa_offset.

This commit begins serialization of the CFI index machine operands by
serializing one kind of CFI instruction - the .cfi_def_cfa_offset instruction.

Reviewers: Duncan P. N. Exon Smith

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

8 years agoFix a performance problem in memcpyopt by removing a linear scan over ranges when...
Nick Lewycky [Tue, 21 Jul 2015 21:56:26 +0000 (21:56 +0000)]
Fix a performance problem in memcpyopt by removing a linear scan over ranges when inserting a new range. No functionality change intended. Patch by Anthony Pesch!

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

8 years ago[MDA] change BlockScanLimit into a command line option.
Jingyue Wu [Tue, 21 Jul 2015 21:50:39 +0000 (21:50 +0000)]
[MDA] change BlockScanLimit into a command line option.

Summary:
In the benchmark (https://github.com/vetter/shoc) we are researching,
the duplicated load is not eliminated because MemoryDependenceAnalysis
hit the BlockScanLimit. This patch change it into a command line option
instead of a hardcoded value.

Patched by Xuetian Weng.

Test Plan: test/Analysis/MemoryDependenceAnalysis/memdep-block-scan-limit.ll

Reviewers: jingyue, reames

Subscribers: reames, llvm-commits

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

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

8 years ago[AsmPrinter] Check for valid constants in handleIndirectSymViaGOTPCRel
Bruno Cardoso Lopes [Tue, 21 Jul 2015 21:45:42 +0000 (21:45 +0000)]
[AsmPrinter] Check for valid constants in handleIndirectSymViaGOTPCRel

Check whether BaseCst is valid before extracting a GlobalValue.
This fixes PR24163.

Patch by David Majnemer.

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

8 years ago[Object][ELF] Handle files with no section header string table.
Michael J. Spencer [Tue, 21 Jul 2015 21:40:33 +0000 (21:40 +0000)]
[Object][ELF] Handle files with no section header string table.

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

8 years ago[PPC64LE] More vector swap optimization TLC
Bill Schmidt [Tue, 21 Jul 2015 21:40:17 +0000 (21:40 +0000)]
[PPC64LE] More vector swap optimization TLC

This makes one substantive change and a few stylistic changes to the
VSX swap optimization pass.

The substantive change is to permit LXSDX and LXSSPX instructions to
participate in swap optimization computations.  The previous change to
insert a swap following a SUBREG_TO_REG widening operation makes this
almost trivial.

I experimented with also permitting STXSDX and STXSSPX instructions.
This can be done using similar techniques:  we could insert a swap
prior to a narrowing COPY operation, and then permit these stores to
participate.  I prototyped this, but discovered that the pattern of a
narrowing COPY followed by an STXSDX does not occur in any of our
test-suite code.  So instead, I added commentary indicating that this
could be done.

Other TLC:
 - I changed SH_COPYSCALAR to SH_COPYWIDEN to more clearly indicate
 the direction of the copy.
 - I factored the insertion of swap instructions into a separate
 function.

Finally, I added a new test case to check that the scalar-to-vector
loads are working properly with swap optimization.

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

8 years agoMIR Parser: Reuse the function 'lexName' when lexing global value tokens. NFC.
Alex Lorenz [Tue, 21 Jul 2015 21:23:08 +0000 (21:23 +0000)]
MIR Parser: Reuse the function 'lexName' when lexing global value tokens. NFC.

This commit refactors the function 'maybeLexGlobalValue' so that now it reuses
the function 'lexName' when lexing a named global value token.

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

8 years ago[SCEV][NFC] Fix a typo in a comment.
Sanjoy Das [Tue, 21 Jul 2015 20:59:22 +0000 (20:59 +0000)]
[SCEV][NFC] Fix a typo in a comment.

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

8 years agoDon't iterate over the program headers in the constructor of ELFFile.
Rafael Espindola [Tue, 21 Jul 2015 20:50:53 +0000 (20:50 +0000)]
Don't iterate over the program headers in the constructor of ELFFile.

Not every program needs this information.

In particular, it is necessary and sufficient for a static linker to scan the
section table.

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

8 years agoRemove oversight group. Replace with LLVM Foundation Board of Directors.
Tanya Lattner [Tue, 21 Jul 2015 20:14:20 +0000 (20:14 +0000)]
Remove oversight group. Replace with LLVM Foundation Board of Directors.

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

8 years agoMake printValue a member function.
Rafael Espindola [Tue, 21 Jul 2015 19:57:43 +0000 (19:57 +0000)]
Make printValue a member function.

We were already passing 3 values it can get from ELFDumper.

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

8 years agoRemove always null argument.
Rafael Espindola [Tue, 21 Jul 2015 19:38:32 +0000 (19:38 +0000)]
Remove always null argument.

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

8 years ago[RewriteStatepointsForGC] minor style cleanup
Philip Reames [Tue, 21 Jul 2015 19:04:38 +0000 (19:04 +0000)]
[RewriteStatepointsForGC] minor style cleanup

Use a named lambda for readability, common some code, remove a stale comments, and use llvm style variable names.

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

8 years agoAdd some utilities to iterator_range for trimming a range and constructing one from...
David Blaikie [Tue, 21 Jul 2015 18:37:12 +0000 (18:37 +0000)]
Add some utilities to iterator_range for trimming a range and constructing one from a container.

To be used in clang in a follow-up commit.

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

8 years agoRemove getDynamicSymbolName.
Rafael Espindola [Tue, 21 Jul 2015 18:20:17 +0000 (18:20 +0000)]
Remove getDynamicSymbolName.

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

8 years agoRemove getStaticSymbolName.
Rafael Espindola [Tue, 21 Jul 2015 18:04:29 +0000 (18:04 +0000)]
Remove getStaticSymbolName.

Every user now keeps track of the correct string table to use.

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

8 years agoFollow up to r242810. NFC.
Chad Rosier [Tue, 21 Jul 2015 17:47:56 +0000 (17:47 +0000)]
Follow up to r242810. NFC.

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

8 years ago[AArch64] Simplify the passing of arguments. NFC.
Chad Rosier [Tue, 21 Jul 2015 17:42:04 +0000 (17:42 +0000)]
[AArch64] Simplify the passing of arguments. NFC.

This is setup for future work planned for the AArch64 Load/Store Opt pass.

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

8 years agoRe-land 242726 to use RAII to do cleanup
Reid Kleckner [Tue, 21 Jul 2015 17:40:14 +0000 (17:40 +0000)]
Re-land 242726 to use RAII to do cleanup

The LooksLikeCodeInBug11395() codepath was returning without clearing
the ProcessedAllocas cache.

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

8 years ago[RewriteStatepointsForGC] Hoist some code out of a loop
Philip Reames [Tue, 21 Jul 2015 17:18:03 +0000 (17:18 +0000)]
[RewriteStatepointsForGC] Hoist some code out of a loop

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

8 years agoMergeFunc: Transfer the callee's attributes when replacing a direct caller
Arnold Schwaighofer [Tue, 21 Jul 2015 17:07:07 +0000 (17:07 +0000)]
MergeFunc: Transfer the callee's attributes when replacing a direct caller

We insert a bitcast which obfuscates the getCalledFunction for the utility
function which looks up attributes from the called function. Loosing ABI
changing parameter attributes is a bad thing.

rdar://21516488

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

8 years agoMIR Serialization: Serialize the external symbol machine operands.
Alex Lorenz [Tue, 21 Jul 2015 16:59:53 +0000 (16:59 +0000)]
MIR Serialization: Serialize the external symbol machine operands.

Reviewers: Duncan P. N. Exon Smith

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

8 years ago[RewriteStatepointsForGC] Delete trivial code
Philip Reames [Tue, 21 Jul 2015 16:51:17 +0000 (16:51 +0000)]
[RewriteStatepointsForGC] Delete trivial code

A bit more code cleanup: delete some a trivial true assertion and supporting code, remove a redundant cast, and use count in assertions where feasible.

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

8 years agoRemove dead code.
Rafael Espindola [Tue, 21 Jul 2015 16:50:57 +0000 (16:50 +0000)]
Remove dead code.

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

8 years agoIR: Extract a function 'printLLVMNameWithoutPrefix' from 'PrintLLVMName'. NFC.
Alex Lorenz [Tue, 21 Jul 2015 16:50:35 +0000 (16:50 +0000)]
IR: Extract a function 'printLLVMNameWithoutPrefix' from 'PrintLLVMName'. NFC.

This commit extracts the code that prints out a name of an LLVM value without a
prefix from a function 'PrintLLVMName' into a publicly accessible function named
'printLLVMNameWithoutPrefix'.

This change would be useful for MIR serialization, as it would allow the MIR
printer to reuse this function to print out the names of the external symbol
machine operands.

Reviewers: Duncan P. N. Exon Smith

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

8 years agoRemove always false parameter.
Rafael Espindola [Tue, 21 Jul 2015 16:42:01 +0000 (16:42 +0000)]
Remove always false parameter.

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

8 years agoUse range loop. NFC.
Rafael Espindola [Tue, 21 Jul 2015 16:40:14 +0000 (16:40 +0000)]
Use range loop. NFC.

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

8 years agoReplace the last uses of ELF::getSymbolName in llvm-readobj.
Rafael Espindola [Tue, 21 Jul 2015 16:26:21 +0000 (16:26 +0000)]
Replace the last uses of ELF::getSymbolName in llvm-readobj.

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

8 years agofix formatting; NFC
Sanjay Patel [Tue, 21 Jul 2015 16:09:58 +0000 (16:09 +0000)]
fix formatting; NFC

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

8 years agoUse helper function. NFC.
Rafael Espindola [Tue, 21 Jul 2015 16:05:53 +0000 (16:05 +0000)]
Use helper function. NFC.

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

8 years agollvm-readobj: use the associated string table to print symbols. NFI.
Rafael Espindola [Tue, 21 Jul 2015 16:02:10 +0000 (16:02 +0000)]
llvm-readobj: use the associated string table to print symbols. NFI.

This just removes some cases that require ELFFile to eagerly parse the ELF
file.

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

8 years ago[CMake] Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be explicitly speci...
Chris Bieneman [Tue, 21 Jul 2015 15:53:09 +0000 (15:53 +0000)]
[CMake] Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be explicitly specified.

One part of my refactoring from r242705 is untenable due to how CMake caches variables. There is no way other than caching to allow variables to be set in one directory and globally readable, but we really don't want to cache the temporary value marking that a directory has already been included.

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

8 years agoRevert 242726, it broke ASan on OS X.
Nico Weber [Tue, 21 Jul 2015 15:48:53 +0000 (15:48 +0000)]
Revert 242726, it broke ASan on OS X.

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

8 years agoRemove unused variable.
Rafael Espindola [Tue, 21 Jul 2015 14:45:56 +0000 (14:45 +0000)]
Remove unused variable.

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

8 years agoSimplify printing the soname. NFC.
Rafael Espindola [Tue, 21 Jul 2015 13:48:41 +0000 (13:48 +0000)]
Simplify printing the soname. NFC.

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

8 years agoAdd missing c++ marker to .h file.
Rafael Espindola [Tue, 21 Jul 2015 13:42:38 +0000 (13:42 +0000)]
Add missing c++ marker to .h file.

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

8 years agoConstfold trunc,rint,nearbyint,ceil and floor using APFloat
Karthik Bhat [Tue, 21 Jul 2015 08:52:23 +0000 (08:52 +0000)]
Constfold trunc,rint,nearbyint,ceil and floor using APFloat
A patch by Chakshu Grover!
This patch allows constfolding of trunc,rint,nearbyint,ceil and floor intrinsics using APFloat class.
Differential Revision: http://reviews.llvm.org/D11144

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

8 years agoAVX512 : Implemented VPMADDUBSW and VPMADDWD instruction ,
Igor Breger [Tue, 21 Jul 2015 07:11:28 +0000 (07:11 +0000)]
AVX512 : Implemented VPMADDUBSW and VPMADDWD instruction ,
Added tests for intrinsics and encoding.

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

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

8 years ago[LIT] Fix discovery.py test once again
Eric Fiselier [Tue, 21 Jul 2015 04:25:13 +0000 (04:25 +0000)]
[LIT] Fix discovery.py test once again

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

8 years ago[ARM] Define subtarget feature "reserve-r9", which is used to decide
Akira Hatanaka [Tue, 21 Jul 2015 01:42:02 +0000 (01:42 +0000)]
[ARM] Define subtarget feature "reserve-r9", which is used to decide
whether register r9 should be reserved.

This recommits r242737, which broke bots because the number of subtarget
features went over the limit of 64.

This change is needed because we cannot use a backend option to set
cl::opt "arm-reserve-r9" when doing LTO.

Out-of-tree projects currently using cl::opt option "-arm-reserve-r9" to
reserve r9 should make changes to add subtarget feature "reserve-r9" to
the IR.

rdar://problem/21529937

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

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

8 years agoBump the size of FeatureBitset up to 96-bits.
Akira Hatanaka [Tue, 21 Jul 2015 01:39:22 +0000 (01:39 +0000)]
Bump the size of FeatureBitset up to 96-bits.

This should avoid exceeding the maximum size when I add another subtarget
feature to ARM's subtarget.

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

8 years agoDon't do a walk over the dynamic table just to find DT_SONAME.
Rafael Espindola [Tue, 21 Jul 2015 01:01:29 +0000 (01:01 +0000)]
Don't do a walk over the dynamic table just to find DT_SONAME.

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

8 years ago[RewriteStatepointsForGC] Minor code cleanup [NFC]
Philip Reames [Tue, 21 Jul 2015 00:49:55 +0000 (00:49 +0000)]
[RewriteStatepointsForGC] Minor code cleanup [NFC]

We can use builders to simplify part of the code and we only check for the existance of the metadata value; this enables us to delete some redundant code.

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

8 years ago[cmake] pass GO_EXECUTABLE to llgo-go
Andrew Wilkins [Tue, 21 Jul 2015 00:46:23 +0000 (00:46 +0000)]
[cmake] pass GO_EXECUTABLE to llgo-go

Summary:
When calling llgo-go from the llvm_add_go_executable
cmake function, specify $GO_EXECUTABLE as the go
command to call. Without this, llgo-go searches $PATH
which may be inconsistent with $GO_EXECUTABLE.

Reviewers: pcc

Subscribers: llvm-commits

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

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

8 years ago[CMake] Fixing inconsistency caused by copy-pasta.
Chris Bieneman [Tue, 21 Jul 2015 00:44:47 +0000 (00:44 +0000)]
[CMake] Fixing inconsistency caused by copy-pasta.

This will actually fix the PR 24194.

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

8 years agoAMDGPU: Set isMoveImm on s_movk_i32
Matt Arsenault [Tue, 21 Jul 2015 00:40:08 +0000 (00:40 +0000)]
AMDGPU: Set isMoveImm on s_movk_i32

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

8 years ago[CMake] Fixing a problem with external projects that aren't getting enabled properly.
Chris Bieneman [Tue, 21 Jul 2015 00:39:53 +0000 (00:39 +0000)]
[CMake] Fixing a problem with external projects that aren't getting enabled properly.

This should address PR 24194, and some builedbot failures.

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

8 years agoARMLoadStoreOpt: Merge subs/adds into LDRD/STRD; Factor out common code
Matthias Braun [Tue, 21 Jul 2015 00:19:01 +0000 (00:19 +0000)]
ARMLoadStoreOpt: Merge subs/adds into LDRD/STRD; Factor out common code

Re-apply of r241928 which had to be reverted because of the r241926
revert.

This commit factors out common code from MergeBaseUpdateLoadStore() and
MergeBaseUpdateLSMultiple() and introduces a new function
MergeBaseUpdateLSDouble() which merges adds/subs preceding/following a
strd/ldrd instruction into an strd/ldrd instruction with writeback where
possible.

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

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

8 years agoARMLoadStoreOptimizer: Create LDRD/STRD on thumb2
Matthias Braun [Tue, 21 Jul 2015 00:18:59 +0000 (00:18 +0000)]
ARMLoadStoreOptimizer: Create LDRD/STRD on thumb2

Re-apply r241926 with an additional check that r13 and r15 are not used
for LDRD/STRD. See http://llvm.org/PR24190. This also already includes
the fix from r241951.

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

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

8 years agoRevert r242737.
Akira Hatanaka [Mon, 20 Jul 2015 23:51:12 +0000 (23:51 +0000)]
Revert r242737.

This caused builds to fail with the following error message:

error:Too many subtarget features! Bump MAX_SUBTARGET_FEATURES.

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

8 years ago[ARM] Define subtarget feature "reserve-r9", which is used to decide
Akira Hatanaka [Mon, 20 Jul 2015 23:21:30 +0000 (23:21 +0000)]
[ARM] Define subtarget feature "reserve-r9", which is used to decide
whether register r9 should be reserved.

This change is needed because we cannot use a backend option to set
cl::opt "arm-reserve-r9" when doing LTO.

Out-of-tree projects currently using cl::opt option "-arm-reserve-r9" to
reserve r9 should make changes to add subtarget feature "reserve-r9" to
the IR.

rdar://problem/21529937

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

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

8 years agoRevert "ARMLoadStoreOptimizer: Create LDRD/STRD on thumb2"
Matthias Braun [Mon, 20 Jul 2015 23:17:20 +0000 (23:17 +0000)]
Revert "ARMLoadStoreOptimizer: Create LDRD/STRD on thumb2"

This reverts commit r241926. This caused http://llvm.org/PR24190

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

8 years agoRevert "ARMLoadStoreOpt: Merge subs/adds into LDRD/STRD; Factor out common code"
Matthias Braun [Mon, 20 Jul 2015 23:17:16 +0000 (23:17 +0000)]
Revert "ARMLoadStoreOpt: Merge subs/adds into LDRD/STRD; Factor out common code"

This reverts commit r241928. This caused http://llvm.org/PR24190

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

8 years agoRevert "ARM: Use SpecificBumpPtrAllocator to fix leak introduced in r241920"
Matthias Braun [Mon, 20 Jul 2015 23:17:14 +0000 (23:17 +0000)]
Revert "ARM: Use SpecificBumpPtrAllocator to fix leak introduced in r241920"

This reverts commit r241951. It caused http://llvm.org/PR24190

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

8 years agoAArch64: Restrict macroop fusion heuristics to cyclone.
Matthias Braun [Mon, 20 Jul 2015 23:11:42 +0000 (23:11 +0000)]
AArch64: Restrict macroop fusion heuristics to cyclone.

Even though this is just some hinting for the scheduler it doesn't make
sense to do that unless you know the target can perform the fusion.

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

8 years agoTargets: commonize some stack realignment code
JF Bastien [Mon, 20 Jul 2015 22:51:32 +0000 (22:51 +0000)]
Targets: commonize some stack realignment code

This patch does the following:
* Fix FIXME on `needsStackRealignment`: it is now shared between multiple targets, implemented in `TargetRegisterInfo`, and isn't `virtual` anymore. This will break out-of-tree targets, silently if they used `virtual` and with a build error if they used `override`.
* Factor out `canRealignStack` as a `virtual` function on `TargetRegisterInfo`, by default only looks for the `no-realign-stack` function attribute.

Multiple targets duplicated the same `needsStackRealignment` code:
 - Aarch64.
 - ARM.
 - Mips almost: had extra `DEBUG` diagnostic, which the default implementation now has.
 - PowerPC.
 - WebAssembly.
 - x86 almost: has an extra `-force-align-stack` option, which the default implementation now has.

The default implementation of `needsStackRealignment` used to just return `false`. My current patch changes the behavior by simply using the above shared behavior. This affects:
 - AMDGPU
 - BPF
 - CppBackend
 - MSP430
 - NVPTX
 - Sparc
 - SystemZ
 - XCore
 - Out-of-tree targets
This is a breaking change! `make check` passes.

The only implementation of the `virtual` function (besides the slight different in x86) was Hexagon (which did `MF.getFrameInfo()->getMaxAlignment() > 8`), and potentially some out-of-tree targets. Hexagon now uses the default implementation.

`needsStackRealignment` was being overwritten in `<Target>GenRegisterInfo.inc`, to return `false` as the default also did. That was odd and is now gone.

Reviewers: sunfish

Subscribers: aemerson, llvm-commits, jfb

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

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

8 years agoDon't try to instrument allocas used by outlined SEH funclets
Reid Kleckner [Mon, 20 Jul 2015 22:49:44 +0000 (22:49 +0000)]
Don't try to instrument allocas used by outlined SEH funclets

Summary:
Arguments to llvm.localescape must be static allocas. They must be at
some statically known offset from the frame or stack pointer so that
other functions can access them with localrecover.

If we ever want to instrument these, we can use more indirection to
recover the addresses of these local variables. We can do it during
clang irgen or with the asan module pass.

Reviewers: eugenis

Subscribers: llvm-commits

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

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

8 years agoRemove duplicated code.
Rafael Espindola [Mon, 20 Jul 2015 22:41:44 +0000 (22:41 +0000)]
Remove duplicated code.

Both ELFObjectFile and ELFFile had an implementation of getLoadName.

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

8 years agoAArch64: Add aditional Cyclone macroop fusion opportunities
Matthias Braun [Mon, 20 Jul 2015 22:34:47 +0000 (22:34 +0000)]
AArch64: Add aditional Cyclone macroop fusion opportunities

Related to rdar://19205407

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

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

8 years agoMachineScheduler: Restrict macroop fusion to data-dependent instructions.
Matthias Braun [Mon, 20 Jul 2015 22:34:44 +0000 (22:34 +0000)]
MachineScheduler: Restrict macroop fusion to data-dependent instructions.

Before creating a schedule edge to encourage MacroOpFusion check that:
- The predecessor actually writes a register that the branch reads.
- The predecessor has no successors in the ScheduleDAG so we can
  schedule it in front of the branch.

This avoids skewing the scheduling heuristic in cases where macroop
fusion cannot happen.

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

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

8 years agoAvoid early pipefail exits due to grep failures in stage comparisons.
Dimitry Andric [Mon, 20 Jul 2015 22:24:40 +0000 (22:24 +0000)]
Avoid early pipefail exits due to grep failures in stage comparisons.

If objects or executables did not contain any RPATH, grep would return
nonzero, and the whole stage comparison loop would unexpectedly exit.
Fix this by checking the grep result explicitly.

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

8 years agoSince BSD cmp(1) does not support the --ignore-initial option, use the
Dimitry Andric [Mon, 20 Jul 2015 22:07:27 +0000 (22:07 +0000)]
Since BSD cmp(1) does not support the --ignore-initial option, use the
more portable 3rd and 4th arguments to skip the first 16 bytes during
the comparison of Phase2 and Phase3 objects.

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

8 years agoAdd 'const' to a few more functions in MachineFrameInfo
Krzysztof Parzyszek [Mon, 20 Jul 2015 22:05:38 +0000 (22:05 +0000)]
Add 'const' to a few more functions in MachineFrameInfo

Reviewer: Eric Christopher
http://reviews.llvm.org/D11372

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

8 years agoFix comment typo (test commit). NFC
Geoff Berry [Mon, 20 Jul 2015 22:03:52 +0000 (22:03 +0000)]
Fix comment typo (test commit). NFC

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

8 years agoSimplify now that we can iterate backwards. NFC.
Rafael Espindola [Mon, 20 Jul 2015 21:45:56 +0000 (21:45 +0000)]
Simplify now that we can iterate backwards. NFC.

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

8 years ago[ARM] Refactor the prologue/epilogue emission to be more robust.
Quentin Colombet [Mon, 20 Jul 2015 21:42:14 +0000 (21:42 +0000)]
[ARM] Refactor the prologue/epilogue emission to be more robust.

This is the first step toward supporting shrink-wrapping for this target.

The changes could be summarized by these items:
- Expand the tail-call return as part of the expand pseudo pass.
- Get rid of the assumptions that the epilogue is the exit block:
  * Do not assume which registers are free in the epilogue. (This indirectly
    improve the lowering of the code for the segmented stacks, see the test
    cases.)
  * Take into account that the basic block can be empty.

Related to <rdar://problem/20821730>

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

8 years ago[NVPTX] make load on global readonly memory to use ldg
Jingyue Wu [Mon, 20 Jul 2015 21:28:54 +0000 (21:28 +0000)]
[NVPTX] make load on global readonly memory to use ldg

Summary:
[NVPTX] make load on global readonly memory to use ldg

Summary:
As describe in [1], ld.global.nc may be used to load memory by nvcc when
__restrict__ is used and compiler can detect whether read-only data cache
is safe to use.

This patch will try to check whether ldg is safe to use and use them to
replace ld.global when possible. This change can improve the performance
by 18~29% on affected kernels (ratt*_kernel and rwdot*_kernel) in
S3D benchmark of shoc [2].

Patched by Xuetian Weng.

[1] http://docs.nvidia.com/cuda/kepler-tuning-guide/#read-only-data-cache
[2] https://github.com/vetter/shoc

Test Plan: test/CodeGen/NVPTX/load-with-non-coherent-cache.ll

Reviewers: jholewinski, jingyue

Subscribers: jholewinski, llvm-commits

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

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

8 years agoSimplify iterating over the dynamic section and report broken ones.
Rafael Espindola [Mon, 20 Jul 2015 21:23:29 +0000 (21:23 +0000)]
Simplify iterating over the dynamic section and report broken ones.

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

8 years ago[Hexagon] Generate MUX from conditional transfers when dot-new not possible
Krzysztof Parzyszek [Mon, 20 Jul 2015 21:23:25 +0000 (21:23 +0000)]
[Hexagon] Generate MUX from conditional transfers when dot-new not possible

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

8 years agoSuppress two warnings from MSVC 2015 that are triggered under /W4. Since we turn...
Aaron Ballman [Mon, 20 Jul 2015 21:14:14 +0000 (21:14 +0000)]
Suppress two warnings from MSVC 2015 that are triggered under /W4. Since we turn off exceptions in the code base, C4577 is moot. C4091 triggers on system headers and is a benign construct.

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

8 years agoMIR Serialization: Initial serialization of machine constant pools.
Alex Lorenz [Mon, 20 Jul 2015 20:51:18 +0000 (20:51 +0000)]
MIR Serialization: Initial serialization of machine constant pools.

This commit implements the initial serialization of machine constant pools and
the constant pool index machine operands. The constant pool is serialized using
a YAML sequence of YAML mappings that represent the constant values.
The target-specific constant pool items aren't serialized by this commit.

Reviewers: Duncan P. N. Exon Smith

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

8 years agotest-release.sh: don't include /usr/local prefix in the tarball
Hans Wennborg [Mon, 20 Jul 2015 20:36:21 +0000 (20:36 +0000)]
test-release.sh: don't include /usr/local prefix in the tarball

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

8 years ago[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that...
Chris Bieneman [Mon, 20 Jul 2015 20:36:06 +0000 (20:36 +0000)]
[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working.

Re-landing r242059 which re-landed r241621... I'm really bad at this.

Summary (r242059):
This change re-lands r241621, with an additional fix that was required to allow tool sources to live outside the llvm checkout. It also no longer renames LLVM_EXTERNAL_*_SOURCE_DIR. This change was reverted in r241663, because it renamed several variables of the format LLVM_EXTERNAL_*_* to LLVM_TOOL_*_*.

Summary (r241621):
The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are:

* factored out canonicalizing tool names from paths to CMake variables * removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools
* removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off
* Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code.
* Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt

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

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

8 years ago[ImplicitNullChecks] Work with implicit defs.
Sanjoy Das [Mon, 20 Jul 2015 20:31:39 +0000 (20:31 +0000)]
[ImplicitNullChecks] Work with implicit defs.

Summary:
This change generalizes the implicit null checks pass to work with
instructions that don't have any explicit register defs.  This lets us
use X86's `cmp` against memory as faulting load instructions.

Reviewers: reames, JosephTremoulet

Subscribers: llvm-commits

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

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

8 years agoMIR Parser: Add support for quoted named global value operands.
Alex Lorenz [Mon, 20 Jul 2015 20:31:01 +0000 (20:31 +0000)]
MIR Parser: Add support for quoted named global value operands.

This commit extends the machine instruction lexer and implements support for
the quoted global value tokens. With this change the syntax for the global value
identifier tokens becomes identical to the syntax for the global identifier
tokens from the LLVM's assembly language.

Reviewers: Duncan P. N. Exon Smith

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

8 years agoRemove Elf_Rela_Iter and Elf_Rel_Iter.
Rafael Espindola [Mon, 20 Jul 2015 20:07:50 +0000 (20:07 +0000)]
Remove Elf_Rela_Iter and Elf_Rel_Iter.

Use just the pointers and check for invalid relocation sections.

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

8 years ago[lit] Implement 'env' in the internal shell
Reid Kleckner [Mon, 20 Jul 2015 19:42:08 +0000 (19:42 +0000)]
[lit] Implement 'env' in the internal shell

The MSys 2 version of 'env' cannot be used to set 'TZ' in the
environment due to some portability hacks in the process spawning
compatibility layer[1]. This affects test/Object/archive-toc.test, which
tries to set TZ in the environment.

Other than that, this saves a subprocess invocation of a small unix
utility, which is makes the tests faster.

The internal shell does not support shell variable expansion, so this
idiom in the ASan tests isn't supported yet:
  RUN: env ASAN_OPTIONS=$ASAN_OPTIONS:opt=1 ...

[1] https://github.com/Alexpux/MSYS2-packages/issues/294

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

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

8 years ago[AArch64] Change EON pattern to match more often.
Chad Rosier [Mon, 20 Jul 2015 18:42:27 +0000 (18:42 +0000)]
[AArch64] Change EON pattern to match more often.

Phabricator: http://reviews.llvm.org/D11359
Patch by Geoff Berry <gberry@codeaurora.org>

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

8 years agoMiscellaneous Fixes for SparseBitVector
Daniel Berlin [Mon, 20 Jul 2015 18:26:23 +0000 (18:26 +0000)]
Miscellaneous Fixes for SparseBitVector

Summary:

1. Fix return value in `SparseBitVector::operator&=`.
2. Add checks if SBV is being assigned is invoking SBV.

Reviewers: dberlin

Subscribers: llvm-commits

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

Committed on behalf of sl@

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

8 years agoAdd missing test for r242296 (vec_sld)
Bill Schmidt [Mon, 20 Jul 2015 15:43:21 +0000 (15:43 +0000)]
Add missing test for r242296 (vec_sld)

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

8 years agoReport errors an invalid virtual addresses.
Rafael Espindola [Mon, 20 Jul 2015 14:45:03 +0000 (14:45 +0000)]
Report errors an invalid virtual addresses.

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

8 years agoRemove unnecessary code.
Rafael Espindola [Mon, 20 Jul 2015 14:29:00 +0000 (14:29 +0000)]
Remove unnecessary code.

We were locating the dynamic string table via both the section and segment
headers.

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

8 years agoAMDGPU/SI: Add VI patterns to select FLAT instructions for global memory ops
Tom Stellard [Mon, 20 Jul 2015 14:28:41 +0000 (14:28 +0000)]
AMDGPU/SI: Add VI patterns to select FLAT instructions for global memory ops

Summary:
The MUBUF addr64 bit has been removed on VI, so we must use FLAT
instructions when the pointer is stored in VGPRs.

Reviewers: arsenm

Subscribers: llvm-commits

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

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