140113 Commits

Author SHA1 Message Date
Kostya Serebryany
95134530d1 [libFuzzer] refresh docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285157 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 01:55:17 +00:00
Dean Michael Berris
e9512859ea Revert "[XRay] Implement llvm-xray extract, start of the llvm-xray tool"
Reverts r285155 -- misconfigured tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 01:50:59 +00:00
Dean Michael Berris
433938ad4c [XRay] Implement llvm-xray extract, start of the llvm-xray tool
Usage:

  llvm-xray extract <object file> [-o <filename or '-'>]

The tool gets the XRay instrumentation map from an object file and turns
it into YAML.  We first support ELF64 sleds on x86_64 binaries, with
provision for supporting other supported platforms and formats later.

This is the first of a many-part change to fully implement the
`llvm-xray` tool.

We also define a subcommand registration and dispatch mechanism to be
used by other further subcommand implementations for llvm-xray.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285155 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 01:42:59 +00:00
Rui Ueyama
7d084db836 Use printf instead of "echo -e" or "echo -n".
Not all echo commands support "-e". On the other hand, printf
command is in POSIX, so it's more portable than "echo -e".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285151 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 01:07:26 +00:00
Kostya Serebryany
7f59a4b62d [libFuzzer] simplify the code in TracePC::HandleTrace a bit more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 00:42:52 +00:00
Kostya Serebryany
9c904557f1 [libFuzzer] simplify the code to print new PCs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 00:20:51 +00:00
Evgeniy Stepanov
43122e284f Utility functions for appending to llvm.used/llvm.compiler.used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 23:53:31 +00:00
Kostya Serebryany
cbe5db8703 [libFuzzer] simplify the code in TracePC::HandleTrace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285142 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 23:52:25 +00:00
Lang Hames
f8406aa6a6 [docs] Avoid repetition of 'considerable' in Error docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285141 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 23:08:32 +00:00
Lang Hames
781a2b464b [docs] Use consistent style for "do more stuff" in Error docs examples.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285138 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 22:41:54 +00:00
Lang Hames
41965a8963 [docs] Fix yet another Error docs formatting issue...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285137 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 22:38:50 +00:00
Lang Hames
94e5282d34 [docs] Fix a few more Error docs formatting issues.
Thanks to Pete Cooper for the review.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285136 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 22:35:55 +00:00
Kostya Serebryany
98711e2ac8 [libFuzzer] add StandaloneFuzzTargetMain.c and a test for it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 22:30:34 +00:00
Lang Hames
582aee6895 [docs] Fix a missing code-block in the new Error docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285134 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 22:25:07 +00:00
Lang Hames
c468b9c369 [docs] Fix a couple of typos in the new Error docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285133 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 22:22:48 +00:00
James Y Knight
ed5107d663 [Sparc] Don't overlap variable-sized allocas with other stack variables.
On SparcV8, it was previously the case that a variable-sized alloca
might overlap by 4-bytes the last fixed stack variable, effectively
because 92 (the number of bytes reserved for the register spill area) !=
96 (the offset added to SP for where to start a DYNAMIC_STACKALLOC).

It's not as simple as changing 96 to 92, because variables that should
be 8-byte aligned would then be misaligned.

For now, simply increase the allocation size by 8 bytes for each dynamic
allocation -- wastes space, but at least doesn't overlap. As the large
comment says, doing this more efficiently will require larger changes in
llvm.

Also adds some test cases showing that we continue to not support
dynamic stack allocation and over-alignment in the same function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 22:13:28 +00:00
Bob Haarman
157b7f540a [codeview] support emitting indirect virtual base class information
Summary:
Fixes PR28281.

MSVC lists indirect virtual base classes in the field list of a class,
using LF_IVBCLASS records. This change makes LLVM emit such records
when processing DW_TAG_inheritance tags with the DIFlagVirtual and
(newly introduced) DIFlagIndirect tags.

Reviewers: rnk, ruiu, zturner

Differential Revision: https://reviews.llvm.org/D25578


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 22:11:52 +00:00
Simon Pilgrim
d9bc309e9c [DAGCombiner] Enable (urem x, (shl pow2, y)) -> (and x, (add (shl pow2, y), -1)) combine for splatted vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285129 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 22:01:09 +00:00
Rong Xu
0eba98aa7d [PGO] Fix select instruction annotation
Summary:
Select instruction annotation in IR PGO uses the edge count to infer the
branch count. It's currently placed in setInstrumentedCounts() where
no all the BB counts have been computed. This leads to wrong branch weights.
Move the annotation after all BB counts are populated.

Reviewers: davidxl

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D25961

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285128 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 21:47:24 +00:00
Simon Pilgrim
908c768e1c [X86][SSE] Regenerated known-bits test with srem->urem fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285124 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 21:24:33 +00:00
Simon Pilgrim
b03ba30cbf [DAGCombiner] Enable srem(x.y) -> urem(x,y) combine for vectors
SelectionDAG::SignBitIsZero (via SelectionDAG::computeKnownBits) has supported vectors since rL280927

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285123 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 21:20:18 +00:00
Lang Hames
72b26e6630 [docs] Add more Error documentation to the Programmer's Manual.
This patch updates some of the existing Error examples, expands on the
documentation for handleErrors, and includes new sections that cover
a number of helpful utilities and common error usage idioms.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285122 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 21:19:30 +00:00
Simon Pilgrim
4864d89aff [X86][SSE] Added vector srem combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285121 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 21:14:11 +00:00
Simon Pilgrim
b4f0b6e6d3 [X86][SSE] Added vector urem combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285119 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 21:10:12 +00:00
Simon Pilgrim
baad275225 [DAGCombiner] Enable sdiv(x.y) -> udiv(x,y) combine for vectors
SelectionDAG::SignBitIsZero (via SelectionDAG::computeKnownBits) has supported vectors since rL280927

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285118 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 20:56:42 +00:00
Guozhi Wei
413fdf3b7f [InstCombine] Resubmit the combine of A->B->A BitCast and fix for pr27996
The original patch of the A->B->A BitCast optimization was reverted by r274094 because it may cause infinite loop inside compiler https://llvm.org/bugs/show_bug.cgi?id=27996.

The problem is with following code

xB = load (type B); 
xA = load (type A); 
+yA = (A)xB; B -> A
+zAn = PHI[yA, xA]; PHI 
+zBn = (B)zAn; // A -> B
store zAn;
store zBn;

optimizeBitCastFromPhi generates

+zBn = (B)zAn; // A -> B

and expects it will be combined with the following store instruction to another

store zAn 

Unfortunately before combineStoreToValueType is called on the store instruction, optimizeBitCastFromPhi is called on the new BitCast again, and this pattern repeats indefinitely.

optimizeBitCastFromPhi only generates BitCast for load/store instructions, only the BitCast before store can cause the reexecution of optimizeBitCastFromPhi, and BitCast before store can easily be handled by InstCombineLoadStoreAlloca.cpp. So the solution to the problem is if all users of a CI are store instructions, we should not do optimizeBitCastFromPhi on it. Then optimizeBitCastFromPhi will not be called on the new BitCast instructions.

Differential Revision: https://reviews.llvm.org/D23896



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285116 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 20:43:42 +00:00
Simon Pilgrim
09845fdead [X86][SSE] Added vector sdiv combine tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285112 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 20:25:47 +00:00
Robert Lougher
59a91134b9 revert: "Remove debug location from common tail when tail-merging"
This reverts r285093, as it caused unexpected buildbot failures on
clang-ppc64le-linux, clang-ppc64be-linux, clang-ppc64be-linux-multistage
and clang-ppc64be-linux-lnt.  Failing test ubsan/TestCases/TypeCheck/vptr.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285110 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 20:17:58 +00:00
Kostya Serebryany
0895ad474e [libFuzzer] when mutating based on CMP traces also try adding +/- 1 to the desired bytes. Add another test for use_cmp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 20:15:15 +00:00
Sanjay Patel
20cfefb146 [InstCombine] Ensure that truncated int types are legal.
Fixes the FIXMEs in D25952 and rL285075.

Patch by bryant!

Differential Revision: https://reviews.llvm.org/D25955


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 20:11:47 +00:00
Evandro Menezes
41a1a9b457 [AArch64] Adjust the cost model for Exynos M1.
Modify the maximum jump table size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285106 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 20:05:42 +00:00
Tim Shen
6141ab42f4 [APFloat] Make APFloat an interface class to the internal IEEEFloat. NFC.
Summary:
The intention is to make APFloat an interface class, so that later I can add a second implementation class DoubleAPFloat to correctly implement PPCDoubleDouble semantic. The interface of IEEEFloat is not public, and can be simplified (currently it's exactly the same as the old APFloat), but that belongs to a separate patch.

DoubleAPFloat should look like:
class DoubleAPFloat {
  const fltSemantics *Semantics;
  std::unique_ptr<APFloat> APFloats;  // Two heap-allocated APFloats.
};

There is no functional change, nor public interface change.

Reviewers: hfinkel, chandlerc, iteratee, echristo, kbarton

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D25536

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285105 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 19:55:59 +00:00
Evandro Menezes
9d6f1231e9 Add option to specify minimum number of entries for jump tables
Add an option to allow easier experimentation by target maintainers with the
minimum number of entries to create jump tables.  Also clarify the name of
the other existing option governing the creation of jump tables.

Differential revision: https://reviews.llvm.org/D25883

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285104 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 19:53:51 +00:00
Vedant Kumar
1fc13ff445 [llvm-cov] Don't use colored output until we know it's supported
CodeCoverageTool::error() depends on CoverageViewOptions::Colors being
initialized. Should fix:

  http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/56

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285103 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 19:52:57 +00:00
Evandro Menezes
301f71ecd1 Switch lowering: improve partitioning of jump tables
When there's a tie between partitionings of jump tables, consider also cases
that result in no jump tables, but in one or a few cases.  The motivation is
that many contemporary processors typically perform case switches fairly
quickly.

Differential revision: https://reviews.llvm.org/D25212

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285099 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 19:11:43 +00:00
Matthew Simpson
da24afa31c [LV] Sink scalar operands of predicated instructions
When we predicate an instruction (div, rem, store) we place the instruction in
its own basic block within the vectorized loop. If a predicated instruction has
scalar operands, it's possible to recursively sink these scalar expressions
into the predicated block so that they might avoid execution. This patch sinks
as much scalar computation as possible into predicated blocks. We previously
were able to sink such operands only if they were extractelement instructions.

Differential Revision: https://reviews.llvm.org/D25632

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285097 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 18:59:45 +00:00
Sanjay Patel
5a313363f4 [InstCombine] add tests for missing icmp + shl nuw fold
Patch by bryant!

Differential Revision: https://reviews.llvm.org/D25952


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285095 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 18:47:56 +00:00
Michael Ilseman
5bd98bf7d6 Add -strip-nonlinetable-debuginfo capability
This adds a new function to DebugInfo.cpp that takes an llvm::Module
as input and removes all debug info metadata that is not directly
needed for line tables, thus effectively stripping all type and
variable information from the module.

The primary motivation for this feature was the bitcode work flow
(cf. http://lists.llvm.org/pipermail/llvm-dev/2016-June/100643.html
for more background). This is not wired up yet, but will be in
subsequent patches.  For testing, the new functionality is exposed to
opt with a -strip-nonlinetable-debuginfo option.

The secondary use-case (and one that works right now!) is as a
reduction pass in bugpoint. I added two new bugpoint options
(-disable-strip-debuginfo and -disable-strip-debug-types) to control
the new features. By default it will first attempt to remove all debug
information, then only the type info, and then proceed to hack at any
remaining MDNodes.

Thanks to Adrian Prantl for stewarding this patch!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285094 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 18:44:13 +00:00
Robert Lougher
e05a7ffa08 Remove debug location from common tail when tail-merging
The branch folding pass tail merges blocks into a common-tail.  However, the
tail retains the debug information from one of the original inputs to the
merge (chosen randomly).  This is a problem for sampled-based PGO, as hits
on the common-tail will be attributed to whichever block was chosen,
irrespective of which path was actually taken to the common-tail.

This patch fixes the issue by nulling the debug location for the common-tail.

Differential Revision: https://reviews.llvm.org/D25742


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285093 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 18:44:07 +00:00
Michael Kuperstein
0e4bd938f4 Fix 80-char violations. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285092 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 18:31:23 +00:00
Vedant Kumar
59b2213d86 [unittests] STLExtrasTest: Remove an MSVC 2013 workaround, NFCI.
Let's see what the bots have to say about this...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285091 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 18:11:17 +00:00
Vedant Kumar
a69463c75b [unittests] Remove an MSVC 2013 workaround, NFCI.
Let's see what the bots have to say about this...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285090 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 17:58:25 +00:00
Nico Weber
c31e4b540a Revert 285087.
The sanitizer-windows bot turned red with:

FAILED: utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/IntrinsicEmitter.cpp.obj
C:\PROGRA~2\MICROS~1.0\VC\bin\AMD64_~2\cl.exe ... -c
    C:\...\llvm\utils\TableGen\IntrinsicEmitter.cpp
c:\...\llvm\utils\tablegen\intrinsicemitter.cpp(254) :
  fatal error C1001: An internal error has occurred in the compiler.
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/114/steps/build%20clang%20lld/logs/stdio


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285089 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 17:46:29 +00:00
Vedant Kumar
d4998ec16b [llvm-cov] Add support for loading coverage from multiple objects
Differential Revision: https://reviews.llvm.org/D25086

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285088 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 17:40:55 +00:00
Nico Weber
3089ab81dc Try removing an MSVC2010 workaround.
Things seem to build fine locally without this, so let's
see what the bots think.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285087 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 17:35:00 +00:00
Dan Gohman
d29493db4e [WebAssembly] Add immediate fields to call_indirect and memory operators.
call_indirect, grow_memory, and current_memory now have immediate
operands in the 0xd binary encoding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285085 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 16:55:52 +00:00
Dehao Chen
f4b759332e Move discriminator assignment to where it is used. (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285084 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 16:50:27 +00:00
Andrea Di Biagio
da33b856cf [IndVarSimplify][Dwarf] When widening the IV increment, correctly set the debug loc.
When indvars widened an induction variable, the debug location for the loop
increment computation was incorrectly set equal to the debug loc of the loop
latch terminator.

This patch fixes the issue by propagating the correct location from the
original loop increment instruction to the new widened increment.

Differential Revision: https://reviews.llvm.org/D25872


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285083 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 16:45:17 +00:00
Pavel Labath
515a7235ef Replace TimeValue by TimePoint in LegacyPassManager. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285081 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 16:20:07 +00:00
Geoff Berry
9511e49eba [EarlyCSE] Make MemorySSA memory dependency check more aggressive.
Now that MemorySSA keeps track of whether MemoryUses are optimized, use
getClobberingMemoryAccess() to check MemoryUse memory dependencies since
it should no longer be so expensive.

This is a follow-up change to https://reviews.llvm.org/D25881

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285080 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 16:18:47 +00:00