Commit Graph

272147 Commits

Author SHA1 Message Date
Vedant Kumar 0b7cb326a1 [cmake] Unmark LLVM_BUILD_INSTRUMENTED_COVERAGE as experimental
The coverage bot has been stable for a while:

  http://lab.llvm.org:8080/coverage/coverage-reports/index.html

llvm-svn: 313769
2017-09-20 17:16:00 +00:00
Vedant Kumar c23e14a0eb [docs] Make a note of LLVM_BUILD_INSTRUMENTED_COVERAGE
llvm-svn: 313768
2017-09-20 17:16:00 +00:00
Jake Ehrlich e5d424b8dc Reland "[llvm-objcopy] Add support for .dynamic, .dynsym, and .dynstr"
I overzealously landed this before I was sure that another change
wouldn't break the build that this change depends on.

This change adds support for sections involved in dynamic loading such
as SHT_DYNAMIC, SHT_DYNSYM, and allocated string tables.

The two added binaries used for tests can be downloaded here and here

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

llvm-svn: 313767
2017-09-20 17:11:58 +00:00
Teresa Johnson f625118ec7 [ThinLTO] Fix dead stripping analysis for SamplePGO
Summary:
The fix for dead stripping analysis in the case of SamplePGO indirect
calls to local functions (r313151) introduced the possibility of an
infinite loop.

Make sure we check for the value being already live after we update it
for SamplePGO indirect call handling.

Reviewers: danielcdh

Subscribers: mehdi_amini, inglorion, llvm-commits, eraman

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

llvm-svn: 313766
2017-09-20 17:09:47 +00:00
Zachary Turner 8978363735 [lit] Reverse path list when updating environment vars.
Bug pointed out by EricWF.  This would construct a path where
items would be added in the wrong order, potentially leading
to using the wrong tools for testing.

llvm-svn: 313765
2017-09-20 17:08:20 +00:00
Rafael Espindola e4bad83edb Don't try to compute a value that is known to fail.
We try to evaluate expressions early when possible, but it is not
possible to evaluate them early if they are based on a section.

Before we would get this wrong on ABSOLUTE expressions.

llvm-svn: 313764
2017-09-20 16:42:56 +00:00
Zachary Turner 3dd2356b3a Make libcxx tests work when llvm sources are not present.
Despite a strong CMake warning that this is an unsupported
libcxx build configuration, some bots still rely on being
able to check out lit and libcxx independently with no
LLVM sources, and then run lit against libcxx.

A previous patch broke that workflow, so this is making it work
again.  Unfortunately, it breaks generation of the llvm-lit
script for libcxx, but we will just have to live with that until
a solution is found that allows libcxx to make more use of
llvm build pieces.  libcxx can still run tests by using the
ninja check target, or by running lit.py directly against the
build tree or source tree.

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

llvm-svn: 313763
2017-09-20 16:01:50 +00:00
David Blaikie 1d5d44ff05 DebugInfo: Remove unneeded attributes from test/DebugInfo/Generic/imported-name-inlined.ll
Remove unneeded attributes from test/DebugInfo/Generic/imported-name-inlined.ll because it was causing failures on pure MIPS builds.

Patch by Miloš Stojanović!

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

llvm-svn: 313762
2017-09-20 15:59:57 +00:00
Simon Atanasyan 8bdbb29524 [mips] Add a valid test case to check the reason of the recent build-bot failure. NFC
llvm-svn: 313761
2017-09-20 15:57:25 +00:00
Serge Pavlov 3b7d381169 Put target deduced from executable name at the start of argument list
When clang is called as 'target-clang', put deduced target option at
the start of argument list so that option '--target=' specified in command
line could override it.

This change fixes PR34671.

llvm-svn: 313760
2017-09-20 15:22:27 +00:00
Ilya Biryukov 77f61badf4 [clangd] Put inacessible items to the end of completion list.
Reviewers: bkramer, krasimir

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

llvm-svn: 313759
2017-09-20 15:09:14 +00:00
Alexander Kornienko 6a140234ed Revert r313736: "[SLP] Vectorize jumbled memory loads."
The revision breaks buildbots:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/6694/steps/test/logs/stdio

llvm-svn: 313758
2017-09-20 14:53:07 +00:00
Alexander Kornienko 7302344bdf Revert r313753: "Fix a -Wsign-compare warning in LoopAccessAnalysis.cpp"
llvm-svn: 313757
2017-09-20 14:52:56 +00:00
Roman Lebedev 30d2608637 Replace r313747, don't always warn on enums, rework testcases.
As Aaron Ballman has pointed out, that is not really correct.
So the key problem there is the invalidity of the testcase.

Revert r313747, and rework testcase in such a way, so these
details (platform-specific default enum sigdness) are
accounted for.

Also, add a C++-specific testcase.

llvm-svn: 313756
2017-09-20 13:50:01 +00:00
Simon Pilgrim d202ad15c1 [X86][SSE] Add PR22415 test case
llvm-svn: 313755
2017-09-20 13:49:52 +00:00
Ilya Biryukov 47f22026b5 [clangd] Serialize onDiagnosticsReady callbacks for the same file.
Summary:
Calls to onDiagnosticsReady were done concurrently before. This sometimes
led to older versions of diagnostics being reported to the user after
the newer versions.

Reviewers: klimek, bkramer, krasimir

Reviewed By: klimek

Subscribers: cfe-commits

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

llvm-svn: 313754
2017-09-20 12:58:55 +00:00
Alexander Kornienko 6c629b5728 Fix a -Wsign-compare warning in LoopAccessAnalysis.cpp
llvm-svn: 313753
2017-09-20 12:18:22 +00:00
Alexander Kornienko 621e555788 [clang-tidy] Fix linkage-related compiler errors in clang-tidy tests
llvm-svn: 313752
2017-09-20 12:16:35 +00:00
Florian Hahn ceb4494786 Recommit [MachineCombiner] Update instruction depths incrementally for large BBs.
This version of the patch fixes an off-by-one error causing PR34596. We
do not need to use std::next(BlockIter) when calling updateDepths, as
BlockIter already points to the next element.

Original commit message:
> For large basic blocks with lots of combinable instructions, the
> MachineTraceMetrics computations in MachineCombiner can dominate the compile
> time, as computing the trace information is quadratic in the number of
> instructions in a BB and it's relevant successors/predecessors.

> In most cases, knowing the instruction depth should be enough to make
> combination decisions. As we already iterate over all instructions in a basic
> block, the instruction depth can be computed incrementally. This reduces the
> cost of machine-combine drastically in cases where lots of instructions
> are combined. The major drawback is that AFAIK, computing the critical path
> length cannot be done incrementally. Therefore we only compute
> instruction depths incrementally, for basic blocks with more
> instructions than inc_threshold. The -machine-combiner-inc-threshold
> option can be used to set the threshold and allows for easier
> experimenting and checking if using incremental updates for all basic
> blocks has any impact on the performance.
>
> Reviewers: sanjoy, Gerolf, MatzeB, efriedma, fhahn
>
> Reviewed By: fhahn
>
> Subscribers: kiranchandramohan, javed.absar, efriedma, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D36619

llvm-svn: 313751
2017-09-20 11:54:37 +00:00
Michael Kruse 8dceb76066 [ScheduleOptimizer] Fix and test schedule tree statistics.
Fix walking over the schedule tree to collect its properties
(Number of permutable bands etc.).

Also add regression tests for these statistics.

llvm-svn: 313750
2017-09-20 11:53:05 +00:00
Ilya Biryukov 83ca8a2b71 [clangd] Run clang-format on ClangdUnit.cpp. NFC.
llvm-svn: 313749
2017-09-20 10:46:58 +00:00
George Rimar 0eb2f30b0b Revert r313746 "[yaml2obj] - Don't crash on invalid document."
It broke BB:
http://lab.llvm.org:8011/builders/llvm-hexagon-elf/builds/9781

llvm-svn: 313748
2017-09-20 10:24:37 +00:00
Roman Lebedev b513ebfc0f [Sema] CheckTautologicalComparisonWithZero(): always complain about enums
Hopefully fixes test-clang-msc-x64-on-i686-linux-RA build.

The underlying problem is that the enum is signed there.
Yet still, it is invalid for it to contain negative values,
so the comparison is always tautological in this case.

No differential, but related to https://reviews.llvm.org/D37629

llvm-svn: 313747
2017-09-20 10:15:27 +00:00
George Rimar cefe7e1142 [yaml2obj] - Don't crash on invalid document.
Previously jaml2obj would segfault on empty document.
(without yaml description).
Patch fixes the issue.

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

llvm-svn: 313746
2017-09-20 09:57:11 +00:00
Roman Lebedev b0f0a1ea03 [Sema] Move some stuff into -Wtautological-unsigned-enum-zero-compare
Recommit. Original commit was reverted because buildbots broke.
The error was only reproducible in the build with assertions.
The problem was that the diagnostic expected true/false as
bool, while it was provided as string "true"/"false".

Summary:
As requested by Sam McCall:
> Enums (not new I guess). Typical case: if (enum < 0 || enum > MAX)
> The warning strongly suggests that the enum < 0 check has no effect
> (for enums with nonnegative ranges).
> Clang doesn't seem to optimize such checks out though, and they seem
> likely to catch bugs in some cases. Yes, only if there's UB elsewhere,
> but I assume not optimizing out these checks indicates a deliberate
> decision to stay somewhat compatible with a technically-incorrect
> mental model.
> If this is the case, should we move these to a
> -Wtautological-compare-enum subcategory?

Reviewers: rjmccall, rsmith, aaron.ballman, sammccall, bkramer, djasper

Reviewed By: aaron.ballman

Subscribers: jroelofs, cfe-commits

Tags: #clang

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

llvm-svn: 313745
2017-09-20 09:54:47 +00:00
Manuel Klimek 89628f6414 clang-format clang-format.
llvm-svn: 313744
2017-09-20 09:51:03 +00:00
Simon Pilgrim 33ec43d653 [X86][SSE] Remove unnecessary NonceMasks from combineX86ShufflesRecursively calls (NFCI)
llvm-svn: 313743
2017-09-20 09:36:11 +00:00
Manuel Klimek e411aa85ac Fix clang-format's detection of structured bindings.
Correctly determine when [ is part of a structured binding instead of a
lambda.

To be able to reuse the implementation already available, this patch also:
- sets the Previous link of FormatTokens in the UnwrappedLineParser
- moves the isCppStructuredBinding function into FormatToken

Before:
  auto const const &&[x, y] { A *i };

After:
  auto const const && [x, y]{A * i};

Fixing formatting of the type of the structured binding is still missing.

llvm-svn: 313742
2017-09-20 09:29:37 +00:00
George Rimar 94444b9a07 [ELF] - Fix segfault when processing .eh_frame.
Its a PR34648 which was a segfault that happened because
we stored pointers to elements in DenseMap. 
When DenseMap grows such pointers are invalidated.
Solution implemented is to keep elements by pointer
and not by value.

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

llvm-svn: 313741
2017-09-20 09:27:41 +00:00
Mikael Holmen 06064d1bac [IfConversion] Add testcases [NFC]
These tests should have been included in r310697 / D34099 but apparently
I missed them.

llvm-svn: 313737
2017-09-20 08:23:29 +00:00
Mohammad Shahid f8db9bd857 [SLP] Vectorize jumbled memory loads.
Summary:
This patch tries to vectorize loads of consecutive memory accesses, accessed
in non-consecutive or jumbled way. An earlier attempt was made with patch D26905
which was reverted back due to some basic issue with representing the 'use mask' of
jumbled accesses.

This patch fixes the mask representation by recording the 'use mask' in the usertree entry.

Change-Id: I9fe7f5045f065d84c126fa307ef6ebe0787296df

Reviewers: mkuper, loladiro, Ayal, zvi, danielcdh

Reviewed By: Ayal

Subscribers: mzolotukhin

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

Commit after rebase for patch D36130

Change-Id: I8add1c265455669ef288d880f870a9522c8c08ab
llvm-svn: 313736
2017-09-20 08:18:28 +00:00
Andrew V. Tischenko 92980ce6aa 'into' instruction should not be decoded as a valid instr in 64-bit mode
llvm-svn: 313735
2017-09-20 08:17:17 +00:00
NAKAMURA Takumi 169dbde262 Revert rL313697, "Compact EhSectionPiece from 32 bytes to 16 bytes."
It broke selfhosting.
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/4896

llvm-svn: 313731
2017-09-20 08:03:18 +00:00
Ilya Biryukov e5128f7e91 [clangd] Introduced Logger interface.
Summary: This fixes a bunch of logging-related FIXMEs.

Reviewers: bkramer, krasimir, malaperle

Reviewed By: malaperle

Subscribers: malaperle, klimek, cfe-commits, mgorny

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

llvm-svn: 313730
2017-09-20 07:24:15 +00:00
Richard Smith 405e2dbf37 Implement C++ [basic.link]p8.
If a function or variable has a type with no linkage (and is not extern "C"),
any use of it requires a definition within the same translation unit; the idea
is that it is not possible to define the entity elsewhere, so any such use is
necessarily an error.

There is an exception, though: some types formally have no linkage but
nonetheless can be referenced from other translation units (for example, this
happens to anonymous structures defined within inline functions). For entities
with those types, we suppress the diagnostic except under -pedantic.

llvm-svn: 313729
2017-09-20 07:22:00 +00:00
Vitaly Buka 8a65209d0b [asan] Try to fix windows test by fflush(stderr)
llvm-svn: 313728
2017-09-20 07:16:08 +00:00
Vitaly Buka cf096c2af3 [asan] Resolve FIXME by converting gtest into lit test
llvm-svn: 313727
2017-09-20 07:01:19 +00:00
Eugene Zemtsov e768daad6e Signal polling is supported with pselect (re-land r313704 without a Windows breakage)
Older Android API levels don't have ppoll, but LLDB works just fine,
since on Android it always uses pselect anyway.

llvm-svn: 313726
2017-09-20 06:56:46 +00:00
Akira Hatanaka 30c93dba5b Revert "Add support for attribute 'noescape'."
This reverts commit r313722.

It looks like compiler-rt/lib/tsan/rtl/tsan_libdispatch_mac.cc cannot be
compiled because some of the functions declared in the file do not match
the ones in the SDK headers (which are annotated with 'noescape').

llvm-svn: 313725
2017-09-20 06:55:43 +00:00
Craig Topper 5c7cd25f82 [X86] Remove isel checks for immediate size on floating point compare and xop compare instructions. NFCI
If these checks fail we end up not selecting an instruction at all. So we are already relying on the immediate being checked upstream of isel. So doing the check in isel is just bloat to the isel table. Interestingly, we didn't check on the AVX512 version of the instructions anyway.

llvm-svn: 313724
2017-09-20 06:38:41 +00:00
Stanislav Mekhanoshin 2e3bf37ec4 [AMDGPU] Fixed memory leak with inliner replaced
Delete inliner before replacing it.

llvm-svn: 313723
2017-09-20 06:34:28 +00:00
Akira Hatanaka e974479fa5 Add support for attribute 'noescape'.
The attribute informs the compiler that the annotated pointer parameter
of a function cannot escape and enables IRGen to attach attribute
'nocapture' to parameters that are annotated with the attribute. That is
the only optimization that currently takes advantage of 'noescape', but
there are other optimizations that will be added later that improves
IRGen for ObjC blocks.

rdar://problem/19886775

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

llvm-svn: 313722
2017-09-20 06:32:45 +00:00
Akira Hatanaka 1b9418e163 Revert "Add support for attribute 'noescape'."
This reverts r313717.

I closed the wrong phabricator review.

llvm-svn: 313721
2017-09-20 06:27:39 +00:00
Akira Hatanaka fc587e6a57 Add support for attribute 'noescape'.
The attribute informs the compiler that the annotated pointer parameter
of a function cannot escape and enables IRGen to attach attribute
'nocapture' to parameters that are annotated with the attribute. That is
the only optimization that currently takes advantage of 'noescape', but
there are other optimizations that will be added later that improves
IRGen for ObjC blocks.

rdar://problem/19886775

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

llvm-svn: 313720
2017-09-20 06:22:51 +00:00
Matt Arsenault c8aea66627 AMDGPU: Move r600 only code into r600 only td file
llvm-svn: 313719
2017-09-20 06:11:25 +00:00
Stanislav Mekhanoshin 5641820141 [AMDGPU] Fix regression in test clang/test/CodeGen/backend-unsupported-error.ll
llvm-svn: 313718
2017-09-20 06:10:15 +00:00
Akira Hatanaka 7d85b8f6f6 [Sema][ObjC] Warn about mismatches in attributes between overriding and
overridden methods when compiling for non-ARC.

Previously, clang would error out when compiling for ARC, but didn't
print any diagnostics when compiling for non-ARC.

This was pointed out in the patch review for attribute noescape:

https://reviews.llvm.org/D32210

llvm-svn: 313717
2017-09-20 05:39:18 +00:00
Matt Arsenault b81495dccb AMDGPU: Match load d16 hi instructions
Also starts selecting global loads for constant address
in some cases. Some end up selecting to mubuf still, which
requires investigation.

We still get sub-optimal regalloc and extra waitcnts inserted
due to not really tracking the liveness of the separate register
halves.

llvm-svn: 313716
2017-09-20 05:01:53 +00:00
NAKAMURA Takumi e08ccfe3a1 DiagnosticInfoOptimizationBase: Appease g++-4.8.2 not confused to add an explicit type to resolve emit() as non-template function.
llvm-svn: 313715
2017-09-20 04:39:02 +00:00
Stanislav Mekhanoshin 5670e6d482 [AMDGPU] Port of HSAIL inliner
Differential Revision: https://reviews.llvm.org/D36849

llvm-svn: 313714
2017-09-20 04:25:58 +00:00