Commit Graph

284527 Commits

Author SHA1 Message Date
Kuba Mracek e834b22874 Revert r327029
llvm-svn: 327033
2018-03-08 17:32:00 +00:00
Kuba Mracek 0fe43695e5 Revert r327031
llvm-svn: 327032
2018-03-08 17:31:31 +00:00
Kuba Mracek 653f94df53 [asan] Fix a false positive ODR violation due to LTO ConstantMerge pass [compiler-rt part]
This fixes a false positive ODR violation that is reported by ASan when using LTO. In cases, where two constant globals have the same value, LTO will merge them, which breaks ASan's ODR detection.

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

llvm-svn: 327031
2018-03-08 17:24:47 +00:00
Sanjay Patel 0cdccf5f37 [x86] fix test to be independent of FP undef
llvm-svn: 327030
2018-03-08 17:24:30 +00:00
Kuba Mracek 0e06d37dba [asan] Fix a false positive ODR violation due to LTO ConstantMerge pass [llvm part]
This fixes a false positive ODR violation that is reported by ASan when using LTO. In cases, where two constant globals have the same value, LTO will merge them, which breaks ASan's ODR detection.

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

llvm-svn: 327029
2018-03-08 17:24:06 +00:00
Sanjay Patel 788a4336cd [StructurizeCFG] fix test to be independent of FP undef
llvm-svn: 327028
2018-03-08 17:13:57 +00:00
Andrea Di Biagio 07eb79a593 [llvm-mca] add override keyword to method ResourcePressureView::printView().
NFC.

llvm-svn: 327027
2018-03-08 17:02:28 +00:00
Sanjay Patel af2c4185a2 [x86] regenerate checks; NFC
This test will fail if we fix FP undef constant folding.

llvm-svn: 327026
2018-03-08 16:56:49 +00:00
Andrea Di Biagio 3db1fd995a [llvm-mca] HWEventListener is a class, not struct.
This should appease the buildbots.

llvm-svn: 327025
2018-03-08 16:34:19 +00:00
Tom Stellard 2a3d0ca19d merge-request.sh: Update 6.0 metabug for 6.0.1
llvm-svn: 327024
2018-03-08 16:29:08 +00:00
Haojian Wu c6a64d9239 [clangd] Early return for #include goto definition.
Summary: This would save cost of walking over the AST, NFC.

Reviewers: ilya-biryukov

Subscribers: klimek, jkorous-apple, cfe-commits, ioeric

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

llvm-svn: 327023
2018-03-08 16:28:12 +00:00
Sanjay Patel e755bf87a5 [StructurizeCFG] auto-generate full checks; NFC
Not sure what the intent of this test is, but this will change when we fix FP undef constant folding.

llvm-svn: 327022
2018-03-08 16:25:37 +00:00
Stefan Pintilie 235fb927b0 [Power9] Add more missing instructions to the Power 9 scheduler
With this patch we should be able to mark the Power 9 model as complete.

llvm-svn: 327021
2018-03-08 16:24:33 +00:00
Matt Arsenault c3fe46bbcf AMDGPU/GlobalISel: Pass subtarget + TM to LegalizerInfo
These are the parameters x86 already uses.

llvm-svn: 327020
2018-03-08 16:24:16 +00:00
Eric Liu 0df75fec3f [clangd] Bump vscode extension version to 0.0.5
llvm-svn: 327019
2018-03-08 16:14:11 +00:00
Andrea Di Biagio 8af3fe81eb [llvm-mca] Unify the API for the various views. NFCI
This allows the customization of the performance report.

Users can specify their own custom sequence of views.
Each view contributes a portion of the performance report generated by the
BackendPrinter.

Internally, class BackendPrinter keeps a sequence of views; views are printed
out in sequence when method 'printReport()' is called. 

This patch addresses one of the two review comments from Clement in D43951.

llvm-svn: 327018
2018-03-08 16:08:43 +00:00
Pavel Labath b312b13960 Fix std unique pointer pretty-printer for new stl versions
Summary: The unique pointer layout was changed in libstdc++ 6.0.23.

Reviewers: labath, clayborg

Reviewed By: labath, clayborg

Subscribers: luporl, lbianc, lldb-commits

Differential Revision: https://reviews.llvm.org/D44015
Patch by Alexandre Yukio Yamashita <alexandre.yamashita@eldorado.org.br>.

llvm-svn: 327017
2018-03-08 16:03:09 +00:00
Pavel Labath 6bf2a8ea70 Install lldb's SB headers (pr36630)
These were removed in r309021 in what looks like an accidentally
committed change. This brings them back.

I also rename the header component to lldb-headers (instead of
lldb_headers) to match the llvm style and add a special
install-lldb-headers target, which installs just the headers.

llvm-svn: 327016
2018-03-08 15:52:46 +00:00
Daniel Sanders ce0bc92329 Fix unused function warning in StatisticTest.cpp
llvm-svn: 327015
2018-03-08 15:52:45 +00:00
Sanjay Patel faf9b0f322 [InstCombine] regenerate checks; NFC
We may not need any of these tests after rL327012, but leaving 
them here for now until that's confirmed.

llvm-svn: 327014
2018-03-08 15:46:38 +00:00
Pavel Labath b9923f049e [LLDB][PPC64] Fix single step and LldbGdbServer tests
Summary:
On PPC64, the tested functions were being entered through their local entry point, while the tests expected the program to stop at the function start address, that, for PPC64, corresponds to the global entry point.

To fix the issue, the test program was modified to call the functions to be tested through function pointers, which, on PPC64, force the calls through the global entry point, while not affecting the test on other platforms.

Reviewers: clayborg, labath

Reviewed By: labath

Subscribers: alexandreyy, lbianc

Differential Revision: https://reviews.llvm.org/D43768
Patch by Leandro Lupori <leandro.lupori@gmail.com>.

llvm-svn: 327013
2018-03-08 15:41:13 +00:00
Sanjay Patel a87b74f72b [InstSimplify] add more tests for FP undef; NFC
llvm-svn: 327012
2018-03-08 15:39:39 +00:00
Pavel Labath b136c3934e DWARFVerifier: Basic verification of .debug_names
Summary:
This patch adds basic .debug_names verification capabilities to the
DWARF verifier. Right now, it checks that the headers and abbreviation
tables of the individual name indexes can be parsed correctly, it
verifies the buckets table and the cross-checks the CU lists for
consistency. I intend to add further checks in follow-up patches.

Reviewers: JDevlieghere, aprantl, probinson, dblaikie

Subscribers: vleschuk, echristo, clayborg, llvm-commits

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

llvm-svn: 327011
2018-03-08 15:34:42 +00:00
Andrea Di Biagio 7bbac07f22 [llvm-mca] Emit the 'Instruction Info' table before the resource pressure view.
In future, both the summary information and the 'instruction info' table should
be moved into a separate "Summary" view.

llvm-svn: 327010
2018-03-08 15:34:38 +00:00
Eric Liu 2e1980bde1 [clangd:vscode] Resolve symlinks for file paths from clangd.
Summary:
For features like go-to-definition, clangd can point clients to symlink paths
(e.g. in bazel execroot) which might not be desired if the symlink points to a
file in the workspace. Clangd might not be able to build the file, and users
might prefer to edit the file on the real path.

This change converts file paths from clangd to real path (e.g. resolving symlinks).
Long term, we might want to the symlink handling logic to clangd where clangd
can better decide whether symlinks should be resolved according to e.g. compile
commands.

Reviewers: sammccall

Subscribers: klimek, ilya-biryukov, jkorous-apple, cfe-commits

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

llvm-svn: 327009
2018-03-08 15:28:42 +00:00
Alexey Bataev 2e0cbe5092 [OPENMP] Emit sizes/init ptrs etc. data for task reductions before
using.

We may emit the code in wrong order because of incorrect implementation
of the runtime functions for task reductions. Threadprivate storages may
be initialized after real initialization of the reduction items. Patch
fixes this problem.

llvm-svn: 327008
2018-03-08 15:24:08 +00:00
Michal Gorny 93176a813a [cmake] Append -Wl,-rpath-link conditionally to GNULD
Append -Wl,-rpath-link conditionally to whether GNU ld.bfd is used
rather than the Linux+!gold conditionals. Also move it out of 'else'
branch of *BSD handling. This fixes build failures with ld.bfd
on Gentoo/FreeBSD, and should cause no harm on other systems using
ld.bfd.

This patch improves the original logic by reusing results of linker
detection introduced in r307852.

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

llvm-svn: 327007
2018-03-08 15:09:38 +00:00
George Rimar 1136ec64e8 [ELF] - Fix crash relative to SHF_LINK_ORDER sections.
Our code assumes all input sections in an output SHF_LINK_ORDER
section has SHF_LINK_ORDER flag. We do not check that and that can cause a crash.

That happens because we call 
std::stable_sort(Sections.begin(), Sections.end(), compareByFilePosition);, 
where compareByFilePosition predicate does not expect to see
null when calls getLinkOrderDep. 

The same might happen when sections refer to non-regular sections. 
Test cases demonstrate the issues, patch fixes them.

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

llvm-svn: 327006
2018-03-08 15:06:58 +00:00
Marshall Clow 6d1aec1260 Implement LWG#2518 - Non-member swap for propagate_const should call member swap
llvm-svn: 327005
2018-03-08 15:01:50 +00:00
Sanjay Patel 4ad3c32144 [InstCombine, NewGVN] remove FP undef from tests
I'm trying to preserve the intent of these tests by using 
non-undef operands; if we fix FP undef folding these tests
will not pass.

llvm-svn: 327004
2018-03-08 14:57:08 +00:00
George Rimar 9e2c8a9db1 [ELF] - Support "INSERT AFTER" statement.
This implements INSERT AFTER in a following way:

During reading scripts it collects all insert statements.
After we done and read all files it inserts statements into script commands list.

With that:
* Rest of code does know nothing about INSERT.
* Approach is straightforward and have no visible limitations.
* It is also easy to support INSERT BEFORE (was seen in clang code once).
* Should work for PR35877 and similar cases.

Cons:
* It assumes we have "main" scripts that describes sections.

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

llvm-svn: 327003
2018-03-08 14:54:38 +00:00
David Zarzycki 9003b3b76d [CMake] Add missing test dependency
This makes 'ninja clean ; ninja check-all' work again.

llvm-svn: 327002
2018-03-08 14:43:24 +00:00
Hans Wennborg aee5881a85 [COFF] Make the DOS stub a real DOS program
It only adds a few bytes and is nice for backward compatibility.

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

llvm-svn: 327001
2018-03-08 14:27:28 +00:00
Ed Maste 1ba49ee897 Use ellipsis ... to indicate omitted commands
In an example like "clang -fxray-instrument .." the .. could be confused
with a literal .. (parent directory), which is used in commands like
"cmake -GNinja .."

llvm-svn: 327000
2018-03-08 13:52:04 +00:00
Andrea Di Biagio a2a940d9a7 Add llvm-mca.rst to the table of contents in docs/CommandGuide.
This should fix the documentation error reported by builder llvm-sphinx-docs
(build #16407) after r326998.

llvm-svn: 326999
2018-03-08 13:43:11 +00:00
Andrea Di Biagio 3a6b092017 [llvm-mca] LLVM Machine Code Analyzer.
llvm-mca is an LLVM based performance analysis tool that can be used to
statically measure the performance of code, and to help triage potential
problems with target scheduling models.

llvm-mca uses information which is already available in LLVM (e.g. scheduling
models) to statically measure the performance of machine code in a specific cpu.
Performance is measured in terms of throughput as well as processor resource
consumption. The tool currently works for processors with an out-of-order
backend, for which there is a scheduling model available in LLVM.

The main goal of this tool is not just to predict the performance of the code
when run on the target, but also help with diagnosing potential performance
issues.

Given an assembly code sequence, llvm-mca estimates the IPC (instructions per
cycle), as well as hardware resources pressure. The analysis and reporting style
were mostly inspired by the IACA tool from Intel.

This patch is related to the RFC on llvm-dev visible at this link:
http://lists.llvm.org/pipermail/llvm-dev/2018-March/121490.html

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

llvm-svn: 326998
2018-03-08 13:05:02 +00:00
Krasimir Georgiev a71f626eac [clang-format] Use NestedBlockIndent as a 0 column in formatted raw strings
Summary:
This makes the formatter of raw string literals use NestedBlockIndent for
determining the 0 column of the content inside. This makes the formatting use
less horizonal space and fixes a case where two newlines before and after the
raw string prefix were selected instead of a single newline after it:

Before:
```
aaaa = ffff(
    R"pb(
      key: value)pb");
```

After:
```
aaaa = ffff(R"pb(
    key: value)pb");
```

Reviewers: djasper, sammccall

Reviewed By: sammccall

Subscribers: klimek, cfe-commits

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

llvm-svn: 326996
2018-03-08 11:29:27 +00:00
James Henderson 667026297d [DWARF] Don't attempt to parse line tables at invalid offsets
Whilst working on improvements to the error handling of the debug line
parsing code, I noticed that if an invalid offset were to be specified
in a call to getOrParseLineTable(), an entry in the LineTableMap would
still be created, even if the offset was not within the section range.
The immediate parsing attempt afterwards would fail (it would end up
getting a version of 0), and thereafter, any subsequent calls to
getOrParseLineTable or getLineTable would return the default-
constructed, invalid line table. In reality, we shouldn't even attempt
to parse this table, and we should always return a nullptr from these
two functions for this situation.

I have tested this via a unit test, which required some new framework
for unit testing debug line. My plan is to add quite a few more unit
tests for the new error reporting mechanism that will follow shortly,
hence the reason why the supporting code for the tests are written the
way they are - I intend to extend the DwarfGenerator class to support
generating debug line. At that point, I'll make sure that there are a
few positive test cases for this and the parsing code too.

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

Reviewers: JDevlieghere, aprantl
llvm-svn: 326995
2018-03-08 10:53:34 +00:00
Jonas Devlieghere 2902a21ef3 [dsymutil] Embed toolchain in dSYM bundle
Allow us to embed the (Xcode) toolchain in the dSYM bundle's property
list.

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

llvm-svn: 326994
2018-03-08 10:39:12 +00:00
Andrea Di Biagio 30e94029d8 [MCSchedule] Always generate processor resource names.
With this patch, the tablegen 'SubtargetEmitter' always generates processor
resource names. 
The impact of this patch on the code size of other llvm tools is small.  I have
observed an average increase of 0.03% in code size when doing a release build of
LLVM (on windows, using MSVC) with all the default backends.

This change is done in preparation for the upcoming llvm-mca patch.

llvm-svn: 326993
2018-03-08 10:38:45 +00:00
Craig Topper a406796f5f [X86] Change X86::PMULDQ/PMULUDQ opcodes to take vXi64 type as input instead of vXi32.
This instruction can be thought of as reading either the even elements of a vXi32 input or the lower half of each element of a vXi64 input. We currently use the vXi32 interpretation, but vXi64 matches better with its broadcast behavior in EVEX.

I'm looking at moving MULDQ/MULUDQ creation to a DAG combine so we can do it when AVX512DQ is enabled without having to go through Custom lowering. But in some of the test cases we failed to use a broadcast load due to the size difference. This should help with that.

I'm also wondering if we can model these instructions in native IR and remove the intrinsics and I think using a vXi64 type will work better with that.

llvm-svn: 326991
2018-03-08 08:02:52 +00:00
Stephan Bergmann 0feb0b9059 Propagate DLLAttr to friend re-declarations of member functions
...that have already been constructed (e.g., in inner classes) while parsing the
class definition.  They would otherwise lack any DLLAttr inherited from the
class, which are only set here (called from Sema::CheckCompletedClass) after the
class definition has been parsed completely.

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

llvm-svn: 326990
2018-03-08 07:34:40 +00:00
Tony Tye 5bbcca6967 [AMDGPU] Update AMDGOUUsage.rst descriptions
- Improve description of XNACK ELF flag.
- Rename all uses of wave to wavefront to be consistent.

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

llvm-svn: 326989
2018-03-08 05:46:01 +00:00
George Burgess IV 003be7cbf4 [CodeGen] Emit lifetime.ends in both EH and non-EH blocks
Before this, we'd only emit lifetime.ends for these temps in
non-exceptional paths. This potentially made our stack larger than it
needed to be for any code that follows an EH cleanup. e.g. in

```
struct Foo { char cs[32]; };

void escape(void *);

struct Bar { ~Bar() { char cs[64]; escape(cs); } };

Foo getFoo();

void baz() {
  Bar b;
  getFoo();
}
```

baz() would require 96 bytes of stack, since the temporary from getFoo()
only had a lifetime.end on the non-exceptional path.

This also makes us keep hold of the Value* returned by
EmitLifetimeStart, so we don't have to remake it later.

llvm-svn: 326988
2018-03-08 05:32:30 +00:00
Eugene Zemtsov e465a84f85 Build LLVMDemangle from build_symbolizer.sh
Symbolizer now depends on internal implementation of itaniumDemangle.

llvm-svn: 326987
2018-03-08 04:34:22 +00:00
Heejin Ahn 2dce27d852 [WebAssembly] Add except_ref as a first-class type
Summary:
Add except_ref as a first-class type, according to the [[https://github.com/WebAssembly/exception-handling/blob/master/proposals/Level-1.md | Level 1 exception handling proposal ]].
Companion to D43706.

Reviewers: sbc100

Subscribers: jfb, dschuff, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 326986
2018-03-08 04:06:57 +00:00
Heejin Ahn 0de587296e [WebAssembly] Add except_ref as a first-class type
Summary: Add except_ref as a first-class type, according to the [[https://github.com/WebAssembly/exception-handling/blob/master/proposals/Level-1.md | Level 1 exception handling proposal ]].

Reviewers: dschuff

Subscribers: jfb, sbc100, llvm-commits

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

llvm-svn: 326985
2018-03-08 04:05:37 +00:00
Heejin Ahn 3f8d38fcf2 [WebAssembly] Add IntrNoReturn property to throw/rethrow intrinsics
Reviewers: dschuff

Subscribers: jfb, sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 326984
2018-03-08 03:47:52 +00:00
Eugene Zemtsov 824189f624 Add Demangle lib into internalization list
Symbolizer now depends on internal implementation of itaniumDemangle.

llvm-svn: 326983
2018-03-08 02:57:54 +00:00
George Karpenkov 04b9dc58b8 [analyzer] Correctly model iteration through "nil" objects
Previously, iteration through nil objects which resulted from
objc-messages being set to nil were modeled incorrectly.

There are a couple of notes about this patch:

In principle, ExprEngineObjC might be left untouched IFF osx.loops
checker is enabled.
I however think that we should not do something
completely incorrect depending on what checkers are left on.
We should evaluate and potentially remove altogether the isConsumedExpr
performance heuristic, as it seems very fragile.

rdar://22205149

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

llvm-svn: 326982
2018-03-08 02:53:39 +00:00