140030 Commits

Author SHA1 Message Date
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
Sanjay Patel
614c32bf11 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285078 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 16:12:31 +00:00
Ulrich Weigand
2677f9fdf7 [SystemZ] Do not use LOC(G) for volatile loads
It is not safe to use LOAD ON CONDITION to implement access to a memory
location marked "volatile", since the architecture leaves it unspecified
whether or not an access happens if the condition is false.

The current code already appears to care about that:
  def LOC  : CondUnaryRSY<"loc",  0xEBF2, nonvolatile_load, GR32, 4>;

Unfortunately, that "nonvolatile_load" operator is simply ignored
by the CondUnaryRSY class, and there was no test to catch it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285077 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 15:39:15 +00:00
Sanjay Patel
ce0f082662 [InstCombine] add test and code comment to show potentially misguided icmp trunc transform
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285075 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 15:16:39 +00:00
Simon Pilgrim
16ce778275 [X86][SSE] Add support for (V)PMOVSX* constant folding
We already have (V)PMOVZX* combining support, this is the beginning of handling (V)PMOVSX* similarly - other combines in combineVSZext can be generalized in future patches.

This unearthed an interesting bug in that we were generating illegal build vectors on 32-bit targets - it was proving difficult to create a test for it from PMOVZX, but it fired immediately with PMOVSX. I've created a more general form of the existing getConstVector to handle these cases - ideally this should be handled in non-target-specific code but I couldn't find an equivalent.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285072 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 14:29:25 +00:00
Sanjay Patel
618621d3d0 [InstCombine] fix checks for previous commit (r285069)
Accidentally put in the hoped-for checks ahead of the transform!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285070 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 13:30:19 +00:00
Sanjay Patel
d50540f8ea [InstCombine] add tests for bitcast interference with min/max (PR28001)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285069 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 13:27:56 +00:00
Rafael Espindola
4fd12996bc fix warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285064 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 12:28:26 +00:00
Zvi Rackover
3ed32c90ce [DAGCombine] Preserve shuffles when one of the vector operands is constant
Summary:
Do *not* perform combines such as:

    vector_shuffle<4,1,2,3>(build_vector(Ud, C0, C1 C2), scalar_to_vector(X))
    ->
    build_vector(X, C0, C1, C2)

Keeping the shuffle allows lowering the constant build_vector to a materialized
constant vector (such as a vector-load from the constant-pool or some other idiom).

Reviewers: delena, igorb, spatel, mkuper, andreadb, RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285063 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 12:14:19 +00:00
Rafael Espindola
050bf6c22b Make the LTO comdat api more symbol table friendly.
In an IR symbol table I would expect the comdats to be represented as:

- A table of strings, one for each comdat name.
- Each symbol has an optional index into that table.

The natural api for accessing that would be

InputFile:
ArrayRef<StringRef> getComdatTable() const;

Symbol:
int getComdatIndex() const;

This patch implements an API as close to that as possible.  The
implementation on top of the current IRObjectFile is a bit hackish,
but should map just fine over a symbol table and is very convenient to
use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285061 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 12:02:03 +00:00
Benjamin Kramer
797783eda8 Fix an unused warning in WebAssemblyInstPrinter with NDEBUG.
Patch by Sam McCall!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285055 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 09:08:50 +00:00
Craig Topper
53bf46f680 [AVX-512] Add support for creating SIGN_EXTEND_VECTOR_INREG and ZERO_EXTEND_VECTOR_INREG for 512-bit vectors to support vpmovzxbq and vpmovsxbq.
Summary: The one tricky thing about this is that the sign/zero_extend_inreg uses v64i8 as an input type which isn't legal without BWI support. Though the vpmovsxbq and vpmovzxbq instructions themselves don't require BWI. To support this we need to add custom lowering for ZERO_EXTEND_VECTOR_INREG with v64i8 input. This can mostly reuse the existing sign extend code with a couple checks for sign extend vs zero extend added.

Reviewers: delena, RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285053 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 04:00:29 +00:00
Peter Collingbourne
2c3f1a7cd5 GlobalDCE: Restore a statement accidentally removed in r285048.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285052 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 02:57:27 +00:00
Matthias Braun
4e3c65d0e2 MachineInstrBundle: Pass iterators to getBundle(Start|End); NFC
This is a function to go backwards in a block to find the first
instruction in a bundle, so iterator is a more natural choice for
parameter/return rather than a reference to a MachineInstruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285051 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 02:55:17 +00:00
Peter Collingbourne
6ff6048618 IR: Deduplicate getParent() functions on derived classes of GlobalValue into the base class. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285050 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 02:54:08 +00:00
Kostya Serebryany
d2c91bff2f [libFuzzer] simplify the code for use_cmp, also use the position hint when available, add a test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285049 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 02:04:43 +00:00
Peter Collingbourne
598979983f GlobalDCE: Deduplicate code. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 01:58:26 +00:00
Sanjay Patel
8f808de831 [InstCombine] auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285046 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 00:44:02 +00:00
Sanjay Patel
5aa57a1a64 [InstCombine] auto-generate checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285045 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 00:41:00 +00:00
Dan Gohman
12e2f72b91 [WebAssembly] Reorder load/store operands to match binary encoding.
The p2align operand of a load/store is encoded before the offset
operand; reorder the MachineInstr operands accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285044 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 00:17:11 +00:00
Vedant Kumar
5b5c5e7555 [llvm-cov] Do not print out the filename of the object file
When we load coverage data from multiple objects, we don't have a way to
attribute a source object to a function record. Printing out the object
filename next to the source filename is already not very useful: soon,
it'll actually become misleading. Stop printing out the filename now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285043 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 00:08:33 +00:00
Dan Gohman
01b89435ec [WebAssembly] Implement more WebAssembly binary encoding.
This changes locals from being declared by the emitLocal hook in
WebAssemblyTargetStreamer, rather than with an instruction. After exploring
the infastructure in LLVM more, this seems to make more sense since
declaring locals doesn't use an encoded opcode.

This also adds more 0xd opcodes, type encodings, and miscellaneous
binary encoding bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285040 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 23:27:49 +00:00
Matthias Braun
cc928287e4 CodeGen/Passes: Pass MachineFunction as functor arg; NFC
Passing a MachineFunction as argument is more natural and avoids an
unnecessary round-trip through the logic determining the correct
Subtarget because MachineFunction already has a reference anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285039 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 23:23:02 +00:00
Sanjay Patel
eef5da2dee [InstCombine] regenerate some checks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285036 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 22:50:26 +00:00
Justin Bogner
31637d91c9 cmake: Rename installhdrs to install-llvm-headers and fix the dependencies
The installhdrs target was inconsistently named and would behave
differently depending on whether or not you ran a build first. This
renames it to install-llvm-headers to match other target names and
adds a dependency on intrinsics_gen so that it will always install the
same set of things.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285035 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 21:58:58 +00:00
Eli Friedman
10310d2d11 Fix regression from my recent GlobalsAA fix.
There are two fixes here: one, AnalyzeUsesOfPointer can't return
false until it has checked all the uses of the pointer. Two, if a
global uses another global, we have to assume the address of the
first global escapes.

Fixes https://llvm.org/bugs/show_bug.cgi?id=30707 .

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285034 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 21:47:44 +00:00
Simon Pilgrim
8d980444a4 [SelectionDAG] Update ComputeNumSignBits SRA/SHL handlers to accept scalar or vector splats
Use isConstOrConstSplat helper.

Also use APInt instead of getZExtValue directly to avoid out of range issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285033 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 21:47:19 +00:00
Justin Bogner
5e86c2aba6 cmake: Make /usr/share/cmake installable with LLVM_DISTRIBUTION_COMPONENTS
Add a cmake-exports install component and appropriate targets for
LLVM_DISTRIBUTION_COMPONENTS to work with.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285030 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 21:40:15 +00:00
Matthias Braun
39e13bbb92 Use MachineInstr::mop_iterator instead of MIOperands; NFC
(Const)?MIOperands is equivalent to the C++ style
MachineInstr::mop_iterator. Use the latter for consistency except for a
few callers of MIOperands::analyzePhysReg().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285029 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 21:36:43 +00:00
Kevin Enderby
aa45092c24 nother additional error check for an invalid Mach-O file
when contained in a Mach-O universal file and the
cputypes in both headers don’t match.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285026 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 21:15:11 +00:00
Simon Pilgrim
e83b8beed2 Use SDValue::getConstantOperandVal() helper. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285025 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 20:56:52 +00:00
Vedant Kumar
ea1ab92227 [pbqp] unique_ptr-ify (Vector|Matrix)::Data, NFC.
Suggested by David Blaikie.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285024 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 20:51:46 +00:00
Vedant Kumar
0ca81d1cb2 [pbqp] Delete some dead code, NFC.
I took the opportunity to replace some copy|move constructors|assignment
operators with default implementations.

As a follow-up, I plan on threading unique_ptr<T []> through a few areas
per David Blaikie's advice.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 20:35:35 +00:00
Dan Gohman
459c4c4cbe [WebAssembly] Fix a broken URL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 20:35:17 +00:00