platform/upstream/llvm.git
6 years ago[InstCombine] add more tests for trig reflections; NFC (PR38458)
Sanjay Patel [Mon, 13 Aug 2018 18:34:32 +0000 (18:34 +0000)]
[InstCombine] add more tests for trig reflections; NFC (PR38458)

llvm-svn: 339598

6 years agoEnforce instantiation of template multiversion functions
Erich Keane [Mon, 13 Aug 2018 18:33:20 +0000 (18:33 +0000)]
Enforce instantiation of template multiversion functions

Multiversioned member functions inside of a template type were
not properly being emitted.  The solution to this is to simply
ensure that their bodies are correctly evaluated/assigned during
template instantiation.

llvm-svn: 339597

6 years ago[analyzer][UninitializedObjectChecker] Refactoring p3.: printTail moved out from...
Kristof Umann [Mon, 13 Aug 2018 18:22:22 +0000 (18:22 +0000)]
[analyzer][UninitializedObjectChecker] Refactoring p3.: printTail moved out from FieldChainInfo

This is a standalone part of the effort to reduce FieldChainInfos inteerface.

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

llvm-svn: 339596

6 years ago[analyzer][UninitializedObjectChecker] Refactoring p2.: Moving pointer chasing to...
Kristof Umann [Mon, 13 Aug 2018 18:17:05 +0000 (18:17 +0000)]
[analyzer][UninitializedObjectChecker] Refactoring p2.: Moving pointer chasing to a separate file

In this patch, the following classes and functions have been moved to a header file:

    FieldChainInfo
    FindUninitializedFields
    isPrimitiveType

This also meant that they moved from anonymous namespace to clang::ento.

Code related to pointer chasing now relies in its own file.

There's absolutely no functional change in this patch -- its literally just copy pasting.

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

llvm-svn: 339595

6 years ago[llvm-mca] Propagate fatal llvm-mca errors from library classes to driver.
Matt Davis [Mon, 13 Aug 2018 18:11:48 +0000 (18:11 +0000)]
[llvm-mca] Propagate fatal llvm-mca errors from library classes to driver.

Summary:
This patch introduces error handling to propagate the errors from llvm-mca library classes (or what will become library classes) up to the driver.  This patch also introduces an enum to make clearer the intention of the return value for Stage::execute.

This supports PR38101.

Reviewers: andreadb, courbet, RKSimon

Reviewed By: andreadb

Subscribers: llvm-commits, tschuett, gbedwell

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

llvm-svn: 339594

6 years ago[Sema] fix -Wfloat-conversion test case.
Nick Desaulniers [Mon, 13 Aug 2018 18:07:50 +0000 (18:07 +0000)]
[Sema] fix -Wfloat-conversion test case.

Summary:
Fixes r339581 ("[SEMA] add more -Wfloat-conversion to
compound assigment analysis").

This test case was caught in postsubmit testing.

Reviewers: aaron.ballman, gkistanova

Reviewed By: aaron.ballman

Subscribers: cfe-commits, srhines

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

llvm-svn: 339593

6 years ago[clang-doc] Pass over function-internal declarations
Julie Hockett [Mon, 13 Aug 2018 18:05:50 +0000 (18:05 +0000)]
[clang-doc] Pass over function-internal declarations

llvm-svn: 339592

6 years ago[analyzer][UninitializedObjectChecker] Refactoring p1.: ImmutableList factory is...
Kristof Umann [Mon, 13 Aug 2018 17:55:52 +0000 (17:55 +0000)]
[analyzer][UninitializedObjectChecker] Refactoring p1.: ImmutableList factory is no longer static

This patch is the first part of a series of patches to refactor UninitializedObjectChecker. The goal of this effort is to

    Separate pointer chasing from the rest of the checker,
    Increase readability and reliability,
    Don't impact performance (too bad).

In this one, ImmutableList's factory is moved to FindUninitializedFields.

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

llvm-svn: 339591

6 years ago[Documentation] Remove unnecessary placeholder, grammar fix in Release Notes.
Eugene Zelenko [Mon, 13 Aug 2018 17:55:48 +0000 (17:55 +0000)]
[Documentation] Remove unnecessary placeholder, grammar fix in Release Notes.

llvm-svn: 339590

6 years ago[X86][BtVer2] Use NoSchedPredicate to model default transitions in variant scheduling...
Andrea Di Biagio [Mon, 13 Aug 2018 17:52:39 +0000 (17:52 +0000)]
[X86][BtVer2] Use NoSchedPredicate to model default transitions in variant scheduling classes. NFC.

llvm-svn: 339589

6 years ago[SimplifyLibCalls] reduce code for optimizeCos; NFCI
Sanjay Patel [Mon, 13 Aug 2018 17:40:49 +0000 (17:40 +0000)]
[SimplifyLibCalls] reduce code for optimizeCos; NFCI

llvm-svn: 339588

6 years agoAttempt to fix some MSVC build errors.
Erik Pilkington [Mon, 13 Aug 2018 17:39:19 +0000 (17:39 +0000)]
Attempt to fix some MSVC build errors.

llvm-svn: 339587

6 years ago[ADT] Implemented unittests for ImmutableList
Kristof Umann [Mon, 13 Aug 2018 17:32:48 +0000 (17:32 +0000)]
[ADT] Implemented unittests for ImmutableList

Also fixed a typo that wasn't discovered as `create` was never instantiated.

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

llvm-svn: 339586

6 years ago[OMPT] Make omp_control_tool() compliant when called from Fortran programs
Jonathan Peyton [Mon, 13 Aug 2018 17:26:18 +0000 (17:26 +0000)]
[OMPT] Make omp_control_tool() compliant when called from Fortran programs

This change fixes an incorrect behavior of the omp_control_tool function when
called from Fortran applications.  A tool callback function for this event is
supposed to get NULL for the third argument according to the specification, but
the current implementation just passes a garbage value. A possible fix is to use
the OPTIONAL attribute for the third argument.

Patch by Hansang Bae

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

llvm-svn: 339585

6 years ago[InstCombine] Limit simplifyAllocaArraySize constant folding to values that fit into...
Simon Pilgrim [Mon, 13 Aug 2018 16:50:20 +0000 (16:50 +0000)]
[InstCombine] Limit simplifyAllocaArraySize constant folding to values that fit into a uint64_t

Fixes OSS-Fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5223

llvm-svn: 339584

6 years agoStraight forward FastDemangle replacement in SubsPrimitiveParmItanium
Stefan Granitz [Mon, 13 Aug 2018 16:45:06 +0000 (16:45 +0000)]
Straight forward FastDemangle replacement in SubsPrimitiveParmItanium

Summary:
Removing FastDemangle will greatly reduce maintenance efforts. This patch replaces the last point of use in LLDB. Semantics should be kept intact.

Once this is agreed upon, we can:
* Remove the FastDemangle sources
* Add more features e.g. substitutions in template parameters, considering all variations, etc.

Depends on LLVM patch https://reviews.llvm.org/D50586

Reviewers: erik.pilkington, friss, jingham, JDevlieghere

Subscribers: kristof.beyls, chrib, lldb-commits

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

llvm-svn: 339583

6 years ago[AST] Update/correct the static_asserts for the bit-fields in Type
Bruno Ricci [Mon, 13 Aug 2018 16:40:57 +0000 (16:40 +0000)]
[AST] Update/correct the static_asserts for the bit-fields in Type

The current static_assert only checks that ObjCObjectTypeBitfields
fits into an unsigned. However it turns out that FunctionTypeBitfields
do not currently fits into an unsigned. Therefore the anonymous
union containing the bit-fields always use 8 bytes instead of 4.

This patch removes the lone misguided static_assert and systematically
checks the size of each bit-field.

Reviewed By: erichkeane

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

llvm-svn: 339582

6 years ago[SEMA] add more -Wfloat-conversion to compound assigment analysis
Nick Desaulniers [Mon, 13 Aug 2018 16:38:07 +0000 (16:38 +0000)]
[SEMA] add more -Wfloat-conversion to compound assigment analysis

Summary: Fixes Bug: https://bugs.llvm.org/show_bug.cgi?id=27061

Reviewers: aaron.ballman, acoomans

Reviewed By: aaron.ballman, acoomans

Subscribers: acoomans, cfe-commits, srhines, pirama

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

llvm-svn: 339581

6 years ago[itanium demangler] Add llvm::itaniumFindTypesInMangledName()
Erik Pilkington [Mon, 13 Aug 2018 16:37:47 +0000 (16:37 +0000)]
[itanium demangler] Add llvm::itaniumFindTypesInMangledName()

This function calls a callback whenever a <type> is parsed.

This is necessary to implement FindAlternateFunctionManglings in LLDB, which
uses a similar hack in FastDemangle. Once that function has been updated to use
this version, FastDemangle can finally be removed.

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

llvm-svn: 339580

6 years ago[InstCombine] auto-generate full checks and add cos intrinsic test; NFC
Sanjay Patel [Mon, 13 Aug 2018 16:29:01 +0000 (16:29 +0000)]
[InstCombine] auto-generate full checks and add cos intrinsic test; NFC

llvm-svn: 339579

6 years ago[SLC] Expand simplification of pow() for vector types
Evandro Menezes [Mon, 13 Aug 2018 16:12:37 +0000 (16:12 +0000)]
[SLC] Expand simplification of pow() for vector types

Also consider vector constants when simplifying `pow()`.

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

llvm-svn: 339578

6 years ago[Tablegen] Replace uses of formatted_raw_ostream with raw_ostream in the predicate...
Andrea Di Biagio [Mon, 13 Aug 2018 15:13:35 +0000 (15:13 +0000)]
[Tablegen] Replace uses of formatted_raw_ostream with raw_ostream in the predicate expander. NFCI

This is a follow-up of r339552.

As pointed out by Craig in D50566, we don't need a formatted_raw_ostream to
indent strings. We can use instead raw_ostream::indent().

Internally, class PredicateExpander already keeps track of the current
indentation level. Also, the grammar for predicates is well parenthesized, and
therefore we don't need to use a formatted_raw_ostream to continuously track the
column number. Instead we can safely replace all the uses of
formatted_raw_ostream::PadToColumn() with uses of raw_ostream::indent().

By replacing formatted_raw_ostream with a simpler raw_ostream, we also avoid the
implicit check on the newline character on every print to stream.

No functional change intended.

llvm-svn: 339577

6 years ago[Hexagon] Silence -Wuninitialized warning from GCC 5.4, NFC
Krzysztof Parzyszek [Mon, 13 Aug 2018 15:08:25 +0000 (15:08 +0000)]
[Hexagon] Silence -Wuninitialized warning from GCC 5.4, NFC

Patch by Kim Gräsman.

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

llvm-svn: 339576

6 years ago[sanitizer] Remove st(X) from the clobber list in 32-bit x86 atomics
Kostya Kortchinsky [Mon, 13 Aug 2018 15:01:24 +0000 (15:01 +0000)]
[sanitizer] Remove st(X) from the clobber list in 32-bit x86 atomics

Summary:
When compiling with `WERROR=ON` & a recent clang, having the `st(?)` registers
in the clobber list produces a fatal error (except `st(7)` for some reason):
```
.../sanitizer_common/sanitizer_atomic_clang_x86.h:98:9: error: inline asm clobber list contains reserved registers: ST0, ST1, ST2, ST3, ST4, ST5, ST6 [-Werror,-Winline-asm]
        "movq %1, %%mm0;"  // Use mmx reg for 64-bit atomic moves
        ^
<inline asm>:1:1: note: instantiated into assembly here
        movq 8(%esp), %mm0;movq %mm0, (%esi);emms;
^
.../sanitizer_common/sanitizer_atomic_clang_x86.h:98:9: note: Reserved registers on the clobber list may not be preserved across the asm statement, and clobbering them may lead to undefined behaviour.
        "movq %1, %%mm0;"  // Use mmx reg for 64-bit atomic moves
        ^
<inline asm>:1:1: note: instantiated into assembly here
        movq 8(%esp), %mm0;movq %mm0, (%esi);emms;
^
```
As far as I can tell, they were in there due to the use of the `emms`
instruction, but removing the clobber doesn't appear to have a functional
impact. I am unsure if there is a better way to address this.

Reviewers: eugenis, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, delcypher, jfb, llvm-commits, #sanitizers

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

llvm-svn: 339575

6 years agoRevert "[OPENMP] Fix emission of the loop doacross constructs."
Alexey Bataev [Mon, 13 Aug 2018 14:42:18 +0000 (14:42 +0000)]
Revert "[OPENMP] Fix emission of the loop doacross constructs."

This reverts commit r339568 because of the problems with the buildbots.

llvm-svn: 339574

6 years ago[clang-format] Fix comment, NFC
Krasimir Georgiev [Mon, 13 Aug 2018 14:32:29 +0000 (14:32 +0000)]
[clang-format] Fix comment, NFC

llvm-svn: 339573

6 years agoFix lint tests for D50449
Kadir Cetinkaya [Mon, 13 Aug 2018 14:32:19 +0000 (14:32 +0000)]
Fix lint tests for D50449

Reviewers: ilya-biryukov, hokein

Reviewed By: hokein

Subscribers: hokein, ioeric, jkorous, arphaman, cfe-commits

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

llvm-svn: 339572

6 years ago[clang-tidy] Recognize [[clang::reinitializes]] attribute in bugprone-use-after-move
Martin Bohme [Mon, 13 Aug 2018 14:24:52 +0000 (14:24 +0000)]
[clang-tidy] Recognize [[clang::reinitializes]] attribute in bugprone-use-after-move

Summary:
This allows member functions to be marked as reinitializing the object. After a
moved-from object has been reinitialized, the check will no longer consider it
to be in an indeterminate state.

The patch that adds the attribute itself is at https://reviews.llvm.org/D49911

Reviewers: ilya-biryukov, aaron.ballman, alexfh, hokein, rsmith

Reviewed By: aaron.ballman

Subscribers: dblaikie, xazax.hun, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 339571

6 years agoRevert "[Sparc] Add support for the cycle counter available in GR740"
Daniel Cederman [Mon, 13 Aug 2018 14:18:09 +0000 (14:18 +0000)]
Revert "[Sparc] Add support for the cycle counter available in GR740"

It breaks when using EXPENSIVE_CHECKS with the error message
"Bad machine code: Using an undefined physical register".

llvm-svn: 339570

6 years agoSummary:Add clang::reinitializes attribute
Martin Bohme [Mon, 13 Aug 2018 14:11:03 +0000 (14:11 +0000)]
Summary:Add clang::reinitializes attribute

Summary:
This is for use by clang-tidy's bugprone-use-after-move check -- see
corresponding clang-tidy patch at https://reviews.llvm.org/D49910.

Reviewers: aaron.ballman, rsmith

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 339569

6 years ago[OPENMP] Fix emission of the loop doacross constructs.
Alexey Bataev [Mon, 13 Aug 2018 14:05:43 +0000 (14:05 +0000)]
[OPENMP] Fix emission of the loop doacross constructs.

The number of loops associated with the OpenMP loop constructs should
not be considered as the number loops to collapse.

llvm-svn: 339568

6 years agoCheck for tied operands
Sid Manning [Mon, 13 Aug 2018 14:01:25 +0000 (14:01 +0000)]
Check for tied operands

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

llvm-svn: 339567

6 years ago[LLD][ELF] - Remove dead code from handleTlsRelocation. NFC.
George Rimar [Mon, 13 Aug 2018 13:59:06 +0000 (13:59 +0000)]
[LLD][ELF] - Remove dead code from handleTlsRelocation. NFC.

Code is dead because R_TLSDESC_CALL is already handled in the
following block of the code:
https://github.com/llvm-mirror/lld/blob/master/ELF/Relocations.cpp#L231

llvm-svn: 339566

6 years ago[SystemZ] Increase the amount of inlining.
Jonas Paulsson [Mon, 13 Aug 2018 13:31:30 +0000 (13:31 +0000)]
[SystemZ]  Increase the amount of inlining.

Implement getInliningThresholdMultiplier() and have it return 3.

Review: Ulrich Weigand
llvm-svn: 339563

6 years ago[X86] Add tests showing missing div/rem 0, X -> 0 combines
Simon Pilgrim [Mon, 13 Aug 2018 13:29:54 +0000 (13:29 +0000)]
[X86] Add tests showing missing div/rem 0, X -> 0 combines

llvm-svn: 339562

6 years ago[DAGCombiner] simplifyDivRem - add comment describing divide by undef/zero combine...
Simon Pilgrim [Mon, 13 Aug 2018 13:12:25 +0000 (13:12 +0000)]
[DAGCombiner] simplifyDivRem - add comment describing divide by undef/zero combine. NFC.

llvm-svn: 339561

6 years ago[ASTImporter] Improved import of friend templates.
Balazs Keri [Mon, 13 Aug 2018 13:08:37 +0000 (13:08 +0000)]
[ASTImporter] Improved import of friend templates.

Summary:
When importing a friend class template declaration,
this declaration should not be merged with any other existing declaration
for the same type. Otherwise the getFriendDecl of the FriendDecl can point
to an other already referenced declaration, this case causes problems.
Additionally the previous decl of class templates is set at import.

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

llvm-svn: 339560

6 years ago[CMake] Fix bug in `add_weak_symbols()` function.
Dan Liew [Mon, 13 Aug 2018 12:59:38 +0000 (12:59 +0000)]
[CMake] Fix bug in `add_weak_symbols()` function.

Previously the the `weak_symbols.txt` files could be modified and the
build system wouldn't update the link flags automatically. Instead the
developer had to know to reconfigure CMake manually.

This is now fixed by telling CMake that the file being used to
read weak symbols from is a configure-time dependency.

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

llvm-svn: 339559

6 years agoRevert "Allow relockable scopes with thread safety attributes."
Haojian Wu [Mon, 13 Aug 2018 12:50:30 +0000 (12:50 +0000)]
Revert "Allow relockable scopes with thread safety attributes."

This reverts commit r339456.

The change introduces a new crash, see

class SCOPED_LOCKABLE FileLock {
 public:
  explicit FileLock()
      EXCLUSIVE_LOCK_FUNCTION(file_);
  ~FileLock() UNLOCK_FUNCTION(file_);
  void Lock() EXCLUSIVE_LOCK_FUNCTION(file_);
  Mutex file_;
};

void relockShared2() {
  FileLock file_lock;
  file_lock.Lock();
}

llvm-svn: 339558

6 years agoFix MSVC 'std::min: no matching overloaded function found' error.
Simon Pilgrim [Mon, 13 Aug 2018 12:24:48 +0000 (12:24 +0000)]
Fix MSVC 'std::min: no matching overloaded function found' error.

llvm-svn: 339557

6 years ago[CGP] Fix GEP issue with out of range APInt constant values not fitting in int64_t
Simon Pilgrim [Mon, 13 Aug 2018 12:10:09 +0000 (12:10 +0000)]
[CGP] Fix GEP issue with out of range APInt constant values not fitting in int64_t

Test case reduced from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7173

llvm-svn: 339556

6 years ago[LLD][ELF] - Remove dead code from handleTlsRelocation. NFC.
George Rimar [Mon, 13 Aug 2018 11:20:18 +0000 (11:20 +0000)]
[LLD][ELF] - Remove dead code from handleTlsRelocation. NFC.

That piece of code is really very old and "protected"
from TLS relocations against symbol in non-allocatable sections.
It is useless because normally non-alloc sections have relocations
with allocatable targets, but not the reverse.
And so the code was simply dead.

llvm-svn: 339553

6 years ago[Tablegen][SubtargetEmitter] Improve expansion of predicates of a variant scheduling...
Andrea Di Biagio [Mon, 13 Aug 2018 11:09:04 +0000 (11:09 +0000)]
[Tablegen][SubtargetEmitter] Improve expansion of predicates of a variant scheduling class.

This patch refactors the logic that expands predicates of a variant scheduling
class.

The idea is to improve the readability of the auto-generated code by removing
redundant parentheses around predicate expressions, and by removing redundant
if(true) statements.

This patch replaces the definition of NoSchedPred in TargetSchedule.td with an
instance of MCSchedPredicate. The new definition is sematically equivalent to
the previous one. The main difference is that now SubtargetEmitter knows that it
represents predicate "true".

Before this patch, we always generated an if (true) for the default transition
of a variant scheduling class.

Example (taken from AArch64GenSubtargetInfo.inc) :

```
if (SchedModel->getProcessorID() == 3) { // CycloneModel
  if ((TII->isScaledAddr(*MI)))
    return 927; // (WriteIS_WriteLD)_ReadBaseRS
  if ((true))
    return 928; // WriteLD_ReadDefault
}
```

Extra parentheses were also generated around the predicate expressions.

With this patch, we get the following auto-generated checks:

```
if (SchedModel->getProcessorID() == 3) { // CycloneModel
  if (TII->isScaledAddr(*MI))
    return 927; // (WriteIS_WriteLD)_ReadBaseRS
  return 928; // WriteLD_ReadDefault
}
```

The new auto-generated code behaves exactly the same as before. So, technically
this is a non functional change.

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

llvm-svn: 339552

6 years ago[Sparc] Add support for the cycle counter available in GR740
Daniel Cederman [Mon, 13 Aug 2018 10:49:48 +0000 (10:49 +0000)]
[Sparc] Add support for the cycle counter available in GR740

Summary: The GR740 provides an up cycle counter in the
registers ASR22 and ASR23. As these registers can not be
read together atomically we only use the value of ASR23
for llvm.readcyclecounter(). The ASR23 register holds the
32 LSBs of the up-counter.

Reviewers: jyknight, venkatra

Reviewed By: jyknight

Subscribers: fedor.sergeev, jrtc27, llvm-commits

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

llvm-svn: 339551

6 years ago[LLD][ELF] - Update test case to check the error message reported. NFC.
George Rimar [Mon, 13 Aug 2018 10:28:00 +0000 (10:28 +0000)]
[LLD][ELF] - Update test case to check the error message reported. NFC.

This updates znotext-plt-relocations-protected.s test case
(adds a file symbol) to check how the error message is built.

It allows to cover/test the following line:
https://github.com/llvm-mirror/lld/blob/master/ELF/Relocations.cpp#L79

llvm-svn: 339550

6 years agoRemove extra semicolon (fixes -Wpedantic warning). NFCI.
Simon Pilgrim [Mon, 13 Aug 2018 10:05:34 +0000 (10:05 +0000)]
Remove extra semicolon (fixes -Wpedantic warning). NFCI.

llvm-svn: 339549

6 years ago[clangd] Generate incomplete trigrams for the Dex index
Kirill Bobyrev [Mon, 13 Aug 2018 08:57:06 +0000 (08:57 +0000)]
[clangd] Generate incomplete trigrams for the Dex index

This patch handles trigram generation "short" identifiers and queries.
Trigram generator produces incomplete trigrams for short names so that
the same query iterator API can be used to match symbols which don't
have enough symbols to form a trigram and correctly handle queries which
also are not sufficient for generating a full trigram.

Reviewed by: ioeric

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

llvm-svn: 339548

6 years ago[clangd] Introduce scoring mechanism for SignatureInformations.
Kadir Cetinkaya [Mon, 13 Aug 2018 08:40:05 +0000 (08:40 +0000)]
[clangd] Introduce scoring mechanism for SignatureInformations.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: mgrang, ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 339547

6 years ago[ARM] Added FP16 VREV Vector Instrinsic CodeGen support
Luke Geeson [Mon, 13 Aug 2018 08:37:41 +0000 (08:37 +0000)]
[ARM] Added FP16 VREV Vector Instrinsic CodeGen support

llvm-svn: 339546

6 years ago[clangd] Support textEdit in addition to insertText.
Kadir Cetinkaya [Mon, 13 Aug 2018 08:23:01 +0000 (08:23 +0000)]
[clangd] Support textEdit in addition to insertText.

Summary:
Completion replies contains textEdits as well. Note that this change
relies on https://reviews.llvm.org/D50443.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: mgrang, ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 339543

6 years ago[clang] Store code completion token range in preprocessor.
Kadir Cetinkaya [Mon, 13 Aug 2018 08:13:35 +0000 (08:13 +0000)]
[clang] Store code completion token range in preprocessor.

Summary:
This change is to support a new fature in clangd, tests will be send toclang-tools-extra with that change.

Unittests are included in: https://reviews.llvm.org/D50449

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 339540

6 years ago[GuardWidening] Widen very likely non-taken br instructions
Max Kazantsev [Mon, 13 Aug 2018 07:58:19 +0000 (07:58 +0000)]
[GuardWidening] Widen very likely non-taken br instructions

This is a second part of D49974 that handles widening of conditional branches that
have very likely `false` branch.

Differential Revision: https://reviews.llvm.org/D50040
Reviewed By: reames

llvm-svn: 339537

6 years ago[SelectionDAG] In PromoteFloatOp_BITCAST, insert a bitcast after the fp_to_fp16 in...
Craig Topper [Mon, 13 Aug 2018 06:53:49 +0000 (06:53 +0000)]
[SelectionDAG] In PromoteFloatOp_BITCAST, insert a bitcast after the fp_to_fp16 in case the result type isn't a scalar integer.

This is another variation of PR38533. In this case, the result type of the bitcast is legal and 16-bits wide, but not a scalar integer. So we need to emit the convert to i16 and then bitcast it to the true result type. This new bitcast will be further type legalized if necessary.

llvm-svn: 339536

6 years ago[SelectionDAG] In PromoteIntRes_BITCAST, when the input is TypePromoteFloat, make...
Craig Topper [Mon, 13 Aug 2018 06:53:47 +0000 (06:53 +0000)]
[SelectionDAG] In PromoteIntRes_BITCAST, when the input is TypePromoteFloat, make sure the output type is scalar. For vectors, use a store and load of temporary.

Previously if the result type was a vector, we emitted a FP_TO_FP16 with a vector result type which isn't valid.

This is basically the opposite case of the root cause of PR38533.

llvm-svn: 339535

6 years agoRestore correct x86_64 EH encodings in kernel code model
Lei Liu [Mon, 13 Aug 2018 06:06:53 +0000 (06:06 +0000)]
Restore correct x86_64 EH encodings in kernel code model

Fixes PR37524.

The exception handling encodings for x86_64 in kernel code model
has been changed with r309884.  Restore it to correct ones.  These
encodings include PersonalityEncoding, LSDAEncoding and
TTypeEncoding.

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

llvm-svn: 339534

6 years ago[SelectionDAG] In PromoteFloatRes_BITCAST, insert a bitcast before the fp16_to_fp...
Craig Topper [Mon, 13 Aug 2018 05:26:49 +0000 (05:26 +0000)]
[SelectionDAG] In PromoteFloatRes_BITCAST, insert a bitcast before the fp16_to_fp in case the input type isn't an i16.

The bitcast can be further legalized as needed.

Fixes PR38533.

llvm-svn: 339533

6 years ago[InstCombine] Fix typo in comment. NFC
Craig Topper [Mon, 13 Aug 2018 00:54:23 +0000 (00:54 +0000)]
[InstCombine] Fix typo in comment. NFC

llvm-svn: 339532

6 years ago[InstCombine] Replace call to haveNoCommonBitsSet in visitXor with just the special...
Craig Topper [Mon, 13 Aug 2018 00:38:27 +0000 (00:38 +0000)]
[InstCombine] Replace call to haveNoCommonBitsSet in visitXor with just the special case that doesn't use computeKnownBits.

Summary: computeKnownBits is expensive. The cases that would be detected by the computeKnownBits portion of haveNoCommonBitsSet were already handled by the earlier call to SimplifyDemandedInstructionBits.

Reviewers: spatel, lebedev.ri

Reviewed By: lebedev.ri

Subscribers: llvm-commits

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

llvm-svn: 339531

6 years ago[ASTMatchers] Let hasAnyArgument also support CXXUnresolvedConstructExpr
Shuai Wang [Sun, 12 Aug 2018 23:30:05 +0000 (23:30 +0000)]
[ASTMatchers] Let hasAnyArgument also support CXXUnresolvedConstructExpr

Subscribers: cfe-commits

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

llvm-svn: 339530

6 years ago[X86] Add constant folding for AVX512 versions of scalar floating point to integer...
Craig Topper [Sun, 12 Aug 2018 22:09:54 +0000 (22:09 +0000)]
[X86] Add constant folding for AVX512 versions of scalar floating point to integer conversion intrinsics.

Summary:
We've supported constant folding for sse versions for many years. This patch adds support for the avx512 versions including unsigned with the default rounding mode. We could probably do more with other roundings modes and SAE in the future.

The test cases are largely based on the sse.ll test cases. But I did add some test cases to ensure the unsigned versions don't accept negative values. Also checked the bounds of f64->i32 conversions to make sure unsigned has a larger positive range than signed.

Reviewers: RKSimon, spatel, chandlerc

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 339529

6 years ago[globalisel] Remove dead code from GlobalISelEmitter
Daniel Sanders [Sun, 12 Aug 2018 21:49:42 +0000 (21:49 +0000)]
[globalisel] Remove dead code from GlobalISelEmitter

Summary: Found by GCC's -Wunused-function.

Patch by Kim Gräsman

Reviewers: ab, dsanders, llvm-commits

Reviewed By: dsanders

Subscribers: rovka, kristof.beyls

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

llvm-svn: 339528

6 years agoRenaming arg_const_range to const_arg_range; NFC.
Aaron Ballman [Sun, 12 Aug 2018 21:19:22 +0000 (21:19 +0000)]
Renaming arg_const_range to const_arg_range; NFC.

This form makes more sense (it is a range over constant arguments) and is most consistent with const_arg_iterator (there are zero instances of arg_const_iterator).

llvm-svn: 339527

6 years agoAMDGPU: Cleanup min/max legacy tests
Matt Arsenault [Sun, 12 Aug 2018 19:29:53 +0000 (19:29 +0000)]
AMDGPU: Cleanup min/max legacy tests

Also add some more tests in preparation for
a future patch.

llvm-svn: 339526

6 years agoDAG: Check no-signed-zeros instead of unsafe-fp-math
Matt Arsenault [Sun, 12 Aug 2018 19:09:12 +0000 (19:09 +0000)]
DAG: Check no-signed-zeros instead of unsafe-fp-math

Addresses fixme, although this should still be checking individual
operand flags.

llvm-svn: 339525

6 years ago[NFC] Fixed build, updated tests
David Bolvansky [Sun, 12 Aug 2018 18:32:53 +0000 (18:32 +0000)]
[NFC] Fixed build, updated tests

llvm-svn: 339524

6 years ago[NFC] Renamed test file
David Bolvansky [Sun, 12 Aug 2018 17:43:27 +0000 (17:43 +0000)]
[NFC] Renamed test file

llvm-svn: 339523

6 years ago[ASTMatchers] Add matchers unresolvedMemberExpr, cxxDependentScopeMemberExpr
Shuai Wang [Sun, 12 Aug 2018 17:34:36 +0000 (17:34 +0000)]
[ASTMatchers] Add matchers unresolvedMemberExpr, cxxDependentScopeMemberExpr

Subscribers: cfe-commits

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

llvm-svn: 339522

6 years ago[Support][JSON][NFC] Silence GCC warning about broken strict aliasing rules
David Bolvansky [Sun, 12 Aug 2018 17:31:46 +0000 (17:31 +0000)]
[Support][JSON][NFC] Silence GCC warning about broken strict aliasing rules

Summary:
The as<T>() method would trigger the following warning on GCC <7:

   warning: dereferencing type-punned pointer will break
       strict-aliasing rules [-Wstrict-aliasing]

     return *reinterpret_cast<T *>(Union.buffer);
                                               ^

Union.buffer is guaranteed to be aligned to whatever types it contains,
and json::Value maintains the invariant that it only calls as<T>() for a
T it has previously placement-newed into Union.buffer. This should
follow the rules for strict aliasing.

Using two static_cast via void * instead of reinterpret_cast
silences the warning and presumably makes GCC understand that no
strict-aliasing violation is happening.

No functional change intended.

Patch by: kimgr (Kim Gräsman)

Reviewers: sammccall, xiangzhai, HaoLiu, llvm-commits, xbolva00

Reviewed By: sammccall, xbolva00

Subscribers: xbolva00

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

llvm-svn: 339521

6 years ago[InstCombine] Fold Select with binary op - non-commutative opcodes
David Bolvansky [Sun, 12 Aug 2018 17:30:07 +0000 (17:30 +0000)]
[InstCombine] Fold Select with binary op - non-commutative opcodes

Summary:
Basic version was merged - https://reviews.llvm.org/D49954

This adds support for FP & non-commutative opcodes

Precommited tests: https://reviews.llvm.org/rL338727

Reviewers: spatel, lebedev.ri

Reviewed By: spatel

Subscribers: jfb

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

llvm-svn: 339520

6 years ago[InstCombine] fix/enhance fadd/fsub factorization
Sanjay Patel [Sun, 12 Aug 2018 15:48:26 +0000 (15:48 +0000)]
[InstCombine] fix/enhance fadd/fsub factorization
  (X * Z) + (Y * Z) --> (X + Y) * Z
  (X * Z) - (Y * Z) --> (X - Y) * Z
  (X / Z) + (Y / Z) --> (X + Y) / Z
  (X / Z) - (Y / Z) --> (X - Y) / Z

The existing code that implemented these folds failed to
optimize vectors, and it transformed code with multiple
uses when it should not have.

llvm-svn: 339519

6 years ago[InstCombine] move/add tests for fadd/fsub factorization; NFC
Sanjay Patel [Sun, 12 Aug 2018 15:06:15 +0000 (15:06 +0000)]
[InstCombine] move/add tests for fadd/fsub factorization; NFC

llvm-svn: 339518

6 years agoAdding the readability module to the list of dependencies for the C++ Core Guidelines...
Aaron Ballman [Sun, 12 Aug 2018 14:47:16 +0000 (14:47 +0000)]
Adding the readability module to the list of dependencies for the C++ Core Guidelines module. Amends r339516 for a failing bot.

llvm-svn: 339517

6 years agoAdd a new check to the readability module that flags uses of "magic numbers" (both...
Aaron Ballman [Sun, 12 Aug 2018 14:35:13 +0000 (14:35 +0000)]
Add a new check to the readability module that flags uses of "magic numbers" (both floating-point and integral).

Patch by Florin Iucha <florin@signbit.net>

llvm-svn: 339516

6 years ago[InstSimplify] Guard against large shift amounts.
Benjamin Kramer [Sun, 12 Aug 2018 11:43:03 +0000 (11:43 +0000)]
[InstSimplify] Guard against large shift amounts.

These are always UB, but can happen for large integer inputs. Testing it
is very fragile as -simplifycfg will nuke the UB top-down.

llvm-svn: 339515

6 years ago[LLD][ELF] - Add one more test case for CallGraphSort.
George Rimar [Sun, 12 Aug 2018 09:16:22 +0000 (09:16 +0000)]
[LLD][ELF] - Add one more test case for CallGraphSort.

This adds a coverage for the following early continue:
https://github.com/llvm-mirror/lld/blob/master/ELF/CallGraphSort.cpp#L200

llvm-svn: 339514

6 years agoAMDGPU: Check NSZ MI flag when folding omod
Matt Arsenault [Sun, 12 Aug 2018 08:44:25 +0000 (08:44 +0000)]
AMDGPU: Check NSZ MI flag when folding omod

I'm not sure the exact nsz flag combination that
is OK. I think as long as it's on either, this is OK.
For now just check it on the omod multiply.

llvm-svn: 339513

6 years agoAMDGPU: Use splat vectors for undefs when folding canonicalize
Matt Arsenault [Sun, 12 Aug 2018 08:42:54 +0000 (08:42 +0000)]
AMDGPU: Use splat vectors for undefs when folding canonicalize

If one of the elements is undef, use the canonicalized constant
from the other element instead of 0.

Splat vectors are more useful for other optimizations, such
as matching vector clamps. This was breaking on clamps
of half3 from the undef 4th component.

llvm-svn: 339512

6 years agoAMDGPU: Fix packing undef parts of build_vector
Matt Arsenault [Sun, 12 Aug 2018 08:42:46 +0000 (08:42 +0000)]
AMDGPU: Fix packing undef parts of build_vector

llvm-svn: 339511

6 years ago[LLF][ELF] - Simplify. NFC.
George Rimar [Sun, 12 Aug 2018 07:52:24 +0000 (07:52 +0000)]
[LLF][ELF] - Simplify. NFC.

llvm-svn: 339510

6 years ago[TargetLowering] Simplify one of the special cases in SimplifyDemandedBits for XOR...
Craig Topper [Sun, 12 Aug 2018 06:52:03 +0000 (06:52 +0000)]
[TargetLowering] Simplify one of the special cases in SimplifyDemandedBits for XOR. NFCI

We were checking for all bits being Known by checking Known.Zero|Known.One, but if all the bits are known then the value should be a Constant and we can just check for that instead.

llvm-svn: 339509

6 years ago[TargetLowering] Use APInt::isSubsetOf to simplify some code. NFC
Craig Topper [Sun, 12 Aug 2018 05:34:15 +0000 (05:34 +0000)]
[TargetLowering] Use APInt::isSubsetOf to simplify some code. NFC

llvm-svn: 339508

6 years ago[X86] Remove unnecessary AddedComplexity line. NFC
Craig Topper [Sun, 12 Aug 2018 03:22:18 +0000 (03:22 +0000)]
[X86] Remove unnecessary AddedComplexity line. NFC

The use of the or_is_add predicate already gives enough of a complexity boost to get the patterns ordered properly.

llvm-svn: 339507

6 years ago[ASTImporter] Added test case for opaque enums
Raphael Isemann [Sat, 11 Aug 2018 23:43:46 +0000 (23:43 +0000)]
[ASTImporter] Added test case for opaque enums

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

llvm-svn: 339506

6 years ago[ASTImporter] Added test case for CXXConversionDecl importing
Raphael Isemann [Sat, 11 Aug 2018 23:43:02 +0000 (23:43 +0000)]
[ASTImporter] Added test case for CXXConversionDecl importing

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

llvm-svn: 339505

6 years agoUse a DenseMap for looking up functions by UID in CompileUnit::FindFunctionByUID
Raphael Isemann [Sat, 11 Aug 2018 23:40:27 +0000 (23:40 +0000)]
Use a DenseMap for looking up functions by UID in CompileUnit::FindFunctionByUID

Summary:
Instead of iterating over our vector of functions, we might as well use a map here to
directly get the function we need.

Thanks to Vedant for pointing this out.

Reviewers: vsk

Reviewed By: vsk

Subscribers: mgrang, lldb-commits

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

llvm-svn: 339504

6 years agoAdd missing _LIBCXXABI_FUNC_VIS to __gxx_personality_seh0
Martin Storsjo [Sat, 11 Aug 2018 19:36:06 +0000 (19:36 +0000)]
Add missing _LIBCXXABI_FUNC_VIS to __gxx_personality_seh0

This was missed in SVN r337754.

llvm-svn: 339503

6 years ago[Dominators] Remove the DeferredDominance class
Chijun Sima [Sat, 11 Aug 2018 08:12:07 +0000 (08:12 +0000)]
[Dominators] Remove the DeferredDominance class

Summary: After converting all existing passes to use the new DomTreeUpdater interface, there isn't any usage of the original DeferredDominance class. Thus, we can safely remove it from the codebase.

Reviewers: kuhar, brzycki, dmgreen, davide, grosser

Reviewed By: kuhar, brzycki

Subscribers: mgorny, llvm-commits

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

llvm-svn: 339502

6 years ago[UnJ] Improve explicit loop count checks
David Green [Sat, 11 Aug 2018 07:37:31 +0000 (07:37 +0000)]
[UnJ] Improve explicit loop count checks

Try to improve the computed counts when it has been explicitly set by a pragma
or command line option. This moves the code around, so that first call to
computeUnrollCount to get a sensible count and override that if explicit unroll
and jam counts are specified.

Also added some extra debug messages for when unroll and jamming is disabled.

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

llvm-svn: 339501

6 years ago[UnJ] Create a hasInvariantIterationCount function. NFC
David Green [Sat, 11 Aug 2018 06:57:28 +0000 (06:57 +0000)]
[UnJ] Create a hasInvariantIterationCount function. NFC

Pulled out a separate function for some code that calculates
if an inner loop iteration count is invariant to it's outer
loop.

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

llvm-svn: 339500

6 years ago[X86] Remove the AL/AX/EAX/RAX short immediate forms from the macro fusion shouldSche...
Craig Topper [Sat, 11 Aug 2018 06:42:51 +0000 (06:42 +0000)]
[X86] Remove the AL/AX/EAX/RAX short immediate forms from the macro fusion shouldScheduleAdjacent. NFC

These instructions are only created by the backend during MCInst lowering.

llvm-svn: 339499

6 years ago[X86] Add the mem-reg form of CMP to the macro fusion shouldScheduleAdjacent.
Craig Topper [Sat, 11 Aug 2018 06:42:50 +0000 (06:42 +0000)]
[X86] Add the mem-reg form of CMP to the macro fusion shouldScheduleAdjacent.

Unlike the other arithmetic instructions the mem-reg form of compare is just a load and not a RMW operation. According to the Intel optimization manual, this form is also supported by macro fusion.

llvm-svn: 339498

6 years ago[X86] Remove ADD8mi and ADDmr from the macro fusion shouldScheduleAdjacent.
Craig Topper [Sat, 11 Aug 2018 06:42:49 +0000 (06:42 +0000)]
[X86] Remove ADD8mi and ADDmr from the macro fusion shouldScheduleAdjacent.

The are RMW of memory operations. They aren't eligible for macro fusion.

llvm-svn: 339497

6 years ago[X86] Change the MOV32ri64 pseudo instruction to def a GR64 directly instead of wrapp...
Craig Topper [Sat, 11 Aug 2018 05:33:00 +0000 (05:33 +0000)]
[X86] Change the MOV32ri64 pseudo instruction to def a GR64 directly instead of wrapping it in a SUBREG_TO_REG.

Now we switch to the subregister in expandPostRAPseudos where we already switched the opcode.

This simplifies a few isel patterns that used the pseudo directly. And magically seems to have improved our ability to CSE it in the undef-label.ll test.

llvm-svn: 339496

6 years agoFix WebAssembly instruction printer after r339474
Richard Trieu [Sat, 11 Aug 2018 04:18:05 +0000 (04:18 +0000)]
Fix WebAssembly instruction printer after r339474

Treat the stack variants of control instructions the same as regular
instructions.  Otherwise, the vector ControlFlowStack will be the wrong
size and have out-of-bounds access.  This was detected by MemorySanitizer.

llvm-svn: 339495

6 years agoMake the section boundary checks on Windows not depend on the order as they are emitt...
Douglas Yung [Sat, 11 Aug 2018 02:46:47 +0000 (02:46 +0000)]
Make the section boundary checks on Windows not depend on the order as they are emitted in reverse when the compiler is built by Visual C++.

llvm-svn: 339494

6 years ago[analyzer] Fix keyboard navigation for .msgNote events
George Karpenkov [Sat, 11 Aug 2018 01:47:41 +0000 (01:47 +0000)]
[analyzer] Fix keyboard navigation for .msgNote events

Does not go to msgNote's.

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

llvm-svn: 339493

6 years ago[gold] Fix Tests cases on i686
Tom Stellard [Sat, 11 Aug 2018 01:08:34 +0000 (01:08 +0000)]
[gold] Fix Tests cases on i686

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: llvm-commits

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

llvm-svn: 339492

6 years agoAMDGPU/GlobalISel: Define instruction mapping for G_INSERT
Tom Stellard [Sat, 11 Aug 2018 00:51:54 +0000 (00:51 +0000)]
AMDGPU/GlobalISel: Define instruction mapping for G_INSERT

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits

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

llvm-svn: 339491

6 years agoFix WebAssembly tests after r339474
Richard Trieu [Fri, 10 Aug 2018 23:58:11 +0000 (23:58 +0000)]
Fix WebAssembly tests after r339474

Add flags to llc RUN lines to keep tests passing.

llvm-svn: 339490

6 years ago[analyzer] InnerPointerChecker: improve warning messages and notes.
Reka Kovacs [Fri, 10 Aug 2018 23:56:57 +0000 (23:56 +0000)]
[analyzer] InnerPointerChecker: improve warning messages and notes.

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

llvm-svn: 339489