platform/upstream/llvm.git
4 years agoDo not call replaceAllUsesWith to upgrade calls to ARC runtime functions
Akira Hatanaka [Mon, 12 Aug 2019 23:53:23 +0000 (23:53 +0000)]
Do not call replaceAllUsesWith to upgrade calls to ARC runtime functions
to intrinsic calls

This fixes a bug in r368311.

It turns out that the ARC runtime functions in the IR can have pointer
parameter types that are not i8* or i8**. Instead of RAUWing normal
functions with intrinsics, manually bitcast the arguments before passing
them to the intrinsic functions and bitcast the return value back to the
type of the original call instruction.

rdar://problem/54125406

llvm-svn: 368634

4 years ago[AMDGPU] removed unused functions from printf lowering
Stanislav Mekhanoshin [Mon, 12 Aug 2019 23:32:35 +0000 (23:32 +0000)]
[AMDGPU] removed unused functions from printf lowering

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

llvm-svn: 368633

4 years ago[clang] Update isDerivedFrom to support Objective-C classes 🔍
Stephane Moore [Mon, 12 Aug 2019 23:23:35 +0000 (23:23 +0000)]
[clang] Update isDerivedFrom to support Objective-C classes 🔍

Summary:
This change updates `isDerivedFrom` to support Objective-C classes by
converting it to a polymorphic matcher.

Notes:
The matching behavior for Objective-C classes is modeled to match the
behavior of `isDerivedFrom` with C++ classes. To that effect,
`isDerivedFrom` matches aliased types of derived Objective-C classes,
including compatibility aliases. To achieve this, the AST visitor has
been updated to map compatibility aliases to their underlying
Objective-C class.

`isSameOrDerivedFrom` also provides similar behaviors for C++ and
Objective-C classes. The behavior that
`cxxRecordDecl(isSameOrDerivedFrom("X"))` does not match
`class Y {}; typedef Y X;` is mirrored for Objective-C in that
`objcInterfaceDecl(isSameOrDerivedFrom("X"))` does not match either
`@interface Y @end typedef Y X;` or
`@interface Y @end @compatibility_alias X Y;`.

Test Notes:
Ran clang unit tests.

Reviewers: aaron.ballman, jordan_rose, rjmccall, klimek, alexfh, gribozavr

Reviewed By: aaron.ballman, gribozavr

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 368632

4 years ago[WinEH] Fix catch block parent frame pointer offset
Reid Kleckner [Mon, 12 Aug 2019 23:02:00 +0000 (23:02 +0000)]
[WinEH] Fix catch block parent frame pointer offset

r367088 made it so that funclets store XMM registers into their local
frame instead of storing them to the parent frame. However, that change
forgot to update the parent frame pointer offset for catch blocks. This
change does that.

Fixes crashes when an exception is rethrown in a catch block that saves
XMMs, as described in https://crbug.com/992860.

llvm-svn: 368631

4 years ago[TextAPI] Fix & Add tests for tbd files version 3.
Juergen Ributzka [Mon, 12 Aug 2019 23:01:07 +0000 (23:01 +0000)]
[TextAPI] Fix & Add tests for tbd files version 3.

- There was a simple typo in TextStub code that prevented version 3 files to be read.
- Included a version 3 unit test to handle the differences in the format.
- Also a typo in Error.h inside the comments.

https://reviews.llvm.org/D66041

This patch is from Cyndy Ishida <cyndy_ishida@apple.com>.

llvm-svn: 368630

4 years ago[risc-v] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM
Daniel Sanders [Mon, 12 Aug 2019 22:41:02 +0000 (22:41 +0000)]
[risc-v] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM

Summary:
This clang-tidy check is looking for unsigned integer variables whose initializer
starts with an implicit cast from llvm::Register and changes the type of the
variable to llvm::Register (dropping the llvm:: where possible).

Depends on D65919

Reviewers: lenary

Subscribers: jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, llvm-commits

Tags: #llvm

Differential Revision for full review was: https://reviews.llvm.org/D65962

llvm-svn: 368629

4 years ago[aarch64] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM
Daniel Sanders [Mon, 12 Aug 2019 22:40:53 +0000 (22:40 +0000)]
[aarch64] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM

Summary:
This clang-tidy check is looking for unsigned integer variables whose initializer
starts with an implicit cast from llvm::Register and changes the type of the
variable to llvm::Register (dropping the llvm:: where possible).

Manual fixups in:
AArch64InstrInfo.cpp - genFusedMultiply() now takes a Register* instead of unsigned*
AArch64LoadStoreOptimizer.cpp - Ternary operator was ambiguous between Register/MCRegister. Settled on Register

Depends on D65919

Reviewers: aemerson

Subscribers: jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, llvm-commits

Tags: #llvm

Differential Revision for full review was: https://reviews.llvm.org/D65962

llvm-svn: 368628

4 years ago[webassembly] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM
Daniel Sanders [Mon, 12 Aug 2019 22:40:45 +0000 (22:40 +0000)]
[webassembly] Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM

Summary:
This clang-tidy check is looking for unsigned integer variables whose initializer
starts with an implicit cast from llvm::Register and changes the type of the
variable to llvm::Register (dropping the llvm:: where possible).

Reviewers: aheejin

Subscribers: jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, llvm-commits

Tags: #llvm

Differential Revision for whole review: https://reviews.llvm.org/D65962

llvm-svn: 368627

4 years ago[AMDGPU] Use PredicateControl in MIMGBaseOpcode. NFC.
Stanislav Mekhanoshin [Mon, 12 Aug 2019 22:32:21 +0000 (22:32 +0000)]
[AMDGPU] Use PredicateControl in MIMGBaseOpcode. NFC.

This is infrastructural, will be needed for future work.
For some reason it was only used in MIMG_NoSampler, while
needed everywere we use MIMGBaseOpcode if we want to use
predicates.

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

llvm-svn: 368626

4 years ago[Attributor] Use the cached data layout directly
Johannes Doerfert [Mon, 12 Aug 2019 22:21:09 +0000 (22:21 +0000)]
[Attributor] Use the cached data layout directly

This removes the warning by using the new DL member.
It also simplifies the code.

llvm-svn: 368625

4 years agoTitle: Fix build warning for operator<< when using GCC 7.
Whitney Tsang [Mon, 12 Aug 2019 22:20:54 +0000 (22:20 +0000)]
Title: Fix build warning for operator<< when using GCC 7.
Authored By: etiotto
Differential Revision: https://reviews.llvm.org/D63459

llvm-svn: 368624

4 years ago[X86] Allow combineTruncateWithSat to use pack instructions for i16->i8 without AVX512BW.
Craig Topper [Mon, 12 Aug 2019 22:18:23 +0000 (22:18 +0000)]
[X86] Allow combineTruncateWithSat to use pack instructions for i16->i8 without AVX512BW.

We need AVX512BW to be able to truncate an i16 vector. If we don't
have that we have to extend i16->i32, then trunc, i32->i8. But we
won't be able to remove the min/max if we do that. At least not
without more special handling.

llvm-svn: 368623

4 years ago[Attributor][NFC] Add IntegerState raw_ostream << operator
Johannes Doerfert [Mon, 12 Aug 2019 22:07:34 +0000 (22:07 +0000)]
[Attributor][NFC] Add IntegerState raw_ostream << operator

llvm-svn: 368622

4 years ago[Attributor] Make the InformationCache an Attributor member
Johannes Doerfert [Mon, 12 Aug 2019 22:05:53 +0000 (22:05 +0000)]
[Attributor] Make the InformationCache an Attributor member

The functionality is not changed but the interfaces are simplified and
repetition is removed.

llvm-svn: 368621

4 years ago[CompilerType] Pass an ExecutionContextScope to GetTypeBitAlign.
Davide Italiano [Mon, 12 Aug 2019 21:49:54 +0000 (21:49 +0000)]
[CompilerType] Pass an ExecutionContextScope to GetTypeBitAlign.

llvm-svn: 368620

4 years ago[GWP-ASan] Update backtrace function signature.
Mitch Phillips [Mon, 12 Aug 2019 21:36:44 +0000 (21:36 +0000)]
[GWP-ASan] Update backtrace function signature.

Summary:
Updates the function signature and comments for backtracing (and printing
backtraces). This update brings GWP-ASan in line with future requirements for
stack frame compression, wherein the length of the trace is provided
explicitly, rather than relying on nullptr-termination.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: #sanitizers, llvm-commits, morehouse

Tags: #sanitizers, #llvm

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

llvm-svn: 368619

4 years ago[GISel]: Fix a bug in KnownBits where we should have been using SizeInBits
Aditya Nandakumar [Mon, 12 Aug 2019 21:28:12 +0000 (21:28 +0000)]
[GISel]: Fix a bug in KnownBits where we should have been using SizeInBits

https://reviews.llvm.org/D66039

We were using getIndexSize instead of getIndexSizeInBits().
Added test case for G_PTRTOINT and G_INTTOPTR.

llvm-svn: 368618

4 years ago[libFuzzer] Merge: print feature coverage number as well.
Max Moroz [Mon, 12 Aug 2019 20:21:27 +0000 (20:21 +0000)]
[libFuzzer] Merge: print feature coverage number as well.

Summary:
feature coverage is a useful signal that is available during the merge
process, but was not printed previously.

Output example:

```
$ ./fuzzer -use_value_profile=1 -merge=1 new_corpus/ seed_corpus/
INFO: Seed: 1676551929
INFO: Loaded 1 modules   (2380 inline 8-bit counters): 2380 [0x90d180, 0x90dacc),
INFO: Loaded 1 PC tables (2380 PCs): 2380 [0x684018,0x68d4d8),
MERGE-OUTER: 180 files, 78 in the initial corpus
MERGE-OUTER: attempt 1
INFO: Seed: 1676574577
INFO: Loaded 1 modules   (2380 inline 8-bit counters): 2380 [0x90d180, 0x90dacc),
INFO: Loaded 1 PC tables (2380 PCs): 2380 [0x684018,0x68d4d8),
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 1048576 bytes
MERGE-INNER: using the control file '/tmp/libFuzzerTemp.111754.txt'
MERGE-INNER: 180 total files; 0 processed earlier; will process 180 files now
#1 pulse  cov: 134 ft: 330 exec/s: 0 rss: 37Mb
#2 pulse  cov: 142 ft: 462 exec/s: 0 rss: 38Mb
#4 pulse  cov: 152 ft: 651 exec/s: 0 rss: 38Mb
#8 pulse  cov: 152 ft: 943 exec/s: 0 rss: 38Mb
#16 pulse  cov: 520 ft: 2783 exec/s: 0 rss: 39Mb
#32 pulse  cov: 552 ft: 3280 exec/s: 0 rss: 41Mb
#64 pulse  cov: 576 ft: 3641 exec/s: 0 rss: 50Mb
#78 LOADED cov: 602 ft: 3936 exec/s: 0 rss: 88Mb
#128 pulse  cov: 611 ft: 3996 exec/s: 0 rss: 93Mb
#180 DONE   cov: 611 ft: 4016 exec/s: 0 rss: 155Mb
MERGE-OUTER: succesfull in 1 attempt(s)
MERGE-OUTER: the control file has 39741 bytes
MERGE-OUTER: consumed 0Mb (37Mb rss) to parse the control file
MERGE-OUTER: 9 new files with 80 new features added; 9 new coverage edges
```

Reviewers: hctim, morehouse

Reviewed By: morehouse

Subscribers: delcypher, #sanitizers, llvm-commits, kcc

Tags: #llvm, #sanitizers

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

llvm-svn: 368617

4 years agoRevert "[lldb] Refactor guard variable checks in IRForTarget"
Stella Stamenova [Mon, 12 Aug 2019 20:08:07 +0000 (20:08 +0000)]
Revert "[lldb] Refactor guard variable checks in IRForTarget"

This reverts commit 94fbbf712e906464f5f3abbeabcfcbc05d5352ec.

llvm-svn: 368616

4 years agoRevert "[lldb] Fix dynamic_cast by no longer failing on variable without metadata"
Stella Stamenova [Mon, 12 Aug 2019 20:08:05 +0000 (20:08 +0000)]
Revert "[lldb] Fix dynamic_cast by no longer failing on variable without metadata"

This reverts commit b448d1bf212219febbb182d00c210bad1bd25e7f.

llvm-svn: 368615

4 years ago[Symbol] GetTypeBitAlign() should return None in case of failure.
Davide Italiano [Mon, 12 Aug 2019 20:03:19 +0000 (20:03 +0000)]
[Symbol] GetTypeBitAlign() should return None in case of failure.

Summary:
And not `zero`. This is the last API needed to be converted to
an Optional<T>.

Reviewers: xiaobai, compnerd

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 368614

4 years agoFix Wnewline-eof after r368598
Nico Weber [Mon, 12 Aug 2019 19:57:17 +0000 (19:57 +0000)]
Fix Wnewline-eof after r368598

llvm-svn: 368613

4 years agoRevert "Disable MachO TBD write tests for Windows."
Juergen Ributzka [Mon, 12 Aug 2019 19:51:34 +0000 (19:51 +0000)]
Revert "Disable MachO TBD write tests for Windows."

The underlying issue was fixed in r357759.

llvm-svn: 368611

4 years ago[Sema] Check __builtin_bit_cast operand for completeness before materializing it.
Erik Pilkington [Mon, 12 Aug 2019 19:29:43 +0000 (19:29 +0000)]
[Sema] Check __builtin_bit_cast operand for completeness before materializing it.

This shouldn't be observable, but it doesn't make sense to materialize an
incomplete type.

llvm-svn: 368610

4 years ago[X86] Remove unreachable code from LowerTRUNCATE. NFC
Craig Topper [Mon, 12 Aug 2019 19:26:45 +0000 (19:26 +0000)]
[X86] Remove unreachable code from LowerTRUNCATE. NFC

All three 256->128 bit cases were already handled above.

Noticed while looking at the coverage report.

llvm-svn: 368609

4 years ago[X86] Add a paranoia type check to the code that detects AVG patterns from truncating...
Craig Topper [Mon, 12 Aug 2019 19:26:37 +0000 (19:26 +0000)]
[X86] Add a paranoia type check to the code that detects AVG patterns from truncating stores.

If we're after type legalize, we should make sure we won't create
a store with an illegal type when we separate the AVG pattern
from the truncating store.

I don't know of a way to fail for this today. Just noticed while
I was in the vicinity.

llvm-svn: 368608

4 years ago[X86] Simplify creation of saturating truncating stores.
Craig Topper [Mon, 12 Aug 2019 19:26:30 +0000 (19:26 +0000)]
[X86] Simplify creation of saturating truncating stores.

We just need to check if the truncating store is legal
instead of going through isSATValidOnAVX512Subtarget.

llvm-svn: 368607

4 years ago[X86] Replace call to isTruncStoreLegalOrCustom with isTruncStoreLegal. NFC
Craig Topper [Mon, 12 Aug 2019 19:26:22 +0000 (19:26 +0000)]
[X86] Replace call to isTruncStoreLegalOrCustom with isTruncStoreLegal. NFC

We have no custom trunc stores on X86.

llvm-svn: 368606

4 years ago small follow-up to r368604
Nico Weber [Mon, 12 Aug 2019 19:19:29 +0000 (19:19 +0000)]
 small follow-up to r368604

llvm-svn: 368605

4 years agolibcxxabi: Rename .hpp files to .h
Nico Weber [Mon, 12 Aug 2019 19:11:23 +0000 (19:11 +0000)]
libcxxabi: Rename .hpp files to .h

LLVM uses .h as its extension for header files.

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

llvm-svn: 368604

4 years ago[asan_symbolize] Fix bug where the frame counter was not incremented.
Dan Liew [Mon, 12 Aug 2019 18:51:25 +0000 (18:51 +0000)]
[asan_symbolize] Fix bug where the frame counter was not incremented.

Summary:
This bug occurred when a plug-in requested that a binary not be
symbolized while the script is trying to symbolize a stack frame. In
this case `self.frame_no` would not be incremented. This would cause
subsequent stack frames that are symbolized to be incorrectly numbered.

To fix this `get_symbolized_lines()` has been modified to take an
argument that indicates whether the stack frame counter should
incremented. In `process_line_posix()` `get_symbolized_lines(None, ...)`
is now used in in the case where we don't want to symbolize a line so
that we can keep the frame counter increment in a single function.

A test case is included. The test uses a dummy plugin that always asks
`asan_symbolize.py` script to not symbolize the first binary that the
script asks about. Prior to the patch this would cause the output to
script to look something like

```
  #0 0x0
  #0 0x0 in do_access
  #1 0x0 in main
```

This is the second attempt at landing this patch. The first (r368373)
failed due to failing some android bots and so was reverted in r368472.
The new test is now disabled for Android. It turns out that the patch
also fails for iOS too so it is also disabled for that family of
platforms too.

rdar://problem/49476995

Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka

Subscribers: #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 368603

4 years ago[clang-doc] Generate HTML links for children namespaces/records
Diego Astiazaran [Mon, 12 Aug 2019 18:42:46 +0000 (18:42 +0000)]
[clang-doc] Generate HTML links for children namespaces/records

Path is now stored in the references to the child while serializing,
then this path is used to generate the relative path in the HTML
generator.
Now some references have paths and some don't so in the reducing phase,
references are now properly merged checking for empty attributes.
Tests added for HTML and YAML generators, merging and serializing.
computeRelativePath function had a bug when the filepath is part of the
given directory; it returned a path that starts with a separator. This
has been fixed.

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

llvm-svn: 368602

4 years agogn build: Merge r368592
Nico Weber [Mon, 12 Aug 2019 18:33:10 +0000 (18:33 +0000)]
gn build: Merge r368592

llvm-svn: 368601

4 years ago[Sema] Require a complete type for __builtin_bit_cast operands
Erik Pilkington [Mon, 12 Aug 2019 18:31:27 +0000 (18:31 +0000)]
[Sema] Require a complete type for __builtin_bit_cast operands

Fixes llvm.org/PR42936

llvm-svn: 368600

4 years ago[libc++] Implement CTAD for std::tuple
Louis Dionne [Mon, 12 Aug 2019 18:30:31 +0000 (18:30 +0000)]
[libc++] Implement CTAD for std::tuple

Summary:
We were using implicit deduction guides instead of explicit ones,
however the implicit ones don't do work anymore when changing the
constructors.

This commit adds the actual guides specified in the Standard to make
libc++ (1) closer to the Standard and (2) more resistent to changes
in std::tuple's constructors.

Reviewers: Quuxplusone

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

llvm-svn: 368599

4 years ago[builtins] MSVC warning disable for clean build
Matthew G McGovern [Mon, 12 Aug 2019 18:08:44 +0000 (18:08 +0000)]
[builtins] MSVC warning disable for clean build
    - https://reviews.llvm.org/D66023
    - amended for ifdef/if gcc errors in previous verison

llvm-svn: 368598

4 years ago[NFC][PowerPC] Add the test case shrink-wrap.mir and shrink-wrap.ll for PPC
Kang Zhang [Mon, 12 Aug 2019 17:50:01 +0000 (17:50 +0000)]
[NFC][PowerPC] Add the test case shrink-wrap.mir and shrink-wrap.ll for PPC

llvm-svn: 368597

4 years ago[ThinLTO][AutoFDO] Fix memory corruption due to race condition from thin backends
Wenlei He [Mon, 12 Aug 2019 17:45:14 +0000 (17:45 +0000)]
[ThinLTO][AutoFDO] Fix memory corruption due to race condition from thin backends

Summary:
This commit fixed a race condition from multi-threaded thinLTO backends that causes non-deterministic memory corruption for a data structure used only by AutoFDO with compact binary profile.
GUIDToFuncNameMap, a static data member of type DenseMap in FunctionSamples is used as a per-module mapping from function name MD5 to name string when input AutoFDO profile is in compact binary format. However with ThinLTO, we can have parallel backends modifying and accessing the class static map concurrently. The fix is to make GUIDToFuncNameMap a member of SampleProfileLoader instead of a file static data.

Reviewers: wmi, davidxl, danielcdh

Subscribers: mehdi_amini, inglorion, hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 368596

4 years ago[CostModel][X86][AArch64] Check all 3 cost kinds in aggregates.ll
Roman Lebedev [Mon, 12 Aug 2019 17:45:12 +0000 (17:45 +0000)]
[CostModel][X86][AArch64] Check all 3 cost kinds in aggregates.ll

llvm-svn: 368595

4 years ago[X86] Disable use of zmm registers for varargs musttail calls under prefer-vector...
Craig Topper [Mon, 12 Aug 2019 17:43:26 +0000 (17:43 +0000)]
[X86] Disable use of zmm registers for varargs musttail calls under prefer-vector-width=256 and min-legal-vector-width=256.

Under this config, the v16f32 type we try to use isn't to a register
class so the getRegClassFor call will fail.

llvm-svn: 368594

4 years ago[ARM] sext of a load is free
David Green [Mon, 12 Aug 2019 17:39:56 +0000 (17:39 +0000)]
[ARM] sext of a load is free

This teaches the cost model that the sext or zext of a load is going to be
free.

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

llvm-svn: 368593

4 years ago[AMDGPU] Printf runtime binding pass
Stanislav Mekhanoshin [Mon, 12 Aug 2019 17:12:29 +0000 (17:12 +0000)]
[AMDGPU] Printf runtime binding pass

This pass is a port of the according pass from the HSAIL compiler.
It parses printf calls and setup runtime printf buffer.
After that it copies printf arguments to the buffer and fills in
module metadata for runtime.

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

llvm-svn: 368592

4 years ago[ASTDump] Add is_anonymous to VisitCXXRecordDecl
Shafik Yaghmour [Mon, 12 Aug 2019 17:07:49 +0000 (17:07 +0000)]
[ASTDump] Add is_anonymous to VisitCXXRecordDecl

Summary:
Adding is_anonymous the ASTDump for CXXRecordDecl. This turned out to be useful when debugging some problems with how LLDB creates ASTs from DWARF.

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

llvm-svn: 368591

4 years ago[clangd] Refactor computation of extracted expr in ExtractVariable tweak. NFC
Sam McCall [Mon, 12 Aug 2019 17:05:35 +0000 (17:05 +0000)]
[clangd] Refactor computation of extracted expr in ExtractVariable tweak. NFC

Summary:
This takes this logic out of the Tweak class, and simplifies the signature of
the function where the main logic is.

The goal is to make it easier to turn into a loop like:

  for (current = N; current and current->parent are both expr; current = current->parent)
    if (suitable(current))
      return current;
  return null;

Reviewers: SureYeaah

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

Tags: #clang

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

llvm-svn: 368590

4 years ago[ARM] MVE shuffle broadcast costs
David Green [Mon, 12 Aug 2019 16:54:07 +0000 (16:54 +0000)]
[ARM] MVE shuffle broadcast costs

A VDUP will perform a vector broadcast in a single instruction. Update the cost
model for MVE accordingly.

Code originally by David Sherwood.

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

llvm-svn: 368589

4 years agoFix multiple lifetime warning messages for range based for loop
Gabor Horvath [Mon, 12 Aug 2019 16:19:39 +0000 (16:19 +0000)]
Fix multiple lifetime warning messages for range based for loop

llvm-svn: 368588

4 years ago[ARM] Put some of the TTI costmodel behind hasNeon calls.
David Green [Mon, 12 Aug 2019 15:59:52 +0000 (15:59 +0000)]
[ARM] Put some of the TTI costmodel behind hasNeon calls.

This puts some of the calls in ARMTargetTransformInfo.cpp behind hasNeon()
checks, now that we have MVE, and updates all the tests accordingly.

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

llvm-svn: 368587

4 years ago[ARM] Add or update a number of costmodel tests. NFC
David Green [Mon, 12 Aug 2019 15:40:27 +0000 (15:40 +0000)]
[ARM] Add or update a number of costmodel tests. NFC

This adds a number of cost model tests for ARM, useful for MVE. It also re-jigs
some of the existing tests to make them easier to update and read.

llvm-svn: 368586

4 years ago[scudo][standalone] Minor corrections
Kostya Kortchinsky [Mon, 12 Aug 2019 15:35:09 +0000 (15:35 +0000)]
[scudo][standalone] Minor corrections

Summary:
Few corrections with no functional change:
- replacing `%zd` with `%zu` all around: the values are unsigned
- prefer `MAP_ANONYMOUS` to `MAP_ANON` (it's deprecated)
- remove the unused `enum LinkerInitialized`
- mark a parameter as `UNUSED` in Fuchsia's `getRandom`
- correct the casing of a variable and use `nullptr` instead of 0 for
  pointers in `list.h`
- reorder some `typedef` to be consistent between `signed` and
  `unsigned`

Reviewers: eugenis, vitalybuka, morehouse, hctim

Reviewed By: vitalybuka, morehouse

Subscribers: delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 368585

4 years ago[XCOFF] Use a single symbolic constant for the size of an embeded name. [NFC]
Sean Fertile [Mon, 12 Aug 2019 15:27:40 +0000 (15:27 +0000)]
[XCOFF] Use a single symbolic constant for the size of an embeded name. [NFC]

Convert SymbolNameSize and SectionNameSize into just `NameSize`. The length of
a name embeded in a symbol table entry or section header table entry is length 8
for Sections, Symbols and Files. No need to have a distinct constant for each
one. Also removes the Size argument to 'generateStringRef' as the size is
always 'XCOFF::NameSize'.

llvm-svn: 368584

4 years ago[InstCombine] add tests for scalar-select-of-vectors; NFC
Sanjay Patel [Mon, 12 Aug 2019 15:21:11 +0000 (15:21 +0000)]
[InstCombine] add tests for scalar-select-of-vectors; NFC

llvm-svn: 368583

4 years ago[lldb][NFC] Minor fixes for lldb_private::DiagnosticManager
Raphael Isemann [Mon, 12 Aug 2019 14:37:12 +0000 (14:37 +0000)]
[lldb][NFC] Minor fixes for lldb_private::DiagnosticManager

llvm-svn: 368582

4 years ago[clangd] Separate chunks with a space when rendering markdown
Ilya Biryukov [Mon, 12 Aug 2019 14:35:30 +0000 (14:35 +0000)]
[clangd] Separate chunks with a space when rendering markdown

Summary:
This results in better rendering of resulting markdown.

Especially noticeable in coc.nvim that does not have a visible horizontal
spaces around inline code blocks. More details and a screenshot from
coc.nvim can be found in https://github.com/clangd/clangd/issues/95.

Reviewers: sammccall

Reviewed By: sammccall

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

Tags: #clang

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

llvm-svn: 368581

4 years agoRemove outdated comment about clang not populating src2dst_offset
Benjamin Kramer [Mon, 12 Aug 2019 14:33:46 +0000 (14:33 +0000)]
Remove outdated comment about clang not populating src2dst_offset

Clang has been setting this since r174293 (of 2013 vintage).

llvm-svn: 368580

4 years agoRevert r368339 "[MBP] Disable aggressive loop rotate in plain mode"
Hans Wennborg [Mon, 12 Aug 2019 14:23:13 +0000 (14:23 +0000)]
Revert r368339 "[MBP] Disable aggressive loop rotate in plain mode"

It caused assertions to fire when building Chromium:

  lib/CodeGen/LiveDebugValues.cpp:331: bool
  {anonymous}::LiveDebugValues::OpenRangesSet::empty() const: Assertion
  `Vars.empty() == VarLocs.empty() && "open ranges are inconsistent"' failed.

See https://crbug.com/992871#c3 for how to reproduce.

> Patch https://reviews.llvm.org/D43256 introduced more aggressive loop layout optimization which depends on profile information. If profile information is not available, the statically estimated profile information(generated by BranchProbabilityInfo.cpp) is used. If user program doesn't behave as BranchProbabilityInfo.cpp expected, the layout may be worse.
>
> To be conservative this patch restores the original layout algorithm in plain mode. But user can still try the aggressive layout optimization with -force-precise-rotation-cost=true.
>
> Differential Revision: https://reviews.llvm.org/D65673

llvm-svn: 368579

4 years ago[llvm-ar][NFC] Fix buildbot
Jordan Rupprecht [Mon, 12 Aug 2019 14:21:51 +0000 (14:21 +0000)]
[llvm-ar][NFC] Fix buildbot

llvm-svn: 368578

4 years ago[lldb] Remove undocumented return value from DiagnosticManager::PutString
Raphael Isemann [Mon, 12 Aug 2019 14:11:37 +0000 (14:11 +0000)]
[lldb] Remove undocumented return value from DiagnosticManager::PutString

The returned value is currently unused. It also seems to imply that
it somehow represents 'printf-style' the number of characters/bytes
written to some output stream (which is incorrect, as we only know
the actual size of the written message when we have rendered it,
e.g. via GetString and DiagnosticManagers have no associated
output stream).

llvm-svn: 368577

4 years ago[llvm-readobj] Downgrade 'PT_DYNAMIC segment offset + size exceeds the size of the...
Jordan Rupprecht [Mon, 12 Aug 2019 14:05:37 +0000 (14:05 +0000)]
[llvm-readobj] Downgrade 'PT_DYNAMIC segment offset + size exceeds the size of the file' from an error to a warning

Summary: This allows llvm-readobj to print other useful information for truncated files instead of giving up.

Reviewers: jhenderson, grimar, MaskRay

Reviewed By: jhenderson, grimar, MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 368576

4 years ago[X86][SSE] Add test showing missing demanded elts PSADBW handling
Simon Pilgrim [Mon, 12 Aug 2019 14:01:16 +0000 (14:01 +0000)]
[X86][SSE] Add test showing missing demanded elts PSADBW handling

llvm-svn: 368575

4 years agoRevert r368565: [CodeGen] Do the Simple Early Return in block-placement pass to optim...
Kang Zhang [Mon, 12 Aug 2019 14:00:31 +0000 (14:00 +0000)]
Revert r368565: [CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks

llvm-svn: 368574

4 years ago[llvm-ar] Accept file paths with windows format slashes
Owen Reynolds [Mon, 12 Aug 2019 14:00:28 +0000 (14:00 +0000)]
[llvm-ar] Accept file paths with windows format slashes

The internal representation of llvm-ar archives uses linux style slashes
for paths, no matter the OS. In the case of windows this meant file
paths input intending to match existing members would only match if
linux style slashes where used. This change allows either slash
direction to be input by the user.

This change includes removing an unnecessary call to normalisePath and
moving the call of another.

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

llvm-svn: 368573

4 years ago[RISCV] Fix ICE in isDesirableToCommuteWithShift
Sam Elliott [Mon, 12 Aug 2019 13:51:00 +0000 (13:51 +0000)]
[RISCV] Fix ICE in isDesirableToCommuteWithShift

Summary:
Ana Pazos reported a bug where we were not checking that an APInt would
fit into 64-bits before calling `getSExtValue()`. This caused asserts when
compiling large constants, such as i128s, as happens when compiling compiler-rt.

This patch adds a testcase and makes the callback less error-prone.

Reviewers: apazos, asb, luismarques

Reviewed By: luismarques

Subscribers: hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, llvm-commits

Tags: #llvm

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

llvm-svn: 368572

4 years ago[InstCombine] x /c fabs(x) -> copysign(1.0, x)
David Bolvansky [Mon, 12 Aug 2019 13:43:35 +0000 (13:43 +0000)]
[InstCombine] x /c fabs(x) -> copysign(1.0, x)

Summary:
x / fabs(x) -> copysign(1.0, x)
fabs(x) / x -> copysign(1.0, x)

Reviewers: spatel, foad, RKSimon, efriedma

Reviewed By: spatel

Subscribers: lebedev.ri, llvm-commits

Tags: #llvm

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

llvm-svn: 368570

4 years ago[clangd] Added the vscode SemanticHighlighting feature code but did not enable it...
Johan Vikstrom [Mon, 12 Aug 2019 13:33:43 +0000 (13:33 +0000)]
[clangd] Added the vscode SemanticHighlighting feature code but did not enable it in the client.

Summary: Added the code for the StaticFeature that must be registered to the client. Also decoding the notification data into objects. Did not register it to the client yet.

Reviewers: hokein, ilya-biryukov

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

Tags: #clang

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

llvm-svn: 368568

4 years ago[lldb][NFC] Add unit test for lldb_private::DiagnosticManager
Raphael Isemann [Mon, 12 Aug 2019 13:31:45 +0000 (13:31 +0000)]
[lldb][NFC] Add unit test for lldb_private::DiagnosticManager

llvm-svn: 368567

4 years ago[DebugInfo] Remove call sites when eliminating unreachable blocks
David Stenberg [Mon, 12 Aug 2019 13:22:29 +0000 (13:22 +0000)]
[DebugInfo] Remove call sites when eliminating unreachable blocks

Summary:
When eliminating an unreachable block we must remove any call site
information for calls residing in the block.

This was originally found on a downstream target, and the attached x86
test case was produced by hand-modifying some MIR.

Reviewers: aprantl, asowda, NikolaPrica, djtodoro, ivanbaev, vsk

Reviewed By: NikolaPrica, vsk

Subscribers: vsk, hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

llvm-svn: 368566

4 years ago[CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks
Kang Zhang [Mon, 12 Aug 2019 13:15:31 +0000 (13:15 +0000)]
[CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks

Summary:

In `block-placement` pass, it will create some patterns for unconditional we can do the simple early retrun.
But the `early-ret` pass is before `block-placement`, we don't want to run it again.
This patch is to do the simple early return to optimize the blocks at the last of `block-placement`.

Reviewed By: efriedma

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

llvm-svn: 368565

4 years ago[llvm-ar][test] Correct tests marked as expected fails
Owen Reynolds [Mon, 12 Aug 2019 13:04:02 +0000 (13:04 +0000)]
[llvm-ar][test] Correct tests marked as expected fails

In diff D64802 I marked three tests as expected failures for darwin but
James Nagurne saw these fail on his downstream embedded ARM cross
compiler.
I believe XFAIL: system-darwin should be used instead of using XFAIL:
darwin due to the problem being related to the darwin host and not the
target.

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

llvm-svn: 368564

4 years ago[clangd] Remove highlightings coming from non topLevelDecls from included files.
Johan Vikstrom [Mon, 12 Aug 2019 13:01:11 +0000 (13:01 +0000)]
[clangd] Remove highlightings coming from non topLevelDecls from included files.

Summary: It is possible to write include code from other files so that the decls from there do not become topLevelDecls (For example by including methods for a class). These Decls are not filtered by topLevelDecls and therefore SemanticHighlighting must manually check that every SLoc belongs in the main file. Otherwise there can be highlightings appearing in places where they should not.

Reviewers: hokein, ilya-biryukov

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

Tags: #clang

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

llvm-svn: 368563

4 years ago[CrossTU] User docs: remove temporary limiation with macro expansion
Gabor Marton [Mon, 12 Aug 2019 12:46:28 +0000 (12:46 +0000)]
[CrossTU] User docs: remove temporary limiation with macro expansion

D65064, D64635, D64638 pathces solve the issue with macor expansion.

llvm-svn: 368562

4 years ago[OpenCL] Ignore parentheses for sampler initialization
Sven van Haastregt [Mon, 12 Aug 2019 12:44:26 +0000 (12:44 +0000)]
[OpenCL] Ignore parentheses for sampler initialization

The sampler handling logic in SemaInit.cpp would inadvertently treat
parentheses around sampler arguments as an implicit cast, leading to
an unreachable "can't implicitly cast lvalue to rvalue with
this cast kind".  Fix by ignoring parentheses once we are in the
sampler initializer case.

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

llvm-svn: 368561

4 years agoRevert r368509 "[CodeGen] Do the Simple Early Return in block-placement pass to optim...
Hans Wennborg [Mon, 12 Aug 2019 12:43:51 +0000 (12:43 +0000)]
Revert r368509 "[CodeGen] Do the Simple Early Return in block-placement pass to optimize the blocks"

> In `block-placement` pass, it will create some patterns for unconditional we can do the simple early retrun.
> But the `early-ret` pass is before `block-placement`, we don't want to run it again.
> This patch is to do the simple early return to optimize the blocks at the last of `block-placement`.
>
> Reviewed By: efriedma
>
> Differential Revision: https://reviews.llvm.org/D63972

This also revertes follow-ups r368514 and r368532.

llvm-svn: 368560

4 years agoCleanup unused variable.
Andrey Churbanov [Mon, 12 Aug 2019 12:37:30 +0000 (12:37 +0000)]
Cleanup unused variable.

This patch fixes problem raised in post-review comments of the
https://reviews.llvm.org/D65285. Developers of ittnotify confirmed
that dll_path_ptr field of the __itt_global structure is never used
by ittnotify library, so it is safe to remove the dll_path array.

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

llvm-svn: 368559

4 years ago[X86][SSE] ComputeKnownBits - add basic PSADBW handling
Simon Pilgrim [Mon, 12 Aug 2019 12:19:19 +0000 (12:19 +0000)]
[X86][SSE] ComputeKnownBits - add basic PSADBW handling

llvm-svn: 368558

4 years ago[X86][SSE] Add test showing missing compute known bits PSADBW handling
Simon Pilgrim [Mon, 12 Aug 2019 12:13:08 +0000 (12:13 +0000)]
[X86][SSE] Add test showing missing compute known bits PSADBW handling

The upper 48-bits of each i64 element is guaranteed to be zero.

llvm-svn: 368557

4 years agoNFC. Remove trailing whitespace in test
James Henderson [Mon, 12 Aug 2019 11:39:54 +0000 (11:39 +0000)]
NFC. Remove trailing whitespace in test

llvm-svn: 368556

4 years ago[llvm-strings] Improve testing of llvm-strings
James Henderson [Mon, 12 Aug 2019 11:36:11 +0000 (11:36 +0000)]
[llvm-strings] Improve testing of llvm-strings

This patch tidies up the llvm-strings testing by:

1. Adding comments to every test.
2. Getting rid of canned input files, and having the tests generate
   them on the fly (this makes the tests self-contained).
3. Adding missing test coverage.
4. Renaming some tests that weren't clear as to their purpose.
5. Adding extra checking of various cases, formatting etc.
6. Removing a test that didn't seem to have any useful purpose for
   testing llvm-strings.

Reviewed by: rupprecht, grimar, MaskRay

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

llvm-svn: 368555

4 years ago[InstCombine] foldShiftIntoShiftInAnotherHandOfAndInICmp(): avoid constantexpr pitfai...
Roman Lebedev [Mon, 12 Aug 2019 11:28:02 +0000 (11:28 +0000)]
[InstCombine] foldShiftIntoShiftInAnotherHandOfAndInICmp(): avoid constantexpr pitfail (PR42962)

Instead of matching value and then blindly casting to BinaryOperator
just to get the opcode, just match instruction and do no cast.

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

llvm-svn: 368554

4 years ago[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for...
Simon Pilgrim [Mon, 12 Aug 2019 10:56:05 +0000 (10:56 +0000)]
[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for ISD::TRUNCATE

llvm-svn: 368553

4 years ago[OpenCL] Fix lang mode predefined macros for C++ mode.
Anastasia Stulova [Mon, 12 Aug 2019 10:44:07 +0000 (10:44 +0000)]
[OpenCL] Fix lang mode predefined macros for C++ mode.

In C++ mode we should only avoid adding __OPENCL_C_VERSION__,
all other predefined macros about the language mode are still
valid.

This change also fixes the language version check in the
headers accordingly.

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

llvm-svn: 368552

4 years ago[ASTImporter] Fix for import of friend class template with definition.
Balazs Keri [Mon, 12 Aug 2019 10:07:38 +0000 (10:07 +0000)]
[ASTImporter] Fix for import of friend class template with definition.

Summary:
If there is a friend class template "prototype" (forward declaration)
and later a definition for it in the existing code, this existing
definition may be not found by ASTImporter because it is not linked
to the prototype (under the friend AST node). The problem is fixed by
looping over all found matching decls instead of break after the first
found one.

Reviewers: martong, a.sidorin, shafik, a_sidorin

Reviewed By: a_sidorin

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

Tags: #clang

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

llvm-svn: 368551

4 years ago[ELF] Remove unnecessary assignment to `isPreemptible` in replaceWithDefined()
Fangrui Song [Mon, 12 Aug 2019 10:01:17 +0000 (10:01 +0000)]
[ELF] Remove unnecessary assignment to `isPreemptible` in replaceWithDefined()

After r368535, it is no longer used in the handling of VER_NDX_LOCAL.
Drop it.

llvm-svn: 368550

4 years ago[clangd] Drop diags from non-written #include.
Haojian Wu [Mon, 12 Aug 2019 09:35:04 +0000 (09:35 +0000)]
[clangd] Drop diags from non-written #include.

Summary: This would fix that we show weird diagnostics on random lines of the main file.

Reviewers: ilya-biryukov

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

Tags: #clang

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

llvm-svn: 368549

4 years ago[CostModel][X86][AArch64] Add some tests for extractvalue
Roman Lebedev [Mon, 12 Aug 2019 09:24:33 +0000 (09:24 +0000)]
[CostModel][X86][AArch64] Add some tests for extractvalue

In https://reviews.llvm.org/D65148 it is suggested that
it should have zero cost, always.

llvm-svn: 368548

4 years agoImprove codegen for deque.
Eric Fiselier [Mon, 12 Aug 2019 07:51:05 +0000 (07:51 +0000)]
Improve codegen for deque.

This patch rewrites a few loops in deque and split_buffer to better
optimize the codegen. For constructors like
`deque<unsigned char> d(500000, 0);` this patch results in a 2x speedup.

The patch improves the codegen  in roughly three ways:

1. Changes do { ... } while (...) loops into more typical for loops.
  The optimizer can reason about normal looking loops better.

2. Split the iteration over a range into (A) iteration over the blocks,
then (B) iteration within the block. This nested structure helps LLVM
lower the inner loop to `memset`.

3. Do fewer things each iteration. Some of these loops were incrementing
  or changing 4-5 variables every loop (in addition to the
  construction). Previously most loops would increment the end pointer,
  the size, and decrement the count of remaining items to construct.
  Now we only increment a single pointer for most iterations.

llvm-svn: 368547

4 years ago[clangd] Highlighting auto variables as the deduced type.
Johan Vikstrom [Mon, 12 Aug 2019 07:45:12 +0000 (07:45 +0000)]
[clangd] Highlighting auto variables as the deduced type.

Summary:
Done in VisitDeclaratorDecl as the AutoTypeLoc is not deduced.
Scoped to only work for variables.
auto function return values need to be handled in a special way (separate patch for that).
auto's that are in lambdas ar enot highlighted as we don't highlight their underlying type (it's a RecordDecl, but the name is not an identifier so it returns in addToken).

Reviewers: hokein, ilya-biryukov

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

Tags: #clang

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

llvm-svn: 368546

4 years ago[CrossTU] Fix problem with CrossTU AST load limit and progress messages.
Balazs Keri [Mon, 12 Aug 2019 07:15:29 +0000 (07:15 +0000)]
[CrossTU] Fix problem with CrossTU AST load limit and progress messages.

Summary:
Number of loaded ASTs is to be incremented only if the AST was really loaded
but not if it was returned from cache. At the same place the message about
a loaded AST is displayed.

Reviewers: martong, gamesh411

Reviewed By: martong

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

Tags: #clang

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

llvm-svn: 368545

4 years ago[X86] Add some reduction add test cases that show sub-optimal code on avx2 and later.
Craig Topper [Mon, 12 Aug 2019 06:55:58 +0000 (06:55 +0000)]
[X86] Add some reduction add test cases that show sub-optimal code on avx2 and later.

For v4i8 and v8i8 when the reduction starts with a load we end up
shifting the data in the scalar domain and copying to the vector
domain a second time using a broadcast.

We already copied it to the vector domain once. It's better to
just shuffle it there.

llvm-svn: 368544

4 years ago[X86] Support -march=tigerlake
Pengfei Wang [Mon, 12 Aug 2019 01:29:46 +0000 (01:29 +0000)]
[X86] Support -march=tigerlake

Support -march=tigerlake for x86.
Compare with Icelake Client, It include 4 more new features ,they are
avx512vp2intersect, movdiri, movdir64b, shstk.

Patch by Xiang Zhang (xiangzhangllvm)

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

llvm-svn: 368543

4 years agoFix pass dependency for LICM
Wenlei He [Sun, 11 Aug 2019 22:54:05 +0000 (22:54 +0000)]
Fix pass dependency for LICM

Expected to address buildbot failure http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/16285 caused by D65060.

llvm-svn: 368542

4 years ago[X86] Remove redundant ';' chars ending IR lines in lit tests. NFC
Bjorn Pettersson [Sun, 11 Aug 2019 19:27:14 +0000 (19:27 +0000)]
[X86] Remove redundant ';' chars ending IR lines in lit tests. NFC

Reviewers: RKSimon, craig.topper

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 368541

4 years ago[SelectionDAG] Widen vector results of SMULFIX/UMULFIX/SMULFIXSAT
Bjorn Pettersson [Sun, 11 Aug 2019 19:27:06 +0000 (19:27 +0000)]
[SelectionDAG] Widen vector results of SMULFIX/UMULFIX/SMULFIXSAT

Summary:
After the commits that changed x86 backend to widen vectors
instead of using promotion some of our downstream tests
started to fail. It was noticed that WidenVectorResult has
been missing support for SMULFIX/UMULFIX/SMULFIXSAT. This
patch adds the missing functionality.

Reviewers: craig.topper, RKSimon

Reviewed By: craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 368540

4 years ago[clang-format] Expand AllowShortBlocksOnASingleLine for WebKit
Owen Pan [Sun, 11 Aug 2019 17:48:36 +0000 (17:48 +0000)]
[clang-format] Expand AllowShortBlocksOnASingleLine for WebKit

See PR40840

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

llvm-svn: 368539

4 years ago[X86] Simplify some of the type checks in combineSubToSubus.
Craig Topper [Sun, 11 Aug 2019 17:36:49 +0000 (17:36 +0000)]
[X86] Simplify some of the type checks in combineSubToSubus.

If we have SSE2 we can handle any i8/i16 type and let
type legalization deal with it.

llvm-svn: 368538

4 years ago[X86] Don't use SplitOpsAndApply for ISD::USUBSAT.
Craig Topper [Sun, 11 Aug 2019 17:36:45 +0000 (17:36 +0000)]
[X86] Don't use SplitOpsAndApply for ISD::USUBSAT.

Target independent type legalization and custom lowering
should be able to handle it.

llvm-svn: 368537

4 years ago[ELF] Remove redundant isDefined() in Symbol::computeBinding() and delete one redunda...
Fangrui Song [Sun, 11 Aug 2019 17:03:00 +0000 (17:03 +0000)]
[ELF] Remove redundant isDefined() in Symbol::computeBinding() and delete one redundant call site

After r367869, VER_NDX_LOCAL can only be assigned to Defined and
CommonSymbol.  CommonSymbol becomes Defined after replaceCommonSymbols(),
thus `versionId == VER_NDX_LOCAL` will imply `isDefined()`.

In maybeReportUndefined(), computeBinding() is called when the symbol is
unknown to be Undefined. computeBinding() != STB_LOCAL will always be
true.

llvm-svn: 368536

4 years ago[ELF] Remove redundant !isPreemptible in Symbol::computeBinding()
Fangrui Song [Sun, 11 Aug 2019 16:12:07 +0000 (16:12 +0000)]
[ELF] Remove redundant !isPreemptible in Symbol::computeBinding()

!isPreemptible was added in r343668 to fix PR39104: symbols redefined by
replaceWithDefined() might be incorrectly considered STB_LOCAL if a
version script specified `local: *;`.

After r367869 (`config->defaultSymbolVersion` was removed), we will
assign VER_NDX_LOCAL to only regular Defined and CommonSymbol, not
Defined created by replaceWithDefined() (because scanVersionScript() is
called before scanRelocations()). The !isPreemptible is thus redundant
and can be deleted.

llvm-svn: 368535

4 years agoProperly detect temporary gsl::Owners through reference initialization chains.
Gabor Horvath [Sun, 11 Aug 2019 14:39:42 +0000 (14:39 +0000)]
Properly detect temporary gsl::Owners through reference initialization chains.

llvm-svn: 368534

4 years ago[ELF] Remove unnecessary assignment to `used` in replaceWithDefined
Fangrui Song [Sun, 11 Aug 2019 13:32:46 +0000 (13:32 +0000)]
[ELF] Remove unnecessary assignment to `used` in replaceWithDefined

`Symbol::used` is used by Undefined and SharedSymbol to record if a
.symtab entry is needed. It is of no use for Defined.

llvm-svn: 368533

4 years ago[NFC][CodeGen] Use while loop instead for loop in MachineBlockPlacement::optimizeBran...
Kang Zhang [Sun, 11 Aug 2019 12:58:50 +0000 (12:58 +0000)]
[NFC][CodeGen] Use while loop instead for loop in MachineBlockPlacement::optimizeBranches()
This will pass EXPENSIVE check.

llvm-svn: 368532