Commit Graph

295817 Commits

Author SHA1 Message Date
Matt Davis b4588e594f [llvm-mca][docs] Move the code marker text into its own subsection. NFC.
Also fixed a few undecorated 'llvm-mca' references to be highlighted
with the 'program' emphasis.

llvm-svn: 338900
2018-08-03 15:56:07 +00:00
Scott Linder 91f578467c [OpenCL] Always emit alloca in entry block for enqueue_kernel builtin
Ensures the statically sized alloca is not converted to DYNAMIC_STACKALLOC
later because it is not in the entry block.

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

llvm-svn: 338899
2018-08-03 15:50:52 +00:00
Jan Vesely faa1ff16c1 amdgcn: Use __constant AS for amdgcn builtins.
Fixes build after clang r338707.
Reviewer: Matthew.Arsenault@amd.com
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

llvm-svn: 338898
2018-08-03 15:14:08 +00:00
Simon Pilgrim 8ca2eff97c [X86] Fix line endings.
llvm-svn: 338897
2018-08-03 15:09:56 +00:00
Graham Yiu 58dbc00559 [Partial Inlining] Fix small bug in detecting if we did something
- It's possible for 'Changed' to return as false even if we did
  partial inline something.  Fixed to accumulate return values

llvm-svn: 338896
2018-08-03 14:42:53 +00:00
Graham Yiu 668e894ccb Fix asm label testcase flaw
- Testcase attempts to (not) grep 'g0' in output to ensure asm symbol is
  properly renamed, but g0 is too generic and can be part of the
  module's path in LLVM IR output.
- Changed to grep '@g0', which is what the proper global symbol name
  would be if not using asm.

llvm-svn: 338895
2018-08-03 14:36:44 +00:00
Nicholas Wilson e408a89a3a [WebAssembly] Cleanup of the way globals and global flags are handled
Differential Revision: https://reviews.llvm.org/D44030

llvm-svn: 338894
2018-08-03 14:33:37 +00:00
Erich Keane 873de98661 revert r338831 - Fix unused variable warning in tablegen generated code
No longer necessary thanks to r338889 (and friends).

llvm-svn: 338893
2018-08-03 14:24:34 +00:00
Martin Probst f326b6b975 clang-format: [JS] don't break comments before any '{'
Summary:
Previously, clang-format would avoid breaking before the first `{`
found, but then happily break before subsequent '{'s on the line. This
change fixes that by looking for the first location that has no opening
curly, if any.

This fixes the original commit by correcting the loop condition.

This reverts commit 66dc646e09b795b943668179c33d09da71a3b6bc.

Reviewers: krasimir

Subscribers: cfe-commits

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

llvm-svn: 338890
2018-08-03 13:58:33 +00:00
Erich Keane ad710b2cab [NFCI] My attempt to fix a warning in r338886 broke the build! Fix it.
Clang format got the best of me... it introduced spaces around something 
in a table-genned file, so it was interpreted as an array and not a 
code block.  

llvm-svn: 338889
2018-08-03 13:51:35 +00:00
Bruno Ricci f1ef886bbf [AST][NFC] Add missing doc for ObjCMethodDecl and ObjCContainerDecl
Add a comment in ObjCMethodDecl and ObjCContainerDecl stating that
we store some bits in ObjCMethodDeclBits and ObjCContainerDeclBits.

This was missed by the recent move in
r338641 : [AST][4/4] Move the bit-fields from ObjCMethodDecl
          and ObCContainerDecl into DeclContext

llvm-svn: 338888
2018-08-03 13:47:12 +00:00
Bruno Ricci c5176cf77e [AST][NFC] Small doc update for DeclContext
Factored out from https://reviews.llvm.org/D49729
following @erichkeane comments.

* Add missing classes in the list of classes
  deriving directly from DeclContext.
* Move the friend declarations together and
  add a comment for why they are required.

Reviewed By: erichkeane

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

llvm-svn: 338887
2018-08-03 13:31:20 +00:00
Erich Keane 480a6c1a0b [NFC] Fix unused expression warning introduced in r338884
llvm-svn: 338886
2018-08-03 13:23:04 +00:00
Bruno Ricci cfd225806d Test commit
llvm-svn: 338885
2018-08-03 13:13:05 +00:00
Erich Keane c7ab495b4d [NFC] Silence unused variable warning in Attr.td/AttrParsedAttrImpl.inc
llvm-svn: 338884
2018-08-03 13:01:32 +00:00
Andrea Di Biagio 1c3bcc6ce5 [llvm-mca] Speed up the computation of the wait/ready/issued sets in the Scheduler.
This patch is a follow-up to r338702.

We don't need to use a map to model the wait/ready/issued sets. It is much more
efficient to use a vector instead.

This patch gives us an average 7.5% speedup (on top of the ~12% speedup obtained
after r338702).

llvm-svn: 338883
2018-08-03 12:55:28 +00:00
Chijun Sima 530484372b [Dominators] Make RemoveUnreachableBlocks return false if the BasicBlock is already awaiting deletion
Summary:
Previously, `removeUnreachableBlocks` still returns true (which indicates the CFG is changed) even when all the unreachable blocks found is awaiting deletion in the DDT class.
This makes code pattern like
```
// Code modified from lib/Transforms/Scalar/SimplifyCFGPass.cpp 
bool EverChanged = removeUnreachableBlocks(F, nullptr, DDT);
...
do {
    EverChanged = someMightHappenModifications();
    EverChanged |= removeUnreachableBlocks(F, nullptr, DDT);
  } while (EverChanged);
```
become a dead loop.
Fix this by detecting whether a BasicBlock is already awaiting deletion.

Reviewers: kuhar, brzycki, dmgreen, grosser, davide

Reviewed By: kuhar, brzycki

Subscribers: llvm-commits

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

llvm-svn: 338882
2018-08-03 12:45:29 +00:00
Andrea Di Biagio eaca8ed5b8 [llvm-mca][docs] Improve the CommandLine documentation.
This patch replaces all the remaining occurrences of string "MCA" with
":program:`llvm-mca`".  Somehow I missed those strings when I committed r338394.

This patch also improves section "Instruction Dispatch".

llvm-svn: 338881
2018-08-03 12:44:56 +00:00
Nico Weber 0e81519571 convert some tabs to spaces
llvm-svn: 338880
2018-08-03 12:21:54 +00:00
Tim Northover 608f136dbb Revert "clang-format: [JS] don't break comments before any '{'"
This reverts commit r338837, it introduced an infinite loop on all bots.

llvm-svn: 338879
2018-08-03 12:19:22 +00:00
Jonas Devlieghere 3a92c5c1d3 [DebugInfo/Verifier] Don't emit error for missing module in index
We don't expect module names to be present in the index. This patch adds
DW_TAG_module to the blacklist.

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

llvm-svn: 338878
2018-08-03 12:01:43 +00:00
Nico Weber d48d5f086f lld-link: Fix subsystem inference for non-console apps on 32-bit, and fix entry point inference on 32-bit with /nodefaultlib
LinkerDriver::inferSubsystem() used to do Symtab->findUnderscore("WinMain"),
but WinMain is stdcall in 32-bit and is hence is called _WinMain@16. Instead,
Symtab->findMangle(mangle("WinMain")) needs to be called.

But since LinkerDriver::inferSubsystem() and LinkerDriver::findDefaultEntry()
both need to call this, introduce a common helper function for this and call it
from both places. (Also call it for "main" for consistency, even though
findUnderscore() is enough for main since that's __cdecl on 32-bit).

This also exposed a bug for /nodefaultlib entrypoint inference: The code here
called findMangle(Sym) instead of findMangle(mangle(Sym)), again doing the
wrong thing on 32-bit. Fix that too.

While here, make Driver::mangle() a static free function.

https://reviews.llvm.org/D50184

llvm-svn: 338877
2018-08-03 12:00:12 +00:00
Jonas Paulsson f107b7275c [SystemZ] Improve handling of instructions which expand to several groups
Some instructions expand to more than one decoder group.

This has been hitherto ignored, but is handled with this patch.

Review: Ulrich Weigand
https://reviews.llvm.org/D50187

llvm-svn: 338849
2018-08-03 10:43:05 +00:00
Max Kazantsev dcf6706e52 [NFC] Add missing comment
llvm-svn: 338848
2018-08-03 10:41:51 +00:00
Max Kazantsev 65cd4836d2 [NFC] Move some methods into static functions
llvm-svn: 338843
2018-08-03 10:16:40 +00:00
Jeremy Morse 019406554b [Windows FS] Allow moving files in TempFile::keep
In r338216 / D49860 TempFile::keep was extended to allow keeping across
filesystems. The aim on Windows was to have this happen in rename_internal
using the existing system API. However, to fix an issue and preserve the
idea of "renaming" not being a move, put Windows keep-across-filesystem in
TempFile::keep.

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

llvm-svn: 338841
2018-08-03 10:13:35 +00:00
Krasimir Georgiev cb4dfaef47 clang-format-diff: Make it work with python3 too
Summary: It is not necessary, but would be nice if the script run on python3 as well (as opposed to only python2, which is going to be deprecated https://pythonclock.org/)

Contributed by MarcoFalke!

Reviewers: krasimir

Reviewed By: krasimir

Subscribers: lebedev.ri, sammccall, cfe-commits

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

llvm-svn: 338839
2018-08-03 10:04:58 +00:00
Simon Pilgrim 94112ebc75 [TargetLowering] Generalise BuildSDIV function
First step towards a BuildSDIV equivalent to D49248 for non-uniform vector support - this just pushes the splat detection down into TargetLowering::BuildSDIV where its still used.

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

llvm-svn: 338838
2018-08-03 10:00:54 +00:00
Martin Probst ec45bc2fea clang-format: [JS] don't break comments before any '{'
Summary:
Previously, clang-format would avoid breaking before the first `{`
found, but then happily break before subsequent '{'s on the line. This
change fixes that by looking for the first location that has no opening
curly, if any.

Reviewers: krasimir

Subscribers: cfe-commits

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

llvm-svn: 338837
2018-08-03 09:34:41 +00:00
Guillaume Chatelet e60866a4e0 [llvm-exegesis] Renaming classes and functions.
Summary: Functional No Op.

Reviewers: gchatelet

Subscribers: tschuett, courbet, llvm-commits

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

llvm-svn: 338836
2018-08-03 09:29:38 +00:00
Sjoerd Meijer d62c5ec2fe [ARM] FP16: support vector zip and unzip
This is addressing PR38404.

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

llvm-svn: 338835
2018-08-03 09:24:29 +00:00
Dean Michael Berris 2c4dcf0576 [XRay][tools] Use Support/JSON.h in llvm-xray convert
Summary:
This change removes the ad-hoc implementation used by llvm-xray's
`convert` subcommand to generate JSON encoded catapult (AKA Chrome
Trace Viewer) trace output, to instead use the JSON encoder now in the
Support library.

Reviewers: kpw, zturner, eizan

Reviewed By: kpw

Subscribers: llvm-commits

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

llvm-svn: 338834
2018-08-03 09:21:31 +00:00
Simon Pilgrim 4014fb1049 [X86] Add example of 'zero shift' guards on rotation patterns (PR34924)
Basic pattern that leaves an unnecessary select on a rotation by zero result. This variant is trivial - the more general case with a compare+branch to prevent execution of undefined shifts is more tricky.

llvm-svn: 338833
2018-08-03 09:20:02 +00:00
Eric Liu db887cab7a Fully qualify the renamed symbol if the shortened name is ambiguous.
Summary:
For example, when renaming `a:🅱️:foo` to `y::foo` below, replacing
`x::foo()` with `y::foo()` can cause ambiguity. In such cases, we simply fully
qualify the name with leading `::`.
```
namespace a {
namespace b {
namespace x { void foo() {} }
namespace y { void foo() {} }
}
}

namespace a {
namespace b {
void f() { x::foo(); }
}
}
```

Reviewers: ilya-biryukov, hokein

Reviewed By: ilya-biryukov

Subscribers: cfe-commits

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

llvm-svn: 338832
2018-08-03 09:16:07 +00:00
Karl-Johan Karlsson cd75901de3 Fix unused variable warning in tablegen generated code
llvm-svn: 338831
2018-08-03 09:13:15 +00:00
Sjoerd Meijer 9b30213828 [ARM] FP16: support VFMA
This is addressing PR38404.

llvm-svn: 338830
2018-08-03 09:12:56 +00:00
Dean Michael Berris 7a3bd723b4 [XRay] fixup: add one more missing std::move(...)
Follow up to D48370.

llvm-svn: 338829
2018-08-03 09:06:11 +00:00
Pavel Labath 659cee52fc Revert "Add support for ARM and ARM64 breakpad generated minidump files"
This reverts commit r338734 (and subsequent fixups in r338772 and
r338746), because it breaks some minidump unit tests and introduces a
lot of compiler warnings.

llvm-svn: 338828
2018-08-03 08:47:22 +00:00
Dean Michael Berris 5e8c5a31dd [XRay] fixup: Add missing std::move(...)
Follow up to D48370.

llvm-svn: 338827
2018-08-03 07:54:37 +00:00
Dean Michael Berris 1fa08d1132 [XRay] Fixup: remove 'noexcept' in defaulted move members
This is to appease stage1 builds using gcc.

Follow-up to D48370.

llvm-svn: 338826
2018-08-03 07:41:34 +00:00
Dean Michael Berris 13d04e766a [XRay][llvm] Load XRay Profiles
Summary:
This change implements the profile loading functionality in LLVM to
support XRay's profiling mode in compiler-rt.

We introduce a type named `llvm::xray::Profile` which allows building a
profile representation. We can load an XRay profile from a file to build
Profile instances, or do it manually through the Profile type's API.

The intent is to get the `llvm-xray` tool to generate `Profile`
instances and use that as the common abstraction through which all
conversion and analysis can be done. In the future we can generate
`Profile` instances from `Trace` instances as well, through conversion
functions.

Some of the key operations supported by the `Profile` API are:

- Path interning (`Profile::internPath(...)`) which returns a unique path
  identifier.

- Block appending (`Profile::addBlock(...)`) to add thread-associated
  profile information.

- Path ID to Path lookup (`Profile::expandPath(...)`) to look up a
  PathID and return the original interned path.

- Block iteration.

A 'Path' in this context represents the function call stack in
leaf-to-root order. This is represented as a path in an internally
managed prefix tree in the `Profile` instance. Having a handle (PathID)
to identify the unique Paths we encounter for a particular Profile
allows us to reduce the amount of memory required to associate profile
data to a particular Path.

This is the first of a series of patches to migrate the `llvm-stacks`
tool towards using a single profile representation.

Depends on D48653.

Reviewers: kpw, eizan

Reviewed By: kpw

Subscribers: mgorny, llvm-commits, hiraditya

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

llvm-svn: 338825
2018-08-03 07:18:39 +00:00
Craig Topper a7a12399a1 [X86] Remove all the vector NOP bitcast patterns. Use a few lines of code in the Select method in X86ISelDAGToDAG.cpp instead.
There are a lot of permutations of types here generating a lot of patterns in the isel table. It's more efficient to just ReplaceUses and RemoveDeadNode from the Select function.

The test changes are because we have a some shuffle patterns that have a bitcast as their root node. But the behavior is identical to another instruction whose pattern doesn't start with a bitcast. So this isn't a functional change.

llvm-svn: 338824
2018-08-03 07:01:10 +00:00
Hans Wennborg e566e2c335 build_llvm_package.bat: Add OpenMP back
After r338721, it builds again.

llvm-svn: 338823
2018-08-03 07:00:08 +00:00
Chijun Sima c72ff1011d [Dominators] Refine the logic of recalculate() in the DomTreeUpdater
Summary:
This patch refines the logic of `recalculate()` in the `DomTreeUpdater` in the following two aspects:
1. Previously, `recalculate()` tests whether there are pending updates/BBs awaiting deletion and then do recalculation under Lazy UpdateStrategy; and do recalculation immediately under Eager UpdateStrategy. (The former behavior is inherited from the `DeferredDominance` class). This is an inconsistency between two strategies and there is no obvious reason to do this. So the behavior is changed to always recalculate available trees when calling `recalculate()`.
2. Fix the issue of when DTU under Lazy UpdateStrategy holds nothing but with BBs awaiting deletion, after calling `recalculate()`, BBs awaiting deletion aren't flushed. An additional unittest is added to cover this case.

Reviewers: kuhar, dmgreen, brzycki, grosser, davide

Reviewed By: kuhar

Subscribers: llvm-commits

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

llvm-svn: 338822
2018-08-03 06:51:35 +00:00
Craig Topper e902b7d0b0 [X86] Support fp128 and/or/xor/load/store with VEX and EVEX encoded instructions.
Move all the patterns to X86InstrVecCompiler.td so we can keep SSE/AVX/AVX512 all in one place.

To save some patterns we'll use an existing DAG combine to convert f128 fand/for/fxor to integer when sse2 is enabled. This allows use to reuse all the existing patterns for v2i64.

I believe this now makes SHA instructions the only case where VEX/EVEX and legacy encoded instructions could be generated simultaneously.

llvm-svn: 338821
2018-08-03 06:12:56 +00:00
Michael Wu 58d837d347 [libclang 8/8] Add support for the flag_enum attribute
Summary:
This adds support to libclang for reading the flag_enum attribute.

This also bumps CINDEX_VERSION_MINOR for this patch series.

Reviewers: yvvan, jbcoe

Reviewed By: yvvan

Subscribers: cfe-commits

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

llvm-svn: 338820
2018-08-03 05:55:40 +00:00
Martin Storsjo 5d108d260f [CMake] Allow building standalone without any llvm-config available
This is the same as libcxxabi/libcxx do.

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

llvm-svn: 338819
2018-08-03 05:51:31 +00:00
Martin Storsjo d07bd75cb3 [CMake] Allow building builtins standalone out of tree without any llvm-config available
This is the same as libcxxabi/libcxx do.

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

llvm-svn: 338818
2018-08-03 05:50:33 +00:00
Hiroshi Inoue 73f8b255b6 [InstSimplify] fold extracting from std::pair (2/2)
This is the second patch of the series which intends to enable jump threading for an inlined method whose return type is std::pair<int, bool> or std::pair<bool, int>. 
The first patch is https://reviews.llvm.org/rL338485.

This patch handles code sequences that merges two values using `shl` and `or`, then extracts one value using `and`.

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

llvm-svn: 338817
2018-08-03 05:39:48 +00:00
Michael Wu 6e88f5334c [libclang 7/8] Add support for getting property setter and getter names
Summary: This allows libclang to access the actual names of property setters and getters without needing to go through the indexer API. Usually default names are used, but the property can specify a different name.

Reviewers: yvvan, jbcoe

Reviewed By: yvvan

Subscribers: cfe-commits

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

llvm-svn: 338816
2018-08-03 05:38:29 +00:00