platform/upstream/llvm.git
5 years agoReapply [Tooling] Make clang-tool find libc++ dir on mac when running on a file witho...
Sam McCall [Wed, 16 Jan 2019 09:41:26 +0000 (09:41 +0000)]
Reapply [Tooling] Make clang-tool find libc++ dir on mac when running on a file without compilation database.

This reverts commit r351282, and re-lands r351222 and r351229 with the
use-after-free fixed.

llvm-svn: 351316

5 years agoFix compiler error in r351311
Joachim Protze [Wed, 16 Jan 2019 09:39:42 +0000 (09:39 +0000)]
Fix compiler error in r351311

llvm-svn: 351315

5 years ago[NewPM][TSan] Reiterate the TSan port
Philip Pfaffe [Wed, 16 Jan 2019 09:28:01 +0000 (09:28 +0000)]
[NewPM][TSan] Reiterate the TSan port

Summary:
Second iteration of D56433 which got reverted in rL350719. The problem
in the previous version was that we dropped the thunk calling the tsan init
function. The new version keeps the thunk which should appease dyld, but is not
actually OK wrt. the current semantics of function passes. Hence, add a
helper to insert the functions only on the first time. The helper
allows hooking into the insertion to be able to append them to the
global ctors list.

Reviewers: chandlerc, vitalybuka, fedor.sergeev, leonardchan

Subscribers: hiraditya, bollu, llvm-commits

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

llvm-svn: 351314

5 years ago[lldb] - Fix crash when listing the history with the key up.
George Rimar [Wed, 16 Jan 2019 09:27:04 +0000 (09:27 +0000)]
[lldb] - Fix crash when listing the history with the key up.

This is https://bugs.llvm.org/show_bug.cgi?id=40112,

Currently, lldb crashes after pressing the up arrow key when listing the history for expressions.

The patch fixes the mistype that was a reason.

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

llvm-svn: 351313

5 years agoUsersManual.rst: Update the clang-cl flags section
Hans Wennborg [Wed, 16 Jan 2019 09:13:47 +0000 (09:13 +0000)]
UsersManual.rst: Update the clang-cl flags section

llvm-svn: 351312

5 years ago[OMPT] Make sure that OMPT is enabled when accessing internals of the runtime
Joachim Protze [Wed, 16 Jan 2019 08:58:17 +0000 (08:58 +0000)]
[OMPT] Make sure that OMPT is enabled when accessing internals of the runtime

Make sure that OMPT is enabled in runtime entry points that access internals
of the runtime. Else, return an appropiate value indicating an error or that
the data is not available.

Patch provided by @sconvent

Reviewers: jlpeyton, omalyshe, hbae, Hahnfeld, joachim.protze

Reviewed By: joachim.protze

Tags: #openmp, #ompt

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

llvm-svn: 351311

5 years ago[DAGCombine] Fix ReduceLoadWidth for shifted offsets
Sam Parker [Wed, 16 Jan 2019 08:40:12 +0000 (08:40 +0000)]
[DAGCombine] Fix ReduceLoadWidth for shifted offsets

ReduceLoadWidth can trigger using a shifted mask is used and this
requires that the function return a shl node to correct for the
offset. However, the way that this was implemented meant that the
returned result could be an existing node, which would be incorrect.
This fixes the method of inserting the new node and replacing uses.

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

llvm-svn: 351310

5 years agoInclude lldb in Win snapshots again (PR37307)
Hans Wennborg [Wed, 16 Jan 2019 08:38:28 +0000 (08:38 +0000)]
Include lldb in Win snapshots again (PR37307)

llvm-svn: 351309

5 years ago[clang-tidy] bugprone-string-constructor: Catch string from nullptr.
Clement Courbet [Wed, 16 Jan 2019 08:36:23 +0000 (08:36 +0000)]
[clang-tidy] bugprone-string-constructor: Catch string from nullptr.

Summary: Context: https://twitter.com/willkirkby/status/1084219580799741953

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 351308

5 years ago[clang-tidy] Avoid fuchsia-overloaded-operator false positive with lambdas after...
Sam McCall [Wed, 16 Jan 2019 08:29:54 +0000 (08:29 +0000)]
[clang-tidy] Avoid fuchsia-overloaded-operator false positive with lambdas after r351047

llvm-svn: 351307

5 years ago[clangd] Fix XPC after rCTE351280
Fangrui Song [Wed, 16 Jan 2019 08:13:15 +0000 (08:13 +0000)]
[clangd] Fix XPC after rCTE351280

llvm-svn: 351306

5 years ago[llvm-rc] Support '--' for delimiting options from input paths
Martin Storsjo [Wed, 16 Jan 2019 08:09:22 +0000 (08:09 +0000)]
[llvm-rc] Support '--' for delimiting options from input paths

This allows avoiding conflicts between paths that begin with the same
chars as some llvm-rc options (which can be used with either slashes
or dashes).

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

llvm-svn: 351305

5 years ago[test] Disable Python binding tests w/ LLVM_ENABLE_PIC=OFF
Michal Gorny [Wed, 16 Jan 2019 08:05:13 +0000 (08:05 +0000)]
[test] Disable Python binding tests w/ LLVM_ENABLE_PIC=OFF

Disable Python binding tests when LLVM_ENABLE_PIC is disabled,
as libclang.so is not being built in that case.  Reported by Nico Weber.

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

llvm-svn: 351304

5 years ago[clang-tidy] Treat references to smart pointers correctly in use-after-move.
Martin Bohme [Wed, 16 Jan 2019 07:53:25 +0000 (07:53 +0000)]
[clang-tidy] Treat references to smart pointers correctly in use-after-move.

Summary:
Previously, we weren't recognizing these as smart pointers and thus
weren't allowing non-dereference accesses as we should -- see new test
cases which fail without the fix.

Reviewers: alexfh, hokein, aaron.ballman, JonasToth

Reviewed By: JonasToth

Subscribers: xazax.hun, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 351303

5 years ago[SEH] Pass the frame pointer from SEH finally to finally functions
Sanjin Sijaric [Wed, 16 Jan 2019 07:39:44 +0000 (07:39 +0000)]
[SEH] Pass the frame pointer from SEH finally to finally functions

Pass the frame pointer that the first finally block receives onto the nested
finally block, instead of generating it using localaddr.

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

llvm-svn: 351302

5 years ago[X86] Correct the type string for __builtin_ia32_gathersiv16sf to make the indices...
Craig Topper [Wed, 16 Jan 2019 07:17:14 +0000 (07:17 +0000)]
[X86] Correct the type string for __builtin_ia32_gathersiv16sf to make the indices an integer type not an FP type.

The element count and width remain the same. This went unnoticed because default conversion from builtin to intrinsic will generate a bitcast if the types don't match.

llvm-svn: 351301

5 years ago[llvm-symbolizer] Add -C as a short alias to -demangle
Dmitry Venikov [Wed, 16 Jan 2019 07:05:58 +0000 (07:05 +0000)]
[llvm-symbolizer] Add -C as a short alias to -demangle

Summary: Provides -C as alias to -demangle. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40069.

Reviewers: jhenderson, ruiu, rnk, fjricci

Reviewed By: jhenderson, ruiu

Subscribers: rupprecht, erik.pilkington, llvm-commits

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

llvm-svn: 351300

5 years agocorrect script name in generated tests
Eric Fiselier [Wed, 16 Jan 2019 05:43:02 +0000 (05:43 +0000)]
correct script name in generated tests

llvm-svn: 351299

5 years ago[WebAssembly] COWS has been renamed to WASI.
Dan Gohman [Wed, 16 Jan 2019 05:23:57 +0000 (05:23 +0000)]
[WebAssembly] COWS has been renamed to WASI.

llvm-svn: 351298

5 years ago[WebAssembly] COWS has been renamed to WASI.
Dan Gohman [Wed, 16 Jan 2019 05:23:52 +0000 (05:23 +0000)]
[WebAssembly] COWS has been renamed to WASI.

llvm-svn: 351297

5 years agoOnly promote args when function attributes are compatible
Tom Stellard [Wed, 16 Jan 2019 05:15:31 +0000 (05:15 +0000)]
Only promote args when function attributes are compatible

Summary:
Check to make sure that the caller and the callee have compatible
function arguments before promoting arguments.  This uses the same
TargetTransformInfo queries that are used to determine if attributes
are compatible for inlining.

The goal here is to avoid breaking ABI when a called function's ABI
depends on a target feature that is not enabled in the caller.

This is a very conservative fix for PR37358.  Ideally we would have a more
sophisticated check for ABI compatiblity rather than checking if the
attributes are compatible for inlining.

Reviewers: echristo, chandlerc, eli.friedman, craig.topper

Reviewed By: echristo, chandlerc

Subscribers: nikic, xbolva00, rkruppe, alexcrichton, llvm-commits

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

llvm-svn: 351296

5 years ago[InstCombine]Avoid introduction of unaligned mem access
Serguei Katkov [Wed, 16 Jan 2019 04:36:26 +0000 (04:36 +0000)]
[InstCombine]Avoid introduction of unaligned mem access

InstCombine is able to transform mem transfer instrinsic to alone store or store/load pair.
It might result in generation of unaligned atomic load/store which later in backend
will be transformed to libcall. It is not an evident gain and it is better to keep intrinsic as is
and handle it at backend.

Reviewers: reames, anna, apilipenko, mkazantsev
Reviewed By: reames
Subscribers: t.p.northover, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D56582

llvm-svn: 351295

5 years ago[SemaCXX] Unconfuse Clang when std::align_val_t is unscoped in C++03
Eric Fiselier [Wed, 16 Jan 2019 02:34:36 +0000 (02:34 +0000)]
[SemaCXX] Unconfuse Clang when std::align_val_t is unscoped in C++03

When -faligned-allocation is specified in C++03 libc++ defines
std::align_val_t as an unscoped enumeration type (because Clang didn't
provide scoped enumerations as an extension until 8.0).
Unfortunately Clang confuses the `align_val_t` overloads of delete with
the sized deallocation overloads which aren't enabled. This caused Clang
to call the aligned deallocation function as if it were the sized
deallocation overload.

For example: https://godbolt.org/z/xXJELh

This patch fixes the confusion.

llvm-svn: 351294

5 years agogn build: Merge r351283.
Peter Collingbourne [Wed, 16 Jan 2019 02:27:12 +0000 (02:27 +0000)]
gn build: Merge r351283.

llvm-svn: 351293

5 years agoAttempt to make test_macros.h even more minimal
Eric Fiselier [Wed, 16 Jan 2019 02:16:57 +0000 (02:16 +0000)]
Attempt to make test_macros.h even more minimal

llvm-svn: 351292

5 years agoFix feature test macros for atomics/mutexes without threading
Eric Fiselier [Wed, 16 Jan 2019 02:10:28 +0000 (02:10 +0000)]
Fix feature test macros for atomics/mutexes without threading

llvm-svn: 351291

5 years agoFix PR40230 - std::pair may have padding on FreeBSD.
Eric Fiselier [Wed, 16 Jan 2019 01:54:34 +0000 (01:54 +0000)]
Fix PR40230 - std::pair may have padding on FreeBSD.

Summary:
FreeBSD ships a very old and deprecated ABI for std::pair where the copy and move constructors are not allowed to be trivial. D25389 change how this was implemented by introducing a non-trivial base class. This patch, introduced in October 2016, introduced an ABI bug that caused nested `std::pair` instantiations to have padding. For example:

```
using PairT = std::pair< std::pair<char, char>, char >;
static_assert(offsetof(PairT, first) == 0, "First member should exist at offset zero"); // Fails on FreeBSD!
```

The bug occurs because the base class for the first element (the nested pair) cannot be put at offset zero because the top-level pair already has the same base class laid out there.

This patch fixes that ABI bug by templating the dummy base class on the same parameters as the pair.

Technically this fix is an ABI break for users who depend on the "broken" ABI introduced in 2016. I'm putting this up for review so that the FreeBSD maintainers can sign off on fixing the ABI by breaking the ABI.
Another option, since we have to "break" the ABI to fix it, would be to move FreeBSD off the deprecated non-trivial pair ABI instead.

Also see:

* https://llvm.org/PR40230
* https://reviews.llvm.org/D21329

Reviewers: rsmith, dim, emaste

Reviewed By: rsmith

Subscribers: mclow.lists, krytarowski, christof, ldionne, libcxx-commits

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

llvm-svn: 351290

5 years agoMove internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`.
Eric Fiselier [Wed, 16 Jan 2019 01:51:12 +0000 (01:51 +0000)]
Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`.

Summary:
Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See  llvm.org/PR39713

This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used.

This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement.

I think we should commit this change immediately, and decide what we want to do about the ABI afterwards.

Reviewers: ldionne, EricWF

Reviewed By: ldionne, EricWF

Subscribers: jyknight, christof, libcxx-commits

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

llvm-svn: 351289

5 years ago[TSan] Use switches when dealing with enums
Julian Lettner [Wed, 16 Jan 2019 01:45:12 +0000 (01:45 +0000)]
[TSan] Use switches when dealing with enums

Summary:
Small refactoring: replace some if-else cascades with switches so that the compiler warns us about missing cases.
Maybe found a small bug?

Reviewers: dcoughlin, kubamracek, dvyukov, delcypher, jfb

Reviewed By: dvyukov

Subscribers: llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 351288

5 years ago[WebAssembly] Store section alignment as a power of 2
Sam Clegg [Wed, 16 Jan 2019 01:43:21 +0000 (01:43 +0000)]
[WebAssembly] Store section alignment as a power of 2

This change bumps for version number of the wasm object file
metadata.

See https://github.com/WebAssembly/tool-conventions/pull/92

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

llvm-svn: 351287

5 years agoImplement feature test macros using a script.
Eric Fiselier [Wed, 16 Jan 2019 01:37:43 +0000 (01:37 +0000)]
Implement feature test macros using a script.

Summary:
This patch implements all the feature test macros libc++ currently supports, as specified by the standard or cppreference prior to C++2a.

The tests and `<version>` header are generated using a script. The script contains a table of each feature test macro, the headers it should be accessible from, and its values of each dialect of C++.
When a new feature test macro is added or needed, the table should be updated and the script re-run.

Reviewers: mclow.lists, jfb, serge-sans-paille

Reviewed By: mclow.lists

Subscribers: arphaman, jfb, ldionne, libcxx-commits

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

llvm-svn: 351286

5 years ago[WebAssembly] Store section alignment as a power of 2
Sam Clegg [Wed, 16 Jan 2019 01:34:48 +0000 (01:34 +0000)]
[WebAssembly] Store section alignment as a power of 2

This change bumps for version number of the wasm object file
metadata.

See https://github.com/WebAssembly/tool-conventions/pull/92

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

llvm-svn: 351285

5 years ago[EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp
Eli Friedman [Wed, 16 Jan 2019 00:50:44 +0000 (00:50 +0000)]
[EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp

This is the clang counterpart to D56747.

Patch by Mandeep Singh Grang.

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

llvm-svn: 351284

5 years ago[GISel]: Add support for CSEing continuously during GISel passes.
Aditya Nandakumar [Wed, 16 Jan 2019 00:40:37 +0000 (00:40 +0000)]
[GISel]: Add support for CSEing continuously during GISel passes.

https://reviews.llvm.org/D52803

This patch adds support to continuously CSE instructions during
each of the GISel passes. It consists of a GISelCSEInfo analysis pass
that can be used by the CSEMIRBuilder.

llvm-svn: 351283

5 years agoRevert "[Tooling] Make clang-tool find libc++ dir on mac when running on a file witho...
Vlad Tsyrklevich [Wed, 16 Jan 2019 00:37:39 +0000 (00:37 +0000)]
Revert "[Tooling] Make clang-tool find libc++ dir on mac when running on a file without compilation database."

This reverts commits r351222 and r351229, they were causing ASan/MSan failures
on the sanitizer bots.

llvm-svn: 351282

5 years ago[EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp
Mandeep Singh Grang [Wed, 16 Jan 2019 00:37:13 +0000 (00:37 +0000)]
[EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp

Summary:
Make recoverfp intrinsic target-independent so that it can be implemented for AArch64, etc.
Refer D53541 for the context. Clang counterpart D56748.

Reviewers: rnk, efriedma

Reviewed By: rnk, efriedma

Subscribers: javed.absar, kristof.beyls, llvm-commits

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

llvm-svn: 351281

5 years ago[clangd] XPC transport layer
Jan Korous [Wed, 16 Jan 2019 00:24:22 +0000 (00:24 +0000)]
[clangd] XPC transport layer

- New transport layer for macOS.
- XPC Framework
- Test client

Framework and client were written by Alex Lorenz.

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

llvm-svn: 351280

5 years ago[LangRef] Fix typo adress->address. NFC
Craig Topper [Wed, 16 Jan 2019 00:21:59 +0000 (00:21 +0000)]
[LangRef] Fix typo adress->address. NFC

llvm-svn: 351279

5 years ago[X86] Rename SHRUNKBLEND ISD node to BLENDV.
Craig Topper [Wed, 16 Jan 2019 00:20:30 +0000 (00:20 +0000)]
[X86] Rename SHRUNKBLEND ISD node to BLENDV.

That's really what it is. If we didn't use intrinsics for BLENDVPS/BLENDVPD/PBLENDVB all the way to isel, this is the node we would use.

llvm-svn: 351278

5 years agogn build: Add check-hwasan target.
Peter Collingbourne [Wed, 16 Jan 2019 00:15:25 +0000 (00:15 +0000)]
gn build: Add check-hwasan target.

The Android sanitizer tests are currently some of the most difficult
to run correctly, requiring at least 3 build directories which have
to be configured in just the right way and built in the correct order
(see e.g. [1] and the functions that it calls).

This patch adds a check-hwasan target which greatly simplifies running
the hwasan tests for gn users, taking advantage of its support for
multiple toolchains. With this the tests can be run simply by setting
an NDK path and running "ninja check-hwasan" with a compatible Android
device connected. The Linux/x86_64 and Android/aarch64 targets are
tested in parallel.

[1] https://github.com/llvm/llvm-zorg/blob/master/zorg/buildbot/builders/sanitizers/buildbot_android.sh

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

llvm-svn: 351277

5 years ago[lldb-mi] Remove use of dialog box
Alex Langford [Wed, 16 Jan 2019 00:09:50 +0000 (00:09 +0000)]
[lldb-mi] Remove use of dialog box

Summary:
This really is only implemented on Windows, and it requires us to pull
in User32. This was only useful when debugging on lldb-mi on Windows, and there
doesn't seem to be a good reason why using a dialog box is better than what
exists for other platforms.

Reviewers: zturner, jingham, compnerd

Subscribers: ki.stfu

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

llvm-svn: 351276

5 years ago[X86] Add avx512 scatter intrinsics that use a vXi1 mask instead of a scalar integer.
Craig Topper [Tue, 15 Jan 2019 23:36:25 +0000 (23:36 +0000)]
[X86] Add avx512 scatter intrinsics that use a vXi1 mask instead of a scalar integer.

We're trying to have the vXi1 types in IR as much as possible. This prevents the need for bitcasts when the producer of the mask was already a vXi1 value like an icmp. The bitcasts can be subject to code motion and interfere with basic block at a time isel in bad ways.

llvm-svn: 351275

5 years agoRemove redundant check.
Adrian Prantl [Tue, 15 Jan 2019 23:33:26 +0000 (23:33 +0000)]
Remove redundant check.

llvm-svn: 351274

5 years agoAMDGPU: Raise the priority of MAD24 in instruction selection.
Changpeng Fang [Tue, 15 Jan 2019 23:12:36 +0000 (23:12 +0000)]
AMDGPU: Raise the priority of MAD24 in instruction selection.

Summary:
  We have seen performance regression when v_add3 is generated. The major reason is that the v_mad pattern
is broken when v_add3 is generated. We also see the register pressure increased. While we could not properly
estimate register pressure during instruction selection, we can give mad a higher priority.

In this work, we raise the priority for mad24 in selection and resolve the performance regression.

Reviewers:
  rampitec

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

llvm-svn: 351273

5 years agoRe-order type param children of ObjC nodes
Stephen Kelly [Tue, 15 Jan 2019 23:07:30 +0000 (23:07 +0000)]
Re-order type param children of ObjC nodes

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 351272

5 years agoNFC: Some cleanups that I missed in the previous commit
Stephen Kelly [Tue, 15 Jan 2019 23:05:11 +0000 (23:05 +0000)]
NFC: Some cleanups that I missed in the previous commit

llvm-svn: 351271

5 years agocompiler-rt/test: Bring back -pie on Android.
Peter Collingbourne [Tue, 15 Jan 2019 22:53:24 +0000 (22:53 +0000)]
compiler-rt/test: Bring back -pie on Android.

Looks like the sanitizer-x86_64-linux-android bot started failing
because -pie is still needed when targeting API levels < 16 (which
is the case by default for arm and i686).

llvm-svn: 351270

5 years agoRe-order overrides in FunctionDecl dump
Stephen Kelly [Tue, 15 Jan 2019 22:50:37 +0000 (22:50 +0000)]
Re-order overrides in FunctionDecl dump

Output all content which is local to the FunctionDecl before traversing
to child AST nodes.

This is necessary so that all of the part which is local to the
FunctionDecl can be split into a different method.

Reviewers: aaron.ballman

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

llvm-svn: 351269

5 years agoNFC: Replace iterator loop with cxx_range_for
Stephen Kelly [Tue, 15 Jan 2019 22:45:46 +0000 (22:45 +0000)]
NFC: Replace iterator loop with cxx_range_for

llvm-svn: 351268

5 years ago[VFS] Add getter for mapping entries.
Jonas Devlieghere [Tue, 15 Jan 2019 22:36:56 +0000 (22:36 +0000)]
[VFS] Add getter for mapping entries.

When generating a reproducer in LLDB we build up the mapping but don't
immediately copy over the files on the file system.

Rather than keeping a separate data structure with real and virtual
paths, we might as well reuse the entries already stored in the
YAMLVFSWriter to lazily copy over the files when needed.

llvm-svn: 351266

5 years ago[VFS] Move RedirectingFileSystem interface into header (NFC)
Jonas Devlieghere [Tue, 15 Jan 2019 22:36:41 +0000 (22:36 +0000)]
[VFS] Move RedirectingFileSystem interface into header (NFC)

This moves the RedirectingFileSystem into the header so it can be
extended. This is needed in LLDB we need a way to obtain the external
path to deal with FILE* and file descriptor APIs.

Discussion on the mailing list:
http://lists.llvm.org/pipermail/llvm-dev/2018-November/127755.html

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

llvm-svn: 351265

5 years agoSimplify code by using Optional::getValueOr()
Adrian Prantl [Tue, 15 Jan 2019 22:30:01 +0000 (22:30 +0000)]
Simplify code by using Optional::getValueOr()

llvm-svn: 351264

5 years ago[debugserver][CMake] Remove commented out line
Alex Langford [Tue, 15 Jan 2019 22:27:59 +0000 (22:27 +0000)]
[debugserver][CMake] Remove commented out line

This has been commented out since rL300111
(commit d742d081f3a1e7412cc609765139ba32d597ac15). Looks like it was
committed as a commented out line, so I'm removing it.

llvm-svn: 351263

5 years ago[libFuzzer] Remove unstable edge handling
Jonathan Metzman [Tue, 15 Jan 2019 22:12:51 +0000 (22:12 +0000)]
[libFuzzer] Remove unstable edge handling

Summary:
Remove code for handling unstable edges from libFuzzer since
it has not been found useful.

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

llvm-svn: 351262

5 years ago[clang-tidy] add options documentation to readability-identifier-naming checker
Paul Hoad [Tue, 15 Jan 2019 22:06:49 +0000 (22:06 +0000)]
[clang-tidy] add options documentation to readability-identifier-naming checker

Summary:
The documentation for this clang-checker did not explain what the options are. But this checkers only works with at least some options defined.

To discover the options, you have to read the source code. This shouldn't be necessary for users who just have access to the clang-tidy binary.

This revision, explains the options and gives an example.

Patch by MyDeveloperDay.

Reviewers: JonasToth, Eugene.Zelenko

Reviewed By: JonasToth

Subscribers: xazax.hun, Eugene.Zelenko

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

llvm-svn: 351261

5 years agocompiler-rt/test: Add a couple of convenience features for Android.
Peter Collingbourne [Tue, 15 Jan 2019 22:06:48 +0000 (22:06 +0000)]
compiler-rt/test: Add a couple of convenience features for Android.

Add a ANDROID_SERIAL_FOR_TESTING CMake variable. This lets you
run the tests with multiple devices attached without having to set
ANDROID_SERIAL.

Add a mechanism for pushing files to the device. Currently most
sanitizers require llvm-symbolizer and the sanitizer runtime to
be pushed to the device. This lets the sanitizer make this happen
automatically before running the tests by specifying the paths in
the lit.site.cfg file.

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

llvm-svn: 351260

5 years ago[libObject] Tweak expected error output from llvm-ar
Jordan Rupprecht [Tue, 15 Jan 2019 22:03:08 +0000 (22:03 +0000)]
[libObject] Tweak expected error output from llvm-ar

llvm-svn: 351259

5 years agogn build: Add a stage2 host toolchain and make the hwasan runtime buildable on x86_64...
Peter Collingbourne [Tue, 15 Jan 2019 22:02:12 +0000 (22:02 +0000)]
gn build: Add a stage2 host toolchain and make the hwasan runtime buildable on x86_64 Linux.

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

llvm-svn: 351258

5 years ago[profile] Sync up InstrProfData.inc with llvm copy /NFC
Rong Xu [Tue, 15 Jan 2019 21:59:17 +0000 (21:59 +0000)]
[profile] Sync up InstrProfData.inc with llvm copy /NFC

llvm-svn: 351257

5 years ago[llvm-ar] Resubmit recursive thin archive test with fix for full path names and bette...
Jordan Rupprecht [Tue, 15 Jan 2019 21:52:31 +0000 (21:52 +0000)]
[llvm-ar] Resubmit recursive thin archive test with fix for full path names and better error messages

llvm-svn: 351256

5 years agogn build: Add a resource_dir.gni file.
Peter Collingbourne [Tue, 15 Jan 2019 21:44:59 +0000 (21:44 +0000)]
gn build: Add a resource_dir.gni file.

The path to the resource directory will end up being used in several
more places once the support for running check-hwasan lands. This
moves the definition to a central location so that it can be used
from those places.

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

llvm-svn: 351255

5 years ago[X86] Add the GCCBuiltin name back to the deprecated avx512 gather intrinsics until...
Craig Topper [Tue, 15 Jan 2019 21:41:31 +0000 (21:41 +0000)]
[X86] Add the GCCBuiltin name back to the deprecated avx512 gather intrinsics until the clang side patch for the new versions is approved.

llvm-svn: 351254

5 years agoX86DAGToDAGISel::matchBitExtract() with truncation (PR36419)
Roman Lebedev [Tue, 15 Jan 2019 21:31:18 +0000 (21:31 +0000)]
X86DAGToDAGISel::matchBitExtract() with truncation (PR36419)

Summary:
Previously in D54095 i have added support for extraction of `lshr` from `X` if we are to produce `BEXTR`.
That was good, but the fix was partial, there was still [[ https://bugs.llvm.org/show_bug.cgi?id=36419 | PR36419 ]].

That pattern can also appear, roughly, when you have a large (64-bit) storage, and the consume bits from it.
It will not be unexpected if you will be doing further computations in 32-bit width.
And then the current code breaks, as the tests show.

The basic idea/pattern here is following:
1. We have `i64` input
2. We perform `i64` right-shift on it.
3. We `trunc`ate that shifted value
4. We do all further work (masking) in `i32`

Since we see `trunc`ation and not `lshr`, we give up, and stop trying to extract that right-shift.
BUT. The mask is `i32`, therefore we can extend both of the operands of the masking (`and`) to `i64`
and truncate the result after masking: https://rise4fun.com/Alive/K4B
```
Name: @bextr64_32_b1 -> @bextr64_32_b0
  %shiftedval = lshr i64 %val, %numskipbits
  %truncshiftedval = trunc i64 %shiftedval to i32
  %widenumlowbits1 = zext i8 %numlowbits to i32
  %notmask1 = shl nsw i32 -1, %widenumlowbits1
  %mask1 = xor i32 %notmask1, -1
  %res = and i32 %truncshiftedval, %mask1
=>
  %shiftedval = lshr i64 %val, %numskipbits
  %widenumlowbits = zext i8 %numlowbits to i64
  %notmask = shl nsw i64 -1, %widenumlowbits
  %mask = xor i64 %notmask, -1
  %wideres = and i64 %shiftedval, %mask
  %res = trunc i64 %wideres to i32
```

Thus, we are again able to extract that `lshr` into `BEXTR`'s control.

Now, the perf (via `llvm-exegesis`) of the snippet suggests that it is not a good idea:
```
$ cat /tmp/old.s
# bextr64_32_b1
# LLVM-EXEGESIS-LIVEIN RSI
# LLVM-EXEGESIS-LIVEIN EDX
# LLVM-EXEGESIS-LIVEIN RDI
movq %rsi, %rcx
shrq %cl, %rdi
shll $8, %edx
bextrl %edx, %edi, %eax
$ cat /tmp/old.s | ./bin/llvm-exegesis -mode=latency -snippets-file=-
Check generated assembly with: /usr/bin/objdump -d /tmp/snippet-1e0082.o
---
mode:            latency
key:
  instructions:
    - 'MOV64rr RCX RSI'
    - 'SHR64rCL RDI RDI'
    - 'SHL32ri EDX EDX i_0x8'
    - 'BEXTR32rr EAX EDI EDX'
  config:          ''
  register_initial_values: []
cpu_name:        bdver2
llvm_triple:     x86_64-unknown-linux-gnu
num_repetitions: 10000
measurements:
  - { key: latency, value: 0.6638, per_snippet_value: 2.6552 }
error:           ''
info:            ''
assembled_snippet: 4889F148D3EFC1E208C4E268F7C74889F148D3EFC1E208C4E268F7C74889F148D3EFC1E208C4E268F7C74889F148D3EFC1E208C4E268F7C7C3
...
$ cat /tmp/old.s | ./bin/llvm-exegesis -mode=uops -snippets-file=-
Check generated assembly with: /usr/bin/objdump -d /tmp/snippet-43e346.o
---
mode:            uops
key:
  instructions:
    - 'MOV64rr RCX RSI'
    - 'SHR64rCL RDI RDI'
    - 'SHL32ri EDX EDX i_0x8'
    - 'BEXTR32rr EAX EDI EDX'
  config:          ''
  register_initial_values: []
cpu_name:        bdver2
llvm_triple:     x86_64-unknown-linux-gnu
num_repetitions: 10000
measurements:
  - { key: PdFPU0, value: 0, per_snippet_value: 0 }
  - { key: PdFPU1, value: 0, per_snippet_value: 0 }
  - { key: PdFPU2, value: 0, per_snippet_value: 0 }
  - { key: PdFPU3, value: 0, per_snippet_value: 0 }
  - { key: NumMicroOps, value: 1.2571, per_snippet_value: 5.0284 }
error:           ''
info:            ''
assembled_snippet: 4889F148D3EFC1E208C4E268F7C74889F148D3EFC1E208C4E268F7C74889F148D3EFC1E208C4E268F7C74889F148D3EFC1E208C4E268F7C7C3
...
```
vs
```
$ cat /tmp/new.s
# bextr64_32_b1
# LLVM-EXEGESIS-LIVEIN RDX
# LLVM-EXEGESIS-LIVEIN SIL
# LLVM-EXEGESIS-LIVEIN RDI
shlq $8, %rdx
movzbl %sil, %eax
orq %rdx, %rax
bextrq %rax, %rdi, %rax
$ cat /tmp/new.s | ./bin/llvm-exegesis -mode=latency -snippets-file=-
Check generated assembly with: /usr/bin/objdump -d /tmp/snippet-8944f1.o
---
mode:            latency
key:
  instructions:
    - 'SHL64ri RDX RDX i_0x8'
    - 'MOVZX32rr8 EAX SIL'
    - 'OR64rr RAX RAX RDX'
    - 'BEXTR64rr RAX RDI RAX'
  config:          ''
  register_initial_values: []
cpu_name:        bdver2
llvm_triple:     x86_64-unknown-linux-gnu
num_repetitions: 10000
measurements:
  - { key: latency, value: 0.7454, per_snippet_value: 2.9816 }
error:           ''
info:            ''
assembled_snippet: 48C1E208400FB6C64809D0C4E2F8F7C748C1E208400FB6C64809D0C4E2F8F7C748C1E208400FB6C64809D0C4E2F8F7C748C1E208400FB6C64809D0C4E2F8F7C7C3
...
$ cat /tmp/new.s | ./bin/llvm-exegesis -mode=uops -snippets-file=-
Check generated assembly with: /usr/bin/objdump -d /tmp/snippet-da403c.o
---
mode:            uops
key:
  instructions:
    - 'SHL64ri RDX RDX i_0x8'
    - 'MOVZX32rr8 EAX SIL'
    - 'OR64rr RAX RAX RDX'
    - 'BEXTR64rr RAX RDI RAX'
  config:          ''
  register_initial_values: []
cpu_name:        bdver2
llvm_triple:     x86_64-unknown-linux-gnu
num_repetitions: 10000
measurements:
  - { key: PdFPU0, value: 0, per_snippet_value: 0 }
  - { key: PdFPU1, value: 0, per_snippet_value: 0 }
  - { key: PdFPU2, value: 0, per_snippet_value: 0 }
  - { key: PdFPU3, value: 0, per_snippet_value: 0 }
  - { key: NumMicroOps, value: 1.2571, per_snippet_value: 5.0284 }
error:           ''
info:            ''
assembled_snippet: 48C1E208400FB6C64809D0C4E2F8F7C748C1E208400FB6C64809D0C4E2F8F7C748C1E208400FB6C64809D0C4E2F8F7C748C1E208400FB6C64809D0C4E2F8F7C7C3
...
```
^ latency increased (worse).

Except //maybe// not really.
Like with all synthetic benchmarks, they //may// be misleading.

Let's take a look on some actual real-world hotpath.
In this case it's 'my' [[ https://github.com/darktable-org/rawspeed | RawSpeed ]]'s `BitStream<>::peekBitsNoFill()`, in [[ https://github.com/darktable-org/rawspeed/blob/e3316dc85127c2c29baa40f998f198a7b278bf36/src/librawspeed/decompressors/VC5Decompressor.cpp#L814 | GoPro VC5 decompressor ]]:
```
raw.pixls.us-unique/GoPro/HERO6 Black$ /usr/src/googlebenchmark/tools/compare.py -a benchmarks ~/rawspeed/build-clangs1-{old,new}/src/utilities/rsbench/rsbench --benchmark_counters_tabular=true --benchmark_min_time=0.00000001 --benchmark_repetitions=128 GOPR9172.GPR
RUNNING: /home/lebedevri/rawspeed/build-clangs1-old/src/utilities/rsbench/rsbench --benchmark_counters_tabular=true --benchmark_min_time=0.00000001 --benchmark_repetitions=128 GOPR9172.GPR --benchmark_display_aggregates_only=true --benchmark_out=/tmp/tmplwbKEM
2018-12-22 21:23:03
Running /home/lebedevri/rawspeed/build-clangs1-old/src/utilities/rsbench/rsbench
Run on (8 X 4012.81 MHz CPU s)
CPU Caches:
  L1 Data 16K (x8)
  L1 Instruction 64K (x4)
  L2 Unified 2048K (x4)
  L3 Unified 8192K (x1)
Load Average: 3.41, 2.41, 2.03
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Benchmark                                        Time           CPU Iterations  CPUTime,s CPUTime/WallTime     Pixels Pixels/CPUTime Pixels/WallTime Raws/CPUTime Raws/WallTime WallTime,s
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
GOPR9172.GPR/threads:8/real_time_mean           40 ms         40 ms        128   0.322244          7.96974        12M       37.4457M        298.534M      3.12047       24.8778   0.040465
GOPR9172.GPR/threads:8/real_time_median         39 ms         39 ms        128   0.312606          7.99155        12M        38.387M        306.788M      3.19891       25.5656   0.039115
GOPR9172.GPR/threads:8/real_time_stddev          4 ms          3 ms        128  0.0271557         0.130575          0        2.4941M        21.3909M     0.207842       1.78257   3.81081m
RUNNING: /home/lebedevri/rawspeed/build-clangs1-new/src/utilities/rsbench/rsbench --benchmark_counters_tabular=true --benchmark_min_time=0.00000001 --benchmark_repetitions=128 GOPR9172.GPR --benchmark_display_aggregates_only=true --benchmark_out=/tmp/tmpWAkan9
2018-12-22 21:23:08
Running /home/lebedevri/rawspeed/build-clangs1-new/src/utilities/rsbench/rsbench
Run on (8 X 4013.1 MHz CPU s)
CPU Caches:
  L1 Data 16K (x8)
  L1 Instruction 64K (x4)
  L2 Unified 2048K (x4)
  L3 Unified 8192K (x1)
Load Average: 3.78, 2.50, 2.06
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Benchmark                                        Time           CPU Iterations  CPUTime,s CPUTime/WallTime     Pixels Pixels/CPUTime Pixels/WallTime Raws/CPUTime Raws/WallTime WallTime,s
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
GOPR9172.GPR/threads:8/real_time_mean           39 ms         39 ms        128   0.311533          7.97323        12M       38.6828M        308.471M      3.22356        25.706  0.0390928
GOPR9172.GPR/threads:8/real_time_median         38 ms         38 ms        128   0.304231          7.99005        12M       39.4437M        315.527M      3.28698        26.294  0.0380316
GOPR9172.GPR/threads:8/real_time_stddev          3 ms          3 ms        128  0.0229149         0.133814          0       2.26225M        19.1421M     0.188521       1.59517   3.13671m
Comparing /home/lebedevri/rawspeed/build-clangs1-old/src/utilities/rsbench/rsbench to /home/lebedevri/rawspeed/build-clangs1-new/src/utilities/rsbench/rsbench
Benchmark                                                 Time             CPU      Time Old      Time New       CPU Old       CPU New
--------------------------------------------------------------------------------------------------------------------------------------
GOPR9172.GPR/threads:8/real_time_pvalue                 0.0000          0.0000      U Test, Repetitions: 128 vs 128
GOPR9172.GPR/threads:8/real_time_mean                  -0.0339         -0.0316            40            39            40            39
GOPR9172.GPR/threads:8/real_time_median                -0.0277         -0.0274            39            38            39            38
GOPR9172.GPR/threads:8/real_time_stddev                -0.1769         -0.1267             4             3             3             3
```
I.e. this results in //roughly// -3% improvements in perf.

While this will help [[ https://bugs.llvm.org/show_bug.cgi?id=36419 | PR36419 ]], it won't address it fully.

Reviewers: RKSimon, craig.topper, andreadb, spatel

Reviewed By: craig.topper

Subscribers: courbet, llvm-commits

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

llvm-svn: 351253

5 years agocompiler-rt/test: Clean up Android specific workarounds in lit.common.cfg.
Peter Collingbourne [Tue, 15 Jan 2019 21:27:44 +0000 (21:27 +0000)]
compiler-rt/test: Clean up Android specific workarounds in lit.common.cfg.

-pie -Wl,--enable-new-dtags are no longer needed because
the driver passes them by default as of r316606.

Prepend -fuse-ld=gold instead of appending it so that the linker can
be overridden using COMPILER_RT_TEST_COMPILER_CFLAGS.

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

llvm-svn: 351252

5 years agotreat invoke like call
David Callahan [Tue, 15 Jan 2019 21:26:51 +0000 (21:26 +0000)]
treat invoke like call

Summary:
InvokeInst should be treated like CallInst and
assigned a separate discriminator. This is particularly
import when an Invoke is converted to a Call
during compilation and so can invalidate sample profile
data collected wtih different link time optimizations

Reviewers: twoh, Kader, danielcdh, wmi

Reviewed By: wmi

Subscribers: llvm-commits

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

llvm-svn: 351251

5 years agoSimplify Value::GetValueByteSize()
Adrian Prantl [Tue, 15 Jan 2019 21:26:03 +0000 (21:26 +0000)]
Simplify Value::GetValueByteSize()

llvm-svn: 351250

5 years ago[clang-cl] Alias /Zc:alignedNew[-] to -f[no-]aligned-allocation
Reid Kleckner [Tue, 15 Jan 2019 21:24:55 +0000 (21:24 +0000)]
[clang-cl] Alias /Zc:alignedNew[-] to -f[no-]aligned-allocation

Implements PR40180.

clang-cl has one minor behavior difference with cl with this change.
Clang allows the user to enable the C++17 feature of aligned allocation
without enabling all of C++17, but MSVC will not call the aligned
allocation overloads unless -std:c++17 is passed. While our behavior is
technically incompatible, it would require making driver mode specific
changes to match MSVC precisely, and clang's behavior is useful because
it allows people to experiment with new C++17 features individually.
Therefore, I plan to leave it as is.

llvm-svn: 351249

5 years agogn build: Move target flags from toolchain to a .gni file.
Peter Collingbourne [Tue, 15 Jan 2019 21:24:00 +0000 (21:24 +0000)]
gn build: Move target flags from toolchain to a .gni file.

While here, add a use_lld flag and default it to true when using
clang on non-mac.

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

llvm-svn: 351248

5 years ago[SanitizerCoverage] Don't create comdat for interposable functions.
Matt Morehouse [Tue, 15 Jan 2019 21:21:01 +0000 (21:21 +0000)]
[SanitizerCoverage] Don't create comdat for interposable functions.

Summary:
Comdat groups override weak symbol behavior, allowing the linker to keep
the comdats for weak symbols in favor of comdats for strong symbols.

Fixes the issue described in:
https://bugs.chromium.org/p/chromium/issues/detail?id=918662

Reviewers: eugenis, pcc, rnk

Reviewed By: pcc, rnk

Subscribers: smeenai, rnk, bd1976llvm, hiraditya, llvm-commits

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

llvm-svn: 351247

5 years agogn build: Add build files for compiler-rt/lib/{hwasan,interception,sanitizer_common...
Peter Collingbourne [Tue, 15 Jan 2019 21:08:21 +0000 (21:08 +0000)]
gn build: Add build files for compiler-rt/lib/{hwasan,interception,sanitizer_common,ubsan}.

This allows the hwasan runtime to be built for Android aarch64.

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

llvm-svn: 351246

5 years agoEnable IAS for OpenBSD SPARC.
Brad Smith [Tue, 15 Jan 2019 21:04:36 +0000 (21:04 +0000)]
Enable IAS for OpenBSD SPARC.

llvm-svn: 351245

5 years agoSimplify code
Adrian Prantl [Tue, 15 Jan 2019 21:04:19 +0000 (21:04 +0000)]
Simplify code

llvm-svn: 351244

5 years agoAdd Doxygen comments.
Adrian Prantl [Tue, 15 Jan 2019 21:04:18 +0000 (21:04 +0000)]
Add Doxygen comments.

llvm-svn: 351243

5 years agogn build: Merge r351216, r351228.
Peter Collingbourne [Tue, 15 Jan 2019 21:02:49 +0000 (21:02 +0000)]
gn build: Merge r351216, r351228.

llvm-svn: 351242

5 years agoCodeGen: Remove debug printf unintentionally added in r351228.
Peter Collingbourne [Tue, 15 Jan 2019 20:59:59 +0000 (20:59 +0000)]
CodeGen: Remove debug printf unintentionally added in r351228.

llvm-svn: 351241

5 years ago[SLP] Added test for PR40310, NFC.
Alexey Bataev [Tue, 15 Jan 2019 20:54:44 +0000 (20:54 +0000)]
[SLP] Added test for PR40310, NFC.

llvm-svn: 351240

5 years agoImplement BlockDecl::Capture dump in terms of visitors
Stephen Kelly [Tue, 15 Jan 2019 20:41:37 +0000 (20:41 +0000)]
Implement BlockDecl::Capture dump in terms of visitors

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 351239

5 years agollvm-objdump -m -D should disassemble all text segments
Michael Trent [Tue, 15 Jan 2019 20:41:30 +0000 (20:41 +0000)]
llvm-objdump -m -D should disassemble all text segments

Summary:
When running llvm-objdump with the -macho option objdump will by default
disassemble only the __TEXT,__text section (or __TEXT_EXEC,__text when
disassembling MH_KEXT_BUNDLE files). The -disassemble-all option is
treated no diferently than -disassemble.

This change upates llvm-objdump's MachO parsing code to disassemble all
__text sections found in a file when -disassemble-all is specified. This
is useful for disassembling files with more than one __text section, or
when disassembling files whose __text section is not present in __TEXT.

I added a lit test case that verifies "llvm-objdump -m -d" and
"llvm-objdump -m -D" produce the expected results on a reference binary.
I also updated the CommandGuide documentation for llvm-objdump.rst and
verified it renders correctly as man and html.

rdar://42899338

Reviewers: ab, pete, lhames

Reviewed By: lhames

Subscribers: rupprecht, llvm-commits

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

llvm-svn: 351238

5 years agoReplace auto -> llvm::Optional<uint64_t>
Adrian Prantl [Tue, 15 Jan 2019 20:33:58 +0000 (20:33 +0000)]
Replace auto -> llvm::Optional<uint64_t>

This addresses post-commit feedback for https://reviews.llvm.org/D56688

llvm-svn: 351237

5 years agoNFC: Implement OMPClause dump in terms of visitors
Stephen Kelly [Tue, 15 Jan 2019 20:31:31 +0000 (20:31 +0000)]
NFC: Implement OMPClause dump in terms of visitors

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 351236

5 years agoImplement CXXCtorInitializer dump in terms of Visitor
Stephen Kelly [Tue, 15 Jan 2019 20:17:33 +0000 (20:17 +0000)]
Implement CXXCtorInitializer dump in terms of Visitor

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 351235

5 years ago[X86] Add versions of the avx512 gather intrinsics that take the mask as a vXi1 vecto...
Craig Topper [Tue, 15 Jan 2019 20:12:33 +0000 (20:12 +0000)]
[X86] Add versions of the avx512 gather intrinsics that take the mask as a vXi1 vector instead of a scalar

In keeping with our general direction of having the vXi1 type present in IR, this patch converts the mask argument for avx512 gather to vXi1. This can avoid k-register to GPR to k-register transitions late in codegen.

I left the existing intrinsics behind because they have many out of tree users such as ISPC. They generate their own code and don't go through the autoupgrade path which only works for bitcode and ll parsing. Ideally we will get them to migrate to target independent intrinsics, but it might be easier for them to migrate to these new intrinsics.

I'll work on scatter and gatherpf/scatterpf next.

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

llvm-svn: 351234

5 years ago[MSP430] Recognize '{' as a line separator
Anton Korobeynikov [Tue, 15 Jan 2019 20:10:46 +0000 (20:10 +0000)]
[MSP430] Recognize '{' as a line separator

msp430-as supports multiple assembly statements on the same line
separated by a '{' character.

llvm-svn: 351233

5 years ago[MSVC Compat] Fix typo correction for inclusion directives.
Volodymyr Sapsai [Tue, 15 Jan 2019 20:08:23 +0000 (20:08 +0000)]
[MSVC Compat] Fix typo correction for inclusion directives.

In MSVC compatibility mode we were checking not the typo corrected
filename but the original filename.

Reviewers: christylee, compnerd

Reviewed By: christylee

Subscribers: jkorous, dexonsmith, sammccall, hokein, cfe-commits

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

llvm-svn: 351232

5 years ago[Nios2] Remove Nios2 backend
Craig Topper [Tue, 15 Jan 2019 19:59:19 +0000 (19:59 +0000)]
[Nios2] Remove Nios2 backend

As mentioned here http://lists.llvm.org/pipermail/llvm-dev/2019-January/129121.html This backend is incomplete and has not been maintained in several months.

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

llvm-svn: 351231

5 years ago[Nios2] Remove Nios2 backend
Craig Topper [Tue, 15 Jan 2019 19:58:36 +0000 (19:58 +0000)]
[Nios2] Remove Nios2 backend

As mentioned here http://lists.llvm.org/pipermail/llvm-dev/2019-January/129121.html This backend is incomplete and has not been maintained in several months.

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

llvm-svn: 351230

5 years ago[Tooling] Fix broken compliation databse tests.
Haojian Wu [Tue, 15 Jan 2019 19:51:39 +0000 (19:51 +0000)]
[Tooling] Fix broken compliation databse tests.

I forgot to update the unittest in r351222.

llvm-svn: 351229

5 years ago[MSP430] Provide a toolchain description
Anton Korobeynikov [Tue, 15 Jan 2019 19:44:05 +0000 (19:44 +0000)]
[MSP430] Provide a toolchain description

This is an initial implementation for msp430 toolchain including
-mmcu option support
-mhwmult options support
-integrated-as by default

The toolchain uses msp430-elf-as as a linker and supports msp430-gcc toolchain tree.

Patch by Kristina Bessonova!

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

llvm-svn: 351228

5 years ago[OpenMP] Fix for nested proc_bind affinity bug
Jonathan Peyton [Tue, 15 Jan 2019 19:39:32 +0000 (19:39 +0000)]
[OpenMP] Fix for nested proc_bind affinity bug

Using proc_bind clause on a nested #pragma omp parallel region
with KMP_AFFINITY set causes an assertion error. This assertion occurs because
the place-partition-var is not properly initialized in the nested master threads.
Trying to get an intuitive result with KMP_AFFINITY + proc_bind is difficult
because of how the KMP_AFFINITY gtid-to-place mapping occurs. This
patch creates an initial place list no matter what affinity mechanism is used.
For KMP_AFFINITY, the place-partition-var is initialized to all the places.

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

llvm-svn: 351227

5 years agoFix size_t/off_t mixup in std::filesystem.
Dan Albert [Tue, 15 Jan 2019 19:16:25 +0000 (19:16 +0000)]
Fix size_t/off_t mixup in std::filesystem.

Summary: ftruncate takes an off_t, not a size_t.

Reviewers: EricWF, mclow.lists

Reviewed By: EricWF

Subscribers: christof, ldionne, libcxx-commits

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

llvm-svn: 351226

5 years agoAdd large file support to create_file for 32-bit.
Dan Albert [Tue, 15 Jan 2019 19:14:15 +0000 (19:14 +0000)]
Add large file support to create_file for 32-bit.

Summary:
The tests need to create files larger than 2GB, but size_t is 32-bit
on a 32-bit system. Make use of explicit off64_t APIs so we can still
use a default off_t for the tests while enabling 64-bit file offsets
for create_file.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: christof, ldionne, libcxx-commits

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

llvm-svn: 351225

5 years ago[OpenMP] Add lock function definitions to fix Bug 40042
Jonathan Peyton [Tue, 15 Jan 2019 19:14:00 +0000 (19:14 +0000)]
[OpenMP] Add lock function definitions to fix Bug 40042

This change fixes the sanity issue reported in Bug 40042.
Lock function definitions for the three lock kinds were added
to disambiguate calls to the lock functions done directly and indirectly.

Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=40042
Patch by Hansang Bae

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

llvm-svn: 351224

5 years ago[OpenMP][Cmake] Allowed OpenMP testing detect test compiler with same generator
Jonathan Peyton [Tue, 15 Jan 2019 19:08:26 +0000 (19:08 +0000)]
[OpenMP][Cmake] Allowed OpenMP testing detect test compiler with same generator

Fix ninja build detect test compiler failed under windows.

Patch by Peiyuan Song

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

llvm-svn: 351223

5 years ago[Tooling] Make clang-tool find libc++ dir on mac when running on a file without compi...
Haojian Wu [Tue, 15 Jan 2019 19:05:50 +0000 (19:05 +0000)]
[Tooling] Make clang-tool find libc++ dir on mac when running on a file without compilation database.

Summary:
This is a regression of r348365.

When clang-tools run on a file without a complation database (`clang-check /tmp/t.cc`),
we will use fixed compilation database as a fallback. However the actual compiler
path in the fallback complation command is just `clang-tool` which is
insufficient to detect the libc++ dir.

Reviewers: ilya-biryukov, EricWF

Reviewed By: ilya-biryukov

Subscribers: cfe-commits

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

llvm-svn: 351222

5 years ago[OpenMP] Fix performance regression in SPEC kdtree test
Jonathan Peyton [Tue, 15 Jan 2019 18:57:24 +0000 (18:57 +0000)]
[OpenMP] Fix performance regression in SPEC kdtree test

Make __ompt_implicit_task_end a static function and remove the inline part.  Remove
pId variable that is unused.  This fixes small regression in SPEC kdtree benchmark.
Also reformat some of __ompt_implicit_task_end.

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

llvm-svn: 351221

5 years ago[libc++] Support different libc++ namespaces in the iterator test
Petr Hosek [Tue, 15 Jan 2019 18:55:55 +0000 (18:55 +0000)]
[libc++] Support different libc++ namespaces in the iterator test

libc++ allows changing the namespace, don't assume __1 in the test
to avoid the test failure if different namespace is being used.

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

llvm-svn: 351220

5 years agoReapply "[CodeGen][X86] Expand USUBSAT to UMAX+SUB, also for vectors"
Nikita Popov [Tue, 15 Jan 2019 18:43:41 +0000 (18:43 +0000)]
Reapply "[CodeGen][X86] Expand USUBSAT to UMAX+SUB, also for vectors"

Related to https://bugs.llvm.org/show_bug.cgi?id=40123.

Rather than scalarizing, expand a vector USUBSAT into UMAX+SUB,
which produces much better code for X86.

Reapplying with updated SLPVectorizer tests.

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

llvm-svn: 351219

5 years agoDo not emit a corrupt symbol table entry for .rela_iplt_{start,end}.
Rui Ueyama [Tue, 15 Jan 2019 18:30:23 +0000 (18:30 +0000)]
Do not emit a corrupt symbol table entry for .rela_iplt_{start,end}.

If .rela.iplt does not exist, we used to emit a corrupt symbol table
that contains two symbols, .rela_iplt_{start,end}, pointing to a
nonexisting section.

This patch fixes the issue by setting section index 0 to the symbols
if .rel.iplt section does not exist.

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

llvm-svn: 351218

5 years ago[Solaris] Move enabling IAS for SPARC from the Solaris toolchain to Generic_GCC.
Brad Smith [Tue, 15 Jan 2019 18:24:03 +0000 (18:24 +0000)]
[Solaris] Move enabling IAS for SPARC from the Solaris toolchain to Generic_GCC.

llvm-svn: 351217

5 years ago[WebAssembly] Fix updating/moving DBG_VALUEs in RegStackify
Yury Delendik [Tue, 15 Jan 2019 18:14:12 +0000 (18:14 +0000)]
[WebAssembly] Fix updating/moving DBG_VALUEs in RegStackify

Summary:
As described in PR40209, there can be issues in DBG_VALUEs handling when multiple defs present in a BB. This patch
adds logic for detection of related to def DBG_VALUEs and localizes register update and movement to found DBG_VALUEs.

Reviewers: aheejin

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

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

llvm-svn: 351216