platform/upstream/llvm.git
5 years ago[CostModel][X86] Add SSE1 fp cost tests
Simon Pilgrim [Fri, 4 Jan 2019 16:37:01 +0000 (16:37 +0000)]
[CostModel][X86] Add SSE1 fp cost tests

llvm-svn: 350401

5 years agoFix typo: "with he MODULE" -> "with the MODULE"
Mark Searles [Fri, 4 Jan 2019 16:35:01 +0000 (16:35 +0000)]
Fix typo: "with he MODULE" -> "with the MODULE"

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

llvm-svn: 350400

5 years ago[X86] Add VPSLLI/VPSRLI ((X >>u C1) << C2) SimplifyDemandedBits combine
Simon Pilgrim [Fri, 4 Jan 2019 15:43:43 +0000 (15:43 +0000)]
[X86] Add VPSLLI/VPSRLI ((X >>u C1) << C2) SimplifyDemandedBits combine

Repeat of the generic SimplifyDemandedBits shift combine

llvm-svn: 350399

5 years agoPrevent unreachable when checking invalid multiversion decls.
Erich Keane [Fri, 4 Jan 2019 15:24:06 +0000 (15:24 +0000)]
Prevent unreachable when checking invalid multiversion decls.

CPUSpecifc/CPUDispatch call resolution assumed that all declarations
that would be passed are valid, however this was an invalid assumption.
This patch deals with those situations by making the valid version take
priority.  Note that the checked ordering is arbitrary, since both are
replaced by calls to the resolver later.

Change-Id: I7ff2ec88c55a721d51bc1f39ea1a1fe242b4e45f
llvm-svn: 350398

5 years ago[MCA] Improved handling of in-order issue/dispatch resources.
Andrea Di Biagio [Fri, 4 Jan 2019 15:08:38 +0000 (15:08 +0000)]
[MCA] Improved handling of in-order issue/dispatch resources.

Added field 'MustIssueImmediately' to the instruction descriptor of instructions
that only consume in-order issue/dispatch processor resources.
This speeds up queries from the hardware Scheduler, and gives an average ~5%
speedup on a release build.

No functional change intended.

llvm-svn: 350397

5 years ago[X86] Split immediate shifts tests. NFCI.
Simon Pilgrim [Fri, 4 Jan 2019 14:56:10 +0000 (14:56 +0000)]
[X86] Split immediate shifts tests. NFCI.

A future patch will combine logical shifts more aggressively.

llvm-svn: 350396

5 years ago[ValueTracking] Fix a misuse of APInt in GetPointerBaseWithConstantOffset
Florian Hahn [Fri, 4 Jan 2019 14:53:22 +0000 (14:53 +0000)]
[ValueTracking] Fix a misuse of APInt in GetPointerBaseWithConstantOffset

GetPointerBaseWithConstantOffset include this code, where ByteOffset
and GEPOffset are both of type llvm::APInt :

  ByteOffset += GEPOffset.getSExtValue();

The problem with this line is that getSExtValue() returns an int64_t, but
the += matches an overload for uint64_t. The problem is that the resulting
APInt is no longer considered to be signed. That in turn causes assertion
failures later on if the relevant pointer type is > 64 bits in width and
the GEPOffset was negative.

Changing it to

  ByteOffset += GEPOffset.sextOrTrunc(ByteOffset.getBitWidth());

resolves the issue and explicitly performs the sign-extending
or truncation. Additionally, instead of asserting later if the result
is > 64 bits, it breaks out of the loop in that case.

See also
 https://reviews.llvm.org/D24729
 https://reviews.llvm.org/D24772

This commit must be merged after D38662 in order for the test to pass.

Patch by Michael Ferguson <mpfergu@gmail.com>.

Reviewers: reames, sanjoy, hfinkel

Reviewed By: hfinkel

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

llvm-svn: 350395

5 years ago[gn build] Make write_cmake_config.py check that each key passed is unique
Nico Weber [Fri, 4 Jan 2019 13:48:58 +0000 (13:48 +0000)]
[gn build] Make write_cmake_config.py check that each key passed is unique

I got that wrong once while locally while working on check-llvm.

Reviewed as part of https://reviews.llvm.org/D56195

llvm-svn: 350394

5 years ago[CMake] Python bindings generation polishing
Stefan Granitz [Fri, 4 Jan 2019 12:47:02 +0000 (12:47 +0000)]
[CMake] Python bindings generation polishing

Summary:
Simplify SWIG invocation and handling of generated files.

The `swig_wrapper` target can generate `LLDBWrapPython.cpp` and `lldb.py` in its own binary directory, so we can get rid of a few global variables and their logic. We can use the swig_wrapper's BINARY_DIR target property to refer to it and liblldb's LIBRARY_OUTPUT_DIRECTORY to refer to the framework/shared object output directory.

Reviewers: JDevlieghere, aprantl, stella.stamenova, beanz, zturner, xiaobai

Reviewed By: aprantl

Subscribers: mgorny, lldb-commits, #lldb

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

llvm-svn: 350393

5 years ago[CMake] Revised RPATH handling
Stefan Granitz [Fri, 4 Jan 2019 12:46:57 +0000 (12:46 +0000)]
[CMake] Revised RPATH handling

Summary:
If we build LLDB.framework, dependant tools need appropriate RPATHs in both locations, the build-tree (for testing) and the install-tree (for deployment). Luckily, CMake can handle it for us: https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling.

* In the build-tree, tools use the absolute path to the framework's actual output location.
* In the install-tree, tools get a list of RPATHs to look for the framework when deployed.

`LLDB_FRAMEWORK_INSTALL_DIR` is added to the `CMAKE_INSTALL_PREFIX` to change the relative location of LLDB.framework in the install-tree.
If it is not empty, it will be added as an additional RPATH to all dependant tools (so they are functional in the install-tree).
If it is empty, LLDB.framework goes to the root and tools will not be functional in the directory structure of the LLVM install-tree.
For historical reasons `LLDB_FRAMEWORK_INSTALL_DIR` defaults to "Library/Frameworks".

Reviewers: xiaobai, JDevlieghere, aprantl, clayborg

Reviewed By: JDevlieghere

Subscribers: ki.stfu, mgorny, lldb-commits, #lldb

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

llvm-svn: 350392

5 years ago[CMake] Revised LLDB.framework builds
Stefan Granitz [Fri, 4 Jan 2019 12:46:50 +0000 (12:46 +0000)]
[CMake] Revised LLDB.framework builds

Summary:
Add features to LLDB CMake builds that have so far only been available in Xcode. Clean up a few inconveniences and prepare further improvements.

Options:
* `LLDB_FRAMEWORK_BUILD_DIR` determines target directory (in build-tree)
* `LLDB_FRAMEWORK_INSTALL_DIR` **only** determines target directory in install-tree
* `LLVM_EXTERNALIZE_DEBUGINFO` allows externalized debug info (dSYM on Darwin, emitted to `bin`)
* `LLDB_FRAMEWORK_TOOLS` determines which executables will be copied to the framework's Resources (dropped symlinking, removed INCLUDE_IN_SUITE, removed dummy targets)

Other changes:
* clean up `add_lldb_executable()`
* include `LLDBFramework.cmake` from `source/API/CMakeLists.txt`
* use `*.plist.in` files, which are typical for CMake and independent from Xcode
* add clang headers to the framework bundle

Reviewers: xiaobai, JDevlieghere, aprantl, davide, beanz, stella.stamenova, clayborg, labath

Reviewed By: aprantl

Subscribers: friss, mgorny, lldb-commits, #lldb

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

llvm-svn: 350391

5 years ago[CMake] Move debugserver options to separate debugserverConfig.cmake
Stefan Granitz [Fri, 4 Jan 2019 12:46:38 +0000 (12:46 +0000)]
[CMake] Move debugserver options to separate debugserverConfig.cmake

Summary:
One place for debugserver options, analog to LLDBConfig for LLDB options (see D55317). It was discussed in earlier reviews already, e.g. D55013.

Reviewers: JDevlieghere, aprantl, xiaobai

Reviewed By: aprantl, xiaobai

Subscribers: mgorny, lldb-commits, #lldb

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

llvm-svn: 350390

5 years ago[CMake] Aggregate options for LLDB in LLDBConfig.cmake
Stefan Granitz [Fri, 4 Jan 2019 12:46:34 +0000 (12:46 +0000)]
[CMake] Aggregate options for LLDB in LLDBConfig.cmake

Summary: In preparation for LLDB.framework changes, collect options for LLDB in LLDBConfig.cmake (used for both, standalone and in-tree builds of LLDB).

Reviewers: JDevlieghere, aprantl, xiaobai

Reviewed By: aprantl

Subscribers: srhines, mgorny, lldb-commits, #lldb

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

llvm-svn: 350389

5 years ago[CMake] Streamline code signing for debugserver #2
Stefan Granitz [Fri, 4 Jan 2019 12:46:30 +0000 (12:46 +0000)]
[CMake] Streamline code signing for debugserver #2

Summary:
Major fixes after D54476 (use Diff1 as base for comparison to see only recent changes):
* In standalone builds target directory for debugserver must be LLDB's bin, not LLVM's bin
* Default identity for code signing must not force-override LLVM_CODESIGNING_IDENTITY globally

We have a lot of cases, make them explicit:

* ID used for code signing (debugserver and in tests):
** `LLDB_CODESIGN_IDENTITY` if set explicitly, or otherwise
** `LLVM_CODESIGNING_IDENTITY` if set explicitly, or otherwise
** `lldb_codesign` as the default

* On Darwin we have a debugserver target that:

* On other systems, the debugserver target is not defined, which is equivalent to **[3A]**

Common configurations on Darwin:
* **[1A]** `cmake -GNinja ../llvm` builds debugserver from source and signs with `lldb_codesign`, no code signing for other binaries (prints status: //lldb debugserver: /path/to/bin/debugserver//)
* **[1A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_CODESIGN_IDENTITY=lldb_codesign ../llvm` builds debugserver from source and signs with `lldb_codesign`, ad-hoc code signing for other binaries (prints status: //lldb debugserver: /path/to/bin/debugserver//)
* **[2A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_USE_SYSTEM_DEBUGSERVER=ON ../llvm` copies debugserver from system, ad-hoc code signing for other binaries (prints status: //Copy system debugserver from: /path/to/system/debugserver//)
* **[2B]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- ../llvm` same, but prints additional warning: //Cannot code sign debugserver with identity '-'. Will fall back to system's debugserver. Pass -DLLDB_CODESIGN_IDENTITY=lldb_codesign to override the LLVM value for debugserver.//
* **[3A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_NO_DEBUGSERVER=ON ../llvm` debugserver not available (prints status: //lldb debugserver will not be available)//

Reviewers: JDevlieghere, beanz, davide, vsk, aprantl, labath

Reviewed By: JDevlieghere, labath

Subscribers: mgorny, #lldb, lldb-commits

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

llvm-svn: 350388

5 years ago[MCA] Store extra information about processor resources in the ResourceManager.
Andrea Di Biagio [Fri, 4 Jan 2019 12:31:14 +0000 (12:31 +0000)]
[MCA] Store extra information about processor resources in the ResourceManager.

Method ResourceManager::use() is responsible for updating the internal state of
used processor resources, as well as notifying resource groups that contain used
resources.

Before this patch, method 'use()' didn't know how to quickly obtain the set of
groups that contain a particular resource unit. It had to discover groups by
perform a potentially slow search (done by iterating over the set of processor
resource descriptors).

With this patch, the relationship between resource units and groups is stored in
the ResourceManager. That means, method 'use()' no longer has to search for
groups. This gives an average speedup of ~4-5% on a release build.

This patch also adds extra code comments in ResourceManager.h to better describe
the resource mask layout, and how resouce indices are computed from resource
masks.

llvm-svn: 350387

5 years ago[Basic] Extend DiagnosticEngine to store and format Qualifiers.
Anastasia Stulova [Fri, 4 Jan 2019 11:50:36 +0000 (11:50 +0000)]
[Basic] Extend DiagnosticEngine to store and format Qualifiers.

Qualifiers can now be streamed into the DiagnosticEngine using
regular << operator. If Qualifiers are empty 'unqualified' will
be printed in the diagnostic otherwise regular qual syntax is
used.

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

llvm-svn: 350386

5 years ago[AArch64] Add command-line option predres
Diogo N. Sampaio [Fri, 4 Jan 2019 11:04:18 +0000 (11:04 +0000)]
[AArch64] Add command-line option predres

Prediction control instructions are only
mandatory from v8.5a onwards but is optional
from Armv8.0-A. This patch adds a command
line option to enable it by it's own.

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

llvm-svn: 350385

5 years agoSymtab: Remove one copy of symbol size computation code
Pavel Labath [Fri, 4 Jan 2019 10:11:25 +0000 (10:11 +0000)]
Symtab: Remove one copy of symbol size computation code

Summary:
The implementation in CalculateSymbolSizes has been made redundant in
D19004, as this patch added another copy of size computation code into
InitAddressIndexes (which is called by CalculateSymbolSizes).

Reviewers: clayborg, jasonmolenda, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 350384

5 years ago[CMake] Use XCODE_ATTRIBUTE properties for code signing and entitlements in Xcode
Stefan Granitz [Fri, 4 Jan 2019 09:22:32 +0000 (09:22 +0000)]
[CMake] Use XCODE_ATTRIBUTE properties for code signing and entitlements in Xcode

Summary: A post-commit comment to D55116 amended that this was the correct way for code signing in Xcode.

Reviewers: beanz

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

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

llvm-svn: 350383

5 years agoRangeMap.h: merge RangeDataArray and RangeDataVector
Pavel Labath [Fri, 4 Jan 2019 07:14:17 +0000 (07:14 +0000)]
RangeMap.h: merge RangeDataArray and RangeDataVector

Summary:
The main difference between the classes was supposed to be the fact that
one is backed by llvm::SmallVector, and the other by std::vector.
However, over the years, they have accumulated various other differences
too.

This essentially removes the std::vector version, as that is pretty much
identical to llvm::SmallVector<T, 0>, and combines their interfaces. It
does not attempt to do a more significant refactoring, even though there
is still a lot of duplication in this file, as it is hard to tell which
quirk of some API is depended on by somebody (and, a previous, more
ambitious attempt at this in D16769 has failed).

I also add some tests, including one which demonstrates one of the
quirks/bugs of the API I have noticed in the process.

Reviewers: clayborg, teemperor, tberghammer

Subscribers: mgorny, JDevlieghere, lldb-commits

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

llvm-svn: 350380

5 years ago[WebAssembly] Split the checking from the sorting logic.
Richard Trieu [Fri, 4 Jan 2019 06:49:24 +0000 (06:49 +0000)]
[WebAssembly] Split the checking from the sorting logic.

Move the check for -1 and identical values outside the vector sorting code.
Compare functions need to be able to compare identical elements to be
conforming.

llvm-svn: 350379

5 years ago[memcpyopt] Remove a few unnecessary isVolatile() checks. NFC
Xin Tong [Fri, 4 Jan 2019 02:13:22 +0000 (02:13 +0000)]
[memcpyopt] Remove a few unnecessary isVolatile() checks. NFC

We already checked for isSimple() on the store.

llvm-svn: 350378

5 years ago[OpenMP] Fix nvidia-cuda-toolkit detection on Debian/Ubuntu
Joel E. Denny [Fri, 4 Jan 2019 02:07:13 +0000 (02:07 +0000)]
[OpenMP] Fix nvidia-cuda-toolkit detection on Debian/Ubuntu

The OpenMP runtime's cmake scripts do not correctly locate the
libdevice that the Debian/Ubuntu package nvidia-cuda-toolkit currently
includes, at least on my Ubuntu 18.04.1 installation.  This patch
fixes that for me.

This problem was discussed at length in D55269.  D40453 added a
similar adjustment in clang, but reviewers of D55269 concluded that,
for the OpenMP runtime, the right place to address this problem is in
cmake's CUDA support.  However, it was also suggested we could add a
workaround to OpenMP's cmake scripts now.  This patch contains such a
workaround, which I've tried to design so that it will have no harmful
effect if cmake improves in the future.

nvidia-cuda-toolkit also needs improvements because its intended
monolithic CUDA tree shim, /usr/lib/cuda, has many empty directories,
such as bin.  I reported that at:

<https://bugs.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+bug/1808999>

Reviewed By: grokos

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

llvm-svn: 350377

5 years ago[lldb] Fix ObjCExceptionRecognizedStackFrame to populate the list of recognized arguments
Kuba Mracek [Fri, 4 Jan 2019 00:25:08 +0000 (00:25 +0000)]
[lldb] Fix ObjCExceptionRecognizedStackFrame to populate the list of recognized arguments

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

llvm-svn: 350376

5 years ago[lldb] Check SafeToCallFunctions before calling functions in GetExceptionObjectForThread
Kuba Mracek [Fri, 4 Jan 2019 00:20:52 +0000 (00:20 +0000)]
[lldb] Check SafeToCallFunctions before calling functions in GetExceptionObjectForThread

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

llvm-svn: 350375

5 years ago[X86] Add post-isel peephole to fold KAND+KORTEST into KTEST if only the zero flag...
Craig Topper [Fri, 4 Jan 2019 00:10:58 +0000 (00:10 +0000)]
[X86] Add post-isel peephole to fold KAND+KORTEST into KTEST if only the zero flag is used.

Doing this late so we will prefer to fold the AND into a masked comparison first. That can be better for the live range of the mask register.

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

llvm-svn: 350374

5 years agorevert r350369: [x86] lower extracted fadd/fsub to horizontal vector math
Sanjay Patel [Fri, 4 Jan 2019 00:02:02 +0000 (00:02 +0000)]
revert r350369: [x86] lower extracted fadd/fsub to horizontal vector math

There are non-codegen tests that need to be updated with this code change.

llvm-svn: 350373

5 years agoAdopt SwiftABIInfo for WebAssembly.
Daniel Dunbar [Thu, 3 Jan 2019 23:24:50 +0000 (23:24 +0000)]
Adopt SwiftABIInfo for WebAssembly.

Summary:
 - This adopts SwiftABIInfo as the base class for WebAssemblyABIInfo, which is in keeping with what is done for other targets for which Swift is supported.

 - This is a minimal patch to unblock exploration of WASM support for Swift (https://bugs.swift.org/browse/SR-9307)

Reviewers: rjmccall, sunfish

Reviewed By: rjmccall

Subscribers: ahti, dschuff, sbc100, jgravelle-google, aheejin, cfe-commits

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

llvm-svn: 350372

5 years agoFix MSVC visualizations for ActionResult and OpaquePtr
Mike Spertus [Thu, 3 Jan 2019 23:24:39 +0000 (23:24 +0000)]
Fix MSVC visualizations for ActionResult and OpaquePtr

Mainly just fixing buggy code. Also removed unnecessary visualizers
for specializations of OpaquePtr

llvm-svn: 350371

5 years ago[hwasan] Switch to 64 allocator with a dense size class map.
Evgeniy Stepanov [Thu, 3 Jan 2019 23:19:02 +0000 (23:19 +0000)]
[hwasan] Switch to 64 allocator with a dense size class map.

Summary:
Replace the 32-bit allocator with a 64-bit one with a non-constant
base address, and reduce both the number of size classes and the maximum
size of per-thread caches.

As measured on [1], this reduces average weighted memory overhead
(MaxRSS) from 26% to 12% over stock android allocator. These numbers
include overhead from code instrumentation and hwasan shadow (i.e. not a
pure allocator benchmark).

This switch also enables release-to-OS functionality, which is not
implemented in the 32-bit allocator. I have not seen any effect from
that on the benchmark.

[1] https://android.googlesource.com/platform/system/extras/+/master/memory_replay/

Reviewers: vitalybuka, kcc

Subscribers: kubamracek, cryptoad, llvm-commits

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

llvm-svn: 350370

5 years ago[x86] lower extracted fadd/fsub to horizontal vector math
Sanjay Patel [Thu, 3 Jan 2019 23:16:19 +0000 (23:16 +0000)]
[x86] lower extracted fadd/fsub to horizontal vector math

This would show up if we fix horizontal reductions to narrow as they go along,
but it's an improvement for size and/or Jaguar (fast-hops) independent of that.

We need to do this late to not interfere with other pattern matching of larger
horizontal sequences.

We can extend this to integer ops in a follow-up patch.

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

llvm-svn: 350369

5 years agosymbols.enable-external-lookup=false on all hosts (not just OSX)
Jan Kratochvil [Thu, 3 Jan 2019 23:11:06 +0000 (23:11 +0000)]
symbols.enable-external-lookup=false on all hosts (not just OSX)

There is already in use:
lit/lit-lldb-init:
settings set symbols.enable-external-lookup false
packages/Python/lldbsuite/test/lldbtest.py:
self.runCmd('settings set symbols.enable-external-lookup false')

But those are not in effect during MI part of the testsuite. Another problem is
that symbols.enable-external-lookup (read by GetEnableExternalLookup) has been
currently read only by LocateMacOSXFilesUsingDebugSymbols and therefore it had
no effect on Linux.

On Red Hat platforms (Fedoras, RHEL-7) there is DWZ in use and so
MiSyntaxTestCase-test_lldbmi_output_grammar FAILs due to:
AssertionError: error: inconsistent pattern ''^.+?\n'' for state 0x5f
(matched string: warning: (x86_64) /lib64/libstdc++.so.6 unsupported
DW_FORM values: 0x1f20 0x1f21
It is the only testcase with this error. It happens due to:
(lldb) target create "/lib64/libstdc++.so.6"
Current executable set to '/lib64/libstdc++.so.6' (x86_64).
(lldb) b main
warning: (x86_64) /lib64/libstdc++.so.6 unsupported DW_FORM values: 0x1f20 0x1f21
Breakpoint 1: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.
which happens only with gcc-base-debuginfo rpm installed (similarly for other packages).

It should also speed up the testsuite as it no longer needs to read
/usr/lib/debug symbols which have no effect (and should not have any effect) on
the testsuite results.

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

llvm-svn: 350368

5 years ago[WebAssembly] Optimize Irreducible Control Flow
Heejin Ahn [Thu, 3 Jan 2019 23:10:11 +0000 (23:10 +0000)]
[WebAssembly] Optimize Irreducible Control Flow

Summary:
Irreducible control flow is not that rare, e.g. it happens in malloc and
3 other places in the libc portions linked in to a hello world program.
This patch improves how we handle that code: it emits a br_table to
dispatch to only the minimal necessary number of blocks. This reduces
the size of malloc by 33%, and makes it comparable in size to asm2wasm's
malloc output.

Added some tests, and verified this passes the emscripten-wasm tests run
on the waterfall (binaryen2, wasmobj2, other).

Reviewers: aheejin, sunfish

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

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

Patch by Alon Zakai (kripken)

llvm-svn: 350367

5 years ago[WebAssembly] Fixed disassembler not knowing about new brlist operand
Wouter van Oortmerssen [Thu, 3 Jan 2019 23:01:30 +0000 (23:01 +0000)]
[WebAssembly] Fixed disassembler not knowing about new brlist operand

Summary:
The previously introduced new operand type for br_table didn't have
a disassembler implementation, causing an assert.

Reviewers: dschuff, aheejin

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

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

llvm-svn: 350366

5 years ago[WebAssembly] Made InstPrinter more robust
Wouter van Oortmerssen [Thu, 3 Jan 2019 22:59:59 +0000 (22:59 +0000)]
[WebAssembly] Made InstPrinter more robust

Summary:
Instead of asserting on certain kinds of malformed instructions, it
now still print, but instead adds an annotation indicating the
problem, and/or indicates invalid_type etc.

We're using the InstPrinter from many contexts that can't always
guarantee values are within range (e.g. the disassembler), where having
output is more valueable than asserting.

Reviewers: dschuff, aheejin

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

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

llvm-svn: 350365

5 years ago[x86] add 512-bit vector tests for horizontal ops; NFC
Sanjay Patel [Thu, 3 Jan 2019 22:55:18 +0000 (22:55 +0000)]
[x86] add 512-bit vector tests for horizontal ops; NFC

llvm-svn: 350364

5 years agoFix check-hwasan with LLVM_BUILD_EXTERNAL_COMPILER_RT=ON
Evgeniy Stepanov [Thu, 3 Jan 2019 22:50:45 +0000 (22:50 +0000)]
Fix check-hwasan with LLVM_BUILD_EXTERNAL_COMPILER_RT=ON

Add a forwarding target for check-hwasan in clang.

llvm-svn: 350363

5 years ago[x86] add AVX512 runs for horizontal ops; NFC
Sanjay Patel [Thu, 3 Jan 2019 22:42:32 +0000 (22:42 +0000)]
[x86] add AVX512 runs for horizontal ops; NFC

llvm-svn: 350362

5 years ago[cmake] Fix monorepo + LLVM_BUILD_EXTERNAL_COMPILER_RT=ON.
Evgeniy Stepanov [Thu, 3 Jan 2019 22:41:10 +0000 (22:41 +0000)]
[cmake] Fix monorepo + LLVM_BUILD_EXTERNAL_COMPILER_RT=ON.

In cmake 3.10.2, if (${VARIABLE_NAME}) seems to always be false no
matter what documentation says (or maybe I just failed at reading).

Anyway, if (VARIABLE_NAME) seems to do what this code intended.

llvm-svn: 350361

5 years agoTestQueues: Move the synchronisation code into the binary itself.
Adrian Prantl [Thu, 3 Jan 2019 22:34:48 +0000 (22:34 +0000)]
TestQueues: Move the synchronisation code into the binary itself.

Thanks to Pavel Labath for the suggestion!

llvm-svn: 350360

5 years ago[X86] Add test case for D56283.
Craig Topper [Thu, 3 Jan 2019 22:31:07 +0000 (22:31 +0000)]
[X86] Add test case for D56283.

This tests a case where we need to be able to compute sign bits for two insert_subvectors that is a liveout of a basic block. The result is then used as a boolean vector in another basic block.

llvm-svn: 350359

5 years ago[x86] remove dead CHECK lines from test file; NFC
Sanjay Patel [Thu, 3 Jan 2019 22:30:36 +0000 (22:30 +0000)]
[x86] remove dead CHECK lines from test file; NFC

llvm-svn: 350358

5 years ago[x86] split tests for FP and integer horizontal math
Sanjay Patel [Thu, 3 Jan 2019 22:26:51 +0000 (22:26 +0000)]
[x86] split tests for FP and integer horizontal math

These are similar patterns, but when you throw AVX512 onto the pile,
the number of variations explodes. For FP, we really don't care about
AVX1 vs. AVX2 for FP ops. There may be some superficial shuffle diffs,
but that's not what we're testing for here, so I removed those RUNs.

Separating by type also lets us specify 'sse3' for the FP file vs. 'ssse3'
for the integer file...because x86.

llvm-svn: 350357

5 years ago[x86] add common FileCheck prefix to reduce assert duplication; NFC
Sanjay Patel [Thu, 3 Jan 2019 22:11:14 +0000 (22:11 +0000)]
[x86] add common FileCheck prefix to reduce assert duplication; NFC

llvm-svn: 350356

5 years ago[X86] Remove terrible DX Register parsing hack in parse operand. NFCI.
Nirav Dave [Thu, 3 Jan 2019 21:46:30 +0000 (21:46 +0000)]
[X86] Remove terrible DX Register parsing hack in parse operand. NFCI.

Fold hack special casing of (%dx) operand parsing into the related
hack for out*/in* instruction parsing.

llvm-svn: 350355

5 years ago[DAGCombiner][x86] scalarize binop followed by extractelement
Sanjay Patel [Thu, 3 Jan 2019 21:31:16 +0000 (21:31 +0000)]
[DAGCombiner][x86] scalarize binop followed by extractelement

As noted in PR39973 and D55558:
https://bugs.llvm.org/show_bug.cgi?id=39973
...this is a partial implementation of a fold that we do as an IR canonicalization in instcombine:

// extelt (binop X, Y), Index --> binop (extelt X, Index), (extelt Y, Index)

We want to have this in the DAG too because as we can see in some of the test diffs (reductions),
the pattern may not be visible in IR.

Given that this is already an IR canonicalization, any backend that would prefer a vector op over
a scalar op is expected to already have the reverse transform in DAG lowering (not sure if that's
a realistic expectation though). The transform is limited with a TLI hook because there's an
existing transform in CodeGenPrepare that tries to do the opposite transform.

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

llvm-svn: 350354

5 years ago[AVR] Update integration/blink.ll as we now generate sbi/cbi instructions.
Nirav Dave [Thu, 3 Jan 2019 21:25:39 +0000 (21:25 +0000)]
[AVR] Update integration/blink.ll as we now generate sbi/cbi instructions.

Silence long standing test failure.

llvm-svn: 350353

5 years ago[OpenMP] Add omp_get_device_num() and update several other device API functions
Jonathan Peyton [Thu, 3 Jan 2019 21:14:19 +0000 (21:14 +0000)]
[OpenMP] Add omp_get_device_num() and update several other device API functions

Add omp_get_device_num() function for 5.0 which returns the number of the
device the current thread is running on. Currently, we are leaving it to the
compiler to handle this properly if it is called inside target.

Also, did some cleanup and updating of duplicate device API functions (in both
libomp and libomptarget) to make them into weak functions that check for the
symbol from libomptarget, and will call the version in libomptarget if it is
present. If any additional device API functions are implemented also in
libomptarget in the future, we should add the dlsym calls to the host functions.
Also, if the omp_target_* functions are to be implemented for the host (this has
been requested), they should attempt to call the libomptarget versions as well.

Patch by Terry Wilmarth

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

llvm-svn: 350352

5 years ago[CaptureTracking] Add a unit test for MaxUsesToExplore
Artur Pilipenko [Thu, 3 Jan 2019 20:16:33 +0000 (20:16 +0000)]
[CaptureTracking] Add a unit test for MaxUsesToExplore

llvm-svn: 350351

5 years ago[AMDGPU] Fix scalar operand folding bug that causes SHOC performance regression.
Alexander Timofeev [Thu, 3 Jan 2019 19:55:32 +0000 (19:55 +0000)]
[AMDGPU] Fix scalar operand folding bug that causes SHOC performance regression.

Detailed description: SIFoldOperands::foldInstOperand iterates over the
operand uses calling the function that changes def-use iteratorson the
way. As a result loop exits immediately when def-use iterator is
changed. Hence, the operand is folded to the very first use instruction
only. This makes VGPR live along the whole basic block and increases
register pressure significantly. The performance drop observed in SHOC
DeviceMemory test is caused by this bug.

Proposed fix: collect uses to separate container for further processing
in another loop.

Testing: make check-llvm
SHOC performance test.

Reviewers: rampitec, ronlieb

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

llvm-svn: 350350

5 years ago[UnrollRuntime] Move the DomTree verification under expensive checks
Anna Thomas [Thu, 3 Jan 2019 19:43:33 +0000 (19:43 +0000)]
[UnrollRuntime] Move the DomTree verification under expensive checks

Suggested by Hal as done in r349871.

llvm-svn: 350349

5 years agoRemove unused %host_cc lit pattern
Nico Weber [Thu, 3 Jan 2019 19:31:53 +0000 (19:31 +0000)]
Remove unused %host_cc lit pattern

It was added in r257236 but then the one use was removed in r309517. Since no
test should call %host_cc, remove the pattern.

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

llvm-svn: 350348

5 years agoReflow module.modulemap for readability
Adrian Prantl [Thu, 3 Jan 2019 19:30:18 +0000 (19:30 +0000)]
Reflow module.modulemap for readability

llvm-svn: 350347

5 years agoUnbreak the modules build by splitting Target out into its own top-level module
Adrian Prantl [Thu, 3 Jan 2019 19:24:37 +0000 (19:24 +0000)]
Unbreak the modules build by splitting Target out into its own top-level module

llvm-svn: 350346

5 years agoRevert "Resubmit rL345008 "Split MachinePipeliner code into header and cpp files""
Stefan Granitz [Thu, 3 Jan 2019 19:09:24 +0000 (19:09 +0000)]
Revert "Resubmit rL345008 "Split MachinePipeliner code into header and cpp files""

This reverts commit r350290.

llvm-svn: 350345

5 years agoRevert "[MachinePipeliner] Add missing header file to MachinePipeliner.h"
Stefan Granitz [Thu, 3 Jan 2019 19:09:18 +0000 (19:09 +0000)]
Revert "[MachinePipeliner] Add missing header file to MachinePipeliner.h"

This reverts commit r350296.

llvm-svn: 350344

5 years ago[llvm-objcopy] Fix buildbots on older compilers
Jordan Rupprecht [Thu, 3 Jan 2019 19:09:00 +0000 (19:09 +0000)]
[llvm-objcopy] Fix buildbots on older compilers

llvm-svn: 350343

5 years ago[MCStreamer] Use report_fatal_error in EmitRawTextImpl
Kristina Brooks [Thu, 3 Jan 2019 18:42:31 +0000 (18:42 +0000)]
[MCStreamer] Use report_fatal_error in EmitRawTextImpl

Use report_fatal_error in MCStreamer::EmitRawTextImpl instead of
using errs() and explain the rationale behind it not being
llvm_unreachable() to save confusion for any future maintainers.

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

llvm-svn: 350342

5 years ago[elfabi] Introduce tool for ELF TextAPI
Armando Montanez [Thu, 3 Jan 2019 18:32:36 +0000 (18:32 +0000)]
[elfabi] Introduce tool for ELF TextAPI

Follow up for D53051

This patch introduces the tool associated with the ELF implementation of
TextAPI (previously llvm-tapi, renamed for better distinction). This
tool will house a number of features related to enalysis and
manipulation of shared object's exposed interfaces. The first major
feature for this tool is support for producing binary stubs that are
useful for compile-time linking of shared objects. This patch introduces
beginnings of support for reading binary ELF objects to work towards
that goal.

Added:

 - elfabi tool.
 - support for reading architecture from a binary ELF file into an
 ELFStub.
 - Support for writing .tbe files.

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

llvm-svn: 350341

5 years agoValidate -add-plugin arguments.
Nico Weber [Thu, 3 Jan 2019 18:26:06 +0000 (18:26 +0000)]
Validate -add-plugin arguments.

-plugin already prints an error if the name of an unknown plugin is passed.
-add-plugin used to silently ignore that, now it errors too.

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

llvm-svn: 350340

5 years agoRename TapiTests to TextAPITests
Nico Weber [Thu, 3 Jan 2019 18:24:58 +0000 (18:24 +0000)]
Rename TapiTests to TextAPITests

This makes the target name consistent with how all the other unit tests are
named.

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

llvm-svn: 350339

5 years ago[x86] add tests for buildvector with extracted element; NFC
Sanjay Patel [Thu, 3 Jan 2019 17:55:32 +0000 (17:55 +0000)]
[x86] add tests for buildvector with extracted element; NFC

llvm-svn: 350338

5 years agoFix typos in comments
Jordan Rupprecht [Thu, 3 Jan 2019 17:51:32 +0000 (17:51 +0000)]
Fix typos in comments

llvm-svn: 350337

5 years ago[llvm-objcopy][ELF] Implement a mutable section visitor that updates size-related...
Jordan Rupprecht [Thu, 3 Jan 2019 17:45:30 +0000 (17:45 +0000)]
[llvm-objcopy][ELF] Implement a mutable section visitor that updates size-related fields (Size, EntrySize, Align) before layout.

Summary:
Fix EntrySize, Size, and Align before doing layout calculation.

As a side cleanup, this removes a dependence on sizeof(Elf_Sym) within BinaryReader, so we can untemplatize that.

This unblocks a cleaner implementation of handling the -O<format> flag. See D53667 for a previous attempt. Actual implementation of the -O<format> flag will come in an upcoming commit, this is largely a NFC (although not _totally_ one, because alignment on binary input was actually wrong before).

Reviewers: jakehehrlich, jhenderson, alexshap, espindola

Reviewed By: jhenderson

Subscribers: emaste, arichardson, llvm-commits

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

llvm-svn: 350336

5 years agoMake -Wstring-plus-int warns even if when the result is not out of bounds
Arnaud Bienner [Thu, 3 Jan 2019 17:45:28 +0000 (17:45 +0000)]
Make -Wstring-plus-int warns even if when the result is not out of bounds

Summary: Patch by Arnaud Bienner

Reviewers: sylvestre.ledru, thakis, serge-sans-paille

Reviewed By: thakis

Subscribers: arphaman, dyung, anemet, llvm-commits, cfe-commits

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

llvm-svn: 350335

5 years ago[UnrollRuntime] Add DomTree verification under debug mode
Anna Thomas [Thu, 3 Jan 2019 17:44:44 +0000 (17:44 +0000)]
[UnrollRuntime] Add DomTree verification under debug mode

NFC: This adds the dom tree verification under debug mode at a point
just before we start unrolling the loop. This allows us to verify dom
tree at a state where it is much smaller and before the unrolling
actually happens.
This also implies we do not need to run -verify-dom-info everytime to
see if the DT is in a valid state when we transform the loop for runtime
unrolling.

llvm-svn: 350334

5 years ago[OPENMP][NVPTX]Fix incompatibility of __syncthreads with LLVM, NFC.
Alexey Bataev [Thu, 3 Jan 2019 17:43:46 +0000 (17:43 +0000)]
[OPENMP][NVPTX]Fix incompatibility of __syncthreads with LLVM, NFC.

Summary:
One of the LLVM optimizations, split critical edges, also clones tail
instructions. This is a dangerous operation for __syncthreads()
functions and this transformation leads to undefined behavior or
incorrect results. Patch fixes this problem by replacing __syncthreads()
function with the assembler instruction, which cost is too high and
wich cannot be copied.

Reviewers: grokos, gtbercea, kkwli0

Subscribers: guansong, openmp-commits, caomhin

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

llvm-svn: 350333

5 years ago[AArch64] Add new scheduling predicates
Evandro Menezes [Thu, 3 Jan 2019 17:28:09 +0000 (17:28 +0000)]
[AArch64] Add new scheduling predicates

Add new scheduling predicates to identify the ASIMD loads and stores using the post indexed addressing mode.

llvm-svn: 350332

5 years agoRe-disable the sanitizer_common/TestCases/Posix/getfsent.cc test. Recent macOS versio...
Kuba Mracek [Thu, 3 Jan 2019 17:26:29 +0000 (17:26 +0000)]
Re-disable the sanitizer_common/TestCases/Posix/getfsent.cc test. Recent macOS versions don't have the /etc/fstab file any more so we cannot test getfsent/setfsent APIs on Darwin.

llvm-svn: 350331

5 years agoDe-tab a couple tests. NFC
Marshall Clow [Thu, 3 Jan 2019 17:18:40 +0000 (17:18 +0000)]
De-tab a couple tests. NFC

llvm-svn: 350330

5 years ago[clangd] Fix detecting atomics in stand-alone builds
Michal Gorny [Thu, 3 Jan 2019 16:43:27 +0000 (16:43 +0000)]
[clangd] Fix detecting atomics in stand-alone builds

Include CheckAtomic CMake module from LLVM in order to detect support
for atomics when building stand-alone.  Otherwise,
the HAVE_CXX_ATOMICS64_WITHOUT_LIB variable is undefined and clangd
wrongly attempts to link -latomic on systems not using the library.

Original bug report: https://bugs.gentoo.org/667016

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

llvm-svn: 350329

5 years ago[OPENMP][NVPTX]Use __kmpc_barrier_simple_spmd(nullptr, 0) instead of
Alexey Bataev [Thu, 3 Jan 2019 16:25:35 +0000 (16:25 +0000)]
[OPENMP][NVPTX]Use __kmpc_barrier_simple_spmd(nullptr, 0) instead of
nvvm_barrier0.

Use runtime functions instead of the direct call to the nvvm intrinsics.
It allows to prevent some dangerous LLVM optimizations, that breaks the
code for the NVPTX target.

llvm-svn: 350328

5 years agoPython compat - no explicit reference to Python version
Serge Guelton [Thu, 3 Jan 2019 15:44:24 +0000 (15:44 +0000)]
Python compat - no explicit reference to Python version

Update documentation and shebang.

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

llvm-svn: 350327

5 years agoPython compat - iterator protocol
Serge Guelton [Thu, 3 Jan 2019 15:43:14 +0000 (15:43 +0000)]
Python compat - iterator protocol

In Python2 next() is used wile it's __next__ in Python3.

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

llvm-svn: 350326

5 years ago[clangd] Move helpers from global namespace into anonymous namespace, NFC.
Haojian Wu [Thu, 3 Jan 2019 15:36:18 +0000 (15:36 +0000)]
[clangd] Move helpers from global namespace into anonymous namespace, NFC.

llvm-svn: 350325

5 years ago[clangd] Bump vscode-clangd v0.0.9
Haojian Wu [Thu, 3 Jan 2019 15:28:38 +0000 (15:28 +0000)]
[clangd] Bump vscode-clangd v0.0.9

llvm-svn: 350324

5 years ago[CostModel][X86] Add truncate cost tests to cover all legal destination types
Simon Pilgrim [Thu, 3 Jan 2019 14:49:39 +0000 (14:49 +0000)]
[CostModel][X86] Add truncate cost tests to cover all legal destination types

We were only testing costs for legal source vector element counts

llvm-svn: 350323

5 years ago[MCA] Improve code comment and reuse an helper function in ResourceManager. NFCI
Andrea Di Biagio [Thu, 3 Jan 2019 14:47:46 +0000 (14:47 +0000)]
[MCA] Improve code comment and reuse an helper function in ResourceManager. NFCI

llvm-svn: 350322

5 years ago[RISCV][MC] Accept %lo and %pcrel_lo on operands to li
Alex Bradbury [Thu, 3 Jan 2019 14:41:41 +0000 (14:41 +0000)]
[RISCV][MC] Accept %lo and %pcrel_lo on operands to li

This matches GNU assembler behaviour.

llvm-svn: 350321

5 years agoPython compat - decode/encode string
Serge Guelton [Thu, 3 Jan 2019 14:40:34 +0000 (14:40 +0000)]
Python compat - decode/encode string

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

llvm-svn: 350320

5 years agoPortable Python script across Python version
Serge Guelton [Thu, 3 Jan 2019 14:27:05 +0000 (14:27 +0000)]
Portable Python script across Python version

Get rid of Python version specific shebang.

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

llvm-svn: 350319

5 years agoPortable Python script across Python version
Serge Guelton [Thu, 3 Jan 2019 14:26:56 +0000 (14:26 +0000)]
Portable Python script across Python version

StringIO is obsoleted in Python3, replaced by io.BytesIO or io.StringIO depending on the use.

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

llvm-svn: 350318

5 years agoDiagnose an unused result from a call through a function pointer whose return type...
Aaron Ballman [Thu, 3 Jan 2019 14:24:31 +0000 (14:24 +0000)]
Diagnose an unused result from a call through a function pointer whose return type is marked [[nodiscard]].

When a function returns a type and that type was declared [[nodiscard]], we diagnose any unused results from that call as though the function were marked nodiscard. The same behavior should apply to calls through a function pointer.

This addresses PR31526.

llvm-svn: 350317

5 years agoPython compat - test if type is integral
Serge Guelton [Thu, 3 Jan 2019 14:12:50 +0000 (14:12 +0000)]
Python compat - test if type is integral

Rely on numbers.Integral instead of int/long

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

llvm-svn: 350316

5 years agoPython compat - urllib
Serge Guelton [Thu, 3 Jan 2019 14:12:44 +0000 (14:12 +0000)]
Python compat - urllib

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

llvm-svn: 350315

5 years agoPython compat - has_key vs. in operator
Serge Guelton [Thu, 3 Jan 2019 14:12:37 +0000 (14:12 +0000)]
Python compat - has_key vs. in operator

Use portable `in` operator instead of `has_key(...)` method.

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

llvm-svn: 350314

5 years agoPython compat - map/filter
Serge Guelton [Thu, 3 Jan 2019 14:12:30 +0000 (14:12 +0000)]
Python compat - map/filter

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

llvm-svn: 350313

5 years agoPython compat - iteritems() vs. items()
Serge Guelton [Thu, 3 Jan 2019 14:12:23 +0000 (14:12 +0000)]
Python compat - iteritems() vs. items()

Always use `items()` and introduce extra `list(...)` call when needed.

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

llvm-svn: 350312

5 years agoPython compat - portable way of raising exceptions
Serge Guelton [Thu, 3 Jan 2019 14:12:13 +0000 (14:12 +0000)]
Python compat - portable way of raising exceptions

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

llvm-svn: 350311

5 years ago[NFC] Remove unused Python import
Serge Guelton [Thu, 3 Jan 2019 14:12:07 +0000 (14:12 +0000)]
[NFC] Remove unused Python import

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

llvm-svn: 350310

5 years agoPythran compat - range vs. xrange
Serge Guelton [Thu, 3 Jan 2019 14:11:58 +0000 (14:11 +0000)]
Pythran compat - range vs. xrange

Use range instead of xrange whenever possible. The extra list creation in Python2
is generally not a performance bottleneck.

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

llvm-svn: 350309

5 years agoPython compat - assertRaisesRegex
Serge Guelton [Thu, 3 Jan 2019 14:11:41 +0000 (14:11 +0000)]
Python compat - assertRaisesRegex

Python3 uses assertRaisesRegex instad of assertRaisesRegexp.

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

llvm-svn: 350308

5 years agoPython compat - print statement
Serge Guelton [Thu, 3 Jan 2019 14:11:33 +0000 (14:11 +0000)]
Python compat - print statement

Make sure all print statements are compatible with Python 2 and Python3 using
the `from __future__ import print_function` statement.

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

llvm-svn: 350307

5 years ago[clangd] Always try to build absolute path
Kadir Cetinkaya [Thu, 3 Jan 2019 13:46:10 +0000 (13:46 +0000)]
[clangd] Always try to build absolute path

Summary:
This only changes behavior in cases when the file itself is a symlink.

When canonicalizing paths do not look at tryGetRealPathName, which
contains the resolved path for files that are symlinks. Instead first build the
absolute path even if it contains some symlinks on the path. Then resolve only
the symlinks on the path and leave it as it is if the file itself is a symlink.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

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

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

llvm-svn: 350306

5 years ago[NewPM] Port Msan
Philip Pfaffe [Thu, 3 Jan 2019 13:42:44 +0000 (13:42 +0000)]
[NewPM] Port Msan

Summary:
Keeping msan a function pass requires replacing the module level initialization:
That means, don't define a ctor function which calls __msan_init, instead just
declare the init function at the first access, and add that to the global ctors
list.

Changes:
- Pull the actual sanitizer and the wrapper pass apart.
- Add a newpm msan pass. The function pass inserts calls to runtime
  library functions, for which it inserts declarations as necessary.
- Update tests.

Caveats:
- There is one test that I dropped, because it specifically tested the
  definition of the ctor.

Reviewers: chandlerc, fedor.sergeev, leonardchan, vitalybuka

Subscribers: sdardis, nemanjai, javed.absar, hiraditya, kbarton, bollu, atanasyan, jsji

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

llvm-svn: 350305

5 years ago[clangd] Check preceding char when completion triggers on ':' or '>'
Ilya Biryukov [Thu, 3 Jan 2019 13:37:12 +0000 (13:37 +0000)]
[clangd] Check preceding char when completion triggers on ':' or '>'

Summary:
Only run completion when we were trigerred on '->' and '::', otherwise
send an error code in return.
To avoid automatically invoking completions in cases like 'a >^' or
'a ? b :^'.

Reviewers: hokein

Reviewed By: hokein

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

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

llvm-svn: 350304

5 years ago[clangd] clang-format everything. NFC
Ilya Biryukov [Thu, 3 Jan 2019 13:28:05 +0000 (13:28 +0000)]
[clangd] clang-format everything. NFC

llvm-svn: 350303

5 years ago[NFC] Fix missing testfile change of rL350299
Diogo N. Sampaio [Thu, 3 Jan 2019 12:48:06 +0000 (12:48 +0000)]
[NFC] Fix missing testfile change of rL350299

This file was missing on the patch

llvm-svn: 350302

5 years ago[X86] Cleanup saturated add/sub tests
Simon Pilgrim [Thu, 3 Jan 2019 12:31:13 +0000 (12:31 +0000)]
[X86] Cleanup saturated add/sub tests
Use X86/X64 check prefixes
Use nounwind to reduce cfi noise

llvm-svn: 350301

5 years ago[SLPVectorizer] Flag ADD/SUB SSAT/USAT intrinsics trivially vectorizable (PR40123)
Simon Pilgrim [Thu, 3 Jan 2019 12:18:23 +0000 (12:18 +0000)]
[SLPVectorizer] Flag ADD/SUB SSAT/USAT intrinsics trivially vectorizable (PR40123)

Enables SLP vectorization for the SSE2 PADDS/PADDUS/PSUBS/PSUBUS style intrinsics

llvm-svn: 350300