152337 Commits

Author SHA1 Message Date
Dehao Chen
c87493d497 Add test coverage for new PM PGOOpt handling.
Summary: This patch adds flags and tests to cover the PGOOpt handling logic in new PM.

Reviewers: chandlerc, davide

Reviewed By: chandlerc

Subscribers: sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309076 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 02:00:43 +00:00
Davide Italiano
f34b3b16e3 [gold] Enable data-sections by default for the gold-plugin.
Follow up to r309056.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309075 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 01:47:17 +00:00
Wei Mi
c076aa05ec Add "REQUIRES: asserts" for test unswitch-equality-undef.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309073 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 01:34:46 +00:00
Sanjoy Das
69b28c8782 [SCEV] Remove unnecessary call to forgetMemoizedResults
`SCEVUnknown::allUsesReplacedWith` does not need to call `forgetMemoizedResults`
since RAUW does a value-equivalent replacement by assumption.  If this
assumption was false then the later setValPtr(New) call would be incorrect too.

This is a non-trivial performance optimization for functions with a large number
of loops since `forgetMemoizedResults` walks all loop backedge taken counts to
see if any of them use the SCEVUnknown being RAUWed.  However, this improvement
is difficult to demonstrate without checking in an excessively large IR file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309072 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 01:32:19 +00:00
Reid Kleckner
59859d9950 [lit] Attempt to fix Python unittest adaptor logic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309071 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 01:27:18 +00:00
Eric Beckmann
f74bed27b4 Move manifest utils into separate lib, to reduce libxml2 deps.
Summary:
Previously were in support.  Since many many things depend on support,
were all forced to also depend on libxml2, which we only want in a few cases.
This puts all the libxml2 deps in a separate lib to be used only in a few
places.

Reviewers: ruiu, thakis, rnk

Subscribers: mgorny, hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309070 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 01:21:55 +00:00
Reid Kleckner
49fc1e6fbc [PDB] Remove stale GSI.h header that I intended to remove in the previous commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 00:58:49 +00:00
Spyridoula Gravani
c88d81fa3e [DWARF] Generalized verification of .apple_names accelerator table to be applicable to any acceleration table. Added verification for .apple_types, .apple_namespaces and .apple_objc sections.
Differential Revision: https://reviews.llvm.org/D35853

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309068 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 00:52:31 +00:00
Reid Kleckner
4a753bdddf [PDB] Improve GSI hash table dumping for publics and globals
The PDB "symbol stream" actually contains symbol records for the publics
and the globals stream. The globals and publics streams are essentially
hash tables that point into a single stream of records. In order to
match cvdump's behavior, we need to only dump symbol records referenced
from the hash table. This patch implements that, and then implements
global stream dumping, since it's just a subset of public stream
dumping.

Now we shouldn't see S_PROCREF or S_GDATA32 records when dumping
publics, and instead we should see those record in the globals stream.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309066 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 00:40:36 +00:00
Eric Beckmann
ec76cbbaaa Reapply "llvm-mt: implement simple merging of manifests, not factoring namespaces.
This time with correct #if.

This reverts commit 9cf4eca0e0383040c1ff1416815c7f649650c2a0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309064 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-26 00:25:12 +00:00
Eugene Zelenko
1778f81efa [AArch64] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309062 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 23:51:02 +00:00
Wei Mi
cedb77eb71 Disable loop unswitching for some patterns containing equality comparison with undef.
This is a workaround for the bug described in PR31652 and
http://lists.llvm.org/pipermail/llvm-dev/2017-July/115497.html. The temporary
solution is to add a function EqualityPropUnSafe. In EqualityPropUnSafe, for
some simple patterns we can know the equality comparison may contains undef,
so we regard such comparison as unsafe and will not do loop-unswitching for
them. We also need to disable the select simplification when one of select
operand is undef and its result feeds into equality comparison.

The patch cannot clear the safety issue caused by the bug, but it can suppress
the issue from happening to some extent.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309059 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 23:37:17 +00:00
Adrian Prantl
e22b98a6ed Debug Info: Support fragmented variables in the MMI side table
This reapplies commit r309034 with a bugfix+test for inlined variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309057 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 23:32:59 +00:00
Davide Italiano
67d8465a23 [gold] Enable function-sections by default.
This is needed, among others, to respect --section-ordering-file
with LTO. I'll follow up with a similar change for data sections.

I hope every version of gold available on the bots has support for
--section-ordering file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309056 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 23:32:50 +00:00
Eric Beckmann
0c862f5c0f Revert "llvm-mt: implement simple merging of manifests, not factoring namespaces."
This reverts commit 813308e240792ca70ed2f998f21df24a5061ada0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309050 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 23:06:46 +00:00
Eric Beckmann
b0707e1a0d llvm-mt: implement simple merging of manifests, not factoring namespaces.
Summary:
Does a simple merge, where mergeable elements are combined, all others
are appended.  Does not apply trickly namespace rules.

Subscribers: llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309047 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 22:50:25 +00:00
Petr Hosek
2f55a43107 Revert "Reland "[LLVM][llvm-objcopy] Added basic plumbing to get things started""
This reverts commit 0d9d9250483761eb2f50236830161b0e2137d483.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309045 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 22:39:52 +00:00
Michal Gorny
5b4c3ec15d [lit] Fix UnboundLocalError for invalid shtest redirects
Replace the incorrect variable reference when invalid redirect is used.
This fixes the following issue:

  File "/usr/src/llvm/utils/lit/lit/TestRunner.py", line 316, in processRedirects
    raise InternalShellError(cmd, "Unsupported redirect: %r" % (r,))
UnboundLocalError: local variable 'r' referenced before assignment

which in turn broke shtest-shell.py and max-failures.py lit tests.

The breakage was introduced during refactoring in rL307310.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309044 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 22:38:31 +00:00
Petr Hosek
50f00d6e8d Reland "[LLVM][llvm-objcopy] Added basic plumbing to get things started"
As discussed on llvm-dev I've implemented the first basic steps towards
llvm-objcopy/llvm-objtool (name pending).

This change adds the ability to copy (without modification) 64-bit
little endian ELF executables that have SHT_PROGBITS, SHT_NOBITS,
SHT_NULL and SHT_STRTAB sections.

Patch by Jake Ehrlich

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309043 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 22:38:08 +00:00
Eric Christopher
dd35be2805 Update the comments on default subtargets based on feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309041 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 22:21:08 +00:00
Kostya Serebryany
8330752796 [libFuzzer] don't disable msan for TracePC::CollectFeatures: this started to cause false positives in msan. No tests for libFuzzer+msan yet -- tests will need to wait until we move libFuzzer to compiler-rt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309038 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 22:05:31 +00:00
Petr Hosek
6d5fc4344c Revert "Reland "[LLVM][llvm-objcopy] Added basic plumbing to get things started""
This reverts commit 960873b10dd071298c817ba74ef2228f94ead7a1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309037 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 21:55:00 +00:00
Adrian Prantl
7cfa553c07 Revert "Debug Info: Support fragmented variables in the MMI side table"
This reverts commit r309034 because of a sanitizer issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309035 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 21:50:45 +00:00
Adrian Prantl
2522046447 Debug Info: Support fragmented variables in the MMI side table
<rdar://problem/17816343>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309034 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 21:29:22 +00:00
Petr Hosek
960873b10d Reland "[LLVM][llvm-objcopy] Added basic plumbing to get things started"
As discussed on llvm-dev I've implemented the first basic steps towards
llvm-objcopy/llvm-objtool (name pending).

This change adds the ability to copy (without modification) 64-bit
little endian ELF executables that have SHT_PROGBITS, SHT_NOBITS,
SHT_NULL and SHT_STRTAB sections.

Patch by Jake Ehrlich

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309032 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 21:16:33 +00:00
Don Hinton
9ed22432b4 [CMAKE] Speedup developer builds when passing LLVM_APPEND_VC_REV = OFF
Make sure multiple targets don't get rebuilt unnecessarily when LLVM_APPEND_VC_REV = OFF.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309031 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 21:13:18 +00:00
Chris Bieneman
35647a1478 [CMake] Fix broken builds from r309029
Fixing the mismatched beginning if and endif contents.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309030 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 20:58:14 +00:00
Chris Bieneman
02829e6c9c [CMake] Allow TableGen.cmake to be included multiple times
This patch allows TableGen.cmake to be safely included multiple times in sub-projects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309029 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 20:53:31 +00:00
Marek Olsak
6044a148c6 AMDGPU/SI: Fix Depth and Height computation for SI scheduler
Patch by: Axel Davy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309028 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 20:37:03 +00:00
Marek Olsak
343cb90d28 AMDGPU/SI: Force exports at the end for SI scheduler
Patch by: Axel Davy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309027 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 20:36:58 +00:00
Martin Storsjo
5b3e8fe6d9 [AArch64] Update a comment in a test
The comment ended up outdated when the test was rewritten in SVN r192281.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309016 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 19:57:26 +00:00
Martin Storsjo
d4147fa3ab [AArch64] Add a test for float argument passing to win64 vararg functions
The existing tests only tested how a va_start is lowered.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309015 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 19:57:22 +00:00
Teresa Johnson
a63ab3c9ea [LTO] Prevent dead stripping and internalization of symbols with sections
Summary:
ELF linkers generate __start_<secname> and __stop_<secname> symbols
when there is a value in a section <secname> where the name is a valid
C identifier.  If dead stripping determines that the values declared
in section <secname> are dead, and we then internalize (and delete)
such a symbol, programs that reference the corresponding start and end
section symbols will get undefined reference linking errors.

To fix this, add the section name to the IRSymtab entry when a symbol is
defined in a specific section. Then use this in the gold-plugin to mark
the symbol as external and visible from outside the summary when the
section name is a valid C identifier.

Reviewers: pcc

Subscribers: mehdi_amini, inglorion, eraman, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309009 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 19:42:32 +00:00
Eric Christopher
94c534f4bd Revert "This patch enables the usage of constant Enum identifiers within Microsoft style inline assembly statements."
This reverts commit r308966.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309005 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 19:22:09 +00:00
Nemanja Ivanovic
57a32cdffd [PowerPC] Pretty-print CR bits the way the binutils disassembler does
This patch just adds printing of CR bit registers in a more human-readable
form akin to that used by the GNU binutils.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309001 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 18:26:35 +00:00
Nemanja Ivanovic
84cbf60689 [PowerPC] - Recommit r304907 now that the issue has been fixed
This is just a recommit since the issue that the commit exposed is now
resolved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308995 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 17:54:51 +00:00
Stephen Hines
75c17877dc [docs] Fix a typo: iteratation -> iteration
Reviewers: dgross

Reviewed By: dgross

Subscribers: dgross, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308994 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 17:52:55 +00:00
Simon Pilgrim
902fe6e6a0 [X86][CGP] Reduce memcmp() expansion to 2 load pairs (PR33914)
D35067/rL308322 attempted to support up to 4 load pairs for memcmp inlining which resulted in regressions for some optimized libc memcmp implementations (PR33914).

Until we can match these more optimal cases, this patch reduces the memcmp expansion to a maximum of 2 load pairs (which matches what we do for -Os).

This patch should be considered for the 5.0.0 release branch as well

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308986 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 17:04:37 +00:00
Simon Pilgrim
ae9f3ffd87 [DAG] Move DAGCombiner::GetDemandedBits to SelectionDAG
This patch moves the DAGCombiner::GetDemandedBits function to SelectionDAG::GetDemandedBits as a first step towards making it easier for targets to get to the source of any demanded bits without the limitations of SimplifyDemandedBits.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308983 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 16:36:44 +00:00
Simon Pilgrim
7d8deb856a [X86] Regenerate test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308981 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 16:10:32 +00:00
Simon Pilgrim
a7461f4539 [X86] Regenerate test with broadcast comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308980 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 16:09:56 +00:00
Fedor Sergeev
a964c1f9b7 [Sparc] invalid adjustments in TLS_LE/TLS_LDO relocations removed
Summary:
Some SPARC TLS relocations were applying nontrivial adjustments
to zero value, leading to unexpected non-zero values in ELF and then
Solaris linker failures.

Getting rid of these adjustments.

Fixes PR33825.

Reviewers: rafael, asb, jyknight

Subscribers: joerg, jyknight, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308978 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 15:28:28 +00:00
Andrew V. Tischenko
b398702175 X86 Asm uses assertions instead of proper diagnostic. This patch fixes that.
Differential Revision: https://reviews.llvm.org/D35115


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308972 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 13:05:12 +00:00
Chandler Carruth
2dcaf78ab6 [LIR] Teach LIR to avoid extending the BE count prior to adding one to
it when safe.

Very often the BE count is the trip count minus one, and the plus one
here should fold with that minus one. But because the BE count might in
theory be UINT_MAX or some such, adding one before we extend could in
some cases wrap to zero and break when we scale things.

This patch checks to see if it would be safe to add one because the
specific case that would cause this is guarded for prior to entering the
preheader. This should handle essentially all of the common loop idioms
coming out of C/C++ code once canonicalized by LLVM.

Before this patch, both forms of loop in the added test cases ended up
subtracting one from the size, extending it, scaling it up by 8 and then
adding 8 back onto it. This is really silly, and it turns out made it
all the way into generated code very often, so this is a surprisingly
important cleanup to do.

Many thanks to Sanjoy for showing me how to do this with SCEV.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308968 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 10:48:32 +00:00
Matan Haroush
0000a717e9 This patch enables the usage of constant Enum identifiers within Microsoft style inline assembly statements.
Differential Revision:
https://reviews.llvm.org/D33277
https://reviews.llvm.org/D33278



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308966 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 10:44:09 +00:00
Michael Zolotukhin
8641ab97a4 [tests] Cleanup vect.omp.persistence.ll test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308964 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 10:35:16 +00:00
Simon Pilgrim
ee5c36fd59 [X86] Add 24-byte memcmp tests (PR33914)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308963 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 10:33:36 +00:00
Francois Pichet
12b7f90cfc Fix endianness bug in DAGCombiner::visitTRUNCATE and visitEXTRACT_VECTOR_ELT
Summary:
Do not assume little endian architecture in DAGCombiner::visitTRUNCATE and DAGCombiner::visitEXTRACT_VECTOR_ELT.
PR33682

Reviewers: hfinkel, sdardis, RKSimon

Reviewed By: sdardis, RKSimon

Subscribers: uabelho, RKSimon, sdardis, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308960 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 09:40:35 +00:00
Sam Parker
e46d723b12 [ARM] Enable partial and runtime unrolling
Enable runtime and partial loop unrolling of simple loops without
calls on M-class cores. The thresholds are calculated based on
whether the target is Thumb or Thumb-2.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308956 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 08:51:30 +00:00
Martin Storsjo
9319e27ba7 [COFF] ARM64 support for COFFImportFile
A test will be committed separately in the lld repo.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308951 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-25 06:05:49 +00:00