platform/upstream/llvm.git
5 years ago[SelectionDAG] Handle unary SelectPatternFlavor for ABS case in SelectionDAGBuilder...
Simon Pilgrim [Tue, 19 Mar 2019 16:24:55 +0000 (16:24 +0000)]
[SelectionDAG] Handle unary SelectPatternFlavor for ABS case in SelectionDAGBuilder::visitSelect

These changes are related to PR37743 and include:

    SelectionDAGBuilder::visitSelect handles the unary SelectPatternFlavor::SPF_ABS case to build ABS node.

    Delete the redundant recognizer of the integer ABS pattern from the DAGCombiner.

    Add promoting the integer ABS node in the LegalizeIntegerType.

    Expand-based legalization of integer result for the ABS nodes.

    Expand-based legalization of ABS vector operations.

    Add some integer abs testcases for different typesizes for Thumb arch

    Add the custom ABS expanding and change the SAD pattern recognizer for X86 arch: The i64 result of the ABS is expanded to:
        tmp = (SRA, Hi, 31)
        Lo = (UADDO tmp, Lo)
        Hi = (XOR tmp, (ADDCARRY tmp, hi, Lo:1))
        Lo = (XOR tmp, Lo)

    The "detectZextAbsDiff" function is changed for the recognition of pattern with the ABS node. Given a ABS node, detect the following pattern:
        (ABS (SUB (ZERO_EXTEND a), (ZERO_EXTEND b))).

    Change integer abs testcases for codegen with the ABS node support for AArch64.
        Indicate that the ABS is legal for the i64 type when the NEON is supported.
        Change the integer abs testcases to show changing of codegen.

    Add combine and legalization of ABS nodes for Thumb arch.

    Extend 'matchSelectPattern' to recognize the ABS patterns with ICMP_SGE condition.

For discussion, see https://bugs.llvm.org/show_bug.cgi?id=37743

Patch by: @ikulagin (Ivan Kulagin)

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

llvm-svn: 356468

5 years ago[TSan][libdispatch] Avoid infinite recursion in dispatch_apply[_f] interceptors
Julian Lettner [Tue, 19 Mar 2019 16:12:59 +0000 (16:12 +0000)]
[TSan][libdispatch] Avoid infinite recursion in dispatch_apply[_f] interceptors

In libdispatch, dispatch_apply is implemented in terms of
dispatch_apply_f. Unfortunately, this means that we can't implement the
interceptor for dispatch_apply_f by forwarding to the dispatch_apply
interceptor.

In the interceptor dispatch_apply_f, we can't use WRAP(dispatch_apply).
WRAP(dispatch_apply) -> REAL(dispatch_apply_f). Requires duplication of
some setup code.

Reviewed By: kubamracek

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

llvm-svn: 356467

5 years ago[llvm-ar] Support N [count] modifier
Jordan Rupprecht [Tue, 19 Mar 2019 16:09:54 +0000 (16:09 +0000)]
[llvm-ar] Support N [count] modifier

Summary:
GNU ar supports the 'N' count modifier for the extract (x) and delete (d) operations. When an archive contains multiple members with the same name, this can be used to extract (or delete) them individually. For example:

```
$ llvm-ar t archive.a
foo
foo
$ llvm-ar x archive.a
-> Writes foo twice, overwriting it the second time :( :(
$ llvm-ar xN 1 archive.a foo && mv foo foo.1
$ llvm-ar xN 2 archive.a foo && mv foo foo.2
-> Write foo twice, renaming it in between invocations to preserve all versions
```

Reviewers: ruiu, MaskRay

Reviewed By: ruiu, MaskRay

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 356466

5 years ago[AMDGPU] Add buffer/load 8/16 bit overloaded intrinsics
Ryan Taylor [Tue, 19 Mar 2019 16:07:00 +0000 (16:07 +0000)]
[AMDGPU] Add buffer/load 8/16 bit overloaded intrinsics

Summary:
Add buffer store/load 8/16 overloaded intrinsics for buffer, raw_buffer and struct_buffer

Change-Id: I166a29f071b2ff4e4683fb0392564b1f223ac61d

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

llvm-svn: 356465

5 years ago[AMDGPU] Ban i8 min3 promotion.
Neil Henning [Tue, 19 Mar 2019 15:50:24 +0000 (15:50 +0000)]
[AMDGPU] Ban i8 min3 promotion.

I found this really weird WWM-related case whereby through the WWM
transformations our isel lowering was trying to promote 2 min's into a
min3 for the i8 type, which our hardware doesn't support.

The new min3_i8.ll test case would previously spew the error:

PromoteIntegerResult #0: t69: i8 = SMIN3 t70, Constant:i8<0>, t68

Before the simple fix to our isel lowering to not do it for i8 MVT's.

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

llvm-svn: 356464

5 years ago[InstCombine] Add missing test for icmp transformation (NFC)
Teresa Johnson [Tue, 19 Mar 2019 15:43:56 +0000 (15:43 +0000)]
[InstCombine] Add missing test for icmp transformation (NFC)

This was split out of D59378. There was no testing for the EQ case in
foldICmpWithDominatingICmp, add one here.

llvm-svn: 356463

5 years agoImprove error handling for Clang module imports.
Adrian Prantl [Tue, 19 Mar 2019 15:38:26 +0000 (15:38 +0000)]
Improve error handling for Clang module imports.

rdar://problem/48883558

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

llvm-svn: 356462

5 years ago[mips] Fix crash on recursive using of .set
Simon Atanasyan [Tue, 19 Mar 2019 15:15:35 +0000 (15:15 +0000)]
[mips] Fix crash on recursive using of .set

Switch to the `MCParserUtils::parseAssignmentExpression` for parsing
assignment expressions in the `.set` directive reduces code and allows
to print an error message instead of crashing in case of incorrect
recursive using of the `.set`.

Fix for the bug https://bugs.llvm.org/show_bug.cgi?id=41053.

Differential Revision: http://reviews.llvm.org/D59452

llvm-svn: 356461

5 years ago[DebugInfo] Move test files added in r356451
Markus Lavin [Tue, 19 Mar 2019 15:15:28 +0000 (15:15 +0000)]
[DebugInfo] Move test files added in r356451

Moved the X86 dependant .ll tests added in r356451 from
test/DebugInfo/Generic to test/DebugInfo/X86.

llvm-svn: 356460

5 years agoFix a "memset clearing an object of non-trivial type" warning in EmulateInstruction
Pavel Labath [Tue, 19 Mar 2019 15:05:55 +0000 (15:05 +0000)]
Fix a "memset clearing an object of non-trivial type" warning in EmulateInstruction

This is a new warning which started appearing as of gcc-8. The Opcode
class has a non-trivial constructor, so the idea of the warning is that
code should use that to initialize the object instead of using memset
(which can perturb class invariants set up by the constructor). In this
case, the Opcode default constructor was already clearing the object's
fields so we can just drop the memset call.

While I'm touching the EmulateInstruction constructor, I also move the
initialization of other members into the class declaration.

llvm-svn: 356459

5 years agoEnsure that const variables declared at namespace scope correctly have external linka...
Aaron Ballman [Tue, 19 Mar 2019 14:53:52 +0000 (14:53 +0000)]
Ensure that const variables declared at namespace scope correctly have external linkage when marked as dllexport and targeting the MSVC ABI.

Patch thanks to Zahira Ammarguellat.

llvm-svn: 356458

5 years ago[scudo][standalone] Add string utility functions
Kostya Kortchinsky [Tue, 19 Mar 2019 14:47:05 +0000 (14:47 +0000)]
[scudo][standalone] Add string utility functions

Summary:
Add some string utility functions, notably to format strings, get
lengths, convert a string to a number. Those functions will be
used in reports and flags (coming up next). They were mostly borrowed
from sanitizer_common.

Make use of the string length function in a couple places in the
platform code that was checked in with inlined version of it.

Add some tests.

Reviewers: morehouse, eugenis, vitalybuka, hctim

Reviewed By: morehouse, vitalybuka

Subscribers: mgorny, delcypher, jdoerfert, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 356457

5 years ago[InstSimplify] SimplifyICmpInst - icmp eq/ne %X, undef -> undef
Simon Pilgrim [Tue, 19 Mar 2019 14:08:23 +0000 (14:08 +0000)]
[InstSimplify] SimplifyICmpInst - icmp eq/ne %X, undef -> undef

As discussed on PR41125 and D59363, we have a mismatch between icmp eq/ne cases with an undef operand:

When the other operand is constant we fold to undef (handled in ConstantFoldCompareInstruction)
When the other operand is non-constant we fold to a bool constant based on isTrueWhenEqual (handled in SimplifyICmpInst).

Neither is really wrong, but this patch changes the logic in SimplifyICmpInst to consistently fold to undef.

The NewGVN test change is annoying (as with most heavily reduced tests) but AFAICT I have kept the purpose of the test based on rL291968.

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

llvm-svn: 356456

5 years ago[ASTImporter] Fix redecl failures of FunctionTemplateSpec
Gabor Marton [Tue, 19 Mar 2019 14:04:50 +0000 (14:04 +0000)]
[ASTImporter] Fix redecl failures of FunctionTemplateSpec

Summary:
Redecl chains of function template specializations are not handled well
currently. We want to handle them similarly to functions, i.e. try to
keep the structure of the original AST as much as possible. The aim is
to not squash a prototype with a definition, rather we create both and
put them in a redecl chain.

Reviewers: a_sidorin, shafik, a.sidorin

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

Tags: #clang

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

llvm-svn: 356455

5 years ago[DebugInfoMetadata] Move main subprogram DIFlag into DISPFlags
Petar Jovanovic [Tue, 19 Mar 2019 13:49:03 +0000 (13:49 +0000)]
[DebugInfoMetadata] Move main subprogram DIFlag into DISPFlags

Moving subprogram specific flags into DISPFlags makes IR code more readable.
In addition, we provide free space in DIFlags for other
'non-subprogram-specific' debug info flags.

Patch by Djordje Todorovic.

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

llvm-svn: 356454

5 years ago[InstCombine] add FMF to tests for extra coverage; NFC
Sanjay Patel [Tue, 19 Mar 2019 13:39:29 +0000 (13:39 +0000)]
[InstCombine] add FMF to tests for extra coverage; NFC

ninf is probably the only relevant possible flag here
(nnan allows simplification and nsz never makes a difference).

llvm-svn: 356453

5 years ago[ASTImporter] Fix redecl failures of ClassTemplateSpec
Gabor Marton [Tue, 19 Mar 2019 13:34:10 +0000 (13:34 +0000)]
[ASTImporter] Fix redecl failures of ClassTemplateSpec

Summary:
Redecl chains of class template specializations are not handled well
currently. We want to handle them similarly to functions, i.e. try to
keep the structure of the original AST as much as possible. The aim is
to not squash a prototype with a definition, rather we create both and
put them in a redecl chain.

Reviewers: a_sidorin, shafik, a.sidorin

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

Tags: #clang

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

llvm-svn: 356452

5 years ago[DebugInfo] Introduce DW_OP_LLVM_convert
Markus Lavin [Tue, 19 Mar 2019 13:16:28 +0000 (13:16 +0000)]
[DebugInfo] Introduce DW_OP_LLVM_convert

Introduce a DW_OP_LLVM_convert Dwarf expression pseudo op that allows
for a convenient way to perform type conversions on the Dwarf expression
stack. As an additional bonus it paves the way for using other Dwarf
v5 ops that need to reference a base_type.

The new DW_OP_LLVM_convert is used from lib/Transforms/Utils/Local.cpp
to perform sext/zext on debug values but mainly the patch is about
preparing terrain for adding other Dwarf v5 ops that need to reference a
base_type.

For Dwarf v5 the op maps to DW_OP_convert and for earlier versions a
complex shift & mask pattern is generated to emulate sext/zext.

This is a recommit of r356442 with trivial fixes for the failing tests.

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

llvm-svn: 356451

5 years ago[OpenCL] Improved testing of default header.
Anastasia Stulova [Tue, 19 Mar 2019 13:04:17 +0000 (13:04 +0000)]
[OpenCL] Improved testing of default header.

Improved some checks and moved testing of the default header
in C++ mode into the Headers folder.

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

llvm-svn: 356450

5 years ago[clang-format] [JS] handle private members.
Martin Probst [Tue, 19 Mar 2019 12:28:41 +0000 (12:28 +0000)]
[clang-format] [JS] handle private members.

Addresses PR40999 https://bugs.llvm.org/show_bug.cgi?id=40999

Private fields and methods in JavaScript would get incorrectly indented
(it sees them as preprocessor directives and hence left aligns them)

In this revision `#identifier` tokens `tok::hash->tok::identifier` are
merged into a single new token `tok::identifier` with the `#` contained
inside the TokenText.

Before:

```
class Example {
  pub = 1;

  static pub2 = "foo";
  static #priv2 = "bar";

  method() { this.#priv = 5; }

  static staticMethod() {
    switch (this.#priv) {
    case '1':
      break;
    }
  }

  this.#privateMethod(); // infinite loop
}

static #staticPrivateMethod() {}
}
```

After this fix the code will be correctly indented

```
class Example {
  pub = 1;
  #priv = 2;

  static pub2 = "foo";
  static #priv2 = "bar";

  method() { this.#priv = 5; }

  static staticMethod() {
    switch (this.#priv) {
    case '1':
      #priv = 3;
      break;
    }
  }

  #privateMethod() {
    this.#privateMethod(); // infinite loop
  }

  static #staticPrivateMethod() {}
}
```

NOTE: There might be some JavaScript code out there which uses the C
processor to preprocess .js files
http://www.nongnu.org/espresso/js-cpp.html. It's not clear how this
revision or even private fields and methods would interact.

Patch originally by MyDeveloperDays (thanks!).

llvm-svn: 356449

5 years ago[InstCombine] Regenerate + add icmp with undef tests
Simon Pilgrim [Tue, 19 Mar 2019 11:44:22 +0000 (11:44 +0000)]
[InstCombine] Regenerate + add icmp with undef tests

Better test coverage for PR41125 and D59363

llvm-svn: 356448

5 years ago[clang-format] [JS] Don't break between template string and tag
Martin Probst [Tue, 19 Mar 2019 11:15:52 +0000 (11:15 +0000)]
[clang-format] [JS] Don't break between template string and tag

Before:
    const x = veryLongIdentifier
        `hello`;
After:
    const x =
        veryLongIdentifier`hello`;

While it's allowed to have the template string and tag identifier
separated by a line break, currently the clang-format output is not
stable when a break is forced. Additionally, disallowing a line break
makes it clear that the identifier is actually a tag for a template
string.

Patch originally by mitchellwills (thanks!).

llvm-svn: 356447

5 years ago[Tooling] Add more scope specifiers until spelling is not ambiguous.
Eric Liu [Tue, 19 Mar 2019 10:12:15 +0000 (10:12 +0000)]
[Tooling] Add more scope specifiers until spelling is not ambiguous.

Summary:
Previously, when the renamed spelling is ambiguous, we simply use the
full-qualfied name (with leading "::"). This patch makes it try adding
additional specifiers one at a time until name is no longer ambiguous,
which allows us to find better disambuguated spelling.

Reviewers: kadircet, gribozavr

Subscribers: jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 356446

5 years ago[clangd] Add support for type hierarchy (super types only for now)
Kadir Cetinkaya [Tue, 19 Mar 2019 09:27:04 +0000 (09:27 +0000)]
[clangd] Add support for type hierarchy (super types only for now)

Summary:
Patch by Nathan Ridge(@nridge)!

This is an LSP extension proposed here:
https://github.com/Microsoft/vscode-languageserver-node/pull/426

An example client implementation can be found here:
https://github.com/theia-ide/theia/pull/3802

Reviewers: kadircet, sammccall

Reviewed By: kadircet

Subscribers: jdoerfert, sammccall, cfe-commits, mgorny, dschaefer, simark, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet

Tags: #clang

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

llvm-svn: 356445

5 years agoRevert "[DebugInfo] Introduce DW_OP_LLVM_convert"
Markus Lavin [Tue, 19 Mar 2019 09:17:28 +0000 (09:17 +0000)]
Revert "[DebugInfo] Introduce DW_OP_LLVM_convert"

This reverts commit 1cf4b593a7ebd666fc6775f3bd38196e8e65fafe.

Build bots found failing tests not detected locally.

Failing Tests (3):
  LLVM :: DebugInfo/Generic/convert-debugloc.ll
  LLVM :: DebugInfo/Generic/convert-inlined.ll
  LLVM :: DebugInfo/Generic/convert-linked.ll

llvm-svn: 356444

5 years agoUse response file when generating LLVM-C.dll
Serge Guelton [Tue, 19 Mar 2019 09:14:09 +0000 (09:14 +0000)]
Use response file when generating LLVM-C.dll

As discovered in D56774 the command line gets to long, so use a response file
to give the script the libs. This change has been tested and is confirmed
working for me.

Commited on behalf of Jakob Bornecrantz.
Differential Revision: https://reviews.llvm.org/D56781

llvm-svn: 356443

5 years ago[DebugInfo] Introduce DW_OP_LLVM_convert
Markus Lavin [Tue, 19 Mar 2019 08:48:19 +0000 (08:48 +0000)]
[DebugInfo] Introduce DW_OP_LLVM_convert

Introduce a DW_OP_LLVM_convert Dwarf expression pseudo op that allows
for a convenient way to perform type conversions on the Dwarf expression
stack. As an additional bonus it paves the way for using other Dwarf
v5 ops that need to reference a base_type.

The new DW_OP_LLVM_convert is used from lib/Transforms/Utils/Local.cpp
to perform sext/zext on debug values but mainly the patch is about
preparing terrain for adding other Dwarf v5 ops that need to reference a
base_type.

For Dwarf v5 the op maps to DW_OP_convert and for earlier versions a
complex shift & mask pattern is generated to emulate sext/zext.

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

llvm-svn: 356442

5 years agoRefactor cast<>'s in if conditionals, which can only assert on failure.
Don Hinton [Tue, 19 Mar 2019 06:14:14 +0000 (06:14 +0000)]
Refactor cast<>'s in if conditionals, which can only assert on failure.

Summary:
This patch refactors several instances of cast<> used in if
conditionals.  Since cast<> asserts on failure, the else branch can
never be taken.

In some cases, the fix is to replace cast<> with dyn_cast<>.  While
others required the removal of the conditional and some minor
refactoring.

A discussion can be seen here: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20190318/265044.html

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

llvm-svn: 356441

5 years ago[WebAssembly] Small improvements in FixIrreducibleControlFlow (NFC)
Heejin Ahn [Tue, 19 Mar 2019 05:26:33 +0000 (05:26 +0000)]
[WebAssembly] Small improvements in FixIrreducibleControlFlow (NFC)

Summary:
- Make some class member methods const
- Delete unnecessary includes
- Use a simpler form of `BuildMI`

Reviewers: kripken

Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 356440

5 years ago[WebAssembly] Improve readability of irreducibility tests
Heejin Ahn [Tue, 19 Mar 2019 05:10:39 +0000 (05:10 +0000)]
[WebAssembly] Improve readability of irreducibility tests

Summary:
This adds `preds` comment lines to BB names for readability, while also
fixes some of existing incorrect comment lines. Also deletes a few
unnecessary attributes. Autogenerated by `opt`.

Reviewers: kripken

Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 356439

5 years ago[WebAssembly] Rename methods according to instruction name changes (NFC)
Heejin Ahn [Tue, 19 Mar 2019 05:07:33 +0000 (05:07 +0000)]
[WebAssembly] Rename methods according to instruction name changes (NFC)

Reviewers: tlively, sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 356438

5 years ago[WebAssembly] Add immarg attribute to intrinsics
Heejin Ahn [Tue, 19 Mar 2019 05:02:30 +0000 (05:02 +0000)]
[WebAssembly] Add immarg attribute to intrinsics

Summary:
After r355981, intrinsic arguments that are immediate values should be
marked as `ImmArg`.

Reviewers: dschuff, tlively

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 356437

5 years ago[WebAssembly] Change wasm.throw's first argument to an immediate
Heejin Ahn [Tue, 19 Mar 2019 04:58:59 +0000 (04:58 +0000)]
[WebAssembly] Change wasm.throw's first argument to an immediate

Summary:
`wasm.throw` builtin's first 'tag' argument should be an immediate index
into the event section.

Reviewers: dschuff, craig.topper

Subscribers: sbc100, jgravelle-google, sunfish, cfe-commits

Tags: #clang

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

llvm-svn: 356436

5 years agoMark 'front()' and 'back()' as noexcept for array/deque/string/string_view. These...
Marshall Clow [Tue, 19 Mar 2019 03:30:07 +0000 (03:30 +0000)]
Mark 'front()' and 'back()' as noexcept for array/deque/string/string_view. These are just rebranded 'operator[]', and should be noexcept like it is.

llvm-svn: 356435

5 years ago[CodeGen] LLVM OpenMP Backend.
Michael Kruse [Tue, 19 Mar 2019 03:18:21 +0000 (03:18 +0000)]
[CodeGen] LLVM OpenMP Backend.

The ParallelLoopGenerator class is changed such that GNU OpenMP specific
code was removed, allowing to use it as super class in a
template-pattern. Therefore, the code has been reorganized and one may
not use the ParallelLoopGenerator directly anymore, instead specific
implementations have to be provided. These implementations contain the
library-specific code. As such, the "GOMP" (code completely taken from
the existing backend) and "KMP" variant were created.

For "check-polly" all tests that involved "GOMP": equivalents were added
that test the new functionalities, like static scheduling and different
chunk sizes. "docs/UsingPollyWithClang.rst" shows how the alternative
backend may be used.

Patch by Michael Halkenhäuser <michaelhalk@web.de>

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

llvm-svn: 356434

5 years agoFactor out repeated code parsing and concatenating header-names from
Richard Smith [Tue, 19 Mar 2019 01:51:19 +0000 (01:51 +0000)]
Factor out repeated code parsing and concatenating header-names from
tokens.

We now actually form an angled_string_literal token for a header name by
concatenation rather than just working out what its contents would be.
This substantially simplifies downstream processing and is necessary for
C++20 header unit imports.

llvm-svn: 356433

5 years agoDon't apply the include depth limit until we actually decide to enter
Richard Smith [Tue, 19 Mar 2019 01:51:17 +0000 (01:51 +0000)]
Don't apply the include depth limit until we actually decide to enter
the file.

NFC unless a skipped #include is found at the final permitted #include
level.

llvm-svn: 356432

5 years ago[WebAssembly] Lower SIMD nnan setcc nodes
Thomas Lively [Tue, 19 Mar 2019 00:55:34 +0000 (00:55 +0000)]
[WebAssembly] Lower SIMD nnan setcc nodes

Summary:
Adds patterns to lower all the remaining setcc modes: lt, gt,
le, and ge. Fixes PR40912.

Reviewers: aheejin, sbc100, dschuff

Reviewed By: dschuff

Subscribers: jgravelle-google, hiraditya, sunfish, jdoerfert, llvm-commits, srj

Tags: #llvm

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

llvm-svn: 356431

5 years agoMinor renaming as suggested in review [NFC]
Aaron Puchert [Tue, 19 Mar 2019 00:14:46 +0000 (00:14 +0000)]
Minor renaming as suggested in review [NFC]

See D59455.

llvm-svn: 356430

5 years agoRemove unused try catch blocks from old debug tests
Eric Fiselier [Tue, 19 Mar 2019 00:00:30 +0000 (00:00 +0000)]
Remove unused try catch blocks from old debug tests

llvm-svn: 356429

5 years ago[ELF] Allow sh_entsize to be unrelated to sh_addralign and not a power of 2
Fangrui Song [Mon, 18 Mar 2019 23:49:18 +0000 (23:49 +0000)]
[ELF] Allow sh_entsize to be unrelated to sh_addralign and not a power of 2

Summary:
This implements Rui Ueyama's idea in PR39044.
I've checked that ld.bfd and gold do not have the power-of-2 requirement
and do not require sh_entsize to be a multiple of sh_align.

Now on the updated test merge-entsize.s, all the 3 linkers happily
create .rodata that is not 3-byte aligned.

This has a use case in Linux arch/x86/crypto/sha512-avx2-asm.S
It uses sh_entsize of 640, which is not a power of 2.
See https://github.com/ClangBuiltLinux/linux/issues/417

Reviewers: ruiu, espindola

Reviewed By: ruiu

Subscribers: nickdesaulniers, E5ten, emaste, arichardson, llvm-commits

Tags: #llvm

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

llvm-svn: 356428

5 years agoThread safety analysis: Add note for unlock kind mismatch
Aaron Puchert [Mon, 18 Mar 2019 23:26:54 +0000 (23:26 +0000)]
Thread safety analysis: Add note for unlock kind mismatch

Summary:
Similar to D56967, we add the existing diag::note_locked_here to tell
the user where we saw the locking that isn't matched correctly.

Reviewers: aaron.ballman, delesley

Reviewed By: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 356427

5 years ago[asan] Disable -Wfortify-source in intentional OOB tests
Reid Kleckner [Mon, 18 Mar 2019 23:03:46 +0000 (23:03 +0000)]
[asan] Disable -Wfortify-source in intentional OOB tests

Needed after r356397

llvm-svn: 356426

5 years ago[MS] Skip vbase construction in abstract class ctors
Reid Kleckner [Mon, 18 Mar 2019 22:41:50 +0000 (22:41 +0000)]
[MS] Skip vbase construction in abstract class ctors

As background, when constructing a complete object, virtual bases are
constructed first. If an exception is thrown later in the ctor, those
virtual bases are destroyed, so sema marks the relevant constructors and
destructors of virtual bases as referenced. If necessary, they are
emitted.

However, an abstract class can never be used to construct a complete
object. In the Itanium C++ ABI, this works out nicely, because we never
end up emitting the "complete" constructor variant, only the "base"
constructor variant, which can be called by constructors of derived
classes. Clang's Sema::MarkBaseAndMemberDestructorsReferenced is aware
of this optimization, and it does not mark ctors and dtors of virtual
bases referenced when the constructor of an abstract class is emitted.

In the Microsoft ABI, there are no complete/base variants, so before
this change, the constructor of an abstract class could reference ctors
and dtors of a virtual base without marking them referenced. This could
lead to unresolved symbol errors at link time, as reported in PR41065.

The fix is to implement the same optimization as Sema: If the class is
abstract, don't bother initializing its virtual bases. The "is this
class the most derived class" check in the constructor will never pass,
and the virtual base constructor calls are always dead. Skip them.

I think Richard noticed this missed optimization back in 2016 when he
was implementing inheriting constructors. I wasn't able to find any bugs
or email about it, though.

Fixes PR41065

llvm-svn: 356425

5 years agoRevert "[ValueTracking][InstSimplify] Support min/max selects in computeConstantRange()"
Nikita Popov [Mon, 18 Mar 2019 22:26:27 +0000 (22:26 +0000)]
Revert "[ValueTracking][InstSimplify] Support min/max selects in computeConstantRange()"

This reverts commit 106f0cdefb02afc3064268dc7a71419b409ed2f3.

This change impacts the AMDGPU smed3.ll and umed3.ll codegen tests.

llvm-svn: 356424

5 years ago[X86] Add gcc rotate intrinsics to ia32intrin.h
Craig Topper [Mon, 18 Mar 2019 22:25:57 +0000 (22:25 +0000)]
[X86] Add gcc rotate intrinsics to ia32intrin.h

This is another attempt at what Erich Keane tried to do in r355322.

This adds rolb, rolw, rold, rolq and their ror equivalent as always_inline wrappers around __builtin_rotate* which will lower to funnel shift intrinsics in IR.

Additionally, when _MSC_VER is not defined we will define _rotl, _lrotl, _rotr, _lrotr as macros to one of the always_inline intrinsics mentioned above. Making sure that _lrotl/_lrotr use either 32 or 64 bit based on the size of long. These need to be macros because we have builtins with the same name for MS compatibility, but _MSC_VER isn't always defined when those builtins are enabled.

We also define _rotwl and _rotwr as macros aliasing to rolw/rorw just like gcc to complete the set. These don't need to be gated with _MSC_VER because these aren't MS builtins.

I've added tests both for non-MS and -ms-extensions with and without _MSC_VER being defined.

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

llvm-svn: 356423

5 years ago[libFuzzer] document -len_control
Kostya Serebryany [Mon, 18 Mar 2019 22:20:47 +0000 (22:20 +0000)]
[libFuzzer] document -len_control

llvm-svn: 356422

5 years agoFix test failures after debug mode changes
Eric Fiselier [Mon, 18 Mar 2019 22:12:09 +0000 (22:12 +0000)]
Fix test failures after debug mode changes

llvm-svn: 356421

5 years ago[X86] Add coverage for 16-bit and 64-bit versions of bsf/bsr/bt/btc/btr/bts in the...
Craig Topper [Mon, 18 Mar 2019 22:06:19 +0000 (22:06 +0000)]
[X86] Add coverage for 16-bit and 64-bit versions of bsf/bsr/bt/btc/btr/bts in the assembly tests that are supposed to provide full coverage. Add coverage for cwtl/cltq/cwtd/cqto as well.

llvm-svn: 356420

5 years ago[X86] Disable CQTO and CLTQ instructions in the assembly parser outside 64-bit mode.
Craig Topper [Mon, 18 Mar 2019 22:06:14 +0000 (22:06 +0000)]
[X86] Disable CQTO and CLTQ instructions in the assembly parser outside 64-bit mode.

llvm-svn: 356419

5 years ago[NFC][TSan][libdispatch] Fix test for dispatch_apply[_f]
Julian Lettner [Mon, 18 Mar 2019 21:55:41 +0000 (21:55 +0000)]
[NFC][TSan][libdispatch] Fix test for dispatch_apply[_f]

* Array index out of bounds: 100 iterations, but size of array is 2.
* Unmatched barrier_init (2) with barrier_wait (200)
* Number of iterations must be smaller than the available parallelism
  for the queue, otherwise we deadlock (since every barrier_wait call
  blocks the thread).

Scary: All of this worked reliably in gcd-apply.mm (for Darwin)

Rievewed By: kubamracek

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

llvm-svn: 356418

5 years agoRemove exception throwing debug mode handler support.
Eric Fiselier [Mon, 18 Mar 2019 21:50:12 +0000 (21:50 +0000)]
Remove exception throwing debug mode handler support.

Summary:
The reason libc++ implemented a throwing debug mode handler was for ease of testing. Specifically,
I thought that if a debug violation aborted, we could only test one violation per file. This made
it impossible to test debug mode. Which throwing behavior we could test more!

However, the throwing approach didn't work either, since there are debug violations underneath noexcept
functions. This lead to the introduction of `_NOEXCEPT_DEBUG`, which was only noexcept when debug
mode was off.

Having thought more and having grown wiser, `_NOEXCEPT_DEBUG` was a horrible decision. It was
viral, it didn't cover all the cases it needed to, and it was observable to the user -- at worst
changing the behavior of their program.

  This patch removes the throwing debug handler, and rewrites the debug tests using 'fork-ing' style
  death tests.

Reviewers: mclow.lists, ldionne, thomasanderson

Reviewed By: ldionne

Subscribers: christof, arphaman, libcxx-commits, #libc

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

llvm-svn: 356417

5 years agoA target definition file that may work for
Jason Molenda [Mon, 18 Mar 2019 21:39:54 +0000 (21:39 +0000)]
A target definition file that may work for
Aarch32 Cortex-M target processor debugging.

<rdar://problem/48448564>

llvm-svn: 356416

5 years ago[ValueTracking][InstSimplify] Support min/max selects in computeConstantRange()
Nikita Popov [Mon, 18 Mar 2019 21:35:19 +0000 (21:35 +0000)]
[ValueTracking][InstSimplify] Support min/max selects in computeConstantRange()

Add support for min/max flavor selects in computeConstantRange(),
which allows us to fold comparisons of a min/max against a constant
in InstSimplify. This was suggested by spatel as an alternative
approach to D59378. I've also added the infinite looping test from
that revision here.

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

llvm-svn: 356415

5 years ago[InstCombine] Add tests for add nuw + uaddo; NFC
Nikita Popov [Mon, 18 Mar 2019 21:35:09 +0000 (21:35 +0000)]
[InstCombine] Add tests for add nuw + uaddo; NFC

Baseline tests for D59471 (InstCombine of `add nuw` and `uaddo` with
constants).

Patch by Dan Robertson.

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

llvm-svn: 356414

5 years ago[X86] Allow any 8-bit immediate to be used with BT/BTC/BTR/BTS not just sign extended...
Craig Topper [Mon, 18 Mar 2019 21:33:59 +0000 (21:33 +0000)]
[X86] Allow any 8-bit immediate to be used with BT/BTC/BTR/BTS not just sign extended 8-bit immediates.

We need to allow [128,255] in addition to [-128, 127] to match gas.

llvm-svn: 356413

5 years ago[CMake] Set LLVM_DEFAULT_EXTERNAL_LIT in standalone build correctly on windows
Alex Langford [Mon, 18 Mar 2019 21:32:31 +0000 (21:32 +0000)]
[CMake] Set LLVM_DEFAULT_EXTERNAL_LIT in standalone build correctly on windows

LLVM installed llvm-lit with a .py suffix on windows. Let's match that
behavior here.

llvm-svn: 356412

5 years ago[GlobalISel] Include missing change from r356396
Amara Emerson [Mon, 18 Mar 2019 21:29:21 +0000 (21:29 +0000)]
[GlobalISel] Include missing change from r356396

Forgot to add a change to relax some asserts in r356396.

llvm-svn: 356411

5 years ago[WebAssembly] Don't override default implementation of isOffsetFoldingLegal. NFC.
Sam Clegg [Mon, 18 Mar 2019 21:21:12 +0000 (21:21 +0000)]
[WebAssembly] Don't override default implementation of isOffsetFoldingLegal. NFC.

The default implementation does we want and is going to more compatible
with dynamic linking (-fPIC) support that is planned.

This is NFC because currently we only build wasm with
`-relocation-model=static` which in turn means that the default
`isOffsetFoldingLegal` always returns true today.

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

llvm-svn: 356410

5 years ago[ValueTracking][InstSimplify] Move abs handling into computeConstantRange(); NFC
Nikita Popov [Mon, 18 Mar 2019 21:20:03 +0000 (21:20 +0000)]
[ValueTracking][InstSimplify] Move abs handling into computeConstantRange(); NFC

This is preparation for D59506. The InstructionSimplify abs handling
is moved into computeConstantRange(), which is the general place for
such calculations. This is NFC and doesn't affect the existing tests
in test/Transforms/InstSimplify/icmp-abs-nabs.ll.

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

llvm-svn: 356409

5 years ago[InstSimplify] Add additional icmp of min/max tests; NFC
Nikita Popov [Mon, 18 Mar 2019 21:19:56 +0000 (21:19 +0000)]
[InstSimplify] Add additional icmp of min/max tests; NFC

These are baseline tests for D59506.

llvm-svn: 356408

5 years ago[X86] Use relocImm in the ROL8ri/ROL16ri/ROL32ri/ROL64ri patterns to be consistent...
Craig Topper [Mon, 18 Mar 2019 20:43:15 +0000 (20:43 +0000)]
[X86] Use relocImm in the ROL8ri/ROL16ri/ROL32ri/ROL64ri patterns to be consistent with the ROR patterns.

llvm-svn: 356407

5 years ago[X86] Replace uses of i64immSExt32_su with i64relocImmSExt32_su.
Craig Topper [Mon, 18 Mar 2019 20:43:09 +0000 (20:43 +0000)]
[X86] Replace uses of i64immSExt32_su with i64relocImmSExt32_su.

For the i8, i16, and i32 instructions we were using a relocImm. Presumably we should for i64 as well.

llvm-svn: 356406

5 years ago[AMDGPU] Enable code selection using `s_mul_hi_u32`/`s_mul_hi_i32`.
Michael Liao [Mon, 18 Mar 2019 20:40:09 +0000 (20:40 +0000)]
[AMDGPU] Enable code selection using `s_mul_hi_u32`/`s_mul_hi_i32`.

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 356405

5 years ago[llvm-objcopy] Make .build-id linking atomic
Jake Ehrlich [Mon, 18 Mar 2019 20:35:18 +0000 (20:35 +0000)]
[llvm-objcopy] Make .build-id linking atomic

This change makes linking into .build-id atomic and safe to use.
Some users under particular workflows are reporting that this races
more than half the time under particular conditions.

llvm-svn: 356404

5 years ago[InstCombine] Improve with.overflow intrinsic tests; NFC
Nikita Popov [Mon, 18 Mar 2019 20:08:35 +0000 (20:08 +0000)]
[InstCombine] Improve with.overflow intrinsic tests; NFC

- Do not use unnamed values in saddo tests
- Add tests for canonicalization of a constant arg0

Patch by Dan Robertson.

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

llvm-svn: 356403

5 years agoRestore comment regarding why Reloc::PIC_ can't be PIC
Sam Clegg [Mon, 18 Mar 2019 20:04:34 +0000 (20:04 +0000)]
Restore comment regarding why Reloc::PIC_ can't be PIC

The original change back in rL29307 explained this but it was
lost somewhere along the way.

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

llvm-svn: 356402

5 years ago[API] Remove unneded LLDB_DISABLE_PYTHON markers.
Davide Italiano [Mon, 18 Mar 2019 20:02:27 +0000 (20:02 +0000)]
[API] Remove unneded LLDB_DISABLE_PYTHON markers.

llvm-svn: 356401

5 years agoFix flat-error-unsupported-gpu-hsa test
Alexandre Ganea [Mon, 18 Mar 2019 19:38:04 +0000 (19:38 +0000)]
Fix flat-error-unsupported-gpu-hsa test

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

llvm-svn: 356400

5 years ago[AMDGPU] Asm/disasm clamp modifier on vop3 int arithmetic
Tim Renouf [Mon, 18 Mar 2019 19:35:44 +0000 (19:35 +0000)]
[AMDGPU] Asm/disasm clamp modifier on vop3 int arithmetic

Allow the clamp modifier on vop3 int arithmetic instructions in assembly
and disassembly.

This involved adding a clamp operand to the affected instructions in MIR
and MC, and thus having to fix up several places in codegen and MIR
tests.

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

Change-Id: Ic7775105f02a985b668fa658a0cd7837846a534e
llvm-svn: 356399

5 years ago[AMDGPU] Asm/disasm v_cndmask_b32_e64 with abs/neg source modifiers
Tim Renouf [Mon, 18 Mar 2019 19:25:39 +0000 (19:25 +0000)]
[AMDGPU] Asm/disasm v_cndmask_b32_e64 with abs/neg source modifiers

This commit allows v_cndmask_b32_e64 with abs, neg source
modifiers on src0, src1 to be assembled and disassembled.

This does appear to be allowed, even though they are floating point
modifiers and the operand type is b32.

To do this, I added src0_modifiers and src1_modifiers to the
MachineInstr, which involved fixing up several places in codegen and mir
tests.

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

Change-Id: I69bf4a8c73ebc65744f6110bb8fc4e937d79fbea
llvm-svn: 356398

5 years ago[Sema] Add some compile time _FORTIFY_SOURCE diagnostics
Erik Pilkington [Mon, 18 Mar 2019 19:23:45 +0000 (19:23 +0000)]
[Sema] Add some compile time _FORTIFY_SOURCE diagnostics

These diagnose overflowing calls to subset of fortifiable functions. Some
functions, like sprintf or strcpy aren't supported right not, but we should
probably support these in the future. We previously supported this kind of
functionality with -Wbuiltin-memcpy-chk-size, but that diagnostic doesn't work
with _FORTIFY implementations that use wrapper functions. Also unlike that
diagnostic, we emit these warnings regardless of whether _FORTIFY_SOURCE is
actually enabled, which is nice for programs that don't enable the runtime
checks.

Why not just use diagnose_if, like Bionic does? We can get better diagnostics in
the compiler (i.e. mention the sizes), and we have the potential to diagnose
sprintf and strcpy which is impossible with diagnose_if (at least, in languages
that don't support C++14 constexpr). This approach also saves standard libraries
from having to add diagnose_if.

rdar://48006655

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

llvm-svn: 356397

5 years agoRevert r356304: remove subreg parameter from MachineIRBuilder::buildCopy()
Amara Emerson [Mon, 18 Mar 2019 19:20:10 +0000 (19:20 +0000)]
Revert r356304: remove subreg parameter from MachineIRBuilder::buildCopy()

After review comments, it was preferred to not teach MachineIRBuilder about
non-generic instructions beyond using buildInstr().

For AArch64 I've changed the buildCopy() calls to buildInstr() + a
separate addReg() call.

This also relaxes the MachineIRBuilder's COPY checking more because it may
not always have a SrcOp given to it.

llvm-svn: 356396

5 years ago[DebugInfo][PDB] Don't write empty debug streams
Alexandre Ganea [Mon, 18 Mar 2019 19:13:23 +0000 (19:13 +0000)]
[DebugInfo][PDB] Don't write empty debug streams

Before, empty debug streams were written as 8 bytes (4 bytes signature + 4 bytes for the GlobalRefs count).

With this patch, unused empty streams aren't emitted anymore. Modules now encode 65535 as an 'unused stream' value, by convention.
Also fix the * Linker * contrib section which wasn't correctly emitted previously.

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

llvm-svn: 356395

5 years ago[MsgPack][AMDGPU] Fix unflushed raw_string_ostream bugs on windows expensive checks bot
Tim Renouf [Mon, 18 Mar 2019 19:00:46 +0000 (19:00 +0000)]
[MsgPack][AMDGPU] Fix unflushed raw_string_ostream bugs on windows expensive checks bot

This fixes a couple of unflushed raw_string_ostream bugs in recent
commits that only show up on a bot building on windows with expensive
checks.

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

Change-Id: I9c6208325503b3ee0786b4b688e13fc24a15babf
llvm-svn: 356394

5 years ago[X86] Rename imm8_su/imm16_su/imm32_su to relocImm8_su/relocImm16_su/relocImm32_su...
Craig Topper [Mon, 18 Mar 2019 18:54:06 +0000 (18:54 +0000)]
[X86] Rename imm8_su/imm16_su/imm32_su to relocImm8_su/relocImm16_su/relocImm32_su/ to accurately reflect what they are.

llvm-svn: 356393

5 years ago[SCEV] Guard movement of insertion point for loop-invariants
Warren Ristow [Mon, 18 Mar 2019 18:52:35 +0000 (18:52 +0000)]
[SCEV] Guard movement of insertion point for loop-invariants

This reinstates r347934, along with a tweak to address a problem with
PHI node ordering that that commit created (or exposed). (That commit
was reverted at r348426, due to the PHI node issue.)

Original commit message:

r320789 suppressed moving the insertion point of SCEV expressions with
dev/rem operations to the loop header in non-loop-invariant situations.
This, and similar, hoisting is also unsafe in the loop-invariant case,
since there may be a guard against a zero denominator. This is an
adjustment to the fix of r320789 to suppress the movement even in the
loop-invariant case.

This fixes PR30806.

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

llvm-svn: 356392

5 years ago[AArch64] Small fix for getIntImmCost
Adhemerval Zanella [Mon, 18 Mar 2019 18:50:58 +0000 (18:50 +0000)]
[AArch64] Small fix for getIntImmCost

It uses the generic AArch64_IMM::expandMOVImm to get the correct
number of instruction used in immediate materialization.

Reviewers: efriedma

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

llvm-svn: 356391

5 years ago[AArch64] Optimize floating point materialization
Adhemerval Zanella [Mon, 18 Mar 2019 18:45:57 +0000 (18:45 +0000)]
[AArch64] Optimize floating point materialization

This patch follows some ideas from r352866 to optimize the floating
point materialization even further. It changes isFPImmLegal to
considere up to 2 mov instruction or up to 5 in case subtarget has
fused literals.

The rationale is the cost is the same for mov+fmov vs. adrp+ldr; but
the mov+fmov sequence is always better because of the reduced d-cache
pressure. The timings are still the same if you consider movw+movk+fmov
vs. adrp+ldr will be fused (although one instruction longer).

Reviewers: efriedma

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

llvm-svn: 356390

5 years ago[TargetLowering] Add code size information on isFPImmLegal. NFC
Adhemerval Zanella [Mon, 18 Mar 2019 18:40:07 +0000 (18:40 +0000)]
[TargetLowering] Add code size information on isFPImmLegal. NFC

This allows better code size for aarch64 floating point materialization
in a future patch.

Reviewers: evandro

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

llvm-svn: 356389

5 years ago[OPENMP] Set scheduling for doacross loops as schedule, 1.
Alexey Bataev [Mon, 18 Mar 2019 18:40:00 +0000 (18:40 +0000)]
[OPENMP] Set scheduling for doacross loops as schedule, 1.

The default scheduling for doacross loops is changed from static to
static, 1.

llvm-svn: 356388

5 years ago[AArch64] Refactor floating point materialization. NFC
Adhemerval Zanella [Mon, 18 Mar 2019 18:23:23 +0000 (18:23 +0000)]
[AArch64] Refactor floating point materialization. NFC

It splits the login of actual instruction emission away from the logic
that figures out the appropriate sequence on AArch64ExpandPseudo::expandMOVImm.
The new function AArch64_IMM::expandMOVImm, which return the list of the
instructions to materialize the immediate constant, is implemented on a
separated unit because it will be used in a subsequent patch to optimize
floating point materialization.

Reviewers: efriedma

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

llvm-svn: 356387

5 years ago[libc++][NFC] Promote CMake comment to an actual option description
Louis Dionne [Mon, 18 Mar 2019 18:18:01 +0000 (18:18 +0000)]
[libc++][NFC] Promote CMake comment to an actual option description

llvm-svn: 356386

5 years ago[AMDGPU] Add the missing clang change of the experimental buffer fat pointer
Michael Liao [Mon, 18 Mar 2019 18:11:37 +0000 (18:11 +0000)]
[AMDGPU] Add the missing clang change of the experimental buffer fat pointer

llvm-svn: 356385

5 years ago[X86] Remove the _alt forms of (V)CMP instructions. Use a combination of custom print...
Craig Topper [Mon, 18 Mar 2019 17:59:59 +0000 (17:59 +0000)]
[X86] Remove the _alt forms of (V)CMP instructions. Use a combination of custom printing and custom parsing to achieve the same result and more

Similar to previous change done for VPCOM and VPCMP

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

llvm-svn: 356384

5 years ago[InstCombine] add/adjust test for NaN checks; NFC
Sanjay Patel [Mon, 18 Mar 2019 17:37:05 +0000 (17:37 +0000)]
[InstCombine] add/adjust test for NaN checks; NFC

llvm-svn: 356383

5 years ago[DAG] Cleanup unused node in SimplifySelectCC.
Nirav Dave [Mon, 18 Mar 2019 17:02:38 +0000 (17:02 +0000)]
[DAG] Cleanup unused node in SimplifySelectCC.

Delete temporarily constructed node uses for analysis after it's use,
holding onto original input nodes. Ideally this would be rewritten
without making nodes, but this appears relatively complex.

Reviewers: spatel, RKSimon, craig.topper

Subscribers: jdoerfert, hiraditya, deadalnix, llvm-commits

Tags: #llvm

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

llvm-svn: 356382

5 years ago[MVT] Fix typos in comment. NFC.
Michael Liao [Mon, 18 Mar 2019 16:57:40 +0000 (16:57 +0000)]
[MVT] Fix typos in comment. NFC.

llvm-svn: 356381

5 years agolld-link: Run conflict-mangled.test on all systems
Nico Weber [Mon, 18 Mar 2019 16:51:23 +0000 (16:51 +0000)]
lld-link: Run conflict-mangled.test on all systems

It seems to pass fine on my Mac, and it running it only on Windows made
me miss it in r355959 and required r355959.

When the test was added in r288992 we still used Win-only
UnDecorateSymbolName() for demangling. Now we use LLVM's
microsoftDemangle() which is cross-platform.

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

llvm-svn: 356380

5 years agoSkip TestVSCode_setFunctionBreakpoints on linux
Pavel Labath [Mon, 18 Mar 2019 16:04:53 +0000 (16:04 +0000)]
Skip TestVSCode_setFunctionBreakpoints on linux

Test hangs under heavy load.

llvm-svn: 356379

5 years agoFix some "variable 'foo' set but not used" warnings
Pavel Labath [Mon, 18 Mar 2019 16:04:46 +0000 (16:04 +0000)]
Fix some "variable 'foo' set but not used" warnings

gcc-8 diagnoses these.

llvm-svn: 356378

5 years agoFix libstdc++ data formatters for python3
Pavel Labath [Mon, 18 Mar 2019 15:42:08 +0000 (15:42 +0000)]
Fix libstdc++ data formatters for python3

Use floor-division for consistentcy across python versions. This fixes a
couple of libstdc++ data formatter tests.

llvm-svn: 356377

5 years ago[libc++] Add a test for PR40977
Louis Dionne [Mon, 18 Mar 2019 15:40:49 +0000 (15:40 +0000)]
[libc++] Add a test for PR40977

Even though the header makes the exact same check since https://llvm.org/D59063,
the headers could conceivably change in the future and introduce a bug.

llvm-svn: 356376

5 years ago[ELF] Emit weak-undef symbols in .dynsym of a PIE binary only if linked against share...
Siva Chandra [Mon, 18 Mar 2019 15:32:57 +0000 (15:32 +0000)]
[ELF] Emit weak-undef symbols in .dynsym of a PIE binary only if linked against shared libs.

Reviewers: espindola

Subscribers: emaste, arichardson, MaskRay, llvm-commits

Tags: #llvm

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

llvm-svn: 356374

5 years ago[AMDGPU] Add an experimental buffer fat pointer address space.
Neil Henning [Mon, 18 Mar 2019 14:44:28 +0000 (14:44 +0000)]
[AMDGPU] Add an experimental buffer fat pointer address space.

Add an experimental buffer fat pointer address space that is currently
unhandled in the backend. This commit reserves address space 7 as a
non-integral pointer repsenting the 160-bit fat pointer (128-bit buffer
descriptor + 32-bit offset) that is heavily used in graphics workloads
using the AMDGPU backend.

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

llvm-svn: 356373

5 years ago[InstCombine] allow general vector constants for funnel shift to shift transforms
Sanjay Patel [Mon, 18 Mar 2019 14:27:51 +0000 (14:27 +0000)]
[InstCombine] allow general vector constants for funnel shift to shift transforms

Follow-up to:
rL356338
rL356369

We can calculate an arbitrary vector constant minus the bitwidth, so there's
no need to limit this transform to scalars and splats.

llvm-svn: 356372

5 years ago[llvm-objcopy] - Calculate the string table section sizes correctly.
George Rimar [Mon, 18 Mar 2019 14:27:41 +0000 (14:27 +0000)]
[llvm-objcopy] - Calculate the string table section sizes correctly.

This fixes the https://bugs.llvm.org/show_bug.cgi?id=40980.

Previously if string optimization occurred as a result of
StringTableBuilder's finalize() method, the size wasn't updated.

This hopefully also makes the interaction between sections during finalization
processes a bit more clear.

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

llvm-svn: 356371

5 years agoFix TestCommandScriptImmediateOutput for python3
Pavel Labath [Mon, 18 Mar 2019 14:13:12 +0000 (14:13 +0000)]
Fix TestCommandScriptImmediateOutput for python3

s/iteritems/items

llvm-svn: 356370

5 years ago[InstCombine] extend rotate-left-by-constant canonicalization to funnel shift
Sanjay Patel [Mon, 18 Mar 2019 14:10:11 +0000 (14:10 +0000)]
[InstCombine] extend rotate-left-by-constant canonicalization to funnel shift

Follow-up to:
rL356338

Rotates are a special case of funnel shift where the 2 input operands
are the same value, but that does not need to be a restriction for the
canonicalization when the shift amount is a constant.

llvm-svn: 356369

5 years ago[SystemZ] Remove icmp undef from reduced tests
Simon Pilgrim [Mon, 18 Mar 2019 13:55:28 +0000 (13:55 +0000)]
[SystemZ] Remove icmp undef from reduced tests

Pre-commit for D59363 (Add icmp UNDEF handling to SelectionDAG::FoldSetCC)

Approved by @uweigand (Ulrich Weigand)

llvm-svn: 356368