platform/upstream/llvm.git
5 years agomodify-python-lldb.py: Remove docstring formatting code
Pavel Labath [Sun, 21 Apr 2019 12:48:53 +0000 (12:48 +0000)]
modify-python-lldb.py: Remove docstring formatting code

The strings have been already cleaned up in r358683, so this code is not
doing anything anymore.

While comparing the outputs before and after removing the formatting
code, I've found a couple of docstrings that managed to escape my perl
script in r358683, so I format them manually with this patch.

llvm-svn: 358846

5 years ago[ARM] Rewrite isLegalT2AddressImmediate
David Green [Sun, 21 Apr 2019 09:54:29 +0000 (09:54 +0000)]
[ARM] Rewrite isLegalT2AddressImmediate

This does two main things, firstly adding some at least basic addressing modes
for i64 types, and secondly treats floats and doubles sensibly when there is no
fpu. The floating point change can help codesize in some cases, especially with
D60294.

Most backends seems to not consider the exact VT in isLegalAddressingMode,
instead switching on type size. That is now what this does when the target does
not have an fpu (as the float data will be loaded using LDR's). i64's currently
use the address range of an LDRD (even though they may be legalised and loaded
with an LDR). This is at least better than marking them all as illegal
addressing modes.

I have not attempted to do much with vectors yet. That will need changing once
MVE is added.

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

llvm-svn: 358845

5 years ago[X86] Add the rounding control operand to the printing for some scalar FMA instructions.
Craig Topper [Sun, 21 Apr 2019 07:12:56 +0000 (07:12 +0000)]
[X86] Add the rounding control operand to the printing for some scalar FMA instructions.

llvm-svn: 358844

5 years ago[CachePruning] Simplify comparator
Fangrui Song [Sun, 21 Apr 2019 06:17:40 +0000 (06:17 +0000)]
[CachePruning] Simplify comparator

llvm-svn: 358843

5 years ago[JITLink] Add dependency on MCParser to unit test after rL358818
Fangrui Song [Sun, 21 Apr 2019 06:12:00 +0000 (06:12 +0000)]
[JITLink] Add dependency on MCParser to unit test after rL358818

This is required by -DBUILD_SHARED_LIBS=on builds for createMCAsmParser.

llvm-svn: 358842

5 years ago[X86] Don't form masked vfpclass instruction from and+vfpclass unless the fpclass...
Craig Topper [Sun, 21 Apr 2019 05:18:04 +0000 (05:18 +0000)]
[X86] Don't form masked vfpclass instruction from and+vfpclass unless the fpclass only has a single use.

llvm-svn: 358841

5 years ago[JITLink] Remove an overly strict error check in JITLink's eh-frame parser.
Lang Hames [Sun, 21 Apr 2019 04:48:32 +0000 (04:48 +0000)]
[JITLink] Remove an overly strict error check in JITLink's eh-frame parser.

The error check required FDEs to refer to the most recent CIE, but the eh-frame
spec allows them to refer to any previously seen CIE. This patch removes the
offending check.

llvm-svn: 358840

5 years ago[BinaryFormat] Fix bitfield-ordering of MachO::relocation_info on big-endian.
Lang Hames [Sun, 21 Apr 2019 03:14:43 +0000 (03:14 +0000)]
[BinaryFormat] Fix bitfield-ordering of MachO::relocation_info on big-endian.

Hopefully this will fix the JITLink regression test failures on big-endian
testers (e.g.
http://lab.llvm.org:8011/builders/clang-s390x-linux-lnt/builds/12702)

llvm-svn: 358839

5 years ago[JITLink] Factor basic common GOT and stub creation code into its own class.
Lang Hames [Sun, 21 Apr 2019 03:14:42 +0000 (03:14 +0000)]
[JITLink] Factor basic common GOT and stub creation code into its own class.

llvm-svn: 358838

5 years ago[gn] Move Features.inc to clangd, create a config for it
Petr Hosek [Sun, 21 Apr 2019 01:09:15 +0000 (01:09 +0000)]
[gn] Move Features.inc to clangd, create a config for it

ClangdLSPServer and clangd unittests now include Features.inc so we
need to append the target_gen_dir that contains it to their
include_dirs. To do so, we use a public config that's applied to
any target that depends on the features one.

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

llvm-svn: 358837

5 years ago[JITLink] Add dependencies on MCDissassembler and Target to unit test.
Lang Hames [Sun, 21 Apr 2019 00:35:58 +0000 (00:35 +0000)]
[JITLink] Add dependencies on MCDissassembler and Target to unit test.

llvm-svn: 358836

5 years agollvm-undname: Improve string literal demangling with embedded \0 chars
Nico Weber [Sat, 20 Apr 2019 23:59:06 +0000 (23:59 +0000)]
llvm-undname: Improve string literal demangling with embedded \0 chars

- Don't assert when a string looks like a u32 string to the heuristic
  but doesn't have a length that's 0 mod 4.  Instead, classify those
  as u16 with embedded \0 chars. Found by oss-fuzz.
- Print embedded nul bytes as \0 instead of \x00.

llvm-svn: 358835

5 years agoftime-trace: Trace the name of the currently active pass as well.
Nico Weber [Sat, 20 Apr 2019 23:22:45 +0000 (23:22 +0000)]
ftime-trace: Trace the name of the currently active pass as well.

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

llvm-svn: 358834

5 years ago[JITLink] Add yet more detail to MachO/x86-64 unsupported relocation errors.
Lang Hames [Sat, 20 Apr 2019 22:59:43 +0000 (22:59 +0000)]
[JITLink] Add yet more detail to MachO/x86-64 unsupported relocation errors.

Knowing the address/symbolnum field values makes it easier to identify the
unsupported relocation, and provides enough information for the full bit
pattern of the relocation to be reconstructed.

llvm-svn: 358833

5 years ago[JITLink][ORC] Add JITLink to the list of dependencies for ORC.
Lang Hames [Sat, 20 Apr 2019 22:15:57 +0000 (22:15 +0000)]
[JITLink][ORC] Add JITLink to the list of dependencies for ORC.

The new ObjectLinkingLayer in ORC depends on JITLink.

This should fix the build error at
http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/9621

llvm-svn: 358832

5 years ago[JITLink] Fix a bad formatv format string.
Lang Hames [Sat, 20 Apr 2019 22:06:12 +0000 (22:06 +0000)]
[JITLink] Fix a bad formatv format string.

llvm-svn: 358831

5 years ago[JITLink] Disable MachO/x86-64 regression test if the X86 target is not built.
Lang Hames [Sat, 20 Apr 2019 21:32:49 +0000 (21:32 +0000)]
[JITLink] Disable MachO/x86-64 regression test if the X86 target is not built.

llvm-svn: 358830

5 years agoRevert r358800. Breaks Obsequi from the test suite.
Amara Emerson [Sat, 20 Apr 2019 21:25:00 +0000 (21:25 +0000)]
Revert r358800. Breaks Obsequi from the test suite.

The last attempt fixed gcc and consumer-typeset, but Obsequi seems to fail with
a different issue.

llvm-svn: 358829

5 years ago[JITLink] Add llvm-jitlink to the list of available tools in lit.
Lang Hames [Sat, 20 Apr 2019 20:05:30 +0000 (20:05 +0000)]
[JITLink] Add llvm-jitlink to the list of available tools in lit.

Should fix the 'llvm-jitlink command not found' errors that are appearing on
some builders.

llvm-svn: 358828

5 years ago[JITLink] Add BinaryFormat to JITLink's dependencies.
Lang Hames [Sat, 20 Apr 2019 19:48:45 +0000 (19:48 +0000)]
[JITLink] Add BinaryFormat to JITLink's dependencies.

Hopefully this will fix the missing dependence on llvm::identify_magic that is
showing up on some PPC bots. E.g.

http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/9617

llvm-svn: 358827

5 years ago[JITLink] Add more detail to MachO/x86-64 "unsupported relocation" errors.
Lang Hames [Sat, 20 Apr 2019 18:50:13 +0000 (18:50 +0000)]
[JITLink] Add more detail to MachO/x86-64 "unsupported relocation" errors.

The extra information here will be helpful in diagnosing errors, like the
ones currently occuring on the PPC big-endian bots. :)

llvm-svn: 358826

5 years ago[JITLink] Add check to JITLink unit test to bail out for unsupported targets.
Lang Hames [Sat, 20 Apr 2019 18:30:17 +0000 (18:30 +0000)]
[JITLink] Add check to JITLink unit test to bail out for unsupported targets.

This should prevent spurious JITLink unit test failures for builds that do not
support the target(s) required by the tests.

llvm-svn: 358825

5 years ago[JITLink] Silence some MSVC implicit cast warnings.
Lang Hames [Sat, 20 Apr 2019 18:30:16 +0000 (18:30 +0000)]
[JITLink] Silence some MSVC implicit cast warnings.

llvm-svn: 358824

5 years ago[JITLink] Add llvm-jitlink subdirectory to tools/LLVMBuild.txt
Lang Hames [Sat, 20 Apr 2019 17:58:29 +0000 (17:58 +0000)]
[JITLink] Add llvm-jitlink subdirectory to tools/LLVMBuild.txt

llvm-svn: 358823

5 years ago[JITLink] Use memset instead of bzero.
Lang Hames [Sat, 20 Apr 2019 17:49:58 +0000 (17:49 +0000)]
[JITLink] Use memset instead of bzero.

llvm-svn: 358822

5 years ago[JITLink] Silence a narrowing conversion warning.
Lang Hames [Sat, 20 Apr 2019 17:37:09 +0000 (17:37 +0000)]
[JITLink] Silence a narrowing conversion warning.

llvm-svn: 358821

5 years ago[JITLink] Update BuildingAJIT tutorials to account for API changes in r358818.
Lang Hames [Sat, 20 Apr 2019 17:35:28 +0000 (17:35 +0000)]
[JITLink] Update BuildingAJIT tutorials to account for API changes in r358818.

DynamicLibrarySearchGenerator::GetForCurrentProcess now takes a char (the global
prefix) rather than a DataLayout reference.

llvm-svn: 358820

5 years ago[JITLink] Fix a missing header and bad prototype.
Lang Hames [Sat, 20 Apr 2019 17:29:57 +0000 (17:29 +0000)]
[JITLink] Fix a missing header and bad prototype.

llvm-svn: 358819

5 years agoInitial implementation of JITLink - A replacement for RuntimeDyld.
Lang Hames [Sat, 20 Apr 2019 17:10:34 +0000 (17:10 +0000)]
Initial implementation of JITLink - A replacement for RuntimeDyld.

Summary:

JITLink is a jit-linker that performs the same high-level task as RuntimeDyld:
it parses relocatable object files and makes their contents runnable in a target
process.

JITLink aims to improve on RuntimeDyld in several ways:

(1) A clear design intended to maximize code-sharing while minimizing coupling.

RuntimeDyld has been developed in an ad-hoc fashion for a number of years and
this had led to intermingling of code for multiple architectures (e.g. in
RuntimeDyldELF::processRelocationRef) in a way that makes the code more
difficult to read, reason about, extend. JITLink is designed to isolate
format and architecture specific code, while still sharing generic code.

(2) Support for native code models.

RuntimeDyld required the use of large code models (where calls to external
functions are made indirectly via registers) for many of platforms due to its
restrictive model for stub generation (one "stub" per symbol). JITLink allows
arbitrary mutation of the atom graph, allowing both GOT and PLT atoms to be
added naturally.

(3) Native support for asynchronous linking.

JITLink uses asynchronous calls for symbol resolution and finalization: these
callbacks are passed a continuation function that they must call to complete the
linker's work. This allows for cleaner interoperation with the new concurrent
ORC JIT APIs, while still being easily implementable in synchronous style if
asynchrony is not needed.

To maximise sharing, the design has a hierarchy of common code:

(1) Generic atom-graph data structure and algorithms (e.g. dead stripping and
 |  memory allocation) that are intended to be shared by all architectures.
 |
 + -- (2) Shared per-format code that utilizes (1), e.g. Generic MachO to
       |  atom-graph parsing.
       |
       + -- (3) Architecture specific code that uses (1) and (2). E.g.
                JITLinkerMachO_x86_64, which adds x86-64 specific relocation
                support to (2) to build and patch up the atom graph.

To support asynchronous symbol resolution and finalization, the callbacks for
these operations take continuations as arguments:

  using JITLinkAsyncLookupContinuation =
      std::function<void(Expected<AsyncLookupResult> LR)>;

  using JITLinkAsyncLookupFunction =
      std::function<void(const DenseSet<StringRef> &Symbols,
                         JITLinkAsyncLookupContinuation LookupContinuation)>;

  using FinalizeContinuation = std::function<void(Error)>;

  virtual void finalizeAsync(FinalizeContinuation OnFinalize);

In addition to its headline features, JITLink also makes other improvements:

  - Dead stripping support: symbols that are not used (e.g. redundant ODR
    definitions) are discarded, and take up no memory in the target process
    (In contrast, RuntimeDyld supported pointer equality for weak definitions,
    but the redundant definitions stayed resident in memory).

  - Improved exception handling support. JITLink provides a much more extensive
    eh-frame parser than RuntimeDyld, and is able to correctly fix up many
    eh-frame sections that RuntimeDyld currently (silently) fails on.

  - More extensive validation and error handling throughout.

This initial patch supports linking MachO/x86-64 only. Work on support for
other architectures and formats will happen in-tree.

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

llvm-svn: 358818

5 years ago[X86] Disable argument copy elision for arguments passed via pointers
Craig Topper [Sat, 20 Apr 2019 15:26:44 +0000 (15:26 +0000)]
[X86] Disable argument copy elision for arguments passed via pointers

Summary:
If you pass two 1024 bit vectors in IR with AVX2 on Windows 64. Both vectors will be split in four 256 bit pieces. The four pieces of the first argument will be passed indirectly using 4 gprs. The second argument will get passed via pointers in memory.

The PartOffsets stored for the second argument are all in terms of its original 1024 bit size. So the PartOffsets for each piece are 32 bytes apart. So if we consider it for copy elision we'll only load an 8 byte pointer, but we'll move the address 32 bytes. The stack object size we create for the first part is probably wrong too.

This issue was encountered by ISPC. I'm working on getting a reduce test case, but wanted to go ahead and get feedback on the fix.

Reviewers: rnk

Reviewed By: rnk

Subscribers: dbabokin, llvm-commits, hiraditya

Tags: #llvm

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

llvm-svn: 358817

5 years ago[CorrelatedValuePropagation] Mark subs that we know not to wrap with nuw/nsw.
Luqman Aden [Sat, 20 Apr 2019 13:14:18 +0000 (13:14 +0000)]
[CorrelatedValuePropagation] Mark subs that we know not to wrap with nuw/nsw.

Summary:
Teach CorrelatedValuePropagation to also handle sub instructions in addition to add. Relatively simple since makeGuaranteedNoWrapRegion already understood sub instructions. Only subtle change is which range is passed as "Other" to that function, since sub isn't commutative.

Note that CorrelatedValuePropagation::processAddSub is still hidden behind a default-off flag as IndVarSimplify hasn't yet been fixed to strip the added nsw/nuw flags and causes a miscompile. (PR31181)

Reviewers: sanjoy, apilipenko, nikic

Reviewed By: nikic

Subscribers: hiraditya, jfb, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 358816

5 years ago[ExecutionDomainFix] Optimize a binary search insertion
Fangrui Song [Sat, 20 Apr 2019 13:00:50 +0000 (13:00 +0000)]
[ExecutionDomainFix] Optimize a binary search insertion

llvm-svn: 358815

5 years ago[llvm-symbolizer] Fix section index at the end of a section
Fangrui Song [Sat, 20 Apr 2019 13:00:09 +0000 (13:00 +0000)]
[llvm-symbolizer] Fix section index at the end of a section

This is very minor issue. The returned section index is only used by
DWARFDebugLine as an llvm::upper_bound input and the use case shouldn't
cause any behavioral change.

llvm-svn: 358814

5 years ago[IndVarSimplify] Generate full checks for some LFTR tests; NFC
Nikita Popov [Sat, 20 Apr 2019 12:05:53 +0000 (12:05 +0000)]
[IndVarSimplify] Generate full checks for some LFTR tests; NFC

llvm-svn: 358813

5 years ago[IndVarSimplify] Add tests for PR31181; NFC
Nikita Popov [Sat, 20 Apr 2019 12:05:43 +0000 (12:05 +0000)]
[IndVarSimplify] Add tests for PR31181; NFC

llvm-svn: 358812

5 years ago[ADT] Avoid warning in bsearch testcase
Sam McCall [Sat, 20 Apr 2019 11:48:11 +0000 (11:48 +0000)]
[ADT] Avoid warning in bsearch testcase

llvm-svn: 358811

5 years ago[LLD][ELF] - Fix mistype. NFC.
George Rimar [Sat, 20 Apr 2019 10:50:27 +0000 (10:50 +0000)]
[LLD][ELF] - Fix mistype. NFC.

Change the tripple name from
aarch64-linux-gnux to -triple=aarch64-linux-gnu

llvm-svn: 358810

5 years ago[llvm-objdump] Fix End in disassemblyObject after rL358806
Fangrui Song [Sat, 20 Apr 2019 07:48:41 +0000 (07:48 +0000)]
[llvm-objdump] Fix End in disassemblyObject after rL358806

llvm-svn: 358809

5 years ago[CVP] Add tests for sub nowrap inference; NFC
Nikita Popov [Sat, 20 Apr 2019 07:43:15 +0000 (07:43 +0000)]
[CVP] Add tests for sub nowrap inference; NFC

These are baseline tests for D60036.

Patch by Luqman Aden.

llvm-svn: 358808

5 years ago[X86] Fix stack probing on x32 (PR41477)
Nikita Popov [Sat, 20 Apr 2019 07:25:46 +0000 (07:25 +0000)]
[X86] Fix stack probing on x32 (PR41477)

Fix for https://bugs.llvm.org/show_bug.cgi?id=41477. On the x32 ABI
with stack probing a dynamic alloca will result in a WIN_ALLOCA_32
with a 32-bit size. The current implementation tries to copy it into
RAX, resulting in a physreg copy error. Fix this by copying to EAX
instead. Also fix incorrect opcodes or registers used in subs.

llvm-svn: 358807

5 years ago[llvm-objdump] Don't disassemble symbols before SectionAddr
Fangrui Song [Sat, 20 Apr 2019 07:19:24 +0000 (07:19 +0000)]
[llvm-objdump] Don't disassemble symbols before SectionAddr

This was caught by UBSAN

tools/llvm-objdump/X86/macho-disassembly-g-dsym.test
tools/llvm-objdump/X86/hex-displacement.test

llvm-svn: 358806

5 years ago[X86] Don't turn (and (shl X, C1), C2) into (shl (and X, (C1 >> C2), C2) if the origi...
Craig Topper [Sat, 20 Apr 2019 04:38:53 +0000 (04:38 +0000)]
[X86] Don't turn (and (shl X, C1), C2) into (shl (and X, (C1 >> C2), C2) if the original AND can represented by MOVZX.

The MOVZX doesn't require an immediate to be encoded at all. Though it does use
a 2 byte opcode so its the same size as a 1 byte immediate. But it has a
separate source and dest register so can help avoid copies.

llvm-svn: 358805

5 years ago[X86] Turn (and (anyextend (shl X, C1), C2)) into (shl (and (anyextend X), (C1 >...
Craig Topper [Sat, 20 Apr 2019 04:38:49 +0000 (04:38 +0000)]
[X86] Turn (and (anyextend (shl X, C1), C2)) into (shl (and (anyextend X), (C1 >> C2), C2) if the AND could match a movzx.

There's one slight regression in here because we don't check that the immediate
already allowed movzx before the shift. I'll fix that next.

llvm-svn: 358804

5 years ago[llvm-objdump] Simplify --{start,stop}-address
Fangrui Song [Sat, 20 Apr 2019 02:10:48 +0000 (02:10 +0000)]
[llvm-objdump] Simplify --{start,stop}-address

llvm-svn: 358803

5 years ago[TSan] Support fiber API on macOS
Julian Lettner [Sat, 20 Apr 2019 00:18:44 +0000 (00:18 +0000)]
[TSan] Support fiber API on macOS

Committing on behalf of Yuri Per (yuri).

Reviewers: dvyukov, kubamracek, yln

Reviewed By: kubamracek

Authored By: yuri

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

llvm-svn: 358802

5 years ago[WebAssembly] Object: Improve error messages on invalid section
Sam Clegg [Sat, 20 Apr 2019 00:11:46 +0000 (00:11 +0000)]
[WebAssembly] Object: Improve error messages on invalid section

Also add a test.

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

llvm-svn: 358801

5 years agoRevert "Revert "[GlobalISel] Add legalization support for non-power-2 loads and stores""
Amara Emerson [Fri, 19 Apr 2019 23:54:44 +0000 (23:54 +0000)]
Revert "Revert "[GlobalISel] Add legalization support for non-power-2 loads and stores""

We were shifting the wrong component of a split load when trying to combine them
back into a single value.

llvm-svn: 358800

5 years ago[GlobalISel][AArch64] Legalize + select G_FRINT
Jessica Paquette [Fri, 19 Apr 2019 23:41:52 +0000 (23:41 +0000)]
[GlobalISel][AArch64] Legalize + select G_FRINT

Exactly the same as G_FCEIL, G_FABS, etc.

Add tests for the fp16/nofp16 behaviour, update arm64-vfloatintrinsics, etc.

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

llvm-svn: 358799

5 years ago[WebAssembly] Emit the DataCount section when bulk memory is enabled
Thomas Lively [Fri, 19 Apr 2019 23:40:36 +0000 (23:40 +0000)]
[WebAssembly] Emit the DataCount section when bulk memory is enabled

Summary:
The DataCount section is necessary for the bulk memory operations
memory.init and data.drop to validate, but it is not recognized by
engines that do not support bulk memory, so emit the section only if
bulk-memory is enabled.

Reviewers: aheejin, dschuff, sbc100

Subscribers: jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 358798

5 years ago[analyzer] Move UninitializedObjectChecker out of alpha
Kristof Umann [Fri, 19 Apr 2019 23:33:50 +0000 (23:33 +0000)]
[analyzer] Move UninitializedObjectChecker out of alpha

Moved UninitializedObjectChecker from the 'alpha.cplusplus' to the
'optin.cplusplus' package.

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

llvm-svn: 358797

5 years agoModules: Adopt template parameters for variable templates to set their decl context...
David Blaikie [Fri, 19 Apr 2019 23:04:05 +0000 (23:04 +0000)]
Modules: Adopt template parameters for variable templates to set their decl context correctly

Exposed by a related bug about visibility of default arguments of nested
templates - without the correct decl context, default template
parameters of variable templates nested in classes would have incorrect
visibility computed.

llvm-svn: 358796

5 years agoModules: Search for a visible definition of the decl context when computing visibilit...
David Blaikie [Fri, 19 Apr 2019 23:02:30 +0000 (23:02 +0000)]
Modules: Search for a visible definition of the decl context when computing visibility of a default template parameter

The code is/was already correct for the case where a parameter is a
parameter of its enclosing lexical DeclContext (functions and classes).
But for other templates (alias and variable templates) they don't create
their own scope to be members of - in those cases, they parameter should
be considered visible if any definition of the lexical decl context is
visible.

[this should cleanup the failure on the libstdc++ modules buildbot]
[this doesn't actually fix the variable template case for a
secondary/compounding reason (its lexical decl context is incorrectly
considered to be the translation unit)]

Test covers all 4 kinds of templates with default args, including a
regression test for the still broken variable template case.

Reviewers: rsmith

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

llvm-svn: 358795

5 years ago[COFF] Pack Name in Symbol as is done in ELF
Reid Kleckner [Fri, 19 Apr 2019 22:51:49 +0000 (22:51 +0000)]
[COFF] Pack Name in Symbol as is done in ELF

Summary:
This assumes all symbols are <4GB long, so we can store them as a 32-bit
integer. This reorders the fields so the length appears first, packing
with the other bitfield data in the base Symbol object.

This saved 70MB / 3.60% of heap allocations when linking
browser_tests.exe with no PDB. It's not much as a percentage, but worth
doing. I didn't do performance measurements, I don't think it will be
measurable in time.

Reviewers: ruiu, inglorion, amccarth, aganea

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 358794

5 years ago[WebAssembly] FastISel: Don't fallback to SelectionDAG after BuildMI in selectCall
Sam Clegg [Fri, 19 Apr 2019 22:43:32 +0000 (22:43 +0000)]
[WebAssembly] FastISel: Don't fallback to SelectionDAG after BuildMI in selectCall

My understanding is that once BuildMI has been called we can't fallback
to SelectionDAG.

This change moves the fallback for when getRegForValue() fails for
that target of an indirect call.  This was failing in -fPIC mode when
the callee is GlobalValue.

Add a test case that tickles this.

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

llvm-svn: 358793

5 years ago[Tests] Split float test into float and doubles
Jonas Devlieghere [Fri, 19 Apr 2019 22:37:55 +0000 (22:37 +0000)]
[Tests] Split float test into float and doubles

As I was waiting for the test suite to complete at 99% I noticed this
test taking quite a bit of time. Since it's easy to split I just went
ahead and did so.

llvm-svn: 358792

5 years ago[GVN+LICM] Use line 0 locations for better crash attribution
Vedant Kumar [Fri, 19 Apr 2019 22:36:40 +0000 (22:36 +0000)]
[GVN+LICM] Use line 0 locations for better crash attribution

This is a follow-up to r291037+r291258, which used null debug locations
to prevent jumpy line tables.

Using line 0 locations achieves the same effect, but works better for
crash attribution because it preserves the right inline scope.

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

llvm-svn: 358791

5 years agoUpdate GN files to build with r358103
Vitaly Buka [Fri, 19 Apr 2019 22:27:50 +0000 (22:27 +0000)]
Update GN files to build with r358103

llvm-svn: 358790

5 years agoRemove the EnableEarlyCSEMemSSA set of options from the legacy
Eric Christopher [Fri, 19 Apr 2019 22:18:53 +0000 (22:18 +0000)]
Remove the EnableEarlyCSEMemSSA set of options from the legacy
and new pass managers. They were default to true and not being
used.

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

llvm-svn: 358789

5 years ago[AArch64] Fix checks for AArch64MCExpr::VK_SABS flag.
Eli Friedman [Fri, 19 Apr 2019 21:58:10 +0000 (21:58 +0000)]
[AArch64] Fix checks for AArch64MCExpr::VK_SABS flag.

VK_SABS is part of the SymLoc bitfield in the variant kind which should
be compared for equality, not by checking the VK_SABS bit.

As far as I know, the existing code happened to produce the correct
results in all cases, so this is just a cleanup.

Patch by Stephen Crane.

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

llvm-svn: 358788

5 years ago[GlobalISel] Add IRTranslator support for G_FRINT
Jessica Paquette [Fri, 19 Apr 2019 21:46:12 +0000 (21:46 +0000)]
[GlobalISel] Add IRTranslator support for G_FRINT

Add it as a simple intrinsic, update arm64-irtranslator.ll.

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

llvm-svn: 358787

5 years agoAttempt to fix buildbot failure in commit 1bb57bac959ac163fd7d8a76d734ca3e0ecee6ab.
Amy Huang [Fri, 19 Apr 2019 21:44:30 +0000 (21:44 +0000)]
Attempt to fix buildbot failure in commit 1bb57bac959ac163fd7d8a76d734ca3e0ecee6ab.

llvm-svn: 358786

5 years ago[GlobalISel] Add a G_FRINT opcode
Jessica Paquette [Fri, 19 Apr 2019 21:44:16 +0000 (21:44 +0000)]
[GlobalISel] Add a G_FRINT opcode

Equivalent to SelectionDAG's frint node.

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

llvm-svn: 358785

5 years ago[X86] Add test case for D60801. NFC
Craig Topper [Fri, 19 Apr 2019 21:39:16 +0000 (21:39 +0000)]
[X86] Add test case for D60801. NFC

llvm-svn: 358784

5 years ago[MS] Emit S_HEAPALLOCSITE debug info
Amy Huang [Fri, 19 Apr 2019 21:09:11 +0000 (21:09 +0000)]
[MS] Emit S_HEAPALLOCSITE debug info

Summary:
This emits labels around heapallocsite calls and S_HEAPALLOCSITE debug
info in codeview. Currently only changes FastISel, so emitting labels still
needs to be implemented in SelectionDAG.

Reviewers: hans, rnk

Subscribers: aprantl, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 358783

5 years ago[libc++] [test] Silence C++20 deprecation warnings in the MSVC STL
Casey Carter [Fri, 19 Apr 2019 20:39:41 +0000 (20:39 +0000)]
[libc++] [test] Silence C++20 deprecation warnings in the MSVC STL

... when including msvc_stdlib_force_include.hpp.

llvm-svn: 358782

5 years agoReapply "[analyzer] Introduce a simplified API for adding custom path notes."
Artem Dergachev [Fri, 19 Apr 2019 20:23:29 +0000 (20:23 +0000)]
Reapply "[analyzer] Introduce a simplified API for adding custom path notes."

This reapplies commit r357323, fixing memory leak found by LSan.

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

llvm-svn: 358781

5 years ago[CMake] Add fuzzer as a component for runtime builds
Chris Bieneman [Fri, 19 Apr 2019 20:13:25 +0000 (20:13 +0000)]
[CMake] Add fuzzer as a component for runtime builds

Calling `add_compiler_rt_component` sets up the component connection between runtime builds and the parent CMake configuration. Adding this call allows specifying `fuzzer` as a `LLVM_RUNTIME_DISTRIBUTION_COMPONENT`.

llvm-svn: 358780

5 years ago[CMake] Pass monorepo build settings in cross compile
Chris Bieneman [Fri, 19 Apr 2019 20:08:55 +0000 (20:08 +0000)]
[CMake] Pass monorepo build settings in cross compile

This allows the cross compiled build targets to configure the LLVM tools and sub-projects that are part of the main build.

This is needed for generating native non llvm *-tablegen tools when cross compiling clang in the monorepo build environment.

llvm-svn: 358779

5 years ago[MSVC] If unable to find link.exe from a MSVC installation, look for link.exe next...
Martin Storsjo [Fri, 19 Apr 2019 19:04:22 +0000 (19:04 +0000)]
[MSVC] If unable to find link.exe from a MSVC installation, look for link.exe next to cl.exe

Previously, if the MSVC installation isn't detected properly, clang
will later just fail to execute link.exe.

This improves using clang in msvc mode on linux, where one intentionally
might not want to point clang to the MSVC installation itself (which
isn't executable as such), but where a link.exe named wine wrapper is
available in the path next to a cl.exe named wine wrapper.

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

llvm-svn: 358778

5 years ago[Docs] Add more info about building the docs
Jonas Devlieghere [Fri, 19 Apr 2019 19:03:58 +0000 (19:03 +0000)]
[Docs] Add more info about building the docs

Including the C++ and Python reference.

llvm-svn: 358777

5 years agoThis test doesn't need to be run for all debug formats.
Jim Ingham [Fri, 19 Apr 2019 18:46:56 +0000 (18:46 +0000)]
This test doesn't need to be run for all debug formats.

llvm-svn: 358776

5 years agoEnable frame pointer elimination for OpenBSD on powerpc.
Brad Smith [Fri, 19 Apr 2019 18:41:40 +0000 (18:41 +0000)]
Enable frame pointer elimination for OpenBSD on powerpc.

llvm-svn: 358775

5 years ago[gn] Support dots in CMake paths in the sync script
Petr Hosek [Fri, 19 Apr 2019 18:29:17 +0000 (18:29 +0000)]
[gn] Support dots in CMake paths in the sync script

Some file paths use dots to pick up sources from parent directories.

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

llvm-svn: 358774

5 years ago[Docs] Make Doxygen functional
Jonas Devlieghere [Fri, 19 Apr 2019 18:02:35 +0000 (18:02 +0000)]
[Docs] Make Doxygen functional

This fixes the doxygen configuration to be functional again. I removed
the customer header and footer, as well as the no-longer-existent style
sheet. I also widened the scope of the documentation, from just the
public API to include the private interfaces as well.

llvm-svn: 358773

5 years ago[LICM & MemorySSA] Make limit flags pass tuning options.
Alina Sbirlea [Fri, 19 Apr 2019 17:46:50 +0000 (17:46 +0000)]
[LICM & MemorySSA] Make limit flags pass tuning options.

Summary:
Make the flags in LICM + MemorySSA tuning options in the old and new
pass managers.

Subscribers: mehdi_amini, jlebar, Prazek, george.burgess.iv, llvm-commits

Tags: #llvm

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

llvm-svn: 358772

5 years agoRevert "[GlobalISel] Add legalization support for non-power-2 loads and stores"
Amara Emerson [Fri, 19 Apr 2019 17:42:13 +0000 (17:42 +0000)]
Revert "[GlobalISel] Add legalization support for non-power-2 loads and stores"

This introduces some runtime failures which I'll need to investigate further.

llvm-svn: 358771

5 years agoRemoved regiser dump checks from FP unit test.
Mitch Phillips [Fri, 19 Apr 2019 17:36:58 +0000 (17:36 +0000)]
Removed regiser dump checks from FP unit test.

llvm-svn: 358770

5 years ago[HWASan] Added no-FP unit test for register dump.
Mitch Phillips [Fri, 19 Apr 2019 17:36:56 +0000 (17:36 +0000)]
[HWASan] Added no-FP unit test for register dump.

Summary: Unit test for D60798.

Reviewers: eugenis

Subscribers: kubamracek, #sanitizers, llvm-commits, pcc

Tags: #sanitizers, #llvm

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

llvm-svn: 358769

5 years agoUpdated test case.
Mitch Phillips [Fri, 19 Apr 2019 17:36:55 +0000 (17:36 +0000)]
Updated test case.

llvm-svn: 358768

5 years agoAdded no-FP unit test for register dump.
Mitch Phillips [Fri, 19 Apr 2019 17:36:53 +0000 (17:36 +0000)]
Added no-FP unit test for register dump.

llvm-svn: 358767

5 years ago[OPENMP][NVPTX] target [teams distribute] simd maybe run without
Alexey Bataev [Fri, 19 Apr 2019 16:48:38 +0000 (16:48 +0000)]
[OPENMP][NVPTX] target [teams distribute] simd maybe run without
runtime.

target [teams distribute] simd costructs do not require full runtime for
the correct execution, we can run them without full runtime.

llvm-svn: 358766

5 years agoUpdate to use PipelineTuningOptions. Corresponds to llvm change: D59723.
Alina Sbirlea [Fri, 19 Apr 2019 16:32:08 +0000 (16:32 +0000)]
Update to use PipelineTuningOptions. Corresponds to llvm change: D59723.

llvm-svn: 358765

5 years ago[GlobalISel][AArch64] Legalize vector G_FPOW
Jessica Paquette [Fri, 19 Apr 2019 16:28:08 +0000 (16:28 +0000)]
[GlobalISel][AArch64] Legalize vector G_FPOW

This instruction is legalized in the same way as G_FSIN, G_FCOS, G_FLOG10, etc.

Update legalize-pow.mir and arm64-vfloatintrinsics.ll to reflect the change.

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

llvm-svn: 358764

5 years ago[NewPassManager] Adding pass tuning options: loop vectorize.
Alina Sbirlea [Fri, 19 Apr 2019 16:11:59 +0000 (16:11 +0000)]
[NewPassManager] Adding pass tuning options: loop vectorize.

Summary:
Trying to add the plumbing necessary to add tuning options to the new pass manager.
Testing with the flags for loop vectorize.

Reviewers: chandlerc

Subscribers: sanjoy, mehdi_amini, jlebar, steven_wu, dexonsmith, dang, llvm-commits

Tags: #llvm

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

llvm-svn: 358763

5 years ago[dsymutil] DwarfLinker: delete unused parameter
Fangrui Song [Fri, 19 Apr 2019 15:45:25 +0000 (15:45 +0000)]
[dsymutil] DwarfLinker: delete unused parameter

llvm-svn: 358762

5 years ago[SelectionDAG] soften splat mask assert/unreachable (PR41535)
Sanjay Patel [Fri, 19 Apr 2019 15:31:11 +0000 (15:31 +0000)]
[SelectionDAG] soften splat mask assert/unreachable (PR41535)

These are general queries, so they should not die when given
a degenerate input like an all undef mask. Callers should be
able to deal with an op that will eventually be simplified away.

llvm-svn: 358761

5 years agollvm-undname: Attempt to fix leak-on-invalid found by oss-fuzz
Nico Weber [Fri, 19 Apr 2019 14:13:11 +0000 (14:13 +0000)]
llvm-undname: Attempt to fix leak-on-invalid found by oss-fuzz

llvm-svn: 358760

5 years ago[MinGW] Add an --appcontainer flag, passed through to lld-link
Martin Storsjo [Fri, 19 Apr 2019 13:50:43 +0000 (13:50 +0000)]
[MinGW] Add an --appcontainer flag, passed through to lld-link

GNU ld doesn't have such a flag though, so this is a lld specific
option.

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

llvm-svn: 358759

5 years agoDebian: Add two missing version code in sid
Sylvestre Ledru [Fri, 19 Apr 2019 13:48:52 +0000 (13:48 +0000)]
Debian: Add two missing version code in sid

llvm-svn: 358758

5 years agoAdd support of the future Debian (Debian 11 - Bullseye)
Sylvestre Ledru [Fri, 19 Apr 2019 13:46:58 +0000 (13:46 +0000)]
Add support of the future Debian (Debian 11 - Bullseye)
https://wiki.debian.org/DebianBullseye

llvm-svn: 358757

5 years agoAdd support of the next Ubuntu (Ubuntu 19.10 - Eoan EANIMAL)
Sylvestre Ledru [Fri, 19 Apr 2019 13:43:28 +0000 (13:43 +0000)]
Add support of the next Ubuntu (Ubuntu 19.10 - Eoan EANIMAL)

llvm-svn: 358756

5 years agogn build: Merge r358722
Nico Weber [Fri, 19 Apr 2019 13:18:41 +0000 (13:18 +0000)]
gn build: Merge r358722

llvm-svn: 358755

5 years agogn build: Merge r358691
Nico Weber [Fri, 19 Apr 2019 13:16:26 +0000 (13:16 +0000)]
gn build: Merge r358691

llvm-svn: 358754

5 years ago[LTO] Add plumbing to save stats during LTO on Darwin.
Florian Hahn [Fri, 19 Apr 2019 12:36:41 +0000 (12:36 +0000)]
[LTO] Add plumbing to save stats during LTO on Darwin.

Gold and ld on Linux already support saving stats, but the
infrastructure is missing on Darwin. Unfortunately it seems like the
configuration from lib/LTO/LTO.cpp is not used.

This patch adds a new LTOStatsFile option and adds plumbing in Clang to
use it on Darwin, similar to the way remarks are handled.

Currnetly the handling of LTO flags seems quite spread out, with a bunch
of duplication. But I am not sure if there is an easy way to improve
that?

Reviewers: anemet, tejohnson, thegameg, steven_wu

Reviewed By: steven_wu

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

llvm-svn: 358753

5 years ago[analyzer][NFC] Reimplement checker options
Kristof Umann [Fri, 19 Apr 2019 12:32:10 +0000 (12:32 +0000)]
[analyzer][NFC] Reimplement checker options

TL;DR:

* Add checker and package options to the TableGen files
* Added a new class called CmdLineOption, and both Package and Checker recieved
   a list<CmdLineOption> field.
* Added every existing checker and package option to Checkers.td.
* The CheckerRegistry class
  * Received some comments to most of it's inline classes
  * Received the CmdLineOption and PackageInfo inline classes, a list of
     CmdLineOption was added to CheckerInfo and PackageInfo
  * Added addCheckerOption and addPackageOption
  * Added a new field called Packages, used in addPackageOptions, filled up in
     addPackage

Detailed description:

In the last couple months, a lot of effort was put into tightening the
analyzer's command line interface. The main issue is that it's spectacularly
easy to mess up a lenghty enough invocation of the analyzer, and the user was
given no warnings or errors at all in that case.

We can divide the effort of resolving this into several chapters:

* Non-checker analyzer configurations:
    Gather every analyzer configuration into a dedicated file. Emit errors for
    non-existent configurations or incorrect values. Be able to list these
    configurations. Tighten AnalyzerOptions interface to disallow making such
    a mistake in the future.

* Fix the "Checker Naming Bug" by reimplementing checker dependencies:
    When cplusplus.InnerPointer was enabled, it implicitly registered
    unix.Malloc, which implicitly registered some sort of a modeling checker
    from the CStringChecker family. This resulted in all of these checker
    objects recieving the name "cplusplus.InnerPointer", making AnalyzerOptions
    asking for the wrong checker options from the command line:
      cplusplus.InnerPointer:Optimisic
    istead of
      unix.Malloc:Optimistic.
    This was resolved by making CheckerRegistry responsible for checker
    dependency handling, instead of checkers themselves.

* Checker options: (this patch included!)
    Same as the first item, but for checkers.

(+ minor fixes here and there, and everything else that is yet to come)

There were several issues regarding checker options, that non-checker
configurations didn't suffer from: checker plugins are loaded runtime, and they
could add new checkers and new options, meaning that unlike for non-checker
configurations, we can't collect every checker option purely by generating code.
Also, as seen from the "Checker Naming Bug" issue raised above, they are very
rarely used in practice, and all sorts of skeletons fell out of the closet while
working on this project.

They were extremely problematic for users as well, purely because of how long
they were. Consider the following monster of a checker option:

  alpha.cplusplus.UninitializedObject:CheckPointeeInitialization=false

While we were able to verify whether the checker itself (the part before the
colon) existed, any errors past that point were unreported, easily resulting
in 7+ hours of analyses going to waste.

This patch, similarly to how dependencies were reimplemented, uses TableGen to
register checker options into Checkers.td, so that Checkers.inc now contains
entries for both checker and package options. Using the preprocessor,
Checkers.inc is converted into code in CheckerRegistry, adding every builtin
(checkers and packages that have an entry in the Checkers.td file) checker and
package option to the registry. The new addPackageOption and addCheckerOption
functions expose the same functionality to statically-linked non-builtin and
plugin checkers and packages as well.

Emitting errors for incorrect user input, being able to list these options, and
some other functionalies will land in later patches.

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

llvm-svn: 358752

5 years agoChange \r\n -> \n for llvm-symbolizer/help.test after rL358749
Fangrui Song [Fri, 19 Apr 2019 12:28:36 +0000 (12:28 +0000)]
Change \r\n -> \n for llvm-symbolizer/help.test after rL358749

llvm-svn: 358751

5 years ago[analyzer] Fix an assertion failure if plugins added dependencies
Kristof Umann [Fri, 19 Apr 2019 11:01:35 +0000 (11:01 +0000)]
[analyzer] Fix an assertion failure if plugins added dependencies

Ideally, there is no reason behind not being able to depend on checkers that
come from a different plugin (or on builtin checkers) -- however, this is only
possible if all checkers are added to the registry before resolving checker
dependencies. Since I used a binary search in my addDependency method, this also
resulted in an assertion failure (due to CheckerRegistry::Checkers not being
sorted), since the function used by plugins to register their checkers
(clang_registerCheckers) calls addDependency.

This patch resolves this issue by only noting which dependencies have to
established when addDependency is called, and resolves them at a later stage
when no more checkers are added to the registry, by which point
CheckerRegistry::Checkers is already sorted.

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

llvm-svn: 358750

5 years ago[llvm-symbolizer] Add llvm-addr2line
Igor Kudrin [Fri, 19 Apr 2019 10:17:52 +0000 (10:17 +0000)]
[llvm-symbolizer] Add llvm-addr2line

This adds an alias for llvm-symbolizer with different defaults so that
it can be used as a drop-in replacement for GNU's addr2line.

If a substring "addr2line" is found in the tool's name:
  * it defaults "-i", "-f" and "-C" to OFF;
  * it uses "--output-style=GNU" by default.

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

llvm-svn: 358749

5 years ago[llvm-symbolizer] Unhide and document the "-output-style" option
Igor Kudrin [Fri, 19 Apr 2019 10:14:18 +0000 (10:14 +0000)]
[llvm-symbolizer] Unhide and document the "-output-style" option

With the latest changes, the option gets useful for users of
llvm-symbolizer, not only for the upcoming llvm-addr2line.

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

llvm-svn: 358748

5 years ago[llvm-symbolizer] Make the output with -output-style=GNU closer to addr2line's
Igor Kudrin [Fri, 19 Apr 2019 10:12:56 +0000 (10:12 +0000)]
[llvm-symbolizer] Make the output with -output-style=GNU closer to addr2line's

This patch addresses two differences in the output of llvm-symbolizer
and GNU's addr2line:

* llvm-symbolizer prints an empty line after the report for an address.

* With "-f -i=0", llvm-symbolizer replaces the name of an inlined
  function with the name from the symbol table, i. e., the top caller
  function in the inlining chain. addr2line preserves the name of the
  inlined function.

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

llvm-svn: 358747