Commit Graph

154541 Commits

Author SHA1 Message Date
David Blaikie
b4ea5a3b36 dwarfdump/symbolizer: Avoid loading unneeded CUs from a DWP
When symbolizing large binaries, parsing every CU in a DWP file is a
significant performance penalty. Instead, use the index to only load the
CUs that are needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313659 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 18:36:11 +00:00
Dehao Chen
a84aa64e93 Handle profile mismatch correctly for SamplePGO.
Summary: Fix the bug when promoted call return type mismatches with the promoted function, we should not try to inline it. Otherwise it may lead to compiler crash.

Reviewers: davidxl, tejohnson, eraman

Reviewed By: tejohnson

Subscribers: llvm-commits, sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313658 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 18:26:54 +00:00
Reid Kleckner
3796a45d29 Re-land "Fix Bug 30978 by emitting cv file checksums."
This reverts r313431 and brings back r313374 with a fix to write
checksums as binary data and not ASCII hex strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313657 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 18:14:45 +00:00
Jake Ehrlich
46f29ab959 [llvm-objcopy] Add support for nested and overlapping segments
This change adds support for nested and even overlapping segments. This means
that PT_PHDR, PT_GNU_RELRO, PT_TLS, and PT_DYNAMIC can be supported properly.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313656 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 18:14:03 +00:00
Saleem Abdulrasool
0cb391043b ExecutionEngine: add R_AARCH64_ABS{16,32}
Add support for the R_AARCH64_ABS{16,32} relocations in the execution
engine.  This is primarily used for DWARF debug information relocations
and needed by the LLVM JIT to support JITing for lldb.

Patch by Alex Langford!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313654 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 18:00:50 +00:00
Krzysztof Parzyszek
fcedb0e885 Revert "Improve TableGen performance of -gen-dag-isel (motivated by X86 backend)"
It breaks a lot of bots due to missing "__iterator_category".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313651 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 17:55:07 +00:00
Krzysztof Parzyszek
b6c562401c Move "(void)variable" closer to the assertion that uses it, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313649 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 17:47:53 +00:00
Shoaib Meenai
6d72a2f921 [cmake] Add SOURCE_DIR argument to llvm_check_source_file_list
The motivation is to be able to check sources outside the current
directory. See D31363 for example usage.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313648 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 17:44:42 +00:00
Krzysztof Parzyszek
2e76b8570f Improve TableGen performance of -gen-dag-isel (motivated by X86 backend)
The introduction of parameterized register classes in r313271 caused the
matcher generation code in TableGen to run much slower, particularly so
in the unoptimized (debug) build. This patch recovers some of the lost
performance.

Summary of changes:
- Cache the set of legal types in TypeInfer::getLegalTypes. The contents
  of this set do not change.
- Add LLVM_ATTRIBUTE_ALWAYS_INLINE to several small functions. Normally
  this would not be necessary, but in the debug build TableGen is not
  optimized, so this helps a little bit.
- Add an early exit from TypeSetByHwMode::operator== for the case when
  one or both arguments are "simple", i.e. only have one mode. This
  saves some time in GenerateVariants.
- Finally, replace the underlying storage type in TypeSetByHwMode::SetType
  with MachineValueTypeSet based on std::array instead of std::set.
  This significantly reduces the number of memory allocation calls.

I've done a number of experiments with the underlying type of InfoByHwMode.
The type is a map, and for targets that do not use the parameterization,
this map has only one entry. The best (unoptimized) performance, somewhat
surprisingly came from std::map, followed closely by std::unordered_map.
DenseMap was the slowest by a large margin.
Various hand-crafted solutions (emulating enough of the map interface
not to make sweeping changes to the users) did not yield any observable
improvements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313647 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 17:32:35 +00:00
Craig Topper
1bfa1fd4c5 [X86] Convert X86ISD::SELECT to ISD::VSELECT just before instruction selection to avoid duplicate patterns
Similar to what we do for X86ISD::SHRUNKBLEND just turn X86ISD::SELECT into ISD::VSELECT. This allows us to remove the duplicated TRUNC patterns.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313644 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 17:19:45 +00:00
Zachary Turner
058162edd3 Resubmit "Fix llvm-lit script generation in libcxx."
After speaking with the libcxx owners, they agreed that this is
a bug in the bot that needs to be fixed by the bot owners, and
the CMake changes are correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313643 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 17:19:10 +00:00
Reid Kleckner
032e1608d6 Re-land r313400 "[DebugInfo] Insert DW_OP_deref when spilling indirect DBG_VALUEs"
I forgot to zero out the BitVector when reusing it between UserValues.

Later uses of the same location number for a different UserValue would
falsely indicate that they were spilled. Usually this would lead to
incorrect debug info, but in some cases they would indicate something
nonsensical like a memory location based on a vector register (Q8 on
ARM).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313640 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 16:32:15 +00:00
Tony Jiang
a2daaca0d6 [PowerPC Peephole] Constants into a join add, use ADDI over LI/ADD.
Two blocks prior to the join each perform an li and the the join block has an
add using the initialized register. Optimize each predecessor block to instead
use addi and delete the li's and add.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313639 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 16:14:37 +00:00
Evandro Menezes
fd1b754b1d [AArch64] Extend tests of loads and stores of register pairs
Include instances of FP register pairs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313638 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 15:46:35 +00:00
Tony Jiang
9488976a0f [Power9] Add missing Power9 instructions.
The following 8 instructions are implemented in this patch.
addpcis(subpcis, lnia), darn, maddhd, maddhdu, maddld, setb

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313636 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 15:22:36 +00:00
David Blaikie
7414b5dffd dwarfdump: Delay parsing abbreviations until they're needed
This speeds up dumping specific DIEs by not parsing abbreviations for
units that are not used.

(this is also handy to have in eventually to speed up llvm-symbolizer
for .dwp files, where parsing most of the DWP file can be avoided by
using the index)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313635 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 15:13:55 +00:00
Daniel Sanders
68b21d6108 [globalisel] Add a G_BSWAP instruction and support bswap using it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313633 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 14:25:15 +00:00
Simon Pilgrim
9ba154704c [X86][SSE] Add 'redundant pand' test case from PR34620
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313632 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 14:02:16 +00:00
Sanjay Patel
031d34937f [x86] regenerate checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313631 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 13:43:09 +00:00
Alexey Bataev
54b1cf3bab [SLP] Reduce test, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313630 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 13:38:56 +00:00
Daniel Sanders
8aded4e290 [globalisel] Add support for intrinsic_void
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313629 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 13:23:01 +00:00
Daniel Sanders
86721de9e5 [globalisel] Add support for intrinsic_w_chain.
This maps directly to G_INTRINSIC_W_SIDE_EFFECTS.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313627 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 12:56:36 +00:00
Nikolai Bozhenov
be4aef480e [Nios2] Subtarget, basic infrastructure for frame, instructions and registers
This is the second minimal patch keeping Nios2 target buildable.
I'm adding subtarget here and other stuff for frame lowering, instruction,
register information methods. I do not add any test cases, as still there
are missing parts like DAG selector and assembly printing. I plan to include
them into the next patch.

Patch by Andrei Grischenko <andrei.l.grischenko@intel.com>

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313626 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 11:54:29 +00:00
Jina Nahias
eef725fc85 [x86] Lowering Mask Set1 intrinsics to LLVM IR
This patch, together with a matching clang patch (https://reviews.llvm.org/D37668), implements the lowering of X86 mask set1 intrinsics to IR.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313625 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 11:03:06 +00:00
Roger Ferrer Ibanez
081fd494d0 [ARM] Use ADDCARRY / SUBCARRY
This is a preparatory step for D34515.

This change:
 - makes nodes ISD::ADDCARRY and ISD::SUBCARRY legal for i32
 - lowering is done by first converting the boolean value into the carry flag
   using (_, C) ← (ARMISD::ADDC R, -1) and converted back to an integer value
   using (R, _) ← (ARMISD::ADDE 0, 0, C). An ARMISD::ADDE between the two
   operations does the actual addition.
 - for subtraction, given that ISD::SUBCARRY second result is actually a
   borrow, we need to invert the value of the second operand and result before
   and after using ARMISD::SUBE. We need to invert the carry result of
   ARMISD::SUBE to preserve the semantics.
 - given that the generic combiner may lower ISD::ADDCARRY and
   ISD::SUBCARRYinto ISD::UADDO and ISD::USUBO we need to update their lowering
   as well otherwise i64 operations now would require branches. This implies
   updating the corresponding test for unsigned.
 - add new combiner to remove the redundant conversions from/to carry flags
   to/from boolean values (ARMISD::ADDC (ARMISD::ADDE 0, 0, C), -1) → C
 - fixes PR34045
 - fixes PR34564

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313618 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 09:05:39 +00:00
Andrei Elovikov
8632b8a5bb Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313617 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 07:56:20 +00:00
Matt Arsenault
4b385be048 AMDGPU: Run internalize symbols at -O0
The relocations used for externally visible functions
aren't supported, so the direct call emitted ends
up hitting a linker error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313616 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 07:40:11 +00:00
Gadi Haber
bbbe81ad6a [X86][Skylake] Adding the scheduling information for the SkylakeClient target
This patch adds the instruction scheduling information for the SkylakeClient (SKL) architecture target by adding the file X86SchedSkylakeClient.td located under the X86 Target.
We used the scheduling information retrieved from the Skylake architects in order to create the file.
The scheduling information includes latency, number of micro-Ops and used ports by each SKL instruction.
The patch continues the scheduling replacement and insertion effort started with the SNB target in r307529 and r310792 and for HSW in r311879.

Please expect some performance fluctuations due to code alignment effects.

Reviewers: craig.topper, zvi, chandlerc, igorb, aymanmus, RKSimon, delena
Differential Revision: https://reviews.llvm.org/D37294

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313613 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 06:19:27 +00:00
Craig Topper
33bc70e64d [X86] Remove some unnecessary patterns for truncate with X86ISD::SELECT and undef preserved source.
We canonicalize undef preserved sources to zero during intrinsic lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313612 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 05:30:24 +00:00
Hongbin Zheng
570e4c977e [LLVM] [RegionInfo] Introduce getExitingBlocks to get all predecessors of Exit in the current region.
This function will return true if all predecessors of Exit are in the current region, false otherwise.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313611 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 04:59:27 +00:00
Craig Topper
4c92030df7 [X86] Add VPERMPD/VPERMQ and VPERMPS/VPERMD to the execution domain fixing table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313610 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 04:39:55 +00:00
Tom Stellard
9b6e3e1821 docs: Fix formatting in HowToReleaseLLVM
This is a follow up to r313608.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313609 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 03:27:26 +00:00
Tom Stellard
c482e16a32 docs: Add instructions for how to submit a merge request
Reviewers: hansw, hans

Reviewed By: hans

Subscribers: hans, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313608 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 03:23:03 +00:00
Zachary Turner
bfc7639dd1 Revert "Fix llvm-lit script generation in libcxx."
This reverts commit 4ad71811d45268d81b60f27e3b8b2bcbc23bd7b9.

There is a bot that is checking out libcxx and lit with nothing
else and then running lit.py against the test tree.  Since there's
no LLVM source tree, there's no LLVM CMake.  CMake actually
reports this as a warning saying unsupported libcxx configuration,
but I guess someone is depending on it anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313607 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 03:11:35 +00:00
Zachary Turner
a2144731b3 Fix llvm-lit script generation in libcxx.
Differential Revision: https://reviews.llvm.org/D37997

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313606 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 02:46:28 +00:00
Vlad Tsyrklevich
b261c46c08 Allow public Triple deduction from ObjectFiles.
Move logic that allows for Triple deduction from an ObjectFile object
out of llvm-objdump.cpp into a public factory, found in the ObjectFile
class.

This should allow other tools in the future to use this logic without
reimplementation.

Patch by Mitch Phillips

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313605 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 02:22:48 +00:00
Vedant Kumar
1ef0d5a130 [llvm-cov] Make report metrics agree with line exec counts, fixes PR34615
Use the same logic as the line-oriented coverage view to determine the
number of covered lines in a function.

Fixes llvm.org/PR34615.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313604 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 02:00:12 +00:00
Zachary Turner
ae83487a49 Set svn:ignore property on *.pyc.
I think this is what is causing the build to constantly encounter tree conflicts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313601 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 00:13:42 +00:00
Vedant Kumar
7c57f171e2 [Coverage] Use gap regions to select better line exec counts
After clang started emitting deferred regions (r312818), llvm-cov has
had a hard time picking reasonable line execuction counts. There have
been one or two generic improvements in this area (e.g r310012), but
line counts can still report coverage for whitespace instead of code
(llvm.org/PR34612).

To fix the problem:

 * Introduce a new region kind so that frontends can explicitly label
   gap areas.

   This is done by changing the encoding of the columnEnd field of
   MappingRegion. This doesn't substantially increase binary size, and
   makes it easy to maintain backwards-compatibility.

 * Don't set the line count to a count from a gap area, unless the count
   comes from a wrapped segment.

 * Don't highlight gap areas as uncovered.

Fixes llvm.org/PR34612.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313597 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 23:37:28 +00:00
Vedant Kumar
f71ef504eb [llvm-cov] Repair a test. NFC.
The checks with the MARKER prefix were not being run over the right
input, because stderr was not redirected properly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313596 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 23:37:27 +00:00
Vedant Kumar
2fbca6bfae [llvm-cov] Simplify code to find the first uncovered segment. NFC.
Now that that segment builder is guaranteed to produce segments in
sorted order, we don't need a linear scan to get the right result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313595 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 23:37:27 +00:00
Zachary Turner
36409f3326 [lit] Use realpath when adding to the config map.
Since the path a user specifies to the llvm-lit script might be
different than the source tree they built from (since they could
be behind different symlinks), we need to use realpath to make
sure that path comparisons work as expected.

Even better would be to use a custom dictionary comparison with
actual file equivalence comparison semantics, but this is the
least friction to unbreak things for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313594 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 23:36:35 +00:00
Yonghong Song
2865ab6996 bpf: add inline-asm support
Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313593 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 23:29:36 +00:00
Yi Kong
74ae606cb2 [ThinLTO/gold] Implement ThinLTO cache pruning support
Differential Revision: https://reviews.llvm.org/D37993

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313592 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 23:24:55 +00:00
Zachary Turner
814f69e369 Fix inverted regex search.
I was using the pattern as the source string and vice versa
causing strange regular expression errors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313590 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 23:14:15 +00:00
Hans Wennborg
96d3026420 Revert r313400 "[DebugInfo] Insert DW_OP_deref when spilling indirect DBG_VALUEs"
This caused asserts in Chromium. See http://crbug.com/766261

> Summary:
> This comes up in optimized debug info for C++ programs that pass and
> return objects indirectly by address. In these programs,
> llvm.dbg.declare survives optimization, which causes us to emit indirect
> DBG_VALUE instructions. The fast register allocator knows to insert
> DW_OP_deref when spilling indirect DBG_VALUE instructions, but the
> LiveDebugVariables did not until this change.
>
> This fixes part of PR34513. I need to look into why this doesn't work at
> -O0 and I'll send follow up patches to handle that.
>
> Reviewers: aprantl, dblaikie, probinson
>
> Subscribers: qcolombet, hiraditya, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D37911

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313589 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 23:08:42 +00:00
Zachary Turner
dd5485381d [lit] Fix a Python 3 compatibility issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313580 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 22:30:45 +00:00
Zachary Turner
af03e798b8 [lit] Update clang and lld to use new config helpers.
NFC intended here, this only updates clang and lld's lit configs
to use some helper functionality in the lit.llvm submodule.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313579 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 22:26:48 +00:00
Adrian Prantl
47842dcdbe Replace for_each with a range-based for. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313578 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 22:11:33 +00:00
Sanjay Patel
a3209ae52e [DAGCombiner] fold assertzexts separated by trunc
If we have an AssertZext of a truncated value that has already been AssertZext'ed, 
we can assert on the wider source op to improve the zext-y knowledge:
 assert (trunc (assert X, i8) to iN), i1 --> trunc (assert X, i1) to iN

This moves a fold from being Mips-specific to general combining, and x86 shows
improvements.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313577 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 22:05:35 +00:00