platform/upstream/llvm.git
4 years agoTest commit. NFC.
Sjoerd Meijer [Wed, 24 Jul 2019 13:30:36 +0000 (13:30 +0000)]
Test commit. NFC.

Removed 2 trailing whitespaces in 2 files that used to be in different
repos to test my new github monorepo workflow.

llvm-svn: 366904

4 years agoFix @skipIfSanitized decorator
Pavel Labath [Wed, 24 Jul 2019 13:05:56 +0000 (13:05 +0000)]
Fix @skipIfSanitized decorator

To run the test the decorator function should return None, not False.
Returning anything other than None skips the test.

llvm-svn: 366903

4 years ago[InstSimplify] Rename SimplifyFPUnOp and SimplifyFPBinOp
Jay Foad [Wed, 24 Jul 2019 12:50:10 +0000 (12:50 +0000)]
[InstSimplify] Rename SimplifyFPUnOp and SimplifyFPBinOp

Summary:
SimplifyFPBinOp is a variant of SimplifyBinOp that lets you specify
fast math flags, but the name is misleading because both functions
can simplify both FP and non-FP ops. Instead, overload SimplifyBinOp
so that you can optionally specify fast math flags.

Likewise for SimplifyFPUnOp.

Reviewers: spatel

Reviewed By: spatel

Subscribers: xbolva00, cameron.mcinally, eraman, hiraditya, haicheng, zzheng, llvm-commits

Tags: #llvm

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

llvm-svn: 366902

4 years ago[InstCombine] add tests for load narrowing; NFC
Sanjay Patel [Wed, 24 Jul 2019 12:44:21 +0000 (12:44 +0000)]
[InstCombine] add tests for load narrowing; NFC

Baseline results for D64432.

llvm-svn: 366901

4 years ago[clangd] Add categories to help options, and only show clangd options.
Sam McCall [Wed, 24 Jul 2019 12:41:52 +0000 (12:41 +0000)]
[clangd] Add categories to help options, and only show clangd options.

Summary:
Restricting the categories prevents extra unwanted options from creeping into
help (D60663), and removes a bunch of noise from --help-hidden.

While here, remove `static` from the opts in favor of an anon namespace, to
reduce the noise level.

Reviewers: hokein

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

Tags: #clang

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

llvm-svn: 366900

4 years ago[FileCheck] Use ASSERT for fatal unit tests
Thomas Preud'homme [Wed, 24 Jul 2019 12:38:34 +0000 (12:38 +0000)]
[FileCheck] Use ASSERT for fatal unit tests

Summary:
A number of EXPECT statements in FileCheck's unit tests are dependent
from results of other values being tested. This commit changes those
earlier test to use ASSERT instead of EXPECT to avoid cascade errors
when they are all related to the same issue.

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya

Tags: #llvm

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

> llvm-svn: 366862

llvm-svn: 366899

4 years ago[FileCheck]] Canonicalize caret location testing
Thomas Preud'homme [Wed, 24 Jul 2019 12:38:29 +0000 (12:38 +0000)]
[FileCheck]] Canonicalize caret location testing

Summary:
Testing of caret location in diagnostic message is currently made with
CHECK directive with the following general format:
CHECK: {{^         \^$}}

James Henderson suggested the following would be more readable:
CHECK: {{^}}         ^{{$}}

and when whole lines can be matched (as is the case for command-line
testing where error messages do not include path):
CHECK:         ^
using the option --match-full-lines.

This commit implements these 2 changes on all existing caret position
tests. It also aligns the caret to the character it is trying to match
in the above line.

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya

Tags: #llvm

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

> llvm-svn: 366861

llvm-svn: 366898

4 years agoFileCheck [8/12]: Define numeric var from expr
Thomas Preud'homme [Wed, 24 Jul 2019 12:38:22 +0000 (12:38 +0000)]
FileCheck [8/12]: Define numeric var from expr

Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch lift the restriction for a
numeric expression to either be a variable definition or a numeric
expression to try to match.

This commit allows a numeric variable to be set to the result of the
evaluation of a numeric expression after it has been matched
successfully. When it happens, the variable is allowed to be used on
the same line since its value is known at match time.

It also makes use of this possibility to reuse the parsing code to
parse a command-line definition by crafting a mirror string of the
-D option with the equal sign replaced by a colon sign, e.g. for option
'-D#NUMVAL=10' it creates the string
'-D#NUMVAL=10 (parsed as [[#NUMVAL:10]])' where the numeric expression
is parsed to define NUMVAL. This result in a few tests needing updating
for the location diagnostics on top of the tests for the new feature.

It also enables empty numeric expression which match any number without
defining a variable. This is done here rather than in commit #5 of the
patch series because it requires to dissociate automatic regex insertion
in RegExStr from variable definition which would make commit #5 even
bigger than it already is.

Copyright:
    - Linaro (changes up to diff 183612 of revision D55940)
    - GraphCore (changes in later versions of revision D55940 and
                 in new revision created off D55940)

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield

Tags: #llvm

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

> llvm-svn: 366860

llvm-svn: 366897

4 years ago[llvm-objdump] - Import the test/Object/X86/no-start-symbol.test test case and rewrit...
George Rimar [Wed, 24 Jul 2019 12:24:43 +0000 (12:24 +0000)]
[llvm-objdump] - Import the test/Object/X86/no-start-symbol.test test case and rewrite it to use YAML.

This patch removes test/Object/X86/no-start-symbol.test (rewrites
it to use YAML and moves it to llvm-objdump tests folder).

(This test was initially introduced in rL239039, but now there
is no reason to keep the precompiled binary it seems).

DIfferential revision: https://reviews.llvm.org/D65136

llvm-svn: 366896

4 years ago[Object/llvm-readobj] - Cleanup testing of the dynamic objects.
George Rimar [Wed, 24 Jul 2019 12:20:42 +0000 (12:20 +0000)]
[Object/llvm-readobj] - Cleanup testing of the dynamic objects.

This patch touches a few test cases:

It removes dtflags.elf-x86-64 binary and elf-dtflags.test.
elf-dtflags.test is excessive because we have the
elf-dynamic-tags.test which test all non-machine specific tags.

It removes testing of --dynamic-table from test\Object\readobj-shared-object.test
(we have the elf-dynamic-tags.test for that), and simplifies this test case.

It moves testing of the headers from readobj-shared-object.test
to elf-file-headers.test.

Adds test/tools/llvm-readobj/elf-file-types.test and test/tools/llvm-readobj/elf-loadname.test.

It opens road for removing the readobj-shared-object.test completely soon.

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

llvm-svn: 366895

4 years ago[yaml2obj] - Allow custom fields for the SHT_UNDEF sections.
George Rimar [Wed, 24 Jul 2019 12:16:22 +0000 (12:16 +0000)]
[yaml2obj] - Allow custom fields for the SHT_UNDEF sections.

This is a follow-up refactoring patch for recently
introduced functionality which which reduces the code duplication
and also makes possible to redefine all possible fields of
the first SHT_NULL section (previously it was only possible to set
sh_link and sh_size).

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

llvm-svn: 366894

4 years ago[clangd] SelectionTree treats TranslationUnitDecl (mostly) consistently with other...
Sam McCall [Wed, 24 Jul 2019 12:14:56 +0000 (12:14 +0000)]
[clangd] SelectionTree treats TranslationUnitDecl (mostly) consistently with other containers.

Summary:
Previously TranslationUnitDecl would never be selected.
This means root() is never null, and returns a reference.

commonAncestor() is in principle never null also, but returning TUDecl
here requires tweaks to be careful not to traverse it (this was already
possible when selecting multiple top-level decls, and there are associated bugs!)
Instead, never allow commonAncestor() to return TUDecl, return null instead.

Reviewers: hokein

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

Tags: #clang

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

llvm-svn: 366893

4 years ago[lldb] Fix build errors from tablegenify platform commit
Raphael Isemann [Wed, 24 Jul 2019 12:08:08 +0000 (12:08 +0000)]
[lldb] Fix build errors from tablegenify platform commit

Forgot to stage some changes...

llvm-svn: 366892

4 years ago[lldb][NFC] Tablegenify platform
Raphael Isemann [Wed, 24 Jul 2019 12:05:42 +0000 (12:05 +0000)]
[lldb][NFC] Tablegenify platform

llvm-svn: 366891

4 years ago[ARM] MVE predicate register support
David Green [Wed, 24 Jul 2019 11:51:36 +0000 (11:51 +0000)]
[ARM] MVE predicate register support

This adds support code for building and shuffling i1 predicate registers. It
generally uses two basic principles, either converting the predicate into an
scalar (through a PREDICATE_CAST) and doing scalar operations on it there, or
by converting the register to an full vector register and back.

Some of the code here is a not super efficient but will hopefully cover most
cases of moving i1 vectors around and can be improved in subsequent patches.

Some code by David Sherwood.

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

llvm-svn: 366890

4 years agoRevert "Revert "[lldb] [Process/NetBSD] Fix constructor after r363707""
Michal Gorny [Wed, 24 Jul 2019 11:44:43 +0000 (11:44 +0000)]
Revert "Revert "[lldb] [Process/NetBSD] Fix constructor after r363707""

The relevant changes have been reapplied, and broke build again.

llvm-svn: 366889

4 years ago[mips] Assign R_TLS type to the R_MIPS_TLS_TPREL_XXX relocations. NFC
Simon Atanasyan [Wed, 24 Jul 2019 11:37:13 +0000 (11:37 +0000)]
[mips] Assign R_TLS type to the R_MIPS_TLS_TPREL_XXX relocations. NFC

That allows to remove duplicated code which subtracts 0x7000 from the
R_MIPS_TLS_TPREL_XXX relocations values in the `MIPS::relocateOne`
function.

llvm-svn: 366888

4 years ago[DWARF][NFC] Add constants for reserved values of an initial length field.
Igor Kudrin [Wed, 24 Jul 2019 11:34:29 +0000 (11:34 +0000)]
[DWARF][NFC] Add constants for reserved values of an initial length field.

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

llvm-svn: 366887

4 years agoRecommit rr366796 "[Object/ELF.h] - Improve testing of the fields in ELFFile<ELFT...
George Rimar [Wed, 24 Jul 2019 11:24:37 +0000 (11:24 +0000)]
Recommit rr366796 "[Object/ELF.h] - Improve testing of the fields in ELFFile<ELFT>::sections()."

With a fix of the issue found by UBSan.

Original commit message:

This eliminates a one error untested and
also introduces a error for one more possible case
which lead to crash previously.

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

llvm-svn: 366886

4 years ago[ARM] MVE integer compares and selects
David Green [Wed, 24 Jul 2019 11:08:14 +0000 (11:08 +0000)]
[ARM] MVE integer compares and selects

This adds the very basics for MVE vector predication, adding integer VCMP and
VSEL instruction support. This is done through predicate registers (MVT::v16i1,
MVT::v8i1, MVT::v4i1), but otherwise using same mechanics as NEON to custom
lower setcc's through ARMISD::VCXX nodes (VCEQ, VCGT, VCEQZ, etc).

An extra VCNE was added, as this can be handled sensibly by MVE's expanded
number of VCMP condition codes. (There are also VCLE and VCLT which are added
later).

VPSEL is also added here, simply selecting on the vselect.

Original code by David Sherwood.

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

llvm-svn: 366885

4 years ago[CrossTU] Add a function to retrieve original source location.
Balazs Keri [Wed, 24 Jul 2019 10:16:37 +0000 (10:16 +0000)]
[CrossTU] Add a function to retrieve original source location.

Summary:
A new function will be added to get the original SourceLocation
for a SourceLocation that was imported as result of getCrossTUDefinition.
The returned SourceLocation is in the context of the (original)
SourceManager for the original source file. Additionally the
ASTUnit object for that source file is returned. This is needed
to get a SourceManager to operate on with the returned source location.

The new function works if multiple different source files are loaded
with the same CrossTU context.

Reviewers: martong, shafik

Reviewed By: martong

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

llvm-svn: 366884

4 years ago[Format] getFormattingLangOpts: make LS_Auto uses LS_Cpp11 lexing rule
Fangrui Song [Wed, 24 Jul 2019 09:50:56 +0000 (09:50 +0000)]
[Format] getFormattingLangOpts: make LS_Auto uses LS_Cpp11 lexing rule

Suggested by sammccall in post-commit review of D65183

Reviewed By: sammccall

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

llvm-svn: 366883

4 years ago[clangd] Fix SelectionTree traversal of qualified types
Sam McCall [Wed, 24 Jul 2019 09:39:11 +0000 (09:39 +0000)]
[clangd] Fix SelectionTree traversal of qualified types

Summary:
QualifiedTypeLoc isn't treated like a regular citizen by RecursiveASTVisitor.
This meant we weren't intercepting the traversal of its inner TypeLoc.

Most of the changes here are about exposing kind() so we can improve the
precision of our tests.

This should fix the issue raised in D65067.

Reviewers: hokein

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

Tags: #clang

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

llvm-svn: 366882

4 years ago[ARM][ParallelDSP] Fix pointer operand reordering
Sam Parker [Wed, 24 Jul 2019 09:38:39 +0000 (09:38 +0000)]
[ARM][ParallelDSP] Fix pointer operand reordering

While combining two loads into a single load, we often need to
reorder the pointer operands for the new load. This reordering was
broken in the cases where there was a chain of values that built up
the pointer.

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

llvm-svn: 366881

4 years ago[clangd] Reformat use of cl::opt: use unqualified name and don't bin-pack attributes...
Sam McCall [Wed, 24 Jul 2019 09:33:27 +0000 (09:33 +0000)]
[clangd] Reformat use of cl::opt: use unqualified name and don't bin-pack attributes. NFC

Reviewers: kadircet

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

Tags: #clang

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

llvm-svn: 366880

4 years ago[lldb] Remove Xcode project legacy
Stefan Granitz [Wed, 24 Jul 2019 09:20:14 +0000 (09:20 +0000)]
[lldb] Remove Xcode project legacy

Summary: Since D65109 removed the manually maintained Xcode project, there's a few things we don't need anymore. Anything here we should keep or anything more to remove?

Reviewers: JDevlieghere, jasonmolenda, clayborg, jingham, lanza, teemperor

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

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

llvm-svn: 366879

4 years ago[SVE][Inline-Asm] Add support to specify SVE registers in the clobber list
Sander de Smalen [Wed, 24 Jul 2019 08:42:34 +0000 (08:42 +0000)]
[SVE][Inline-Asm] Add support to specify SVE registers in the clobber list

Adds the SVE vector and predicate registers to the list of known registers.

Patch by Kerry McLaughlin.

Reviewers: erichkeane, sdesmalen, rengolin

Reviewed By: sdesmalen

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

llvm-svn: 366878

4 years ago[clangd] Bump vscode-clangd v0.0.16
Haojian Wu [Wed, 24 Jul 2019 08:14:29 +0000 (08:14 +0000)]
[clangd] Bump vscode-clangd v0.0.16

CHANGELOG:
- detect C++ language based on some well-known file paths
- upgrade the lsp-client and lsp-server dependencies

llvm-svn: 366877

4 years ago[Format] Make it easy to add new format::FormatStyle::LanguageStandard. NFCI
Fangrui Song [Wed, 24 Jul 2019 08:04:29 +0000 (08:04 +0000)]
[Format] Make it easy to add new format::FormatStyle::LanguageStandard. NFCI

Preparatory change for D65043.

We current use `!=LS_Cpp03` to enable language standards 11,14,17, and
2a. `>=LS_Cpp11` is better if we decide to add new LanguageStandard in
the future.

Reviewed By: sammccall

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

llvm-svn: 366876

4 years ago[clangd] Update a stale comment, NFC.
Haojian Wu [Wed, 24 Jul 2019 07:57:25 +0000 (07:57 +0000)]
[clangd] Update a stale comment, NFC.

llvm-svn: 366875

4 years ago[Remark] Suppress the "-Wreturn-type" compiler warning, NFC
Haojian Wu [Wed, 24 Jul 2019 07:55:01 +0000 (07:55 +0000)]
[Remark] Suppress the "-Wreturn-type" compiler warning, NFC

llvm-svn: 366874

4 years ago[clangd] Implement "prepareRename"
Haojian Wu [Wed, 24 Jul 2019 07:49:23 +0000 (07:49 +0000)]
[clangd] Implement "prepareRename"

Summary:
- "prepareRename" request is added in LSP v3.12.0
- also update the vscode-client dependency to pick-up the rename bug fix[1]

[1]: https://github.com/microsoft/vscode-languageserver-node/issues/447

Reviewers: sammccall

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

Tags: #clang

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

llvm-svn: 366873

4 years agoRevert "FileCheck [8/12]: Define numeric var from expr"
Thomas Preud'homme [Wed, 24 Jul 2019 07:32:34 +0000 (07:32 +0000)]
Revert "FileCheck [8/12]: Define numeric var from expr"

This reverts commit 1b05977538d9487aa845ee2f3bec8b89c63c4f29.

llvm-svn: 366872

4 years agoRevert "[FileCheck]] Canonicalize caret location testing"
Thomas Preud'homme [Wed, 24 Jul 2019 07:32:18 +0000 (07:32 +0000)]
Revert "[FileCheck]] Canonicalize caret location testing"

This reverts commit ba4e8d791342219c072a5c8de8a3f41fbb53c6be.

llvm-svn: 366871

4 years agoRevert "[FileCheck] Use ASSERT for fatal unit tests"
Thomas Preud'homme [Wed, 24 Jul 2019 07:32:11 +0000 (07:32 +0000)]
Revert "[FileCheck] Use ASSERT for fatal unit tests"

This reverts commit fb596735fe9c1ea22afb1727cbbba449bd6334c2.

llvm-svn: 366870

4 years ago[Clangd] Fixed ExtractVariable for certain types of Exprs
Shaurya Gupta [Wed, 24 Jul 2019 05:42:55 +0000 (05:42 +0000)]
[Clangd] Fixed ExtractVariable for certain types of Exprs

Summary:

- Modified ExtractVariable for extraction of MemberExpr, DeclRefExpr and Assignment Expr
- Removed extraction from label statements.
- Fixed unittests

Reviewers: sammccall, kadircet

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

Tags: #clang

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

llvm-svn: 366869

4 years ago[RISCV] Implement benchmark::cycleclock::Now
Roger Ferrer Ibanez [Wed, 24 Jul 2019 05:33:46 +0000 (05:33 +0000)]
[RISCV] Implement benchmark::cycleclock::Now

This is a cherrypick of D64237 onto llvm/utils/benchmark and
libcxx/utils/google-benchmark.

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

llvm-svn: 366868

4 years ago[PowerPC][NFC] use opcode instead of MachineInstr for instrHasImmForm().
Chen Zheng [Wed, 24 Jul 2019 04:50:23 +0000 (04:50 +0000)]
[PowerPC][NFC] use opcode instead of MachineInstr for instrHasImmForm().

llvm-svn: 366867

4 years ago[AArch64] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after r366857
Fangrui Song [Wed, 24 Jul 2019 01:59:44 +0000 (01:59 +0000)]
[AArch64] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after r366857

llvm-svn: 366866

4 years ago[SafeStack] Insert the deref before remaining elements
Petr Hosek [Wed, 24 Jul 2019 00:16:23 +0000 (00:16 +0000)]
[SafeStack] Insert the deref before remaining elements

This is a follow up to D64971. While we need to insert the deref after
the offset, it needs to come before the remaining elements in the
original expression since the deref needs to happen before the LLVM
fragment if present.

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

llvm-svn: 366865

4 years ago[Remarks] String tables should be move-only
Francis Visoiu Mistrih [Tue, 23 Jul 2019 22:50:08 +0000 (22:50 +0000)]
[Remarks] String tables should be move-only

Copying them is expensive. This allows the tables to be moved around at
lower cost, and allows a remarks::StringTable to be constructed from
a remarks::ParsedStringTable.

llvm-svn: 366864

4 years ago[lldb] Fix enum value description
Jonas Devlieghere [Tue, 23 Jul 2019 22:46:16 +0000 (22:46 +0000)]
[lldb] Fix enum value description

llvm-svn: 366863

4 years ago[FileCheck] Use ASSERT for fatal unit tests
Thomas Preud'homme [Tue, 23 Jul 2019 22:41:51 +0000 (22:41 +0000)]
[FileCheck] Use ASSERT for fatal unit tests

Summary:
A number of EXPECT statements in FileCheck's unit tests are dependent
from results of other values being tested. This commit changes those
earlier test to use ASSERT instead of EXPECT to avoid cascade errors
when they are all related to the same issue.

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya

Tags: #llvm

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

llvm-svn: 366862

4 years ago[FileCheck]] Canonicalize caret location testing
Thomas Preud'homme [Tue, 23 Jul 2019 22:41:46 +0000 (22:41 +0000)]
[FileCheck]] Canonicalize caret location testing

Summary:
Testing of caret location in diagnostic message is currently made with
CHECK directive with the following general format:
CHECK: {{^         \^$}}

James Henderson suggested the following would be more readable:
CHECK: {{^}}         ^{{$}}

and when whole lines can be matched (as is the case for command-line
testing where error messages do not include path):
CHECK:         ^
using the option --match-full-lines.

This commit implements these 2 changes on all existing caret position
tests. It also aligns the caret to the character it is trying to match
in the above line.

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya

Tags: #llvm

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

llvm-svn: 366861

4 years agoFileCheck [8/12]: Define numeric var from expr
Thomas Preud'homme [Tue, 23 Jul 2019 22:41:38 +0000 (22:41 +0000)]
FileCheck [8/12]: Define numeric var from expr

Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch lift the restriction for a
numeric expression to either be a variable definition or a numeric
expression to try to match.

This commit allows a numeric variable to be set to the result of the
evaluation of a numeric expression after it has been matched
successfully. When it happens, the variable is allowed to be used on
the same line since its value is known at match time.

It also makes use of this possibility to reuse the parsing code to
parse a command-line definition by crafting a mirror string of the
-D option with the equal sign replaced by a colon sign, e.g. for option
'-D#NUMVAL=10' it creates the string
'-D#NUMVAL=10 (parsed as [[#NUMVAL:10]])' where the numeric expression
is parsed to define NUMVAL. This result in a few tests needing updating
for the location diagnostics on top of the tests for the new feature.

It also enables empty numeric expression which match any number without
defining a variable. This is done here rather than in commit #5 of the
patch series because it requires to dissociate automatic regex insertion
in RegExStr from variable definition which would make commit #5 even
bigger than it already is.

Copyright:
    - Linaro (changes up to diff 183612 of revision D55940)
    - GraphCore (changes in later versions of revision D55940 and
                 in new revision created off D55940)

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield

Tags: #llvm

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

llvm-svn: 366860

4 years ago[DWARF] Use 32-bit format specifier for offset
Jonas Devlieghere [Tue, 23 Jul 2019 22:34:21 +0000 (22:34 +0000)]
[DWARF] Use 32-bit format specifier for offset

This should fix PR42730.

llvm-svn: 366859

4 years ago[lldb][test_suite] Update tests with unexpected pass on Android aarch64
Alex Langford [Tue, 23 Jul 2019 22:12:16 +0000 (22:12 +0000)]
[lldb][test_suite] Update tests with unexpected pass on Android aarch64

Summary: update some test decorates that can actually pass on andriod aarch64

Patch by Wanyi Ye <kusmour@gmail.com>

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

llvm-svn: 366858

4 years ago[AArch64][GlobalISel] Add support for s128 loads, stores, extracts, truncs.
Amara Emerson [Tue, 23 Jul 2019 22:05:13 +0000 (22:05 +0000)]
[AArch64][GlobalISel] Add support for s128 loads, stores, extracts, truncs.

We need to be able to load and store s128 for memcpy inlining, where we want to
generate Q register mem ops. Making these legal also requires that we add some
support in other instructions. Regbankselect should also know about these since
they have no GPR register class that can hold them, so need special handling to
live on the FPR bank.

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

llvm-svn: 366857

4 years agoFix "control reaches end of non-void function" warning. NFCI.
Simon Pilgrim [Tue, 23 Jul 2019 21:59:48 +0000 (21:59 +0000)]
Fix "control reaches end of non-void function" warning. NFCI.

llvm-svn: 366856

4 years ago[docs] Clarify where the indirect UB due to write-write races comes from
Eli Friedman [Tue, 23 Jul 2019 21:51:26 +0000 (21:51 +0000)]
[docs] Clarify where the indirect UB due to write-write races comes from

This is based on https://bugs.llvm.org/show_bug.cgi?id=42435#c3.

Patch by Ralf Jung.

llvm-svn: 366855

4 years ago[GlobalISel][AArch64] Save a copy on G_SELECT by fixing condition to GPR
Jessica Paquette [Tue, 23 Jul 2019 21:39:50 +0000 (21:39 +0000)]
[GlobalISel][AArch64] Save a copy on G_SELECT by fixing condition to GPR

The condition can never be fed by FPRs, so it should always be on a GPR.

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

llvm-svn: 366854

4 years ago[ExpressionParser] Handle llvm::Expected result
Jonas Devlieghere [Tue, 23 Jul 2019 21:14:41 +0000 (21:14 +0000)]
[ExpressionParser] Handle llvm::Expected result

This fixes the unchecked-error assertion at runtime.

  Expected<T> must be checked before access or destruction. Expected<T>
  value was in success state. (Note: Expected<T> values in success mode
  must still be checked prior to being destroyed).

llvm-svn: 366853

4 years ago[ExpressionParser] Fix formatting and whitespace (NFC)
Jonas Devlieghere [Tue, 23 Jul 2019 21:14:23 +0000 (21:14 +0000)]
[ExpressionParser] Fix formatting and whitespace (NFC)

Fix formatting and whitespace before making changes to this file.

llvm-svn: 366852

4 years ago[ARM] Add opt-bisect support to ARMParallelDSP.
Eli Friedman [Tue, 23 Jul 2019 20:48:46 +0000 (20:48 +0000)]
[ARM] Add opt-bisect support to ARMParallelDSP.

llvm-svn: 366851

4 years ago[lldb] Fix occasional hangs of VSCode testcases
Jan Kratochvil [Tue, 23 Jul 2019 20:45:03 +0000 (20:45 +0000)]
[lldb] Fix occasional hangs of VSCode testcases

On slower machines the vscode testcases were sometimes hanging:

  1910 ? Sl 0:00 |   \_ /usr/bin/python .../llvm/tools/lldb/test/dotest.py ... -p TestVSCode_setBreakpoints.py
  2649 ? Sl 0:00 |       \_ .../build/bin/lldb-vscode
  2690 ? S  0:00 |           \_ .../build/bin/lldb-server gdbserver --fd=9 --native-regs --setsid
  2708 ? t  0:00 |               \_ .../build/lldb-test-build.noindex/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.test_functionality/a.out

A reproducer of the racy bug for send_recv():
#         self.send_packet(command)
#+        import time
#+        time.sleep(1)
#         done = False

I guess `request_continue` was probably originally intended to be synchronous
but then it isn't and this code has been leftover there.

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

llvm-svn: 366850

4 years ago[Remarks] Introduce a new format: yaml-strtab
Francis Visoiu Mistrih [Tue, 23 Jul 2019 20:42:46 +0000 (20:42 +0000)]
[Remarks] Introduce a new format: yaml-strtab

This exposes better support to use a string table with a format through
an actual new remark::Format, called yaml-strtab.

This can now be used with -fsave-optimization-record=yaml-strtab.

llvm-svn: 366849

4 years agoRevert "Revert "Add ReadCStringFromMemory for faster string reads""
Antonio Afonso [Tue, 23 Jul 2019 20:40:37 +0000 (20:40 +0000)]
Revert "Revert "Add ReadCStringFromMemory for faster string reads""

This reverts commit 9c10b620c0619611dfe062216459431955ac4801.

llvm-svn: 366848

4 years agoRevert "Revert "Implement xfer:libraries-svr4:read packet""
Antonio Afonso [Tue, 23 Jul 2019 20:40:30 +0000 (20:40 +0000)]
Revert "Revert "Implement xfer:libraries-svr4:read packet""

This reverts commit 08c38f77c5fb4d3735ec215032fed8ee6730b3db.

llvm-svn: 366847

4 years ago[Remarks][NFC] Move the YAML serializer to its own header
Francis Visoiu Mistrih [Tue, 23 Jul 2019 19:28:03 +0000 (19:28 +0000)]
[Remarks][NFC] Move the YAML serializer to its own header

llvm-svn: 366842

4 years ago[PowerPC] Remove redundant load immediate instructions
Yi-Hong Lyu [Tue, 23 Jul 2019 19:11:07 +0000 (19:11 +0000)]
[PowerPC] Remove redundant load immediate instructions

Currently PowerPC backend emits code like this:

  r3 = li 0
  std r3, 264(r1)
  r3 = li 0
  std r3, 272(r1)

This patch fixes that and other cases where a register already contains a value that is loaded so we will get:

  r3 = li 0
  std r3, 264(r1)
  std r3, 272(r1)

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

llvm-svn: 366840

4 years agogn build: Merge r366832
Nico Weber [Tue, 23 Jul 2019 19:02:47 +0000 (19:02 +0000)]
gn build: Merge r366832

llvm-svn: 366837

4 years agold.lld: Demangle symbols from archives in diagnostics
Nico Weber [Tue, 23 Jul 2019 19:00:01 +0000 (19:00 +0000)]
ld.lld: Demangle symbols from archives in diagnostics

This ports r366573 from COFF to ELF.

There are now to toString(Archive::Symbol), one doing MSVC demangling
in COFF and one doing Itanium demangling in ELF, so rename these two
to toCOFFString() and to toELFString() to not get a duplicate symbol.

Nothing ever passes a raw Archive::Symbol to CHECK(), so these not
being part of the normal toString() machinery seems ok.

There are two code paths in the ELF linker that emits this type of
diagnostic:

1. The "normal" one in InputFiles.cpp. This is covered by the tweaked test.

2. An additional one that's only used for libcalls if there's at least
   one bitcode in the link, and if the libcall symbol is lazy, and
   lazily loaded from an archive (i.e. not from a lazy .o file).
   (This code path was added in r339301.) Since all libcall names so far
   are C symbols and never mangled, the change there is not observable
   and hence not covered by tests.

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

llvm-svn: 366836

4 years ago[X86] In lowerVectorShuffle, instead of creating a new node to canonicalize the shuff...
Craig Topper [Tue, 23 Jul 2019 18:46:15 +0000 (18:46 +0000)]
[X86] In lowerVectorShuffle, instead of creating a new node to canonicalize the shuffle mask by commuting, just commute the mask and swap V1/V2.

LegalizeDAG tries to legal the DAG by legalizing nodes before
their operands.

If we create a new node, we end up legalizing it after its operands.
This prevents some of the optimizations that can be done when the
operand is a build_vector since the build_vector will have been
legalized to something else.

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

llvm-svn: 366835

4 years ago[libFuzzer] Fix __sanitizer_print_memory_profile return type in ExtFunctions.def
Max Moroz [Tue, 23 Jul 2019 18:26:53 +0000 (18:26 +0000)]
[libFuzzer] Fix __sanitizer_print_memory_profile return type in ExtFunctions.def

Summary:
Looks like a typo, as that function actually returns void and is used
as such in libFuzzer code as well.

Reviewers: kcc, Dor1s

Reviewed By: Dor1s

Subscribers: delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 366834

4 years ago[utils] Remove sync-source (with SVN)
Jonas Devlieghere [Tue, 23 Jul 2019 18:09:13 +0000 (18:09 +0000)]
[utils] Remove sync-source (with SVN)

llvm-svn: 366833

4 years ago[Remarks] Add unit tests for YAML serialization
Francis Visoiu Mistrih [Tue, 23 Jul 2019 18:09:12 +0000 (18:09 +0000)]
[Remarks] Add unit tests for YAML serialization

Add tests for both the string table and non string table case.

llvm-svn: 366832

4 years agoclang-format: Fix namespace end comments for namespaces with attributes and macros.
Nico Weber [Tue, 23 Jul 2019 17:49:45 +0000 (17:49 +0000)]
clang-format: Fix namespace end comments for namespaces with attributes and macros.

Fixes PR39247.

While here, also make C++20 `namespace A::inline B::inline C` nested
inline namespaced definitions work.

Before:
    #define DEPRECATE_WOOF [[deprecated("meow")]]

    namespace DEPRECATE_WOOF woof {
    void f() {}
    } // namespace DEPRECATE_WOOFwoof

    namespace [[deprecated("meow")]] woof {
      void f() {}
    } // namespace [[deprecated("meow")]]woof

    namespace woof::inline bark {
      void f() {}
    } // namespace woof::inlinebark

Now:
    #define DEPRECATE_WOOF [[deprecated("meow")]]

    namespace DEPRECATE_WOOF woof {
    void f() {}
    } // namespace woof

    namespace [[deprecated("meow")]] woof {
    void f() {}
    } // namespace woof

    namespace woof::inline bark {
    void f() {}
    } // namespace woof::inline bark

(In addition to the fixed namespace end comments, also note the correct
indent of the namespace contents.)

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

llvm-svn: 366831

4 years ago[Utils] Add back utils directory
Jonas Devlieghere [Tue, 23 Jul 2019 17:47:08 +0000 (17:47 +0000)]
[Utils] Add back utils directory

Due to a bug my earlier commit removed the whole utils directory:
https://reviews.llvm.org/D65123

llvm-svn: 366830

4 years ago[IndVars] Fix a subtle bug in optimizeLoopExits
Philip Reames [Tue, 23 Jul 2019 17:45:11 +0000 (17:45 +0000)]
[IndVars] Fix a subtle bug in optimizeLoopExits

The original code failed to account for the fact that one exit can have a pointer exit count without all of them having pointer exit counts.  This could cause two separate bugs:
1) We might exit the loop early, and leave optimizations undone.  This is what triggered the assertion failure in the reported test case.
2) We might optimize one exit, then exit without indicating a change.  This could result in an analysis invalidaton bug if no other transform is done by the rest of indvars.

Note that the pointer exit counts are a really fragile concept.  They show up only when we have a pointer IV w/o a datalayout to provide their size.  It's really questionable to me whether the complexity implied is worth it.

llvm-svn: 366829

4 years agoImprove clang-format-diff help output
Nico Weber [Tue, 23 Jul 2019 17:34:18 +0000 (17:34 +0000)]
Improve clang-format-diff help output

The description in clang-format-diff.py is more useful than the one
in `clang-format-diff -h`, so use the same description in both places.

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

llvm-svn: 366828

4 years ago[Utils] Remove legacy scripts
Jonas Devlieghere [Tue, 23 Jul 2019 17:23:36 +0000 (17:23 +0000)]
[Utils] Remove legacy scripts

As pointed out by Nathan in D65155, these scrips don't seem to serve any
real need anymore.

llvm-svn: 366827

4 years ago[IR][Verifier] Allow IntToPtrInst to be !dereferenceable
Ryan Taylor [Tue, 23 Jul 2019 17:19:56 +0000 (17:19 +0000)]
[IR][Verifier] Allow IntToPtrInst to be !dereferenceable

Summary:
Allow IntToPtrInst to carry !dereferenceable metadata tag.
This is valid since !dereferenceable can be only be applied to
pointer type values.

Change-Id: If8a6e3c616f073d51eaff52ab74535c29ed497b4

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 366826

4 years ago[RISCV][NFC] Correct RUN in rvi-pseudos-invalid.s
Sam Elliott [Tue, 23 Jul 2019 17:14:42 +0000 (17:14 +0000)]
[RISCV][NFC] Correct RUN in rvi-pseudos-invalid.s

This test should test both riscv32 and riscv64.

llvm-svn: 366825

4 years ago[Logging] Fix format strings
Jonas Devlieghere [Tue, 23 Jul 2019 17:03:37 +0000 (17:03 +0000)]
[Logging] Fix format strings

Change format strings to use the `{}` syntax instead of the printf
syntax when using LLDB_LOG.

llvm-svn: 366824

4 years ago[clang][NFCI] Fix random typos
Jan Korous [Tue, 23 Jul 2019 16:54:11 +0000 (16:54 +0000)]
[clang][NFCI] Fix random typos

llvm-svn: 366823

4 years ago[compiler-rt][builtins] Provide __clear_cache for SPARC
Rainer Orth [Tue, 23 Jul 2019 16:33:54 +0000 (16:33 +0000)]
[compiler-rt][builtins] Provide __clear_cache for SPARC

While working on https://reviews.llvm.org/D40900, two tests were failing since __clear_cache
aborted.  While libgcc's __clear_cache is just empty, this only happens because
gcc (in gcc/config/sparc/sparc.c (sparc32_initialize_trampoline, sparc64_initialize_trampoline))
emits flush insns directly.

The following patch mimics that.

Tested on sparcv9-sun-solaris2.11.

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

llvm-svn: 366822

4 years ago[CMake] Add -z defs on Solaris
Rainer Orth [Tue, 23 Jul 2019 16:27:34 +0000 (16:27 +0000)]
[CMake] Add -z defs on Solaris

Like other ELF targets, shared objects should be linked with -z defs on Solaris.

Tested on x86_64-pc-solaris2.11 and sparcv9-sun-solaris2.11.

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

llvm-svn: 366821

4 years ago[clang, test] Fix Clang :: Headers/max_align.c on 64-bit SPARC
Rainer Orth [Tue, 23 Jul 2019 16:24:00 +0000 (16:24 +0000)]
[clang, test] Fix Clang :: Headers/max_align.c on 64-bit SPARC

Clang :: Headers/max_align.c currently FAILs on 64-bit SPARC:

  error: 'error' diagnostics seen but not expected:
    File /vol/llvm/src/clang/dist/test/Headers/max_align.c Line 12: static_assert failed due to requirement '8 == _Alignof(max_align_t)' ""
  1 error generated.

This happens because SuitableAlign isn't defined for SPARCv9 unlike SPARCv8
(which uses the default of 64 bits).  gcc's sparc/sparc.h has

  #define BIGGEST_ALIGNMENT (TARGET_ARCH64 ? 128 : 64)

This patch sets SuitableAlign to match and updates the corresponding testcase.

Tested on sparcv9-sun-solaris2.11.

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

llvm-svn: 366820

4 years ago[GlobalISel][AArch64] Teach GISel to handle shifts in load addressing modes
Jessica Paquette [Tue, 23 Jul 2019 16:09:42 +0000 (16:09 +0000)]
[GlobalISel][AArch64] Teach GISel to handle shifts in load addressing modes

When we select the XRO variants of loads, we can pull in very specific shifts
(of the size of an element). E.g.

```
ldr x1, [x2, x3, lsl #3]
```

This teaches GISel to handle these when they're coming from shifts
specifically.

This adds a new addressing mode function, `selectAddrModeShiftedExtendXReg`
which recognizes this pattern.

This also packs this up with `selectAddrModeRegisterOffset` into
`selectAddrModeXRO`. This is intended to be equivalent to `selectAddrModeXRO`
in AArch64ISelDAGtoDAG.

Also update load-addressing-modes to show that all of the cases here work.

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

llvm-svn: 366819

4 years ago[ASTImporter] Fix inequivalence of ClassTemplateInstantiations
Gabor Marton [Tue, 23 Jul 2019 15:46:38 +0000 (15:46 +0000)]
[ASTImporter] Fix inequivalence of ClassTemplateInstantiations

Summary:
We falsely state inequivalence if the template parameter is a
qualified/nonquialified template in the first/second instantiation.
Also, different kinds of TemplateName should be equal if the template
decl (if available) is equal (even if the name kind is different).

Reviewers: a_sidorin, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

llvm-svn: 366818

4 years ago[TargetLowering] SimplifyMultipleUseDemandedBits - add VECTOR_SHUFFLE support.
Simon Pilgrim [Tue, 23 Jul 2019 15:35:55 +0000 (15:35 +0000)]
[TargetLowering] SimplifyMultipleUseDemandedBits - add VECTOR_SHUFFLE support.

If all the demanded elts are from one operand and are inline, then we can use the operand directly.

The changes are mainly from SSE41 targets which has blendvpd but not cmpgtq, allowing the v2i64 comparison to be simplified as we only need the signbit from alternate v4i32 elements.

llvm-svn: 366817

4 years agoRevert "[Object/ELF.h] - Improve testing of the fields in ELFFile<ELFT>::sections()."
Vlad Tsyrklevich [Tue, 23 Jul 2019 15:02:13 +0000 (15:02 +0000)]
Revert "[Object/ELF.h] - Improve testing of the fields in ELFFile<ELFT>::sections()."

This reverts commit r366796 because it was causing ubsan buildbot
failures.

llvm-svn: 366815

4 years ago[llvm-ar] Fix support for archives with members larger than 4GB
Owen Reynolds [Tue, 23 Jul 2019 14:44:21 +0000 (14:44 +0000)]
[llvm-ar] Fix support for archives with members larger than 4GB

llvm-ar outputs a strange error message when handling archives with
members larger than 4GB due to not checking file size when passing the
value as an unsigned 32 bit integer. This overflow issue caused
malformed archives to be created.:

https://bugs.llvm.org/show_bug.cgi?id=38058

This change allows for members above 4GB and will error in a case that
is over the formats size limit, a 10 digit decimal integer.

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

llvm-svn: 366813

4 years ago[clangd] Log version, cwd, args, and transport on startup. NFC
Sam McCall [Tue, 23 Jul 2019 14:30:28 +0000 (14:30 +0000)]
[clangd] Log version, cwd, args, and transport on startup. NFC

Reviewers: hokein

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

Tags: #clang

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

llvm-svn: 366811

4 years ago[libomptarget] Handle offload policy in push_tripcount
Jonas Hahnfeld [Tue, 23 Jul 2019 14:20:48 +0000 (14:20 +0000)]
[libomptarget] Handle offload policy in push_tripcount

If the first target region in a program calls the push_tripcount
function, libomptarget didn't handle the offload policy correctly.
This could lead to unexpected error messages as seen in
http://lists.llvm.org/pipermail/openmp-dev/2019-June/002561.html

To solve this, add a check calling IsOffloadDisabled() as all other
entry points already do. If this method returns false, libomptarget
is effectively disabled.

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

llvm-svn: 366810

4 years ago[ARM][LowOverheadLoops] Fix branch target codegen
Sam Parker [Tue, 23 Jul 2019 14:08:46 +0000 (14:08 +0000)]
[ARM][LowOverheadLoops] Fix branch target codegen

While lowering test.set.loop.iterations, it wasn't checked how the
brcond was using the result and so the wls could branch to the loop
preheader instead of not entering it. The same was true for
loop.decrement.reg.

So brcond and br_cc and now lowered manually when using the hwloop
intrinsics. During this we now check whether the result has been
negated and whether we're using SETEQ or SETNE and 0 or 1. We can
then figure out which basic block the WLS and LE should be targeting.

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

llvm-svn: 366809

4 years agoFix MSVC warning about extending a uint32_t shift result to uint64_t. NFCI.
Simon Pilgrim [Tue, 23 Jul 2019 14:04:54 +0000 (14:04 +0000)]
Fix MSVC warning about extending a uint32_t shift result to uint64_t. NFCI.

llvm-svn: 366808

4 years ago[SLPVectorizer] Revert local change that got accidently got committed in rL366799
Simon Pilgrim [Tue, 23 Jul 2019 13:42:01 +0000 (13:42 +0000)]
[SLPVectorizer] Revert local change that got accidently got committed in rL366799

This wasn't part of D63281

llvm-svn: 366807

4 years agoRevert [RISCV] Re-enable rv32i-aliases-invalid.s test
Sam Elliott [Tue, 23 Jul 2019 13:30:56 +0000 (13:30 +0000)]
Revert [RISCV] Re-enable rv32i-aliases-invalid.s test

This reverts r366797 (git commit 53f9fec8e8b58f5a904bbfb4a1d648cde65aa860)

llvm-svn: 366806

4 years ago[NFC][ASAN] Add brackets around not command
Lei Huang [Tue, 23 Jul 2019 13:10:29 +0000 (13:10 +0000)]
[NFC][ASAN] Add brackets around not command

Under certain execution conditions, the `not` command binds to the command the
output is piped to rather than the command piping the output. In this case, that
flips the return code of the FileCheck invocation, causing a failure when
FileCheck succeeds.

llvm-svn: 366805

4 years ago[lldb][NFC] Tablegenify process
Raphael Isemann [Tue, 23 Jul 2019 12:54:33 +0000 (12:54 +0000)]
[lldb][NFC] Tablegenify process

llvm-svn: 366804

4 years agoProcessMachCore: Fix a -Wmisleading-indentation warning
Pavel Labath [Tue, 23 Jul 2019 12:53:45 +0000 (12:53 +0000)]
ProcessMachCore: Fix a -Wmisleading-indentation warning

llvm-svn: 366803

4 years ago[NFC][InstCombine] Fixup commutative/negative tests with icmp preds in @llvm.umul...
Roman Lebedev [Tue, 23 Jul 2019 12:42:57 +0000 (12:42 +0000)]
[NFC][InstCombine] Fixup commutative/negative tests with icmp preds in @llvm.umul.with.overflow tests

llvm-svn: 366802

4 years ago[InstSimplify][NFC] Tests for skipping 'div-by-0' checks before inverted @llvm.umul...
Roman Lebedev [Tue, 23 Jul 2019 12:42:49 +0000 (12:42 +0000)]
[InstSimplify][NFC] Tests for skipping 'div-by-0' checks before inverted @llvm.umul.with.overflow

It would be already handled by the non-inverted case if we were hoisting
the `not` in InstCombine, but we don't (granted, we don't sink it
in this case either), so this is a separate case.

llvm-svn: 366801

4 years ago[NFC][PhaseOredering][SimplifyCFG] Add more runlines to umul.with.overflow tests
Roman Lebedev [Tue, 23 Jul 2019 12:42:41 +0000 (12:42 +0000)]
[NFC][PhaseOredering][SimplifyCFG] Add more runlines to umul.with.overflow tests

This way it will be more obvious that the problem is both
in cost threshold and in hardcoded benefit check,
plus will show how the instsimplify cleans this all in the end.

llvm-svn: 366800

4 years ago[TargetLowering] Add SimplifyMultipleUseDemandedBits
Simon Pilgrim [Tue, 23 Jul 2019 12:39:08 +0000 (12:39 +0000)]
[TargetLowering] Add SimplifyMultipleUseDemandedBits

This patch introduces the DAG version of SimplifyMultipleUseDemandedBits, which attempts to peek through ops (mainly and/or/xor so far) that don't contribute to the demandedbits/elts of a node - which means we can do this even in cases where we have multiple uses of an op, which normally requires us to demanded all bits/elts. The intention is to remove a similar instruction - SelectionDAG::GetDemandedBits - once SimplifyMultipleUseDemandedBits has matured.

The InstCombine version of SimplifyMultipleUseDemandedBits can constant fold which I haven't added here yet, and so far I've only wired this up to some basic binops (and/or/xor/add/sub/mul) to demonstrate its use.

We do see a couple of regressions that need to be addressed:

    AMDGPU unsigned dot product codegen retains an AND mask (for ZERO_EXTEND) that it previously removed (but otherwise the dotproduct codegen is a lot better).

    X86/AVX2 has poor handling of vector ANY_EXTEND/ANY_EXTEND_VECTOR_INREG - it prematurely gets converted to ZERO_EXTEND_VECTOR_INREG.

The code owners have confirmed its ok for these cases to fixed up in future patches.

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

llvm-svn: 366799

4 years agoFix windows build after r366791
Pavel Labath [Tue, 23 Jul 2019 12:26:09 +0000 (12:26 +0000)]
Fix windows build after r366791

A side effect of this commit was that it exchanged the order of types
and compile units in the output of SymbolVendor::Dump. A couple of PDB
tests dependened on that to assert the links between the two.

While it wouldn't be too hard to update the tests, the change of
ordering was not something I intended to do with that patch, and is easy
to restore the original order, so I do just that.

llvm-svn: 366798

4 years ago[RISCV] Re-enable rv32i-aliases-invalid.s test
Sam Elliott [Tue, 23 Jul 2019 11:40:55 +0000 (11:40 +0000)]
[RISCV] Re-enable rv32i-aliases-invalid.s test

We were getting test failures on some builders, which pointed to @LINE
being an undefined variable. I think that these failures should have
been fixed by https://reviews.llvm.org/rL366434, so I'm re-enabling the
test.

llvm-svn: 366797

4 years ago[Object/ELF.h] - Improve testing of the fields in ELFFile<ELFT>::sections().
George Rimar [Tue, 23 Jul 2019 11:37:14 +0000 (11:37 +0000)]
[Object/ELF.h] - Improve testing of the fields in ELFFile<ELFT>::sections().

This eliminates a one error untested and
also introduces a error for one more possible case
which lead to crash previously.

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

llvm-svn: 366796

4 years ago[lldb][NFC] Tablegenify source
Raphael Isemann [Tue, 23 Jul 2019 11:08:12 +0000 (11:08 +0000)]
[lldb][NFC] Tablegenify source

llvm-svn: 366795