platform/upstream/llvm.git
3 years agoAMDGPU/GlobalISel: Fix test bugs and add a few more cases
Matt Arsenault [Sat, 8 Aug 2020 13:33:23 +0000 (09:33 -0400)]
AMDGPU/GlobalISel: Fix test bugs and add a few more cases

The wrong alignment or addrspace was used. Also add various cases to
stress a future patch.

3 years ago[ELF] Move the outSecOff addend from relocAlloc/relocNonAlloc/... to InputSectionBase...
Fangrui Song [Mon, 10 Aug 2020 15:57:19 +0000 (08:57 -0700)]
[ELF] Move the outSecOff addend from relocAlloc/relocNonAlloc/... to InputSectionBase::relocate

For an InputSection, the `buf` argument of `InputSectionBase::relocate` points
to the content of the containing OutputSection, instead of the content of the
InputSection itself, so `outSecOff` needs to be added in its callees.  This is
counter-intuitive and leads to many `- outSecOff` and `+ outSecOff`.

This patch makes `InputSection::writeTo` call `InputSectionBase::relocate` with
`outSecOff` added. relocAlloc/relocNonAlloc/relocateNonAllocForRelocatable can
thus be simplified now.

Updated test:

* non-abs-reloc.s: A minor offset bug is fixed for a diagnostic in `relocateNonAlloc`

Reviewed By: grimar

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

3 years ago[ELF][test] Enhance x86-64-split-stack-prologue-adjust-success.s & non-abs-reloc.s
Fangrui Song [Mon, 10 Aug 2020 15:52:16 +0000 (08:52 -0700)]
[ELF][test] Enhance x86-64-split-stack-prologue-adjust-success.s & non-abs-reloc.s

Catch problems when outSecOff is not zero and outSecOff is added twice or not added.

3 years ago[split-file] Fix sys::fs::remove() on Solaris after D83834
Fangrui Song [Mon, 10 Aug 2020 22:02:10 +0000 (15:02 -0700)]
[split-file] Fix sys::fs::remove() on Solaris after D83834

where stdio.h ::remove() may set errno to EEXIST instead of ENOTEMPTY.

POSIX.1-2017 allows EEXIST for unlink() (which is called by remove()):

> [EEXIST] or [ENOTEMPTY]
> The flag parameter has the AT_REMOVEDIR bit set and the path argument names a directory that is not an empty directory, or there are hard links to the directory other than dot or a single entry in dot-dot.

Reviewed By: ro

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

3 years ago[clang] Add a matcher for template template parameters.
Bruno Ricci [Tue, 11 Aug 2020 14:54:15 +0000 (15:54 +0100)]
[clang] Add a matcher for template template parameters.

There are already matchers for type template parameters and non-type template
parameters, but somehow no matcher exists for template template parameters
and I need it to write unit tests.

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

Reviewed By: aaron.ballman

3 years ago[DebugInfo] Allow GNU macro extension to be emitted
David Stenberg [Tue, 11 Aug 2020 11:48:30 +0000 (13:48 +0200)]
[DebugInfo] Allow GNU macro extension to be emitted

Allow the GNU .debug_macro extension to be emitted for DWARF versions
earlier than 5. The extension is basically what became DWARF 5's format,
except that a DW_AT_GNU_macros attribute is emitted, and some entries
like the strx entries are missing. In this patch I emit GNU's indirect
entries, which are the same as DWARF 5's strp entries.

This patch adds the extension behind a hidden LLVM flag,
-use-gnu-debug-macro. I would later want to enable it by default when
tuning for GDB and targeting DWARF versions earlier than 5.

The size of a Clang 8.0 binary built with RelWithDebInfo and the flags
"-gdwarf-4 -fdebug-macro" reduces from 1533 MB to 1349 MB with
.debug_macro (compared to 1296 MB without -fdebug-macro).

Reviewed By: SouraVX, dblaikie

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

3 years ago[DebugInfo] Simplify DwarfDebug::emitMacro
David Stenberg [Tue, 11 Aug 2020 11:46:59 +0000 (13:46 +0200)]
[DebugInfo] Simplify DwarfDebug::emitMacro

Broken out from a review comment on D82975. This is an NFC expect for
that the Macinfo macro string is now emitted using a single emitBytes()
invocation, so it can be done using a single string directive.

Reviewed By: dblaikie

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

3 years ago[GlobalISel] Remove unused variable. NFC.
Benjamin Kramer [Tue, 11 Aug 2020 14:56:45 +0000 (16:56 +0200)]
[GlobalISel] Remove unused variable. NFC.

3 years ago[DWARFYAML] Let the address size of line tables inferred from the object file.
Xing GUO [Tue, 11 Aug 2020 14:41:14 +0000 (22:41 +0800)]
[DWARFYAML] Let the address size of line tables inferred from the object file.

Currently, the line table uses the first compilation unit's address size
as its address size. It's not the right behavior. The address size should be
inferred from the target machine.

Reviewed By: jhenderson

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

3 years ago[flang][directives] Use TableGen information for clause classes in parse-tree
Valentin Clement [Tue, 11 Aug 2020 14:43:56 +0000 (10:43 -0400)]
[flang][directives] Use TableGen information for clause classes in parse-tree

This patch takes advantage of the directive information and tablegen generation
to replace the clauses class parse tree and in the dump parse tree sections.

Reviewed By: sscalpone

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

3 years agoGlobalISel: Implement bitcast action for G_INSERT_VECTOR_ELT
Matt Arsenault [Tue, 16 Jun 2020 01:35:15 +0000 (21:35 -0400)]
GlobalISel: Implement bitcast action for G_INSERT_VECTOR_ELT

This mirrors the support for the equivalent extracts. This also
creates a huge mess that would be greatly improved if we had any bit
operation combines.

3 years ago[NFC] Guard the cost report block of debug outputs with NDEBUG and
Dinar Temirbulatov [Tue, 11 Aug 2020 14:34:47 +0000 (16:34 +0200)]
[NFC] Guard the cost report block of debug outputs with NDEBUG and
switch to SmallString, this is part of D57779.

3 years ago[clang] Don't make ObjCIvarDecl visible twice when adding them to an implicit ObjCInt...
Raphael Isemann [Tue, 11 Aug 2020 12:42:26 +0000 (14:42 +0200)]
[clang] Don't make ObjCIvarDecl visible twice when adding them to an implicit ObjCInterfaceDecl

`addDecl` is making the ivar visible in its primary context. The primary context
of the ivar here is in a 'fragile' ABI the ObjCInterfaceDecl and in a
'non-fragile' ABI the current ObjCImplementationDecl. The additional call to
`makeDeclVisibleInContext` to make the ivar visible in the ObjCInterfaceDecl is
only necessary in the 'non-fragile' case (as in the 'fragile' case the Decl
becomes automatically visible in the ObjCInterfaceDecl with the `addDecl` call
as thats its primary context). See `Sema::ActOnIvar` for where the ivar is put
into a different context depending on the ABI.

To put this into an example:

```
lang=c++
@implementation SomeClass
{
  id ivar1;
}
@end

fragile case:
implicit ObjCInterfaceDecl 'SomeClass'
`- ivar1 (in primary context and will be automatically made visible)
ObjCImplementationDecl 'SomeClass'

non-fragile case:
implicit ObjCInterfaceDecl 'SomeClass'
`-<<<ivar1 not visible here and needs to be manually marked as visible.>>>
ObjCImplementationDecl 'SomeClass'
`- ivar1 (in its primary context and will be automatically made visible here)
```

Making a Decl visible multiple times in the same context is inefficient and
potentially can lead to crashes. See D84827 for more info and what this is
breaking.

Reviewed By: aprantl

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

3 years ago[clang] Don't make synthesized accessor stub functions visible twice
Raphael Isemann [Tue, 11 Aug 2020 12:37:53 +0000 (14:37 +0200)]
[clang] Don't make synthesized accessor stub functions visible twice

`addDecl` is making the Decl visible, so there is no need to make it explicitly
visible again. Making it visible twice will also make the lookup storage less
efficient and potentially lead to crashes, see D84827 for that.

Reviewed By: aprantl

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

3 years agoTableGen/GlobalISel: Hack the operand order for atomic_store
Matt Arsenault [Sun, 2 Aug 2020 21:23:52 +0000 (17:23 -0400)]
TableGen/GlobalISel: Hack the operand order for atomic_store

ISD::ATOMIC_STORE arbitrarily has the operands in the opposite order
from regular ISD::STORE, which always introduced an annoying
duplication of patterns to handle both cases. Since in GlobalISel
there's just the one G_STORE, we need to swap the operands to
correctly emit the type check for the pointer operand.

Some work started in 20aafa31569b5157e792daa8860d71dd0df8a53a to
migrate SelectionDAG to use ISD::STORE for atomics, but that work
seems to have stalled. Since this is the pretty much the last
operation which matters which isn't supported for AMDGPU, use this
compatibility hack to unblock declaring it functionally complete.

Not sure what's going on with the pending_phis AArch64 test. It seems
it didn't always use atomics, and I'm not sure what it was originally
testing matters anymore.

3 years ago[flang] Disable -Wmaybe-uninitialized for GCC
Tim Keith [Tue, 11 Aug 2020 14:20:13 +0000 (07:20 -0700)]
[flang] Disable -Wmaybe-uninitialized for GCC

According to llvm/cmake/config-ix.cmake, gcc's potentially uninitialized
use analysis has lots of false positives. We are encountering one in
flang/lib/Lower/CharacterExpr.cpp.

That warning is disabled for gcc in in-tree builds; this does the same
thing for out-of-tree builds.

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

3 years ago[NFC][ARM][SimplifyCFG] Add some tests.
Sam Parker [Tue, 11 Aug 2020 14:10:49 +0000 (15:10 +0100)]
[NFC][ARM][SimplifyCFG] Add some tests.

Add some tests around thresholds and minsize.

3 years ago[clang][HeaderInsert] Do not treat defines with values as header guards
Kadir Cetinkaya [Sat, 8 Aug 2020 23:02:23 +0000 (01:02 +0200)]
[clang][HeaderInsert] Do not treat defines with values as header guards

This was resulting in inserting headers at bogus locations, see
https://github.com/ycm-core/YouCompleteMe/issues/3736 for an example.

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

3 years ago[clangd] Disable ExtractFunction for C
Kadir Cetinkaya [Tue, 11 Aug 2020 13:03:32 +0000 (15:03 +0200)]
[clangd] Disable ExtractFunction for C

This tweak uses constructs like auto and refs, which are not available
in C.

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

3 years ago[clangd] Unify macro matching in code completion for AST and Index based macros
Kadir Cetinkaya [Tue, 11 Aug 2020 11:32:00 +0000 (13:32 +0200)]
[clangd] Unify macro matching in code completion for AST and Index based macros

fixes https://github.com/clangd/clangd/issues/489

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

3 years agoRevert "[flang][directives] Use TableGen information for clause classes in parse...
clementval [Tue, 11 Aug 2020 13:54:04 +0000 (09:54 -0400)]
Revert "[flang][directives] Use TableGen information for clause classes in parse-tree"

This reverts commit bf93edc4758b512e84b70ec6335d15b0cf386a18.

Buildbot failure

3 years ago[llvm-readobj/elf] - Remove `unwrapOrError` calls from DumpStyle<ELFT>::printRelocati...
Georgii Rymar [Wed, 5 Aug 2020 13:41:30 +0000 (16:41 +0300)]
[llvm-readobj/elf] - Remove `unwrapOrError` calls from DumpStyle<ELFT>::printRelocationsHelper.

It removes all `unwrapOrError` calls except the first one, which
is is bit different and can be removed separately.

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

3 years ago[compiler-rt][builtins] Un-xfail two tests on sparcv9
Rainer Orth [Tue, 11 Aug 2020 13:46:38 +0000 (15:46 +0200)]
[compiler-rt][builtins] Un-xfail two tests on sparcv9

Two tests currently `XPASS` on sparcv9:

  Unexpectedly Passed Tests (2):
    Builtins-sparcv9-sunos :: compiler_rt_logbl_test.c
    Builtins-sparcv9-sunos :: divtc3_test.c

The following patch fixes this.

Tested on `sparcv9-sun-solaris2.11`.

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

3 years ago[llvm-readobj][test] - Rename gnu-phdrs.test to program-headers.test, NFCI.
Georgii Rymar [Tue, 11 Aug 2020 13:44:50 +0000 (16:44 +0300)]
[llvm-readobj][test] - Rename gnu-phdrs.test to program-headers.test, NFCI.

program-headers.test was merged to gnu-phdrs.test and removed in D85526.
Now, gnu-phdrs.test contains tests for both GNU and LLVM style.

It was decided that this renaming should be done separately for a better
commit history and diffing purposes.

3 years ago[flang][directives] Use TableGen information for clause classes in parse-tree
Valentin Clement [Mon, 10 Aug 2020 19:44:38 +0000 (15:44 -0400)]
[flang][directives] Use TableGen information for clause classes in parse-tree

This patch takes advantage of the directive information and tablegen generation
to replace the clauses class parse tree and in the dump parse tree sections.

Reviewed By: sscalpone

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

3 years ago[llvm-readobj] - Refine program headers testing (`-l`, `--program-headers` and `...
Georgii Rymar [Fri, 7 Aug 2020 13:42:33 +0000 (16:42 +0300)]
[llvm-readobj] - Refine program headers testing (`-l`, `--program-headers` and `--segment`).

We have `gnu-phdrs.test` that tests
`-l`, `--program-headers` and `--segment` options for `llvm-readelf`.

We also have:
1) `program-headers.test` that tests `--program-headers` and `-l`
   for `llvm-readobj`. It doesn't test `--segment` and also uses
   lots of precompiled objects. It is very incomplete in compare
   with the `gnu-phdrs.test`.

2) `pt-gnu-property.test` that contains a simple test for the
   `PT_GNU_PROPERTY` segment. There is no reason to have it in
   a separate file.

This patch:
1) Merges `program-headers.test` and `pt-gnu-property.test` to `gnu-phdrs.test`.
2) Removes 2 precompiled binaries used by `program-headers.test`
   (other ones are still used by another tests).

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

3 years ago[ARM][MVE] Added extra tail-predication runs for auto-correlation test case. NFC
Sjoerd Meijer [Tue, 11 Aug 2020 12:55:14 +0000 (13:55 +0100)]
[ARM][MVE] Added extra tail-predication runs for auto-correlation test case. NFC

3 years ago[lld] s/dyn_cast/isa
Pavel Labath [Tue, 11 Aug 2020 13:20:59 +0000 (15:20 +0200)]
[lld] s/dyn_cast/isa

Fixes some unused variable warnings with gcc.

3 years ago[cmake] Make gtest macro definitions a part the library interface
Pavel Labath [Tue, 28 Jul 2020 13:26:23 +0000 (15:26 +0200)]
[cmake] Make gtest macro definitions a part the library interface

These definitions are needed by any file which uses gtest. Previously we
were adding them in the add_unittest function, but over time we've
accumulated libraries (which don't go through add_unittest) building on
gtest and this has resulted in proliferation of the definitions.

Making this a part of the library interface enables them to be managed
centrally. This follows a patch for -Wno-suggest-override (D84554) which
took a similar approach.

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

3 years ago[X86][SSE] Add tests for 256-bit HOP(SHUFFLE(X,Y),SHUFFLE(X,Y)) --> SHUFFLE(HOP(X...
Simon Pilgrim [Tue, 11 Aug 2020 13:01:45 +0000 (14:01 +0100)]
[X86][SSE] Add tests for 256-bit HOP(SHUFFLE(X,Y),SHUFFLE(X,Y)) --> SHUFFLE(HOP(X,Y)) patterns

This should be addressed by combineHorizOpWithShuffle once we enable it for HADD/SUB

3 years ago[X86][SSE] Add tests for HOP(LOSUBVECTOR(SHUFFLE(X)),HISUBVECTOR(SHUFFLE(X))) patterns
Simon Pilgrim [Tue, 11 Aug 2020 12:35:12 +0000 (13:35 +0100)]
[X86][SSE] Add tests for HOP(LOSUBVECTOR(SHUFFLE(X)),HISUBVECTOR(SHUFFLE(X))) patterns

This should be addressed by combineHorizOpWithShuffle once we enable it for HADD/SUB

3 years ago[clang-format] use spaces for alignment of binary/ternary expressions with UT_AlignWi...
Maximilian Fickert [Tue, 11 Aug 2020 12:54:46 +0000 (14:54 +0200)]
[clang-format] use spaces for alignment of binary/ternary expressions with UT_AlignWithSpaces

Use spaces to align binary and ternary expressions when using AlignOperands and UT_AlignWithSpaces.

This fixes an oversight in the new UT_AlignWithSpaces option (see D75034), which did not correctly identify the alignment of binary/ternary expressions.

Reviewed By: curdeius

Patch by: fickert

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

3 years ago[lldb] Add SubstTemplateTypeParm to RemoveWrappingTypes
Raphael Isemann [Tue, 11 Aug 2020 11:57:54 +0000 (13:57 +0200)]
[lldb] Add SubstTemplateTypeParm to RemoveWrappingTypes

Like the other type sugar removed by RemoveWrappingTypes, SubstTemplateTypeParm
is just pure sugar that should be ignored. If we don't ignore it (as we do now),
LLDB will fail to read values from record fields that have a
SubstTemplateTypeParm type.

Only way to produce such a type in LLDB is to either use the `import-std-module`
setting to get a template into the expression parser or just create your own
template directly in the expression parser which is what we do in the test.

Reviewed By: jarin

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

3 years ago[lldb] watchpoint ID common completion for commands `watchpoint delete/enable/disable...
Gongyu Deng [Tue, 11 Aug 2020 11:38:36 +0000 (13:38 +0200)]
[lldb] watchpoint ID common completion for commands `watchpoint delete/enable/disable/modify/ignore`

1. Added a common completion WatchPointIDs to complete with a list of the IDs of the current watchpoints;
2. Applied the completion to these commands: watchpoint delete/enable/disable/modify/ignore;
3. Added a correlated test case.

Reviewed By: teemperor

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

3 years ago[SCEV] ] If RHS >= Start, simplify (Start smax RHS) to RHS for trip counts.
Florian Hahn [Tue, 11 Aug 2020 12:05:04 +0000 (13:05 +0100)]
[SCEV] ] If RHS >= Start, simplify (Start smax RHS) to RHS for trip counts.

This is the max version of D85046.

This change causes binary changes in 44 out of 237 benchmarks (out of
MultiSource/SPEC2000/SPEC2006)

Reviewed By: lebedev.ri

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

3 years ago[LLD][ELF] - Update and fix gnu-ifunc* tests.
Georgii Rymar [Mon, 10 Aug 2020 12:30:08 +0000 (15:30 +0300)]
[LLD][ELF] - Update and fix gnu-ifunc* tests.

It turns that gnu-ifunc-plt-i386.s and gnu-ifunc-plt.s tests are broken.

Initially they were implemented in D27581 and tested that `IRELATIVE` relocations
are placed after other relocations in `.rel.plt`.

Later, we started to place `IRELATIVE` relocations to `.rela.dyn` (D65651).

Also, at some point `.plt` was renamed to `.iplt` (D71520).

Now, `gnu-ifunc*` tests mentioned do not test what they intended to test initially:
they should test that `IRELATIVE` relocations are placed after other ones in
`.rela.dyn`. Also, comments needs to be updated accordingly after changes performed.

This patch updates them.

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

3 years ago[SVE][CodeGen] Legalisation of INSERT_VECTOR_ELT for scalable vectors
Kerry McLaughlin [Tue, 11 Aug 2020 11:19:42 +0000 (12:19 +0100)]
[SVE][CodeGen] Legalisation of INSERT_VECTOR_ELT for scalable vectors

When the result type of insertelement needs to be split,
SplitVecRes_INSERT_VECTOR_ELT will try to store the vector to a
stack temporary, store the element at the location of the stack
temporary plus the index, and reload the Lo/Hi parts.

This patch does the following to ensure this works for scalable vectors:
 - Sets the StackID with getStackIDForScalableVectors() in CreateStackTemporary
 - Adds an IsScalable flag to getMemBasePlusOffset() and scales the
    offset by VScale when this is true
 - Ensures the immediate is clamped correctly by clampDynamicVectorIndex
    so that we don't try to use an out of range index

Reviewed By: david-arm

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

3 years agoFix Wdocumentation unknown param warnings. NFC.
Simon Pilgrim [Tue, 11 Aug 2020 11:46:48 +0000 (12:46 +0100)]
Fix Wdocumentation unknown param warnings. NFC.

3 years agoFix Wdocumentation unknown param warning. NFC.
Simon Pilgrim [Tue, 11 Aug 2020 11:41:29 +0000 (12:41 +0100)]
Fix Wdocumentation unknown param warning. NFC.

3 years ago[AST][RecoveryExpr] Don't preserve the return type if the FunctionDecl is invalid.
Haojian Wu [Tue, 11 Aug 2020 11:49:11 +0000 (13:49 +0200)]
[AST][RecoveryExpr] Don't preserve the return type if the FunctionDecl is invalid.

If a functionDecl is invalid (e.g. return type cannot be formed), int is
use as he fallback type, which may lead to some bogus diagnostics.

Reviewed By: sammccall

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

3 years ago[DebugInfo] Allow GNU macro extension to be read
David Stenberg [Tue, 11 Aug 2020 08:54:52 +0000 (10:54 +0200)]
[DebugInfo] Allow GNU macro extension to be read

Allow the GNU .debug_macro extension to be parsed and printed by
llvm-dwarfdump. In an upcoming patch support will be added for emitting
that format also.

Reviewed By: dblaikie

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

3 years ago[DebugInfo] Introduce GNU macro extension entry encodings
David Stenberg [Tue, 11 Aug 2020 08:53:38 +0000 (10:53 +0200)]
[DebugInfo] Introduce GNU macro extension entry encodings

This is a preparatory patch for allowing the GNU .debug_macro extension,
which is a precursor to the DWARF 5 format, to be emitted by LLVM for
earlier DWARF versions.

The entries share the same encoding and behavior as in DWARF5; there are
just more entries in the DWARF 5 format. Therefore, we could have used
those existing DWARF 5 entries, but I think that explicitly referring to
the GNU macro variants makes the code more clear.

The defines that this patch introduces can be found in GCC in the dwarf2.h header:
  https://gcc.gnu.org/git/?p=gcc.git;a=blob;
  f=include/dwarf2.h;
  h=0b6facfd4cf4c02320c7328114231b128ab42d5e;
  hb=dccbf1e2a6e544f71b4a5795f0c79015db019fc3#l425

Reviewed By: dblaikie

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

3 years ago[DebugInfo] Refactor .debug_macro checks. NFCI
David Stenberg [Tue, 11 Aug 2020 07:28:32 +0000 (09:28 +0200)]
[DebugInfo] Refactor .debug_macro checks. NFCI

Move the Dwarf version checks that determine if the .debug_macro section
should be emitted, into a DwarfDebug member. This is a preparatory
refactoring for allowing the GNU .debug_macro extension, which is a
precursor to the DWARF 5 format, to be emitted by LLVM for earlier DWARF
versions.

Reviewed By: dblaikie

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

3 years ago[lldb] thread index common completion for commands like `thread select/step-over`
Gongyu Deng [Tue, 11 Aug 2020 11:19:27 +0000 (13:19 +0200)]
[lldb] thread index common completion for commands like `thread select/step-over`

1. Added a common completion completing with a list of the threads of the current process;
2. Apply the common completion above to these commands: thread
   continue/info/exception/select/step-in/step-inst/step-inst-over/step-out/step-over/step-script​
3. Correlated test case test_common_completion_thread_index.

Reviewed By: teemperor

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

3 years ago[clangd] Enforce trailing slash for remote index's project root
Kirill Bobyrev [Tue, 11 Aug 2020 11:24:22 +0000 (13:24 +0200)]
[clangd] Enforce trailing slash for remote index's project root

Reviewed By: hokein

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

3 years ago[AutoUpgrade] Simplify code
Benjamin Kramer [Tue, 11 Aug 2020 11:20:39 +0000 (13:20 +0200)]
[AutoUpgrade] Simplify code

No need to set the name on an instruction that's going away, just move
it from the old instruction to the new one.

3 years ago[CodeGen] Refactor getMemBasePlusOffset & getObjectPtrOffset to accept a TypeSize
Kerry McLaughlin [Tue, 11 Aug 2020 10:38:08 +0000 (11:38 +0100)]
[CodeGen] Refactor getMemBasePlusOffset & getObjectPtrOffset to accept a TypeSize

Changes the Offset arguments to both functions from int64_t to TypeSize
& updates all uses of the functions to create the offset using TypeSize::Fixed()

Reviewed By: efriedma

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

3 years ago[lldb] stop-hook ID common completion for commands `target stop-hook enable/disable...
Gongyu Deng [Tue, 11 Aug 2020 11:13:49 +0000 (13:13 +0200)]
[lldb] stop-hook ID common completion for commands `target stop-hook enable/disable/delete'

1. Added a common completion StopHookIDs to provide completion with a list of stop hook ids;
2. Applied the common completion to commands: `target stop-hook delete/enable/disable';
3. Added an related test case.

Reviewed By: teemperor

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

3 years ago[X86][FPEnv] Fix a use after free
Benjamin Kramer [Tue, 11 Aug 2020 11:00:47 +0000 (13:00 +0200)]
[X86][FPEnv] Fix a use after free

Found by asan!

3 years ago[lldb] Fix unhandled switch case for GOFF in GDBRemoteCommunicationClient
Raphael Isemann [Tue, 11 Aug 2020 10:47:42 +0000 (12:47 +0200)]
[lldb] Fix unhandled switch case for GOFF in GDBRemoteCommunicationClient

Just implementing the default case that emits an error to supress the compiler
warning.

3 years ago[compiler-rt][ubsan][test] Fix TypeCheck/misaligned.cpp on Sparc
Rainer Orth [Tue, 11 Aug 2020 10:46:34 +0000 (12:46 +0200)]
[compiler-rt][ubsan][test] Fix TypeCheck/misaligned.cpp on Sparc

Two ubsan tests FAIL on Sparc:

  UBSan-Standalone-sparc :: TestCases/TypeCheck/misaligned.cpp
  UBSan-Standalone-sparcv9 :: TestCases/TypeCheck/misaligned.cpp

I've reported the details in Bug 47015, but it boils down to the fact that
the `s1` subtest actually incurs a fault on strict-alignment targets like
Sparc which UBSan doesn't expect.

This can be fixed like the `w1` subtest by compiling with
`-fno-sanitize-recover=alignment`.

Tested on `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`, and
`x86_64-pc-linux-gnu`.

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

3 years ago[VE] Update bit operations
Kazushi (Jam) Marukawa [Mon, 10 Aug 2020 08:16:57 +0000 (17:16 +0900)]
[VE] Update bit operations

Change bitreverse/bswap/ctlz/ctpop/cttz regression tests to support i128
and signext/zeroext i32 types.  This patch also change the way to support
i32 types using 64 bits VE instructions.

Reviewed By: simoll

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

3 years ago[SVE] Add ISD nodes for predicated integer extend inreg operations.
Paul Walker [Fri, 7 Aug 2020 18:19:50 +0000 (19:19 +0100)]
[SVE] Add ISD nodes for predicated integer extend inreg operations.

These are useful instructions when lowering fixed length vector
extends, so I've broken this patch out as kind of NFC like work.

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

3 years ago[X86] Rename combineVectorPackWithShuffle -> combineHorizOpWithShuffle. NFC.
Simon Pilgrim [Tue, 11 Aug 2020 10:38:26 +0000 (11:38 +0100)]
[X86] Rename combineVectorPackWithShuffle -> combineHorizOpWithShuffle. NFC.

The plan is to use this for (F)HADD/SUB opcodes as well as PACKs - similar to how we use combineShuffleWithHorizOp

3 years ago[clangd] RIFF.cpp - Use logical && instead of bitwise & for padding check
Simon Pilgrim [Tue, 11 Aug 2020 10:36:21 +0000 (11:36 +0100)]
[clangd] RIFF.cpp - Use logical && instead of bitwise & for padding check

Fixes PR47070

3 years ago[lldb] tab completion for `target modules load -u`
Gongyu Deng [Tue, 11 Aug 2020 10:29:25 +0000 (12:29 +0200)]
[lldb] tab completion for `target modules load -u`

1. Added a common completion ModuleUUIDs to provide a list of the UUIDs of modules for completion;
2. Added a new enumeration item eArgTypeModuleUUID to CommandArgumentType which is set as the option argument type of OptionGroupUUID;
3. Applied the module UUID completion to the argument of the type eArgTypeModuleUUID in lldb/source/Interpreter/CommandObject.cpp;
4. Added an related test case in lldb/test/API/functionalities/completion/TestCompletion.py.

3 years ago[SVE] Lower fixed length vector integer subtract operations.
Paul Walker [Mon, 10 Aug 2020 17:02:53 +0000 (18:02 +0100)]
[SVE] Lower fixed length vector integer subtract operations.

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

3 years ago[lldb] move the frame index completion into a common completion and apply it to ...
Gongyu Deng [Tue, 11 Aug 2020 10:20:43 +0000 (12:20 +0200)]
[lldb] move the frame index completion into a common completion and apply it to `thread backtrace -s`

Commands frame select and thread backtrace -s can be completed in the same way.
Moved the dedicated completion of frame select into a common completion and
apply it to the both commands, along with the test modified.

3 years agoAdd missing `-o -` to a recent test
David Zarzycki [Tue, 11 Aug 2020 09:56:58 +0000 (05:56 -0400)]
Add missing `-o -` to a recent test

Caught with a build-system that remounts the source directory read-only.

3 years ago[lldb] tab completion for `target modules search-paths insert​`
Gongyu Deng [Tue, 11 Aug 2020 09:12:11 +0000 (11:12 +0200)]
[lldb] tab completion for `target modules search-paths insert​`

Dedicated completion for the command `target modules search-paths insert​` with a test case.

Reviewed By: JDevlieghere

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

3 years ago[NFC] Fix typo in comment.
Kai Nacke [Tue, 11 Aug 2020 09:27:56 +0000 (05:27 -0400)]
[NFC] Fix typo in comment.

Twelvth -> Twelfth

3 years ago[SystemZ/ZOS] Add binary format goff and operating system zos to the triple
Kai Nacke [Fri, 19 Jun 2020 11:43:35 +0000 (13:43 +0200)]
[SystemZ/ZOS] Add binary format goff and operating system zos to the triple

Adds the binary format goff and the operating system zos to the triple
class. goff is selected as default binary format if zos is choosen as
operating system. No further functionality is added.

Reviewers: efriedma, tahonermann, hubert.reinterpertcast, MaskRay

Reviewed By: efriedma, tahonermann, hubert.reinterpertcast

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

3 years ago[Docs] Fixed missing closing quote character
Dávid Bolvanský [Tue, 11 Aug 2020 09:21:15 +0000 (11:21 +0200)]
[Docs] Fixed missing closing quote character

3 years ago[SLP] Make sure instructions are ordered when computing spill cost.
Florian Hahn [Tue, 11 Aug 2020 09:15:20 +0000 (11:15 +0200)]
[SLP] Make sure instructions are ordered when computing spill cost.

The entries in VectorizableTree are not necessarily ordered by their
position in basic blocks. Collect them and order them by dominance so
later instructions are guaranteed to be visited first. For instructions
in different basic blocks, we only scan to the beginning of the block,
so their order does not matter, as long as all instructions in a basic
block are grouped together. Using dominance ensures a deterministic order.

The modified test case contains an example where we compute a wrong
spill cost (2) without this patch, even though there is no call between
any instruction in the bundle.

This seems to have limited practical impact, .e.g on X86 with a recent
Intel Xeon CPU with -O3 -march=native -flto on MultiSource,SPEC2000,SPEC2006
there are no binary changes.

Reviewed By: ABataev

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

3 years ago[lldb] type language common completion
Gongyu Deng [Tue, 11 Aug 2020 08:32:55 +0000 (10:32 +0200)]
[lldb] type language common completion

1. Added a new common completion TypeLanguages to provide a list of supporting languages;
2. Bound the completion to eArgTypeLanguage;
3. Added a related test case.

3 years ago[InstCombine] ~(~X + Y) -> X - Y
Dávid Bolvanský [Tue, 11 Aug 2020 09:05:06 +0000 (11:05 +0200)]
[InstCombine] ~(~X + Y) -> X - Y

Proof:
https://alive2.llvm.org/ce/z/4xharr

Solves PR47051

Reviewed By: nikic

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

3 years ago[SCEVExpander] Add helper to clean up instrs inserted while expanding.
Florian Hahn [Tue, 11 Aug 2020 08:30:31 +0000 (09:30 +0100)]
[SCEVExpander] Add helper to clean up instrs inserted while expanding.

SCEVExpander already tracks which instructions have been inserted n
InsertedValues/InsertedPostIncValues. This patch adds an additional
vector to collect the instructions in insertion order. This can then be
used to remove exactly the instructions inserted by the expander.

This replaces ExpandedValuesCleaner, which in some cases might remove
values not inserted by the expander (e.g. if a value was dead before
insertion and is then used during expansion).

Reviewed By: lebedev.ri

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

3 years ago[lldb] tab completion for 'command delete/unalias'
Gongyu Deng [Tue, 11 Aug 2020 08:10:08 +0000 (10:10 +0200)]
[lldb] tab completion for 'command delete/unalias'

Provided dedicated tab completions for `command delete/unalias`.

Reviewed By: teemperor

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

3 years ago[lldb][NFC] Fix warning in Thread::AutoCompleteThreadPlans
Raphael Isemann [Tue, 11 Aug 2020 08:26:01 +0000 (10:26 +0200)]
[lldb][NFC] Fix warning in Thread::AutoCompleteThreadPlans

3 years ago[lldb] tab completion for `thread plan discard`
Gongyu Deng [Tue, 11 Aug 2020 08:02:51 +0000 (10:02 +0200)]
[lldb] tab completion for `thread plan discard`

Dedicated completion for the command `thread plan discard` with a corresponding
test case.

Reviewed By: teemperor

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

3 years ago[Analyzer] Improve invalid dereference bug reporting in DereferenceChecker.
Balázs Kéri [Tue, 11 Aug 2020 07:03:22 +0000 (09:03 +0200)]
[Analyzer] Improve invalid dereference bug reporting in DereferenceChecker.

Report undefined pointer dereference in similar way as null pointer dereference.

Reviewed By: NoQ

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

3 years ago[lldb][NFC] Remove unused custom reimplementation of realpath for Windows
Raphael Isemann [Tue, 11 Aug 2020 08:04:16 +0000 (10:04 +0200)]
[lldb][NFC] Remove unused custom reimplementation of realpath for Windows

No one is calling this function it seems and according to
https://bugs.llvm.org/show_bug.cgi?id=47088 this can leak memory, so let's just
remove it:

Quote from the bug report:
> Before return on line 146, the memory allocated on line 130 is not freed.

Reviewed By: amccarth

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

3 years ago[RDA] Fix DBG_VALUE issues
Sam Parker [Fri, 7 Aug 2020 08:49:09 +0000 (09:49 +0100)]
[RDA] Fix DBG_VALUE issues

We skip debug instructions in RDA so we cannot attempt to look them
up in our instruction map without causing a crash. But some of the
methods select the last instruction in the block and this
instruction may be a debug instruction... So, use getLastNonDebugInstr
instead of calling back on a MachineBasicBlock.

MachineBasicBlock iterators have also been updated to use
instructionsWithoutDebug so we can avoid the manual checks for debug
instructions.

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

3 years ago[lldb] tab completion for `disassemble -F`
Gongyu Deng [Tue, 11 Aug 2020 07:59:30 +0000 (09:59 +0200)]
[lldb] tab completion for `disassemble -F`

1.Added a new common completion DisassemblyFlavors;

2. Bound DisassemblyFlavors to argument of type eArgTypeDisassemblyFlavor in
CommandObject.cpp;

3. Added a related test case.

3 years ago[lldb] tab completion for `watchpoint set variable`
Gongyu Deng [Tue, 11 Aug 2020 07:50:28 +0000 (09:50 +0200)]
[lldb] tab completion for `watchpoint set variable`

1. Applied the common completion `eVariablePathCompletion` to command
`watchpoint set variable`;

2. Added a related test case.

Reviewed By: teemperor, JDevlieghere

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

3 years ago[clangd] Improve diagnostics in dexp interface
Kirill Bobyrev [Tue, 11 Aug 2020 07:48:54 +0000 (09:48 +0200)]
[clangd] Improve diagnostics in dexp interface

When running dexp in remote mode without --project-root it shuts down
with an assertion. This is not the desired behaviour: instruct user on
how to run it properly when the configuration is incorrect.

3 years agoRevert "[flang] Version information in flang/f18"
Richard Barton [Tue, 11 Aug 2020 07:41:57 +0000 (08:41 +0100)]
Revert "[flang] Version information in flang/f18"

Patch breaks out of tree builds and fails its regression test on buildbots.

This reverts commit 6e67a74ed73e60a9609f2666e9ac9f44c63c3e0f.

3 years ago[LazyValueInfo] Let getEdgeValueLocal look into freeze instructions
Juneyoung Lee [Tue, 11 Aug 2020 01:15:18 +0000 (10:15 +0900)]
[LazyValueInfo] Let getEdgeValueLocal look into freeze instructions

This patch makes getEdgeValueLocal more precise when a freeze instruction is
given, by adding support for freeze into constantFoldUser

Reviewed By: efriedma

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

3 years agoTest requires a debug build to pass.
Eric Christopher [Tue, 11 Aug 2020 06:57:33 +0000 (23:57 -0700)]
Test requires a debug build to pass.

3 years ago[Attributor][NFC] Connect AAPotentialValues with AAValueSimplify
Shinji Okumura [Tue, 11 Aug 2020 06:52:02 +0000 (15:52 +0900)]
[Attributor][NFC] Connect AAPotentialValues with AAValueSimplify

This patch enables `AAValueSimplify` to use information from `AAPotentialValues`

Reviewed By: jdoerfert

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

3 years ago[X86] Custom match X86ISD::VPTERNLOG in X86ISelDAGToDAG in order to reduce isel patterns.
Craig Topper [Tue, 11 Aug 2020 06:13:40 +0000 (23:13 -0700)]
[X86] Custom match X86ISD::VPTERNLOG in X86ISelDAGToDAG in order to reduce isel patterns.

By factoring out the end of tryVPTERNLOG, we can use the same code
to directly match X86ISD::VPTERNLOG. This allows us to remove
around 3-4K worth of X86GenDAGISel.inc.

3 years ago[CodeGen] Expand float operand for STRICT_FSETCC/STRICT_FSETCCS
QingShan Zhang [Tue, 11 Aug 2020 05:53:02 +0000 (05:53 +0000)]
[CodeGen] Expand float operand for STRICT_FSETCC/STRICT_FSETCCS

This patch is the continue work of https://reviews.llvm.org/D69281
to implement the way that expands STRICT_FSETCC/STRICT_FSETCCS.

Reviewed By: uweigand

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

3 years ago[lldb] Remove redundant add_definitions() in CMake (NFC)
Jonas Devlieghere [Tue, 11 Aug 2020 05:45:23 +0000 (22:45 -0700)]
[lldb] Remove redundant add_definitions() in CMake (NFC)

Remove the unused LLDB_CONFIGURATION_RELEASE and move LLDB_USE_OS_LOG
under debugserver which is the only one using it.

3 years ago[lldb] Use modern CMake to avoid repetition (NFC)
Jonas Devlieghere [Tue, 11 Aug 2020 05:25:05 +0000 (22:25 -0700)]
[lldb] Use modern CMake to avoid repetition (NFC)

Use the target variants of include_directories and add_definitions to
avoid repetition.

3 years ago[gn build] Port db91320a898
LLVM GN Syncbot [Tue, 11 Aug 2020 04:32:01 +0000 (04:32 +0000)]
[gn build] Port db91320a898

3 years agoRevert "Move ELFObjHandler to TextAPI library"
Haowei Wu [Tue, 11 Aug 2020 04:30:01 +0000 (21:30 -0700)]
Revert "Move ELFObjHandler to TextAPI library"

This reverts commit e6f8ba12e6ea97cbf4374b70e78309c2d859ca1c due
to build failures.

3 years ago[gn build] Port e6f8ba12e6e
LLVM GN Syncbot [Tue, 11 Aug 2020 04:24:23 +0000 (04:24 +0000)]
[gn build] Port e6f8ba12e6e

3 years agoMove ELFObjHandler to TextAPI library
Haowei Wu [Mon, 10 Aug 2020 18:35:01 +0000 (11:35 -0700)]
Move ELFObjHandler to TextAPI library

This change moves ELFObjHandler to llvm/TextAPI library so it can
be used by different llvm tools.

3 years ago[mlir][shape] Fix description copy pasta
Jacques Pienaar [Tue, 11 Aug 2020 04:17:32 +0000 (21:17 -0700)]
[mlir][shape] Fix description copy pasta

3 years ago[Sparc] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros on SPARCv9
Brad Smith [Tue, 11 Aug 2020 04:04:24 +0000 (00:04 -0400)]
[Sparc] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP macros on SPARCv9

3 years ago[lldb] Add missings moves where appropiate (NFC)
Jonas Devlieghere [Tue, 11 Aug 2020 04:01:23 +0000 (21:01 -0700)]
[lldb] Add missings moves where appropiate (NFC)

Manually curated list of things found by clang-tidy's
performance-unnecessary-value-param.

3 years ago[macho2yaml][test] Specify the object file's endianness. NFC.
Xing GUO [Tue, 11 Aug 2020 03:46:50 +0000 (11:46 +0800)]
[macho2yaml][test] Specify the object file's endianness. NFC.

This patch is intended to fix testing failure on big endian machine.

Failed testing: http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/52450

3 years ago[macho2yaml][test] Specify the object file's endianness. NFC.
Xing GUO [Tue, 11 Aug 2020 03:12:23 +0000 (11:12 +0800)]
[macho2yaml][test] Specify the object file's endianness. NFC.

This change specifies the endianness of the generated object file to fix
the testing failure.

Testing failure: http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/52449

3 years ago[Sema] Fix missing warning on initializer lists on field initializers with overloaded...
Zequan Wu [Tue, 11 Aug 2020 01:51:09 +0000 (18:51 -0700)]
[Sema] Fix missing warning on initializer lists on field initializers with overloaded operators

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

3 years ago[X86][FPEnv] Teach X86 mask compare intrinsics to respect strict FP semantics.
Wang, Pengfei [Tue, 11 Aug 2020 02:04:13 +0000 (10:04 +0800)]
[X86][FPEnv] Teach X86 mask compare intrinsics to respect strict FP semantics.

When we use mask compare intrinsics under strict FP option, the masked
elements shouldn't raise any exception. So, we cann't replace the
intrinsic with a full compare + "and" operation.

Reviewed By: craig.topper

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

3 years ago[lldb] Fix typo in AppleDWARFIndex
Jonas Devlieghere [Tue, 11 Aug 2020 02:21:09 +0000 (19:21 -0700)]
[lldb] Fix typo in AppleDWARFIndex

apple_names_table_up appeared twice in the binary expression, while the
second instance was meant to check apple_namespaces_table_up.

Fixes PR47101

3 years ago[AST] add parenthesis locations for IfStmt and SwitchStmt
Zequan Wu [Mon, 10 Aug 2020 23:29:33 +0000 (16:29 -0700)]
[AST] add parenthesis locations for IfStmt and SwitchStmt

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

3 years ago[macho2yaml] Refactor the DWARF section dumpers.
Xing GUO [Fri, 7 Aug 2020 04:07:31 +0000 (12:07 +0800)]
[macho2yaml] Refactor the DWARF section dumpers.

This patch refactors the DWARF section dumpers. When dumping a DWARF
section, if the DWARF parser fails to parse the section, we will dump it
as a raw content section. This patch also fixes a bug in
DWARFYAML::Data::isEmpty(). Finally, a test case that tests dumping the
__debug_aranges section is added.

Reviewed By: jhenderson, grimar

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

3 years ago[lld-macho] improve handling of -platform_version
Greg McGary [Tue, 11 Aug 2020 01:47:16 +0000 (18:47 -0700)]
[lld-macho] improve handling of -platform_version

This improves the handling of `-platform_version` by addressing the FIXME in the code to process the arguments.

Reviewed By: int3, #lld-macho

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

3 years ago[lld-macho] Handle command-line option -sectcreate SEG SECT FILE
Greg McGary [Tue, 11 Aug 2020 01:47:13 +0000 (18:47 -0700)]
[lld-macho] Handle command-line option -sectcreate SEG SECT FILE

Handle command-line option `-sectcreate SEG SECT FILE`, which inputs a binary blob from `FILE` into `SEG,SECT`

Reviewed By: int3

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