platform/upstream/llvm.git
4 years ago[lldb][cmake] Move the remove_module_flags call to the right place in debugserver...
Raphael Isemann [Mon, 27 Apr 2020 14:03:37 +0000 (16:03 +0200)]
[lldb][cmake] Move the remove_module_flags call to the right place in debugserver's CMakeLists

This code should always be executed, not just when building the debugserver
on its own. Fixes the modules build when building LLVM+LLDB together.

4 years ago[libc++] Create a small DSL for defining Lit features and parameters
Louis Dionne [Fri, 17 Apr 2020 13:19:49 +0000 (09:19 -0400)]
[libc++] Create a small DSL for defining Lit features and parameters

This allows defining Lit features that can be enabled or disabled based
on compiler support, and parameters that are passed on the command line.

The main benefits are:
- Feature detection is entirely based on the substitutions provided in
  the TestingConfig object, which is simpler and decouples it from the
  complicated compiler emulation infrastructure.
- The syntax is declarative, which makes it easy to see what features
  and parameters are accepted by the test suite. This is significantly
  less entangled than the current config.py logic.
- Since feature detection is based on substitutions, it works really
  well on top of the new format, and custom Lit configurations can be
  created easily without being based on `config.py`.

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

4 years ago[lldb] Remove NativeProcessDarwin
Pavel Labath [Mon, 27 Apr 2020 13:22:05 +0000 (15:22 +0200)]
[lldb] Remove NativeProcessDarwin

this is dead and non-functional code that hasn't been touched (modulo
refactors) since it was checked in (as an "NFC, with no review and
tests) in 2016.

Anyone interested in adding darwin support to lldb-server can look this
up in git history.

4 years ago[lld][macho] Fix implicit dependency on DenseMap.h include
Simon Pilgrim [Mon, 27 Apr 2020 13:05:29 +0000 (14:05 +0100)]
[lld][macho] Fix implicit dependency on DenseMap.h include

It was depending on CachedHashString.h providing the include.

4 years agoRevert "[gn build] (manually) merge 811c0c9eb46"
Nico Weber [Mon, 27 Apr 2020 13:00:21 +0000 (09:00 -0400)]
Revert "[gn build] (manually) merge 811c0c9eb46"

This reverts commit b160e9e5394ca1f52a94b5f44c3610567b7bb420.
811c0c9eb46 was reverted in 96717125e852.

4 years ago[lldb] Adjust TestExec code to be closer to real world code
Raphael Isemann [Mon, 27 Apr 2020 12:38:32 +0000 (14:38 +0200)]
[lldb] Adjust TestExec code to be closer to real world code

Summary:
For some reason the TestExec test on the macOS bots randomly fails with this error:
```
output: * thread #2, stop reason = EXC_BAD_ACCESS (code=1, address=0x108e66000)
  * frame #0: 0x0000000108e66000
[...]
  File "/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/test/API/functionalities/exec/TestExec.py", line 25, in test_hitting_exec
    self.do_test(False)
  File "/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/test/API/functionalities/exec/TestExec.py", line 113, in do_test
    "Stopped at breakpoint in exec'ed process.")
AssertionError: False is not True : Stopped at breakpoint in exec'ed process.
Config=x86_64-/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/bin/clang-11
```

I don't know why the test program is failing and I couldn't reproduce this problem on my own.
This patch is a stab in the dark that just tries to make the test code more similar to code which
we would expect in a user program to make whatever part of macOS happy that is currently
not liking our code.

The actual changes are:
* We pass in argv[0] that is describing otherprog path instead of the current argv[0].
* We pass in a non-null envp (which anyway doesn't seem to be allowed on macOS man page).

Reviewers: labath, JDevlieghere

Reviewed By: labath

Subscribers: abidh, lldb-commits

Tags: #lldb

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

4 years agoCachedHashString.h - remove unnecessary includes. NFC.
Simon Pilgrim [Sun, 26 Apr 2020 21:21:11 +0000 (22:21 +0100)]
CachedHashString.h - remove unnecessary includes. NFC.
We don't need the full DenseMap.h just DenseMapInfo.h

4 years ago[opt] PassPrinters.h - remove unused includes + forward declarations. NFC.
Simon Pilgrim [Sun, 26 Apr 2020 21:18:50 +0000 (22:18 +0100)]
[opt] PassPrinters.h - remove unused includes + forward declarations. NFC.

4 years ago[opt] NewPMDriver.h - remove unused LLVMContext forward declaration. NFC.
Simon Pilgrim [Sun, 26 Apr 2020 21:16:29 +0000 (22:16 +0100)]
[opt] NewPMDriver.h - remove unused LLVMContext forward declaration. NFC.

4 years agoRevert "[analyzer] On-demand parsing capability for CTU"
Dmitri Gribenko [Mon, 27 Apr 2020 12:24:34 +0000 (14:24 +0200)]
Revert "[analyzer] On-demand parsing capability for CTU"

This reverts commit 811c0c9eb462d1fef6ab6908aab7881e5c4f5fbf. It broke
multiple buildbots.

4 years ago[clang-tidy] modernize-use-using: Fix broken fixit with InjectedClassName
Matthias Gehre [Sun, 12 Apr 2020 18:06:31 +0000 (20:06 +0200)]
[clang-tidy] modernize-use-using: Fix broken fixit with InjectedClassName

Summary:
Before this PR, `modernize-use-using` would transform the typedef in
```
template <int A>
struct InjectedClassName {
  typedef InjectedClassName b;
};
```
into `using b = InjectedClassName<A>;` and
```
template <int>
struct InjectedClassNameWithUnnamedArgument {
  typedef InjectedClassNameWithUnnamedArgument b;
};
```
into `using b = InjectedClassNameWithUnnamedArgument<>;`.
The first fixit is surprising because its different than the code
before, but the second fixit doesn't even compile.

This PR adds an option to the TypePrinter to print InjectedClassNameType without
template parameters (i.e. as written).

Reviewers: aaron.ballman, alexfh, hokein, njames93

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

4 years ago[clang] Remove NFC overload in ASTImporterTest
Raphael Isemann [Mon, 27 Apr 2020 12:10:36 +0000 (14:10 +0200)]
[clang] Remove NFC overload in ASTImporterTest

This overload is just an artifact from the original version of the patch, but
doesn't have any functional purpose.

4 years ago[mlir] Fixed warning related to unused variable in Liveness.
Marcel Koester [Mon, 27 Apr 2020 10:22:24 +0000 (12:22 +0200)]
[mlir] Fixed warning related to unused variable in Liveness.

The latest changes of the Liveness analysis caused a warning related to an
unused variable. This commit solves this warning.

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

4 years agoFix modules build after introduction of PassSupport.h include check
Raphael Isemann [Mon, 27 Apr 2020 11:51:22 +0000 (13:51 +0200)]
Fix modules build after introduction of PassSupport.h include check

D78815 added a check that ensures that PassSupport.h and PassAnalysisSupport.h
aren't included directly. However, as compiling this header into a module will
try to parse it with a clean preprocessor state, this check is also triggered
there. The check seems to make sense and it seems that compiling this header
into its own module is a mistake, so this patch makes those two headers
textual in the modulemap.

4 years ago[X86][SSE] getFauxShuffle - account for PEXTW/PEXTB implicit zero-extension
Simon Pilgrim [Mon, 27 Apr 2020 11:46:38 +0000 (12:46 +0100)]
[X86][SSE] getFauxShuffle - account for PEXTW/PEXTB implicit zero-extension

The insert(truncate/extend(extract(vec0,c0)),vec1,c1) case in rGacbc5ede99 wasn't combining the 'mineltsize' with the src vector elt size which may be smaller due to implicit extension during extraction.

Reduced from test case provided by @mstorsjo

4 years ago[NFC][CostModel] Refactor getCastInstrCost
Sam Parker [Mon, 27 Apr 2020 11:41:30 +0000 (12:41 +0100)]
[NFC][CostModel] Refactor getCastInstrCost

Move ZExt/SExt load handling into the BasicTTI switch statement.

4 years ago[flang] Semantic checks for OpenMP combined constructs.
David Truby [Thu, 9 Apr 2020 17:54:28 +0000 (18:54 +0100)]
[flang] Semantic checks for OpenMP combined constructs.

Summary:
This includes a refactor of the existing combined construct checks
that were present, as well as adding the remaining combined constructs
that had not been implemented yet.

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, llvm-commits

Tags: #llvm

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

4 years ago[flang] Fix handling of files without terminating newlines.
David Truby [Tue, 21 Apr 2020 18:45:43 +0000 (19:45 +0100)]
[flang] Fix handling of files without terminating newlines.

Reviewers: sscalpone

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[ASTImporter] Also import overwritten file buffers
Raphael Isemann [Mon, 27 Apr 2020 08:06:56 +0000 (10:06 +0200)]
[ASTImporter] Also import overwritten file buffers

Summary:
Overwritten file buffers are at the moment ignored when importing and
instead only the underlying file buffer is imported.

This patch fixes this by not going to the underlying file entry if the file has
an overwritten buffer.

Reviewers: martong, a.sidorin, shafik

Reviewed By: martong, shafik

Subscribers: rnkovacs

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

4 years ago[SveEmitter] IsInsertOp1SVALL and builtins for svqdec[bhwd] and svqinc[bhwd]
Sander de Smalen [Sun, 26 Apr 2020 11:47:17 +0000 (12:47 +0100)]
[SveEmitter] IsInsertOp1SVALL and builtins for svqdec[bhwd] and svqinc[bhwd]

Some ACLE builtins leave out the argument to specify the predicate
pattern, which is expected to be expanded to an SV_ALL pattern.

This patch adds the flag IsInsertOp1SVALL to insert SV_ALL as the
second operand.

Reviewers: efriedma, SjoerdMeijer

Reviewed By: SjoerdMeijer

Tags: #clang

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

4 years ago[gn build] (manually) merge 811c0c9eb46
Nico Weber [Mon, 27 Apr 2020 10:39:33 +0000 (06:39 -0400)]
[gn build] (manually) merge 811c0c9eb46

4 years ago[Analyzer] Include typedef statements in CFG build.
Balázs Kéri [Mon, 27 Apr 2020 07:45:38 +0000 (09:45 +0200)]
[Analyzer] Include typedef statements in CFG build.

Summary:
Array size expressions in typedef statements with a VLA
(variable-length array) are handled from now as in plain
(non-typedef) VLA declarations.
Type-aliases with VLA are handled too
(but main focus is on C code).

Reviewers: Szelethus, aaron.ballman, NoQ, xazax.hun

Reviewed By: aaron.ballman, xazax.hun

Subscribers: rnkovacs, NoQ, efriedma, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, ASDenysPetrov, cfe-commits

Tags: #clang

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

4 years agoAdd the gsl::Pointer/gsl::Owner combo to ArrayRef and SmallVector so it can diagnose...
Benjamin Kramer [Mon, 27 Apr 2020 10:31:07 +0000 (12:31 +0200)]
Add the gsl::Pointer/gsl::Owner combo to ArrayRef and SmallVector so it can diagnose this common combo.

4 years ago[mlir] Extended Alloc and Dealloc operations with memory-effect traits.
Julian Gross [Wed, 22 Apr 2020 09:22:43 +0000 (11:22 +0200)]
[mlir] Extended Alloc and Dealloc operations with memory-effect traits.

Extended standard Alloc and Dealloc operations with memory-effect traits.

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

4 years ago[NFC] UnifyLoopExits: correctly skip expensive checks
Sameer Sahasrabuddhe [Mon, 27 Apr 2020 09:40:35 +0000 (15:10 +0530)]
[NFC] UnifyLoopExits: correctly skip expensive checks

4 years ago[MLIR] Propagate input side effect information
Tres Popp [Thu, 23 Apr 2020 16:13:44 +0000 (18:13 +0200)]
[MLIR] Propagate input side effect information

Summary:
Previously operations like std.load created methods for obtaining their
effects but did not inherit from the SideEffect interfaces when their
parameters were decorated with the information. The resulting situation
was that passes had no information on the SideEffects of std.load/store
and had to treat them more cautiously. This adds the inheritance
information when creating the methods.

As a side effect, many tests are modified, as they were using std.load
for testing and this oepration would be folded away as part of pattern
rewriting. Tests are modified to use store or to reutn the result of the
std.load.

Reviewers: mravishankar, antiagainst, nicolasvasilache, herhut, aartbik, ftynse!

Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, bader, grosul1, frgossen, Kayjukh, llvm-commits

Tags: #llvm

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

4 years ago[flang][docs] Doxygen support in flang.
sameeran joshi [Mon, 27 Apr 2020 09:22:36 +0000 (14:52 +0530)]
[flang][docs] Doxygen support in flang.

    Summary:
    Added support for doxygen-style documentation generation from source code.
    Added -DLLVM_ENABLE_DOXYGEN=ON -DFLANG_INCLUDE_DOCS=ON flags to cmake.
    Added the target doxygen-flang for building doxygen
    Updated README.txt

    Reviewers: DavidTruby, richard.barton.arm, sscalpone,  mehdi_amini, jdoerfert

    Reviewed By: DavidTruby, richard.barton.arm, sscalpone

    Previous review: https://github.com/flang-compiler/f18/pull/1065

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

4 years ago[analyzer] On-demand parsing capability for CTU
Endre Fülöp [Mon, 27 Apr 2020 08:13:34 +0000 (10:13 +0200)]
[analyzer] On-demand parsing capability for CTU

Summary:
Add an option to enable on-demand parsing of needed ASTs during CTU analysis.
Two options are introduced. CTUOnDemandParsing enables the feature, and
CTUOnDemandParsingDatabase specifies the path to a compilation database, which
has all the necessary information to generate the ASTs.

Reviewers: martong, balazske, Szelethus, xazax.hun

Subscribers: ormris, mgorny, whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, steakhal, cfe-commits

Tags: #clang

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

4 years ago[ARM] Replace hasNoSchedulingInfo with UnsupportedFeatures in the A57 schedule
David Green [Mon, 27 Apr 2020 08:19:06 +0000 (09:19 +0100)]
[ARM] Replace hasNoSchedulingInfo with UnsupportedFeatures in the A57 schedule

hasNoSchedulingInfo should be used for Pseudo's and other instructions
that are never expected to be scheduled. This removes the flag from new
ARM instructions, instead fixing the A57 schedule by marking the related
architecture features as unsupported.

4 years ago[ARM] Only produce qadd8b under hasV6Ops
David Green [Sun, 26 Apr 2020 20:58:58 +0000 (21:58 +0100)]
[ARM] Only produce qadd8b under hasV6Ops

When compiling for a arm5te cpu from clang, the +dsp attribute is set.
This meant we could try and generate qadd8 instructions where we would
end up having no pattern. I've changed the condition here to be hasV6Ops
&& hasDSP, which is what other parts of ARMISelLowering seem to use for
similar instructions.

Fixed PR45677.

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

4 years ago[AST] Preserve the invalid initializer for auto VarDecl.
Haojian Wu [Mon, 27 Apr 2020 08:04:13 +0000 (10:04 +0200)]
[AST] Preserve the invalid initializer for auto VarDecl.

Fixes https://github.com/clangd/clangd/issues/330

Reviewers: sammccall

Tags: #clang

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

4 years ago[libc++] Add UNSUPPORTED markup for shared_mutex and shared_timed_mutex tests
Louis Dionne [Mon, 27 Apr 2020 08:09:54 +0000 (04:09 -0400)]
[libc++] Add UNSUPPORTED markup for shared_mutex and shared_timed_mutex tests

The tests were previously disabled entirely whenever availability markup
was enabled. Instead, enable the tests but add the proper UNSUPPORTED
markup.

4 years agoExplicitly tell Clang to output to stdout in a test that runs FileCheck
Dmitri Gribenko [Mon, 27 Apr 2020 08:03:45 +0000 (10:03 +0200)]
Explicitly tell Clang to output to stdout in a test that runs FileCheck

4 years ago[lldb][TypeSystemClang] Desugar an elaborated type before checking if it's a typedef...
Aleksandr Urakov [Fri, 24 Apr 2020 13:09:06 +0000 (16:09 +0300)]
[lldb][TypeSystemClang] Desugar an elaborated type before checking if it's a typedef or getting a typedefed type

Summary:
Sometimes a result variable of some expression can be presented as an elaborated
type. In this case the methods `IsTypedefType()` and `GetTypedefedType()` of
`SBType` didn't work. This patch fixes that.

I didn't find the test for these API methods, so I added a basic test for this
too.

Reviewers: aprantl, teemperor, labath, leonid.mashinskiy

Reviewed By: teemperor

Subscribers: labath, lldb-commits

Tags: #lldb

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

4 years ago[MLIR] Remove document references to gpu.kernel_module and gpu.kernel.
Tres Popp [Fri, 24 Apr 2020 10:33:47 +0000 (12:33 +0200)]
[MLIR] Remove document references to gpu.kernel_module and gpu.kernel.

Summary:
These have been replaced from attributes to operations gpu.module and
gpu.func respectively.

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

4 years ago[lldb] Improve error message when --func-regex parameter for the breakpoint command...
Raphael Isemann [Mon, 27 Apr 2020 07:11:45 +0000 (09:11 +0200)]
[lldb] Improve error message when --func-regex parameter for the breakpoint command is invalid

Summary:
Currently the breakpoint command is prompting the user to file a bug report if the provided regex is invalid:
```
(lldb) rbreak *foo
error: Function name regular expression could not be compiled: "Inconvertible error value. An error has occurred that could not be converted to a known std::error_code. Please file a bug. repetition-operator operand invalid"
```

The reason is simply that we are using the wrong StringError constructor (the one with the error code as the first parameter
is also printing the string version of the error code, and the inconvertible error code is just an invalid place holder code with
that description). Switching the StringError constructor parameters will only print the error message we get from the regex
engine when we convert the error into a string.

I checked the rest of the code base and I couldn't find the same issue anywhere else.

Fixes rdar://62233561

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: lldb-commits

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

4 years ago[libc++] Mark C++20 Synchronization Library tests as unsupported in C++11
Louis Dionne [Mon, 27 Apr 2020 07:37:51 +0000 (03:37 -0400)]
[libc++] Mark C++20 Synchronization Library tests as unsupported in C++11

The various headers comprising the C++20 Synchronization Library only
contain something in C++ >= 14, not C++ >= 11.

4 years ago[mlir] Don't allocate an operand storage if the operation is known to never have...
River Riddle [Mon, 27 Apr 2020 04:28:32 +0000 (21:28 -0700)]
[mlir] Don't allocate an operand storage if the operation is known to never have operands

Certain classes of operations, such as FuncOp, are known to never have operands. This revision adds a bit to operation to detect this case and avoid allocating the unnecessary operand storage. This saves 1 word for each instance of these operations.

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

4 years ago[mlir] Optimize operand storage such that all operations can have resizable operand...
River Riddle [Mon, 27 Apr 2020 04:28:22 +0000 (21:28 -0700)]
[mlir] Optimize operand storage such that all operations can have resizable operand lists

This revision refactors the structure of the operand storage such that there is no additional memory cost for resizable operand lists until it is required. This is done by using two different internal representations for the operand storage:
* One using trailing operands
* One using a dynamically allocated std::vector<OpOperand>

This allows for removing the resizable operand list bit, and will free up APIs from needing to workaround non-resizable operand lists.

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

4 years ago[mlir] Optimize the allocation of resizable operand lists
River Riddle [Mon, 27 Apr 2020 04:28:11 +0000 (21:28 -0700)]
[mlir] Optimize the allocation of resizable operand lists

This revision optimizes resizable operand lists by allocating them in the same location as the trailing operands. This has numerous benefits:
* If the operation has at least one operand at construction time, there is 0 additional memory overhead to the resizable storage.
* There is less pointer arithmetic necessary as the resizable storage is now only used when the operands are dynamically allocated.

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

4 years ago[X86][CostModel] Fix typos in test. NFC
Craig Topper [Mon, 27 Apr 2020 04:08:17 +0000 (21:08 -0700)]
[X86][CostModel] Fix typos in test. NFC

4 years ago[NFC][DAGCombine] Adding three helper functions and change the getNegatedExpression...
QingShan Zhang [Mon, 27 Apr 2020 03:46:42 +0000 (03:46 +0000)]
[NFC][DAGCombine] Adding three helper functions and change the getNegatedExpression to negateExpression

This is a NFC patch for D77319. The idea is to hide the getNegatibleCost inside the getNegatedExpression()
to have it return null if the cost is expensive, and add some helper function for easy to use. And
rename the old getNegatedExpression to negateExpression to avoid the semantic conflict.

Reviewed By: RKSimon

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

4 years ago[AMDGPU] Expose llvm fence instruction as clang intrinsic
Saiyedul Islam [Mon, 27 Apr 2020 02:56:03 +0000 (08:26 +0530)]
[AMDGPU] Expose llvm fence instruction as clang intrinsic

Expose llvm fence instruction as clang builtin for AMDGPU target

__builtin_amdgcn_fence(unsigned int memoryOrdering, const char *syncScope)

The first argument of this builtin is one of the memory-ordering specifiers
__ATOMIC_ACQUIRE, __ATOMIC_RELEASE, __ATOMIC_ACQ_REL, or __ATOMIC_SEQ_CST
following C++11 memory model semantics. This is mapped to corresponding
LLVM atomic memory ordering for the fence instruction using LLVM atomic C
ABI. The second argument is an AMDGPU-specific synchronization scope
defined as string.

Reviewed By: sameerds

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

4 years ago[llvm-objcopy][MachO] Fix segment's vmsize
Alexander Shaposhnikov [Fri, 24 Apr 2020 07:58:27 +0000 (00:58 -0700)]
[llvm-objcopy][MachO] Fix segment's vmsize

This diff fixes the calculation of the field vmsize
in LC_SEGMENT/LC_SEGMENT_64 load commands.

Test plan: make check-all

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

4 years ago[X86] Add cost model tests for conversions between <2 x float> and integers.
Craig Topper [Sun, 26 Apr 2020 22:04:49 +0000 (15:04 -0700)]
[X86] Add cost model tests for conversions between <2 x float> and integers.

For all but 2 x i32 we were starting from 4 x float.

4 years ago[X86] Add cost table entry for v2i32->v2f64 fp_to_uint with avx512.
Craig Topper [Sun, 26 Apr 2020 21:02:21 +0000 (14:02 -0700)]
[X86] Add cost table entry for v2i32->v2f64 fp_to_uint with avx512.

We're currently getting this from the default implementation. But
I don't like how the cost model came to this answer and I might
be making some changes there.

4 years ago[clangd] Strip /showIncludes in clangd compile commands
Arthur Eubanks [Fri, 24 Apr 2020 23:08:36 +0000 (16:08 -0700)]
[clangd] Strip /showIncludes in clangd compile commands

In command lines with /showIncludes, clangd would output includes to stdout, breaking clients.

Summary: Fixes https://github.com/clangd/clangd/issues/322.

Reviewers: sammccall, kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[TableGen] Simplify with TGParser::consume()
Fangrui Song [Sun, 26 Apr 2020 22:16:07 +0000 (15:16 -0700)]
[TableGen] Simplify with TGParser::consume()

4 years ago[clangd] Fold buildAST into ParsedAST::build. NFCI
Sam McCall [Sun, 26 Apr 2020 22:13:56 +0000 (00:13 +0200)]
[clangd] Fold buildAST into ParsedAST::build. NFCI

4 years ago[mlir][DenseStringAttr] Fix support for splat detection and iteration
River Riddle [Sun, 26 Apr 2020 20:52:50 +0000 (13:52 -0700)]
[mlir][DenseStringAttr] Fix support for splat detection and iteration

This revision also adds proper tests for splat detection.

4 years ago[ViewCFG] Allow printing edge weights in debuggers
Hongtao Yu [Sun, 26 Apr 2020 18:22:16 +0000 (11:22 -0700)]
[ViewCFG] Allow printing edge weights in debuggers

Summary:
Extending the Function::viewCFG prototypes to allow for printing block probability info in form of .dot files during debugging.

Also avoiding an AV when no BFI/BPI available.

Reviewers: wenlei, davidxl, knaumov

Reviewed By: wenlei, davidxl

Subscribers: MaskRay, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoAMDGPU: Add some missing atomics tests
Matt Arsenault [Sun, 26 Apr 2020 15:11:43 +0000 (11:11 -0400)]
AMDGPU: Add some missing atomics tests

We had no FP atomic load/store coverage.

4 years ago[Lexicon] fix typo "may is" -> "is"
Sergei Trofimovich [Sun, 26 Apr 2020 18:35:05 +0000 (19:35 +0100)]
[Lexicon] fix typo "may is" -> "is"

Reviewers: MaskRay

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[IR] Since AttributeSets are sorted, binary search them.
Benjamin Kramer [Sun, 26 Apr 2020 18:03:29 +0000 (20:03 +0200)]
[IR] Since AttributeSets are sorted, binary search them.

Not likely to make a big difference, but there's a fair bit of pointer
chasing in large sets.

4 years ago[LV] Fix recording of BranchTakenCount for FoldTail
Ayal Zaks [Sat, 25 Apr 2020 00:44:38 +0000 (03:44 +0300)]
[LV] Fix recording of BranchTakenCount for FoldTail

When folding tail, branch taken count is computed during initial VPlan execution
and recorded to be used by the compare computing the loop's mask. This recording
should directly set the State, instead of reusing Value2VPValue mapping which
serves original Values present prior to vectorization.
The branch taken count may be a constant Value, which may be used elsewhere in
the loop; trying to employ Value2VPValue for both leads to the issue reported in
https://reviews.llvm.org/D76992#inline-721028

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

4 years ago[DSE,MSSA] Continue checking more remaining candidates with dbgcnt.
Florian Hahn [Thu, 23 Apr 2020 17:58:33 +0000 (18:58 +0100)]
[DSE,MSSA] Continue checking more remaining candidates with dbgcnt.

After changing the candidate iteration strategy, we should continue with
the next candidate, rather than breaking out of the loop.

4 years ago[clang-tidy] Use StringSwitch in a bunch of places. NFCI.
Benjamin Kramer [Sun, 26 Apr 2020 15:23:30 +0000 (17:23 +0200)]
[clang-tidy] Use StringSwitch in a bunch of places. NFCI.

4 years ago[InstCombine] updated test comments; NFC
Sanjay Patel [Sun, 26 Apr 2020 12:45:08 +0000 (08:45 -0400)]
[InstCombine] updated test comments; NFC

As suggested in review for:
rG4abab5c5ca7b

4 years agoSort EnumAttr so it matches Attribute::operator<
Benjamin Kramer [Sun, 26 Apr 2020 14:52:53 +0000 (16:52 +0200)]
Sort EnumAttr so it matches Attribute::operator<

This means AttrBuilder will always create a sorted set of attributes and
we can skip the sorting step. Sorting attributes is surprisingly
expensive, and I recently made it worse by making it use array_pod_sort.

4 years ago[polly] Don't include PassSupport.h directly - include via Pass.h
Simon Pilgrim [Sun, 26 Apr 2020 14:51:32 +0000 (15:51 +0100)]
[polly] Don't include PassSupport.h directly - include via Pass.h

Missed this in D78815

4 years agoRe-land [MC] Fix quadratic behavior in addPendingLabel
Alexandre Ganea [Sun, 26 Apr 2020 14:39:30 +0000 (10:39 -0400)]
Re-land [MC] Fix quadratic behavior in addPendingLabel

This was discovered when compiling large unity/blob/jumbo files.

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

4 years ago[X86][SSE] getFauxShuffle - support insert(truncate/extend(extract(vec0,c0)),vec1...
Simon Pilgrim [Sun, 26 Apr 2020 14:31:01 +0000 (15:31 +0100)]
[X86][SSE] getFauxShuffle - support insert(truncate/extend(extract(vec0,c0)),vec1,c1) shuffle patterns at the byte level

Followup to the PR45604 fix at rGe71dd7c011a3 where we disabled most of these cases.

By creating the shuffle at the byte level we can handle any extension/truncation as long as we track how small the scalar got and assume that the upper bytes will need to be zero.

4 years agoX86ISelDAGToDAG.cpp - remove unnecessary includes. NFC.
Simon Pilgrim [Sun, 26 Apr 2020 13:50:39 +0000 (14:50 +0100)]
X86ISelDAGToDAG.cpp - remove unnecessary includes. NFC.
The X86 specific headers have to include these so we don't need to duplicate.

4 years agoMachineFunction.h - reduce includes to forward declarations. NFC.
Simon Pilgrim [Sun, 26 Apr 2020 12:49:57 +0000 (13:49 +0100)]
MachineFunction.h - reduce includes to forward declarations. NFC.

4 years agoX86MCTargetDesc.h - remove unused DataType.h include. NFC.
Simon Pilgrim [Sun, 26 Apr 2020 12:47:19 +0000 (13:47 +0100)]
X86MCTargetDesc.h - remove unused DataType.h include. NFC.

4 years agoX86MCTargetDesc.cpp - remove MSVC intrin.h include. NFC.
Simon Pilgrim [Sun, 26 Apr 2020 12:37:51 +0000 (13:37 +0100)]
X86MCTargetDesc.cpp - remove MSVC intrin.h include. NFC.

This was needed when the file called cpuid but that was removed at rL233170.

4 years agoX86MacroFusion.h - reduce MachineScheduler.h include. NFC.
Simon Pilgrim [Sun, 26 Apr 2020 12:17:45 +0000 (13:17 +0100)]
X86MacroFusion.h - reduce MachineScheduler.h include. NFC.
We only need a ScheduleDAGMutation forward declaration.

4 years agoraw_ostream_test: Add a missing buffer flush
Benjamin Kramer [Sun, 26 Apr 2020 13:18:25 +0000 (15:18 +0200)]
raw_ostream_test: Add a missing buffer flush

4 years ago[clangd] Disable delayed template parsing in the main file
Sam McCall [Sat, 25 Apr 2020 01:03:01 +0000 (03:03 +0200)]
[clangd] Disable delayed template parsing in the main file

Summary:
This is on by default in windows and breaks most features in template bodies.
We'd already disabled it in code completion, now disable it for building ASTs.

Potential regressions:
 - we may give spurious errors where files with templates relying on delayed
   parsing are directly opened
 - we may misparse such template bodies that are instantiated (and therefore
   *were* previously parsed)

Still *probably* a win overall. Avoiding the regressions entirely would be
substantial work and we don't have plans for it now.

Fixes https://github.com/clangd/clangd/issues/302 (again)

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[SCCP] Support ranges for loads and stores.
Florian Hahn [Sun, 26 Apr 2020 10:54:35 +0000 (11:54 +0100)]
[SCCP] Support ranges for loads and stores.

Integer ranges can be used for loaded/stored values. Note that widening
can be disabled for loads/stores, as we only rely on instructions that
cause continued increases to ranges to be widened (like binary
operators).

Reviewers: efriedma, mssimpso, davide

Reviewed By: efriedma

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

4 years ago[SCCP] Add load/store test for integer ranges.
Florian Hahn [Sat, 18 Apr 2020 18:49:32 +0000 (19:49 +0100)]
[SCCP] Add load/store test for integer ranges.

4 years agoraw_ostream: Simplify code a bit. NFCI.
Benjamin Kramer [Sun, 26 Apr 2020 12:05:55 +0000 (14:05 +0200)]
raw_ostream: Simplify code a bit. NFCI.

4 years ago[Pass] Ensure we don't include PassSupport.h or PassAnalysisSupport.h directly
Simon Pilgrim [Sun, 26 Apr 2020 11:57:57 +0000 (12:57 +0100)]
[Pass] Ensure we don't include PassSupport.h or PassAnalysisSupport.h directly

Both PassSupport.h and PassAnalysisSupport.h are only supposed to be included via Pass.h.

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

4 years ago[SveEmitter] Add IsAppendSVALL and builtins for svptrue and svcnt[bhwd]
Sander de Smalen [Sun, 26 Apr 2020 11:31:10 +0000 (12:31 +0100)]
[SveEmitter] Add IsAppendSVALL and builtins for svptrue and svcnt[bhwd]

Some ACLE builtins leave out the argument to specify the predicate
pattern, which is expected to be expanded to an SV_ALL pattern.

This patch adds the flag IsAppendSVALL to append SV_ALL as the final
operand.

Reviewers: SjoerdMeijer, efriedma, rovka, rengolin

Reviewed By: efriedma

Tags: #clang

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

4 years ago[CMake] Fix logic error: NOT LIBCLANG_BUILD_STATIC does not imply PIC
David Zarzycki [Sun, 26 Apr 2020 11:02:32 +0000 (07:02 -0400)]
[CMake] Fix logic error: NOT LIBCLANG_BUILD_STATIC does not imply PIC

4 years agoX86Operand.h - remove unnecessary includes. NFC.
Simon Pilgrim [Sun, 26 Apr 2020 11:11:49 +0000 (12:11 +0100)]
X86Operand.h - remove unnecessary includes. NFC.

4 years agoAMDGPU/Utils - cleanup include and forward declarations. NFC.
Simon Pilgrim [Sun, 26 Apr 2020 11:06:28 +0000 (12:06 +0100)]
AMDGPU/Utils - cleanup include and forward declarations. NFC.
Remove unused includes + forward declarations.
Reduce unnecessary StringRef.h includes to StringRef forward declaration.

4 years ago[IR] Simplify code to print string attributes a bit. NFC.
Benjamin Kramer [Sun, 26 Apr 2020 11:06:50 +0000 (13:06 +0200)]
[IR] Simplify code to print string attributes a bit. NFC.

4 years agoDefault raw_string_ostream to be unbuffered
Benjamin Kramer [Sun, 26 Apr 2020 10:45:57 +0000 (12:45 +0200)]
Default raw_string_ostream to be unbuffered

raw_string_ostream can just use the std::string as a buffer. The buffer
requirement came from the days when the minimum buffer size was 128
(fixed in 2015) and std::string was non-SSO. Now we can just use the
inline capacity for small things and on a good growth strategy later.

This assumes that the standard library isn't doing something bad like
only growing to the exact size. I checked some common implementations
and they grow by 2x (libc++) or 1.5x (msvc) which is reasonable. We
should still check if this incurs any performance regressions though.

4 years ago[TableGen] Delete unused Record::resolveReferencesTo() after D44478. NFC
Fangrui Song [Sun, 26 Apr 2020 08:21:36 +0000 (01:21 -0700)]
[TableGen] Delete unused Record::resolveReferencesTo() after D44478. NFC

4 years ago[CaptureTracking] Make MaxUsesToExplore cheaper (NFC)
Nikita Popov [Thu, 23 Apr 2020 16:17:51 +0000 (18:17 +0200)]
[CaptureTracking] Make MaxUsesToExplore cheaper (NFC)

The change in D78624 had a noticeable negative compile-time impact.
It seems that going through a function call for the MaxUsesToExplore
default is fairly expensive, at least if LLVM is not built with LTO.

This patch makes MaxUsesToExpore default to 0 and assigns the actual
default in the implementation instead. This recovers most of the
regression.

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

4 years ago[GVN] Reduce expression size (NFC)
Nikita Popov [Wed, 22 Apr 2020 19:43:07 +0000 (21:43 +0200)]
[GVN] Reduce expression size (NFC)

Reduce size of GVN::Expression by reordering fields to reduce padding.

4 years ago[IR] Use map for string attributes (NFC)
Nikita Popov [Sat, 25 Apr 2020 10:21:21 +0000 (12:21 +0200)]
[IR] Use map for string attributes (NFC)

Attributes are currently stored as a simple list. Enum attributes
additionally use a bitset to allow quickly determining whether an
attribute is set. String attributes on the other hand require a
full scan of the list. As functions tend to have a lot of string
attributes (at least when clang is used), this is a noticeable
performance issue.

This patch adds an additional name => attribute map to the
AttributeSetNode, which allows querying string attributes quickly.
This results in a 3% reduction in instructions retired on CTMark.
Changes to memory usage seem to be in the noise (attribute sets are
uniqued, and we don't tend to have more than a few dozen or hundred
unique attribute sets, so adding an extra map does not have a
noticeable cost.)

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

4 years ago[X86] Fix the cost of v16i1->v16i16 sext/zext on avx targets.
Craig Topper [Sun, 26 Apr 2020 06:00:57 +0000 (23:00 -0700)]
[X86] Fix the cost of v16i1->v16i16 sext/zext on avx targets.

Previously we were hitting the scalarization case in the default
implementation.

4 years ago[X86][CostModel] Improve costs for vXi1 sign_extend/zero_extend with avx512.
Craig Topper [Sun, 26 Apr 2020 04:37:10 +0000 (21:37 -0700)]
[X86][CostModel] Improve costs for vXi1 sign_extend/zero_extend with avx512.

With avx512 vXi1 is legal and uses k-registers with many custom cases
for extending.

4 years ago[X86][CostModel] Add sext/zext from vXi1 tests to min-legal-vector-width.ll. NFC
Craig Topper [Sun, 26 Apr 2020 01:35:59 +0000 (18:35 -0700)]
[X86][CostModel] Add sext/zext from vXi1 tests to min-legal-vector-width.ll. NFC

We aren't properly costing extends from k-registers. I also added
command lines without avx512bw to be able to show all the different
extending strategies we have.

4 years ago[TableGen] Add TGParser::consume()
Fangrui Song [Sun, 26 Apr 2020 04:05:19 +0000 (21:05 -0700)]
[TableGen] Add TGParser::consume()

4 years ago[NFC][PowerPC] Add the killed flag for the case expand-isel-liveness.mir
Kang Zhang [Sun, 26 Apr 2020 04:40:20 +0000 (04:40 +0000)]
[NFC][PowerPC] Add the killed flag for the case expand-isel-liveness.mir

4 years ago[clangd] Enable textual fallback for go-to-definition on dependent names
Nathan Ridge [Thu, 19 Mar 2020 20:28:53 +0000 (16:28 -0400)]
[clangd] Enable textual fallback for go-to-definition on dependent names

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[SourceMgr] Tidy up the SourceMgr header file to include less stuff.
Chris Lattner [Sat, 25 Apr 2020 21:39:31 +0000 (14:39 -0700)]
[SourceMgr] Tidy up the SourceMgr header file to include less stuff.

Summary:
Specifically make some simple refactorings to get PointerUnion.h and
Twine.h out of the public includes.  While here, trim out a lot of
transitive includes as well.

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agollvm-tblgen -gen-dag-isel: Hoist SmallVector TmpBuf
Fangrui Song [Sun, 26 Apr 2020 03:16:35 +0000 (20:16 -0700)]
llvm-tblgen -gen-dag-isel: Hoist SmallVector TmpBuf

4 years ago[NFC][PowerPC] Add a new test case in expand-isel-liveness.mir
Kang Zhang [Sun, 26 Apr 2020 03:15:54 +0000 (03:15 +0000)]
[NFC][PowerPC] Add a new test case in expand-isel-liveness.mir

4 years agollvm-tblgen -gen-dag-isel: Reduce lib/Target/*/*GenDAGISel.inc
Fangrui Song [Sun, 26 Apr 2020 02:55:26 +0000 (19:55 -0700)]
llvm-tblgen -gen-dag-isel: Reduce lib/Target/*/*GenDAGISel.inc

X86GenDAGISel.inc: 22597697 bytes -> 20874981 bytes

4 years ago[X86] Shrink lib/Target/X86/X86GenDisassemblerTables.inc
Fangrui Song [Sun, 26 Apr 2020 02:13:16 +0000 (19:13 -0700)]
[X86] Shrink lib/Target/X86/X86GenDisassemblerTables.inc

6330853 bytes -> 5207842 bytes

4 years ago[AVR][NFC] Move preprocessor tests to Preprocessor directory
Ayke van Laethem [Tue, 14 Apr 2020 22:37:44 +0000 (00:37 +0200)]
[AVR][NFC] Move preprocessor tests to Preprocessor directory

These tests were placed in the CodeGen directory while they really
should have been placed in the Preprocessor directory.

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

4 years ago[TableGen] Drop deprecated leading # when parsing a SimpleValue
Fangrui Song [Sat, 25 Apr 2020 22:40:14 +0000 (15:40 -0700)]
[TableGen] Drop deprecated leading # when parsing a SimpleValue

4 years ago[TableGen] Drop deprecated leading # operation (NOP) and replace ## with #
Fangrui Song [Sat, 25 Apr 2020 22:58:40 +0000 (15:58 -0700)]
[TableGen] Drop deprecated leading # operation (NOP) and replace ## with #

4 years ago[builtins] Support architectures with 16-bit int
Ayke van Laethem [Wed, 22 Apr 2020 18:25:22 +0000 (20:25 +0200)]
[builtins] Support architectures with 16-bit int

This is the first patch in a series to add support for the AVR target.
This patch includes changes to make compiler-rt more target independent
by not relying on the width of an int or long.

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

4 years ago[X86] Improve lowering of v16i8->v16i1 truncate under prefer-vector-width=256.
Craig Topper [Sat, 25 Apr 2020 22:00:19 +0000 (15:00 -0700)]
[X86] Improve lowering of v16i8->v16i1 truncate under prefer-vector-width=256.

4 years ago[docs] Fix :option: links
Jon Roelofs [Sat, 25 Apr 2020 22:19:02 +0000 (16:19 -0600)]
[docs] Fix :option: links