platform/upstream/llvm.git
4 years agoStop-hooks weren't getting called on step-out. Fix that.
Jim Ingham [Thu, 15 Aug 2019 21:37:52 +0000 (21:37 +0000)]
Stop-hooks weren't getting called on step-out. Fix that.

There was a little bit of logic in the StopInfoBreakpoint::PerformAction
that would null out the StopInfo once we had a completed plan so that the
next call to GetStopInfo would replace it with the StopInfoThreadPlan.

But the stop-hooks check for whether a thread stopped for a reason didn't
trigger this conversion.  So I added an API to do that directly, and then
called it where before we just reset the StopInfo.

<rdar://problem/54270767>

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

llvm-svn: 369052

4 years agoRemove CMake >= v3.13 target_link_options.
Mitch Phillips [Thu, 15 Aug 2019 21:34:13 +0000 (21:34 +0000)]
Remove CMake >= v3.13 target_link_options.
Instead, use set_target_properties.

llvm-svn: 369051

4 years ago[MemorySSA] Remove restrictive asserts.
Alina Sbirlea [Thu, 15 Aug 2019 21:20:08 +0000 (21:20 +0000)]
[MemorySSA] Remove restrictive asserts.

The verification I added has overly restrictive asserts.
Unreachable blocks can have any incoming value in practice, after an
update due to a "replaceAllUses" call when the repalced entry is
LiveOnEntry.

llvm-svn: 369050

4 years ago[Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug
Joel E. Denny [Thu, 15 Aug 2019 21:17:48 +0000 (21:17 +0000)]
[Rewrite][NFC] Add FIXMEs and tests for RemoveLineIfEmpty bug

I'd like to add these comments to warn others of problems I
encountered when trying to use `RemoveLineIfEmpty`.  I originally
tried to fix the problem, but I realized I could implement the
functionality more easily and efficiently in my calling code where I
can make the simplifying assumption that there are no prior edits to
the line from which text is being removed.  While I've lost the
motivation to write a fix, which doesn't look easy, I figure a warning
to others is better than silence.

I've added a unit test to demonstrate the problem.  I don't know how
to mark it as an expected failure, so I just marked it disabled.

Reviewed By: jkorous

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

llvm-svn: 369049

4 years ago[GWP-ASan] Implement stack frame compression.
Mitch Phillips [Thu, 15 Aug 2019 21:09:09 +0000 (21:09 +0000)]
[GWP-ASan] Implement stack frame compression.

Summary:
This patch introduces stack frame compression to GWP-ASan. Each stack frame is
variable-length integer encoded as the difference between frame[i] and
frame[i - 1]. Furthermore, we use zig-zag encoding on the difference to ensure
that negative differences are also encoded into a relatively small number of
bytes.

Examples of what the compression looks like can be seen in
`gwp_asan/tests/compression.cpp`.

This compression can reduce the memory consumption cost of stack traces by
~50%.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: mgorny, #sanitizers, llvm-commits, eugenis, morehouse

Tags: #sanitizers, #llvm

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

llvm-svn: 369048

4 years agogn build: Merge r369039
Nico Weber [Thu, 15 Aug 2019 21:00:33 +0000 (21:00 +0000)]
gn build: Merge r369039

llvm-svn: 369047

4 years agogn build: Merge r369018
Nico Weber [Thu, 15 Aug 2019 21:00:26 +0000 (21:00 +0000)]
gn build: Merge r369018

llvm-svn: 369046

4 years agoFix nm on GCC 5.1 after the C++14 move
JF Bastien [Thu, 15 Aug 2019 20:38:42 +0000 (20:38 +0000)]
Fix nm on GCC 5.1 after the C++14 move

Summary:
As in D66306, fix the invocation of std::sort with std::function by not using
std::function, since it's easier to read and is broken in libstdc++ from GCC 5.1
(see https://gcc.gnu.org/PR65942).

Reviewers: thakis

Subscribers: jkorous, mgrang, dexonsmith, rupprecht, llvm-commits

Tags: #llvm

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

llvm-svn: 369045

4 years agoMark the test as unsupported on darwin, NFC.
Alexey Bataev [Thu, 15 Aug 2019 20:31:47 +0000 (20:31 +0000)]
Mark the test as unsupported on darwin, NFC.

The bundler may fail on darwin, mark the test as not compatible.

llvm-svn: 369044

4 years ago[Sema] Implement DR2386 for C++17 structured binding
Reid Kleckner [Thu, 15 Aug 2019 19:45:28 +0000 (19:45 +0000)]
[Sema] Implement DR2386 for C++17 structured binding

Allow implementations to provide complete definitions of
std::tuple_size<T>, but to omit the 'value' member to signal that T is
not tuple-like. The Microsoft standard library implements
std::tuple_size<const T> this way.

If the value member exists, clang still validates that it is an ICE, but
if it does not, then the type is considered to not be tuple-like.

Fixes PR33236

Reviewers: rsmith

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

llvm-svn: 369043

4 years ago[WebAssembly] Correctly handle va_arg of zero-sized structures
Guanzhong Chen [Thu, 15 Aug 2019 19:33:36 +0000 (19:33 +0000)]
[WebAssembly] Correctly handle va_arg of zero-sized structures

Summary:
D66168 passes size 0 structs indirectly, while the wasm backend expects it to
be passed directly. This causes subsequent variadic arguments to be read
incorrectly.

This diff changes it so that size 0 structs are passed directly.

Reviewers: dschuff, tlively, sbc100

Reviewed By: dschuff

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

Tags: #clang

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

llvm-svn: 369042

4 years agoApply llvm-prefer-register-over-unsigned from clang-tidy to LLVM
Daniel Sanders [Thu, 15 Aug 2019 19:22:08 +0000 (19:22 +0000)]
Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM

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

Partial reverts in:
X86FrameLowering.cpp - Some functions return unsigned and arguably should be MCRegister
X86FixupLEAs.cpp - Some functions return unsigned and arguably should be MCRegister
X86FrameLowering.cpp - Some functions return unsigned and arguably should be MCRegister
HexagonBitSimplify.cpp - Function takes BitTracker::RegisterRef which appears to be unsigned&
MachineVerifier.cpp - Ambiguous operator==() given MCRegister and const Register
PPCFastISel.cpp - No Register::operator-=()
PeepholeOptimizer.cpp - TargetInstrInfo::optimizeLoadInstr() takes an unsigned&
MachineTraceMetrics.cpp - MachineTraceMetrics lacks a suitable constructor

Manual fixups in:
ARMFastISel.cpp - ARMEmitLoad() now takes a Register& instead of unsigned&
HexagonSplitDouble.cpp - Ternary operator was ambiguous between unsigned/Register
HexagonConstExtenders.cpp - Has a local class named Register, used llvm::Register instead of Register.
PPCFastISel.cpp - PPCEmitLoad() now takes a Register& instead of unsigned&

Depends on D65919

Reviewers: arsenm, bogner, craig.topper, RKSimon

Reviewed By: arsenm

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

Tags: #llvm

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

llvm-svn: 369041

4 years ago[Hexagon] Fix instruction selection for vselect v4i8
Krzysztof Parzyszek [Thu, 15 Aug 2019 19:20:09 +0000 (19:20 +0000)]
[Hexagon] Fix instruction selection for vselect v4i8

llvm-svn: 369040

4 years agoRevert [Bugpoint redesign] Added Pass to Remove Global Variables
Diego Trevino Ferrer [Thu, 15 Aug 2019 19:08:15 +0000 (19:08 +0000)]
Revert [Bugpoint redesign] Added Pass to Remove Global Variables

This reverts r368918 because it was unstable!

It broke these builds:
 * http://lab.llvm.org:8011/builders/lld-x86_64-ubuntu-fast/builds/4649
 * http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/29966
 * http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/29964

But surprisingly this passed:
 * http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/29965

llvm-svn: 369039

4 years agoMVT: Add v3i16/v3f16 vectors
Matt Arsenault [Thu, 15 Aug 2019 18:58:25 +0000 (18:58 +0000)]
MVT: Add v3i16/v3f16 vectors

AMDGPU has some buffer intrinsics which theoretically could use
this. Some of the generated tables include the 3 and 4 element vector
versions of these rounded to 64-bits, which is ambiguous. Add these to
help the table disambiguate these.

Assertion change is for the path odd sized vectors now take for R600.
v3i16 is widened to v4i16, which then needs to be promoted to v4i32.

llvm-svn: 369038

4 years ago[NFC] Add a couple of dump routines for RegisterPressure helper classes
Philip Reames [Thu, 15 Aug 2019 18:49:39 +0000 (18:49 +0000)]
[NFC] Add a couple of dump routines for RegisterPressure helper classes

llvm-svn: 369037

4 years ago[ValueTracking] Look through ptrmask intrinsics during getUnderlyingObject.
Florian Hahn [Thu, 15 Aug 2019 18:39:56 +0000 (18:39 +0000)]
[ValueTracking] Look through ptrmask intrinsics during getUnderlyingObject.

Reviewers: nlopes, efriedma, hfinkel, sanjoy, aqjune, jdoerfert

Reviewed By: jdoerfert

Subscribers: jdoerfert, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 369036

4 years agoRename this file from cx2.c to c2x.c; NFC.
Aaron Ballman [Thu, 15 Aug 2019 18:37:30 +0000 (18:37 +0000)]
Rename this file from cx2.c to c2x.c; NFC.

llvm-svn: 369035

4 years agoChange test to use uint64_t to support compiling for 32-bit architectures.
Adrian Prantl [Thu, 15 Aug 2019 18:37:11 +0000 (18:37 +0000)]
Change test to use uint64_t to support compiling for 32-bit architectures.

llvm-svn: 369034

4 years agoAllow standards-based attributes to have leading and trailing underscores.
Aaron Ballman [Thu, 15 Aug 2019 18:35:44 +0000 (18:35 +0000)]
Allow standards-based attributes to have leading and trailing underscores.

This gives library implementers a way to use standards-based attributes that do not conflict with user-defined macros of the same name. Attributes in C2x require this behavior normatively (C2x 6.7.11p4), but there's no reason to not have the same behavior in C++, especially given that such attributes may be used by a C library consumed by a C++ compilation.

llvm-svn: 369033

4 years ago[NFC] Added tests for 'select with ctlz to cttz' fold
David Bolvansky [Thu, 15 Aug 2019 18:23:37 +0000 (18:23 +0000)]
[NFC] Added tests for 'select with ctlz to cttz' fold

llvm-svn: 369032

4 years ago[X86] Add custom type legalization for bitcasting mmx to v2i32/v4i16/v8i8 to use...
Craig Topper [Thu, 15 Aug 2019 18:23:37 +0000 (18:23 +0000)]
[X86] Add custom type legalization for bitcasting mmx to v2i32/v4i16/v8i8 to use movq2dq instead of going through memory.

llvm-svn: 369031

4 years agoAdd LLVMLibC proposal to docs/index.rst.
Siva Chandra [Thu, 15 Aug 2019 18:08:11 +0000 (18:08 +0000)]
Add LLVMLibC proposal to docs/index.rst.

Reviewers: rupprecht

Subscribers: arphaman, llvm-commits

Tags: #llvm

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

llvm-svn: 369030

4 years agoLink libpthread into LLVMCore.so
Benjamin Kramer [Thu, 15 Aug 2019 18:06:30 +0000 (18:06 +0000)]
Link libpthread into LLVMCore.so

After r369018 the compiler can inline pthread calls into users of
RWMutex.

llvm-svn: 369029

4 years agoFix the test, NFC.
Alexey Bataev [Thu, 15 Aug 2019 17:53:49 +0000 (17:53 +0000)]
Fix the test, NFC.

llvm-svn: 369028

4 years agoRevert "MemoryBuffer: Add a missing error-check to getOpenFileImpl"
Pavel Labath [Thu, 15 Aug 2019 17:52:40 +0000 (17:52 +0000)]
Revert "MemoryBuffer: Add a missing error-check to getOpenFileImpl"

This reverts commit r368977 because it broke a couple of tests in lldb.

llvm-svn: 369027

4 years ago[DebugInfo] Avoid crash from dropped fragments in LiveDebugValues
Jeremy Morse [Thu, 15 Aug 2019 17:49:46 +0000 (17:49 +0000)]
[DebugInfo] Avoid crash from dropped fragments in LiveDebugValues

This patch avoids a crash caused by DW_OP_LLVM_fragments being dropped
from DIExpressions by LiveDebugValues spill-restore code. The appearance
of a previously unseen fragment configuration confuses LDV, as documented
in PR42773, and reproduced by the test function this patch adds (Crashes
on a x86_64 debug build).

To avoid this, on spill restore, we now use fragment information from the
spilt-location-expression.

In addition, when spilling, we now don't spill any DBG_VALUE with a complex
expression, as it can't be safely restored and will definitely lead to an
incorrect variable location. The discussion of this is in D65368.

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

llvm-svn: 369026

4 years ago[CallGraph] Refine call graph for indirect calls with !callees metadata
Mark Lacey [Thu, 15 Aug 2019 17:47:53 +0000 (17:47 +0000)]
[CallGraph] Refine call graph for indirect calls with !callees metadata

For indirect call sites having a small set of possible callees,
!callees metadata can be used to indicate what those callees are.
This patch updates the call graph and lazy call graph analyses so
that they consider this metadata when encountering call sites. For
the call graph, it adds a new external call graph node to the graph
for each unique !callees metadata node. A call graph edge connects
an indirect call site with the external node associated with the
!callees metadata that is attached to it. And there is an edge from
this external node to each of the callees indicated by the metadata.
Similarly, for the lazy call graph, the patch adds Ref edges from a
caller to the possible callees indicated by the metadata.

The primary purpose of the patch is to facilitate iterating over the
functions in a module such that all of the callees indicated by a
given !callees metadata node will be visited prior to the functions
containing call sites annotated by that node. This property is
required by optimizations performing a bottom-up traversal of the
SCC DAG. For example, the inliner can be made to inline through an
indirect call. If the call site is annotated with !callees metadata,
this patch ensures that the inliner will have visited all of the
callees prior to the caller, allowing it to reliably compute the
cost of inlining one or more of the potential callees.

Original patch by @mssimpso. I've made some small changes to get it
to apply, build, and pass tests on the top of tree, as well as
some minor tweaks to formatting and functionality.

Subscribers: mehdi_amini, hiraditya, llvm-commits, mssimpso

Tags: #llvm

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

llvm-svn: 369025

4 years ago[NewPM][PassInstrumentation] IR printing support for (Thin)LTO
Taewook Oh [Thu, 15 Aug 2019 17:47:44 +0000 (17:47 +0000)]
[NewPM][PassInstrumentation] IR printing support for (Thin)LTO

Summary: IR printing has not been correctly supported with (Thin)LTO if the new pass manager is enabled. Previously we only get outputs from backend(codegen) passes, as they are still under legacy pass manager even when the new pass manager is enabled. This patch addresses the issue and enables IR printing for optimization passes with new pass manager + (Thin)LTO setting.

Reviewers: fedor.sergeev, philip.pfaffe

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

Tags: #llvm

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

llvm-svn: 369024

4 years agoFix lld on GCC 5.1 after the C++14 move
JF Bastien [Thu, 15 Aug 2019 17:47:19 +0000 (17:47 +0000)]
Fix lld on GCC 5.1 after the C++14 move

Summary:
libstdc++ in GCC 5.1 has some bugs. The move to C++14 in D66195 triggered one
such bug caused by the new constexpr support in C++14, and the implementation
doing SFINAE wrong with the comparator to std::stable_sort.

Here's a small repro: https://godbolt.org/z/2QC3-n

The fix is to inline the lambdas directly into the llvm::stable_sort call
instead of erasing them through a std::function. The code is more readable as
well.

Reviewers: thakis, ruiu, espindola

Subscribers: emaste, arichardson, MaskRay, jkorous, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 369023

4 years ago[X86] Improve cost model for subvector extraction of less than 128-bit vectors
Craig Topper [Thu, 15 Aug 2019 17:29:42 +0000 (17:29 +0000)]
[X86] Improve cost model for subvector extraction of less than 128-bit vectors

Now that we're using widening legalization. We need to improve our extract_subvector cost model for these types. This patch begins by modeling these as a subvector extract followed by a permute. I've left FIXMEs in the code for future improvements.

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

llvm-svn: 369022

4 years ago[sanitizer_common] Always use posix_spawn on Darwin
Julian Lettner [Thu, 15 Aug 2019 17:25:10 +0000 (17:25 +0000)]
[sanitizer_common] Always use posix_spawn on Darwin

On Darwin we have two external symbolizers: atos and llvm-symbolizer.
atos was changed to use posix_spawn (instead of fork+execv) in a
previous commit [1]. Let's use posix_spawn for llvm-symbolizer as well.

Our hope is that eventually we can transition to posix_spawn on other
platforms too.

[1] 399408a92f1dbbefeb708f718b0d8eb62dfa9f09

llvm-svn: 369021

4 years agoTest commit #2.
George Karpenkov [Thu, 15 Aug 2019 17:17:21 +0000 (17:17 +0000)]
Test commit #2.

llvm-svn: 369020

4 years ago[Driver][Bundler] Improve bundling of object files.
Alexey Bataev [Thu, 15 Aug 2019 17:15:35 +0000 (17:15 +0000)]
[Driver][Bundler] Improve bundling of object files.

Summary:
Previously, object files were bundled using partial linking. It resulted
in the following structure of the bundled objects:
```
<host_code>
clang-offload-bundle
__CLANG_OFFLOAD_BUNDLE__<target>
<target_code>
```
But when we tried to unbundle object files, it worked correctly only for
the target objects. The host object remains bundled. It produced a lot of
junk sections in the host object files and in some cases may caused
incorrect linking.

Patch improves bundling of the object files. After this patch the
bundled object looks like this:

```
<host_code>
clang-offload-bundle
__CLANG_OFFLOAD_BUNDLE__<target>
<target_code>
__CLANG_OFFLOAD_BUNDLE__<host>
<host_code>
```

With this structure we are able to unbundle the host object files too so
that after unbundling they are the same as were before.
The host section is bundled twice. The bundled section is used to
unbundle the original host section.

Reviewers: yaxunl, tra, jlebar, hfinkel, jdoerfert

Subscribers: caomhin, kkwli0, cfe-commits

Tags: #clang

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

llvm-svn: 369019

4 years ago[Support] Base RWMutex on std::shared_timed_mutex (C++14)
Benjamin Kramer [Thu, 15 Aug 2019 16:55:23 +0000 (16:55 +0000)]
[Support] Base RWMutex on std::shared_timed_mutex (C++14)

This should have the same semantics. We use std::shared_mutex instead on
MSVC and C++17, std::shared_timed_mutex is less efficient than our
custom implementation on Windows, std::shared_mutex should be faster.

llvm-svn: 369018

4 years ago[LLVM][Alignment] Fix MSVC potential division by 0 warning (PR42911)
Simon Pilgrim [Thu, 15 Aug 2019 16:34:23 +0000 (16:34 +0000)]
[LLVM][Alignment] Fix MSVC potential division by 0 warning (PR42911)

Original Patch by @gchatelet (Guillaume Chatelet)

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

llvm-svn: 369016

4 years ago[BUNDLER]Improve the test, NFC.
Alexey Bataev [Thu, 15 Aug 2019 16:28:24 +0000 (16:28 +0000)]
[BUNDLER]Improve the test, NFC.

Summary:
Make the test more portable and do not rely on the pre-bundled object
file.

Reviewers: Hahnfeld, hfinkel, jdoerfert

Subscribers: caomhin, kkwli0, cfe-commits

Tags: #clang

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

llvm-svn: 369015

4 years ago[Hexagon] Generate vector min/max for HVX
Krzysztof Parzyszek [Thu, 15 Aug 2019 16:13:17 +0000 (16:13 +0000)]
[Hexagon] Generate vector min/max for HVX

llvm-svn: 369014

4 years ago[llvm] Migrate llvm::make_unique to std::make_unique
Jonas Devlieghere [Thu, 15 Aug 2019 15:54:37 +0000 (15:54 +0000)]
[llvm] Migrate llvm::make_unique to std::make_unique

Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances across the monorepo.

llvm-svn: 369013

4 years agoAdd a proposal for a libc project under the LLVM umbrella.
Siva Chandra [Thu, 15 Aug 2019 15:50:42 +0000 (15:50 +0000)]
Add a proposal for a libc project under the LLVM umbrella.

Reviewers: chandlerc, dlj, echristo, hfinkel, jfb, zturner

Subscribers: dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 369012

4 years ago[cmake] install_symlink should obey DESTDIR unconditionally
Justin Bogner [Thu, 15 Aug 2019 15:36:13 +0000 (15:36 +0000)]
[cmake] install_symlink should obey DESTDIR unconditionally

Setting DESTDIR was erroneously buried under a condition here - if
it's set it should always be used.

llvm-svn: 369011

4 years ago[MCA] Slightly refactor class RetireControlUnit, and add the ability to override...
Andrea Di Biagio [Thu, 15 Aug 2019 15:27:40 +0000 (15:27 +0000)]
[MCA] Slightly refactor class RetireControlUnit, and add the ability to override the mask of used buffered resources in class mca::Instruction. NFCI

This patch teaches the RCU how to peek 'next' RCUTokens. A new method has been
added to the RetireControlUnit class with the goal of minimizing the complexity
of follow-up patches that will enable macro-fusion support in mca.

This patch also adds method Instruction::getNumMicroOpcodes() to simplify common
interactions with the instruction descriptor (a pattern quite common in some
pipeline stages).

Added the ability to override the default set of consumed scheduler resources
(this -again- is to simplify future patches that add support for macro-op fusion).

No functional change intended.

llvm-svn: 369010

4 years agoRe-land "[compiler-rt] Migrate llvm::make_unique to std::make_unique"
Jonas Devlieghere [Thu, 15 Aug 2019 14:57:44 +0000 (14:57 +0000)]
Re-land "[compiler-rt] Migrate llvm::make_unique to std::make_unique"

With the compiler-rt check for C++14 updated in r368960, this should now
be fine to land.

llvm-svn: 369009

4 years agoRemove SmallBitVector.h include. NFCI.
Simon Pilgrim [Thu, 15 Aug 2019 14:40:37 +0000 (14:40 +0000)]
Remove SmallBitVector.h include. NFCI.

SmallBitVector/BitVector types aren't used at all in the cpp file.

llvm-svn: 369008

4 years agoRemove BitVector.h include. NFCI.
Simon Pilgrim [Thu, 15 Aug 2019 14:39:28 +0000 (14:39 +0000)]
Remove BitVector.h include. NFCI.

BitVector type isn't used at all in the cpp file.

llvm-svn: 369007

4 years ago[PowerPC] Use xxleqv to set all one vector IMM(-1).
Jinsong Ji [Thu, 15 Aug 2019 14:32:51 +0000 (14:32 +0000)]
[PowerPC] Use xxleqv to set all one vector IMM(-1).

Summary:
xxspltib/vspltisb are 3 cycle PM instructions,
xxleqv is 2 cycle ALU instruction.

We should use xxleqv to set all one vectors.

Reviewers: hfinkel, nemanjai, steven.zhang

Subscribers: hiraditya, kbarton, MaskRay, shchenz, llvm-commits

Tags: #llvm

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

llvm-svn: 369006

4 years ago[clangd] Don't use Bind() where C++14 move capture works
Benjamin Kramer [Thu, 15 Aug 2019 14:16:06 +0000 (14:16 +0000)]
[clangd] Don't use Bind() where C++14 move capture works

llvm-svn: 369005

4 years ago[lib/Object] - Remove objdump-file-header.test
George Rimar [Thu, 15 Aug 2019 13:39:58 +0000 (13:39 +0000)]
[lib/Object] - Remove objdump-file-header.test

objdump-file-header.test is placed in the wrong folder.
I removed it and updated the existent llvm-objdump test cases with
the updated content of the file removed.

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

llvm-svn: 369004

4 years ago[OpenMP] Enable warning about "implicit fallthrough"
Jonas Hahnfeld [Thu, 15 Aug 2019 13:26:55 +0000 (13:26 +0000)]
[OpenMP] Enable warning about "implicit fallthrough"

Fix last warned location in ittnotify_static.cpp using the defined
macro KMP_FALLTHROUGH().

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

llvm-svn: 369003

4 years ago[OpenMP] Remove 'unnecessary parentheses'
Jonas Hahnfeld [Thu, 15 Aug 2019 13:26:41 +0000 (13:26 +0000)]
[OpenMP] Remove 'unnecessary parentheses'

The variables in kmp_lock.cpp are really arrays of function pointers
that return void or int, not pointers to functions that return void*
or int*. The other changes are only cosmetic.

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

llvm-svn: 369002

4 years ago[OMPT] Resolve warnings because of ints in if conditions
Jonas Hahnfeld [Thu, 15 Aug 2019 13:26:29 +0000 (13:26 +0000)]
[OMPT] Resolve warnings because of ints in if conditions

The implementation status can only be one of
ompt_event_UNIMPLEMENTED = ompt_set_never = 1
ompt_event_MAY_ALWAYS = ompt_set_always = 5

In both cases, the condition was already true, so just remove
the check.

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

llvm-svn: 369001

4 years ago[lldb][NFC] Refactor remaining completion logic to use CompletionRequests
Raphael Isemann [Thu, 15 Aug 2019 13:14:10 +0000 (13:14 +0000)]
[lldb][NFC] Refactor remaining completion logic to use CompletionRequests

This patch moves the remaining completion functions from the
old completion API (that used several variables) to just
passing a single CompletionRequest.

This is for the most part a simple change as we just replace
the old arguments with a single CompletionRequest argument.

There are a few places where I had to create new CompletionRequests
in the called functions as CompletionRequests itself are immutable
and don't expose their internal match list anymore. This means that
if a function wanted to change the CompletionRequest or directly
access the result list, we need to work around this by creating
a new CompletionRequest and a temporary match/description list.

Preparation work for rdar://53769355

llvm-svn: 369000

4 years ago[OpenMP] Turn on -Wall compiler warnings by default
Jonas Hahnfeld [Thu, 15 Aug 2019 13:11:50 +0000 (13:11 +0000)]
[OpenMP] Turn on -Wall compiler warnings by default

Instead, maintain a list of disabled options to still build libomp and
libomptarget without warnings. This includes -Wno-error and -Wno-pedantic
to silence warnings that LLVM enables when building in-tree.

I tested the following compilers:
 * Clang 6.0, 7.0, 8.0
 * GCC 4.8.5 (CentOS 7), GCC 6, 7, 8, 9
 * Intel Compiler 16, 17, 18, 19

RFC thread on openmp-dev mailing list:
http://lists.llvm.org/pipermail/openmp-dev/2019-August/002668.html

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

llvm-svn: 368999

4 years ago[DAGCombine] MergeConsecutiveStores - fix cppcheck/MSVC extension warning. NFCI.
Simon Pilgrim [Thu, 15 Aug 2019 13:07:14 +0000 (13:07 +0000)]
[DAGCombine] MergeConsecutiveStores - fix cppcheck/MSVC extension warning. NFCI.

Set the StartIdx type to size_t so that it matches the StoreNodes SmallVector size() and index types.

Silences the MSVC analyzer warning that unsigned increment might overflow before exceeding size_t on 64-bit targets - this isn't likely to happen but it means we use consistent types and reduces the warning "noise" a little.

llvm-svn: 368998

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

Summary:

This patch has trigger a bug of r368339, and the r368339 has been reverted, So upstream this patch again.

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

Reviewed By: efriedma

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

llvm-svn: 368997

4 years ago[ARM] Fix alignment checks for BE VLDRH
David Green [Thu, 15 Aug 2019 12:54:47 +0000 (12:54 +0000)]
[ARM] Fix alignment checks for BE VLDRH

We need to allow any alignment at least 2, not just exactly 2, so that the big
endian loads and stores can be selected successfully. I've also added extra BE
testing for the load and store tests.

Thanks to Oliver for the report.

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

llvm-svn: 368996

4 years ago[SDAG][x86] check for relaxed math when matching an FP reduction
Sanjay Patel [Thu, 15 Aug 2019 12:43:15 +0000 (12:43 +0000)]
[SDAG][x86] check for relaxed math when matching an FP reduction

If the last step in an FP add reduction allows reassociation and doesn't care
about -0.0, then we are free to recognize that computation as a reduction
that may reorder the intermediate steps.

This is requested directly by PR42705:
https://bugs.llvm.org/show_bug.cgi?id=42705
and solves PR42947 (if horizontal math instructions are actually faster than
the alternative):
https://bugs.llvm.org/show_bug.cgi?id=42947

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

llvm-svn: 368995

4 years ago[MCA] Slightly refactor the logic in ResourceManager. NFCI
Andrea Di Biagio [Thu, 15 Aug 2019 12:39:55 +0000 (12:39 +0000)]
[MCA] Slightly refactor the logic in ResourceManager. NFCI

This patch slightly changes the API in the attempt to simplify resource buffer
queries. It is done in preparation for a patch that will enable support for
macro fusion.

llvm-svn: 368994

4 years ago[ValueTracking] Add MustPreserveNullness arg to functions analyzing calls. (NFC)
Florian Hahn [Thu, 15 Aug 2019 12:13:02 +0000 (12:13 +0000)]
[ValueTracking] Add MustPreserveNullness arg to functions analyzing calls. (NFC)

Some uses of getArgumentAliasingToReturnedPointer and
isIntrinsicReturningPointerAliasingArgumentWithoutCapturing require the
calls/intrinsics to preserve the nullness of the argument.

For alias analysis, the nullness property does not really come into
play.

This patch explicitly sets it to true. In D61669, the alias analysis
uses will be switched to not require preserving nullness.

Reviewers: nlopes, efriedma, hfinkel, sanjoy, aqjune, jdoerfert

Reviewed By: jdoerfert

Tags: #llvm

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

llvm-svn: 368993

4 years ago[ADT] PointerUnion: Use C++14 constexpr std::min
Benjamin Kramer [Thu, 15 Aug 2019 11:49:00 +0000 (11:49 +0000)]
[ADT] PointerUnion: Use C++14 constexpr std::min

llvm-svn: 368992

4 years ago[clangd] llvm::integer_sequence -> std::integer_sequence.
Benjamin Kramer [Thu, 15 Aug 2019 11:09:22 +0000 (11:09 +0000)]
[clangd] llvm::integer_sequence -> std::integer_sequence.

llvm-svn: 368991

4 years agoReplace llvm::integer_sequence and friends with the C++14 standard version
Benjamin Kramer [Thu, 15 Aug 2019 10:56:05 +0000 (10:56 +0000)]
Replace llvm::integer_sequence and friends with the C++14 standard version

The implementation in libc++ takes O(1) compile time, ours was O(n).

llvm-svn: 368990

4 years agoBump llvm-go to C++14
Benjamin Kramer [Thu, 15 Aug 2019 10:55:25 +0000 (10:55 +0000)]
Bump llvm-go to C++14

llvm-svn: 368989

4 years ago[ARM] MVE predicate store patterns
David Green [Thu, 15 Aug 2019 10:41:42 +0000 (10:41 +0000)]
[ARM] MVE predicate store patterns

Stack loads and stores were already working, but direct stores were not. This
adds the patterns for them, same as predicate loads.

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

llvm-svn: 368988

4 years ago[AArch64] Change location of frame-record within callee-save area.
Sander de Smalen [Thu, 15 Aug 2019 10:34:16 +0000 (10:34 +0000)]
[AArch64] Change location of frame-record within callee-save area.

This patch changes the location of the frame-record (FP, LR) to the
bottom of the callee-saved area. According to the AAPCS the location of
the frame-record within the stackframe is unspecified (section 5.2.3 The
Frame Pointer), so the compiler should be free to choose a different
location.

The reason for changing the location of the frame-record is to prepare
the frame for allocating an SVE area below the callee-saves. This way the
compiler can use the VL-scaled addressing modes to directly access SVE
objects from the frame-pointer.

            :                :
        | stack |        | stack |
        |  args |        |  args |
        +-------+        +-------+
        |  x30  |        |  x19  |
        |  x29  |        |  x20  |
  FP -> |- - - -|        |  x21  |
        |  x19  |   ==>  |  x22  |
        |  x20  |        |- - - -|
        |  x21  |        |  x30  |
        |  x22  |        |  x29  |
        +-------+        +-------+ <- FP
        |///////|        |///////|         // realignment gap
        |- - - -|        |- - - -|
        |spills/|        |spills/|
        | locals|        | locals|
  SP -> +-------+        +-------+ <- SP

Things to point out:
- The algorithm to find a paired register should be prevented from
  accidentally pairing some callee-saved register with LR that is not
  FP, since they should always be paired together when the frame
  has a frame-record.
- For Darwin platforms the location of the frame-record is unchanged,
  since the unwind encoding does not allow for encoding this position
  dynamically and other tools currently depend on the former layout.

Reviewers: efriedma, rovka, rengolin, thegameg, greened, t.p.northover

Reviewed By: efriedma

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

llvm-svn: 368987

4 years agoAdd ptrmask intrinsic
Florian Hahn [Thu, 15 Aug 2019 10:12:26 +0000 (10:12 +0000)]
Add ptrmask intrinsic

This patch adds a ptrmask intrinsic which allows masking out bits of a
pointer that must be zero when accessing it, because of ABI alignment
requirements or a restriction of the meaningful bits of a pointer
through the data layout.

This avoids doing a ptrtoint/inttoptr round trip in some cases (e.g. tagged
pointers) and allows us to not lose information about the underlying
object.

Reviewers: nlopes, efriedma, hfinkel, sanjoy, jdoerfert, aqjune

Reviewed by: sanjoy, jdoerfert

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

llvm-svn: 368986

4 years agoRevert rL368939 "Remove LVALUE / RVALUE workarounds"
Russell Gallop [Thu, 15 Aug 2019 10:12:11 +0000 (10:12 +0000)]
Revert rL368939 "Remove LVALUE / RVALUE workarounds"

This reverts commit cad8356d699b36c73abb267f65db575ddacbd652.

To unbreak Windows bots

llvm-svn: 368985

4 years ago[Support] Fix Wundef warning
Sven van Haastregt [Thu, 15 Aug 2019 10:05:22 +0000 (10:05 +0000)]
[Support] Fix Wundef warning

llvm-svn: 368984

4 years ago[ELF][AArch64] Improve error message for unknown relocations
Fangrui Song [Thu, 15 Aug 2019 10:02:54 +0000 (10:02 +0000)]
[ELF][AArch64] Improve error message for unknown relocations

Like rLLD354040.

Previously, for unrecognized relocation types, in -no-pie/-pie mode, we got something like:

  foo.o: unrecognized relocation ...

In -shared mode:

  error: can't create dynamic relocation ... against symbol: yyy in readonly segment

Delete the default case from AArch64::getRelExpr and add the error there.

Reviewed By: grimar

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

llvm-svn: 368983

4 years ago[llvm-objcopy] Allow 'protected' visibility to be set when using
Chris Jackson [Thu, 15 Aug 2019 09:45:09 +0000 (09:45 +0000)]
[llvm-objcopy] Allow 'protected' visibility to be set when using
add-symbol

Reviewers: Maskray, rupprecht

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

llvm-svn: 368982

4 years ago[ARM] MVE trunc to i1 vectors
David Green [Thu, 15 Aug 2019 09:26:51 +0000 (09:26 +0000)]
[ARM] MVE trunc to i1 vectors

This adds patterns for selecting trunc instructions from full vectors to i1's
vectors.

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

llvm-svn: 368981

4 years ago[analyzer] Warn about -analyzer-configs being meant for development purposes only
Kristof Umann [Thu, 15 Aug 2019 08:53:16 +0000 (08:53 +0000)]
[analyzer] Warn about -analyzer-configs being meant for development purposes only

This is more of a temporary fix, long term, we should convert AnalyzerOptions.def
into the universally beloved (*coughs*) TableGen format, where they can more
easily be separated into developer-only, alpha, and user-facing configs.

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

llvm-svn: 368980

4 years ago[analyzer] Add docs for cplusplus.InnerPointer
Kristof Umann [Thu, 15 Aug 2019 08:52:10 +0000 (08:52 +0000)]
[analyzer] Add docs for cplusplus.InnerPointer

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

llvm-svn: 368979

4 years ago[InstCombine] Precommit test case for D66216
Florian Hahn [Thu, 15 Aug 2019 08:42:12 +0000 (08:42 +0000)]
[InstCombine] Precommit test case for D66216

llvm-svn: 368978

4 years agoMemoryBuffer: Add a missing error-check to getOpenFileImpl
Pavel Labath [Thu, 15 Aug 2019 08:20:15 +0000 (08:20 +0000)]
MemoryBuffer: Add a missing error-check to getOpenFileImpl

Summary:
In case the function was called with a desired read size *and* the file
was not an "mmap()" candidate, the function was falling back to a
"pread()", but it was failing to check the result of that system call.
This meant that the function would return "success" even though the read
operation failed, and it returned a buffer full of uninitialized memory.

Reviewers: rnk, dblaikie

Subscribers: kristina, llvm-commits

Tags: #llvm

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

llvm-svn: 368977

4 years ago[clang] Loop pragma parsing. NFC.
Sjoerd Meijer [Thu, 15 Aug 2019 07:39:05 +0000 (07:39 +0000)]
[clang] Loop pragma parsing. NFC.

Just a refactoring and a tidy up.

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

llvm-svn: 368976

4 years ago[lldb] Let LLDB depend on intrinsics_gen to fix non-deterministic module build failures
Raphael Isemann [Thu, 15 Aug 2019 07:29:53 +0000 (07:29 +0000)]
[lldb] Let LLDB depend on intrinsics_gen to fix non-deterministic module build failures

Summary:
When building with modules we currently fail randomly to build LLDB's modules and get error messages like below:
```
In file included from <module-includes>:1:
In file included from llvm-project/llvm/include/llvm/IR/Argument.h:18:
llvm-project/llvm/include/llvm/IR/Attributes.h:74:14: fatal error: 'llvm/IR/Attributes.inc' file not found
    #include "llvm/IR/Attributes.inc"
             ^~~~~~~~~~~~~~~~~~~~~~~~
...
In file included from llvm-project/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp:9:
llvm-project/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.h:12:10: fatal error: could not build module 'lldb_Wrapper'
```

The reason for this is that our source files can include Clang headers which in turn include files like Attributes.inc which
are generated by intrinsics_gen. However, it seems Clang can't express this dependency in its CMake code, so intrinsics_gen
is actually not guaranteed to be built before we start parsing LLDB source files and Clang headers. Clang worked around this
by letting all libraries depend on intrinsics_gen, which at least lets their builds pass.

As I haven't figured out how to solve these dependencies properly and I want to get the LLDB+Modules build green,
I suggest we copy Clang's hack until we figure out how to get Clang's dependencies right.

Reviewers: sgraenitz, aprantl, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: mgorny, javed.absar, kristof.beyls, mgrang, lldb-commits

Tags: #lldb

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

llvm-svn: 368975

4 years ago[llvm-readobj][MachO] Fix section type printing
Seiya Nuta [Thu, 15 Aug 2019 07:22:04 +0000 (07:22 +0000)]
[llvm-readobj][MachO] Fix section type printing

Summary:
Currently, llvm-readobj mistakenly decodes section type as section attribute.

This patch fixes the bug and affected tests.

Reviewers: JDevlieghere, jhenderson, rupprecht, alexshap, echristo

Reviewed By: jhenderson, rupprecht, alexshap, echristo

Subscribers: javed.absar, rupprecht, llvm-commits

Tags: #llvm

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

llvm-svn: 368974

4 years ago[LV] fold-tail predication should be respected even with assume_safety
Dorit Nuzman [Thu, 15 Aug 2019 07:12:14 +0000 (07:12 +0000)]
[LV] fold-tail predication should be respected even with assume_safety

assume_safety implies that loads under "if's" can be safely executed
speculatively (unguarded, unmasked). However this assumption holds only for the
original user "if's", not those introduced by the compiler, such as the
fold-tail "if" that guards us from loading beyond the original loop trip-count.
Currently the combination of fold-tail and assume-safety pragmas results in
ignoring the fold-tail predicate that guards the loads, generating unmasked
loads. This patch fixes this behavior.

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

Reviewers: Ayal, hsaito, fhahn
llvm-svn: 368973

4 years ago[X86] Add isel pattern to match VZEXT_MOVL and a v2i64 scalar_to_vector bitcasted...
Craig Topper [Thu, 15 Aug 2019 06:46:30 +0000 (06:46 +0000)]
[X86] Add isel pattern to match VZEXT_MOVL and a v2i64 scalar_to_vector bitcasted from x86mmx to MOVQ2DQ.

We already had the pattern for just the scalar to vector and bitcast,
but not the case where we wanted zeroes in the high half of the xmm.

llvm-svn: 368972

4 years ago[X86] Make sure load is non-volatile in the MMX_X86movdq2q (loadv2i64) isel pattern.
Craig Topper [Thu, 15 Aug 2019 06:46:26 +0000 (06:46 +0000)]
[X86] Make sure load is non-volatile in the MMX_X86movdq2q (loadv2i64) isel pattern.

This pattern will narrow the load so we should make sure its not
volatile.

llvm-svn: 368971

4 years ago[Clang] Pragma vectorize_predicate implies vectorize
Sjoerd Meijer [Thu, 15 Aug 2019 06:24:40 +0000 (06:24 +0000)]
[Clang] Pragma vectorize_predicate implies vectorize

New pragma "vectorize_predicate(enable)" now implies "vectorize(enable)",
and it is ignored when vectorization is disabled with e.g.
"vectorize(disable) vectorize_predicate(enable)".

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

llvm-svn: 368970

4 years ago[X86] Add test cases for _mm_movepi64_pi64 and _mm_movpi64_epi64.
Craig Topper [Thu, 15 Aug 2019 06:20:33 +0000 (06:20 +0000)]
[X86] Add test cases for _mm_movepi64_pi64 and _mm_movpi64_epi64.

llvm-svn: 368969

4 years ago[X86] Remove unneeded isel pattern for v4f32->v4i32 fp_to_sint and conversion to...
Craig Topper [Thu, 15 Aug 2019 05:52:02 +0000 (05:52 +0000)]
[X86] Remove unneeded isel pattern for v4f32->v4i32 fp_to_sint and conversion to MMX.

fp_to_sint is turned into X86cvttp2si during isel preprocessing.
The other redundant isel patterns were removed previously, but I
missed this one because its in the MMX td file.

llvm-svn: 368968

4 years ago[X86] Disable custom type legalization for v2i32/v4i16/v8i8->i64.
Craig Topper [Thu, 15 Aug 2019 05:51:58 +0000 (05:51 +0000)]
[X86] Disable custom type legalization for v2i32/v4i16/v8i8->i64.

The default legalization can take care of this.

llvm-svn: 368967

4 years ago[X86] Disable custom type legalization for v2i32/v4i16/v8i8->f64 bitcast.
Craig Topper [Thu, 15 Aug 2019 05:51:54 +0000 (05:51 +0000)]
[X86] Disable custom type legalization for v2i32/v4i16/v8i8->f64 bitcast.

The generic legalization handles this in the same way so just use
that.

llvm-svn: 368966

4 years ago[X86] Remove some unreachable code from LowerBITCAST.
Craig Topper [Thu, 15 Aug 2019 05:51:50 +0000 (05:51 +0000)]
[X86] Remove some unreachable code from LowerBITCAST.

llvm-svn: 368965

4 years ago[ELF][PPC] Improve error message for unknown relocations
Fangrui Song [Thu, 15 Aug 2019 05:22:23 +0000 (05:22 +0000)]
[ELF][PPC] Improve error message for unknown relocations

Like rLLD354040.

Previously, for unrecognized relocation types, in -no-pie mode:

  foo.o: unrecognized reloc 256

In -pie/-shared mode:

  error: can't create dynamic relocation R_PPC_xxx against symbol: yyy in readonly segment

llvm-svn: 368964

4 years ago[llvm-objdump] Add warning messages if disassembly + source for problematic inputs
Michael Pozulp [Thu, 15 Aug 2019 05:15:22 +0000 (05:15 +0000)]
[llvm-objdump] Add warning messages if disassembly + source for problematic inputs

Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=41905

Reviewers: jhenderson, rupprecht, grimar

Reviewed By: jhenderson, grimar

Subscribers: RKSimon, MaskRay, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 368963

4 years agoFix variable mismatch between signature and body
Jonas Devlieghere [Thu, 15 Aug 2019 05:09:09 +0000 (05:09 +0000)]
Fix variable mismatch between signature and body

I updated the signature to conform to the LLDB coding style but
accidentally forgot to update the function body.

llvm-svn: 368962

4 years ago[llvm-objcopy] Move duplicate tablegen from objcopy and strip into one file
Michael Pozulp [Thu, 15 Aug 2019 04:45:41 +0000 (04:45 +0000)]
[llvm-objcopy] Move duplicate tablegen from objcopy and strip into one file

Summary: This avoids maintaining the same options in two different places.

Reviewers: jhenderson, alexshap, rupprecht, MaskRay

Reviewed By: jhenderson, rupprecht, MaskRay

Subscribers: MaskRay, wolfgangp, jakehehrlich, abrachet, llvm-commits

Tags: #llvm

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

llvm-svn: 368961

4 years ago[CMake] Check for C++14 instead of C++11
Jonas Devlieghere [Thu, 15 Aug 2019 04:42:15 +0000 (04:42 +0000)]
[CMake] Check for C++14 instead of C++11

Now that LLVM moved to C++14, `COMPILER_RT_HAS_STD_CXX11_FLAG` should
become `COMPILER_RT_HAS_STD_CXX14_FLAG`.

I ran into this issue when replacing llvm::make_unique with
std::make_unique in an X-ray unit test. We are correctly passing
`-std=c++14`, but this got overwritten further down the invocation by
the compiler-rt flags. Given that this unit test is using LLVM headers,
this is bound to break sooner than later, regardless of my change.

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

llvm-svn: 368960

4 years ago[NFC] Fix documentation for some utility classes.
Jonas Devlieghere [Thu, 15 Aug 2019 04:35:46 +0000 (04:35 +0000)]
[NFC] Fix documentation for some utility classes.

This fixes a few warnings emitted when compiling with -Wdocumentation.

llvm-svn: 368959

4 years ago[Tooling] Add a hack to work around issues with matcher binding in r368681.
David L. Jones [Thu, 15 Aug 2019 04:10:11 +0000 (04:10 +0000)]
[Tooling] Add a hack to work around issues with matcher binding in r368681.

The change in r368681 contains a (probably unintentional) behavioral change for
rewrite rules with a single matcher. Previously, the single matcher would not
need to be bound (`joinCaseMatchers` returned it directly), even though a final
DynTypeMatcher was created and bound by `buildMatcher`. With the new change, a
single matcher will be bound, in addition to the final binding (which is now in
`buildMatchers`, but happens roughly at the same point in the overall flow).

This patch simply duplicates the "final matcher" trick: it creates an extra
DynTypedMatcher for each rewrite rule case matcher, and unconditionally makes it
bindable. This is probably not the right long-term fix, but it does allow
existing code to continue to work with this interface.

Subscribers: cfe-commits, gribozavr, ymandel

Tags: #clang

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

llvm-svn: 368958

4 years ago[NFC] Remove documentation comment to fix warning.
Jonas Devlieghere [Thu, 15 Aug 2019 04:09:00 +0000 (04:09 +0000)]
[NFC] Remove documentation comment to fix warning.

Remove the @return to fix the warning: '@returns' command used in a
comment that is attached to a function returning void [-Wdocumentation]

llvm-svn: 368957

4 years ago[X86] Remove some dead code and combine some repeated code that's left.
Craig Topper [Thu, 15 Aug 2019 04:07:43 +0000 (04:07 +0000)]
[X86] Remove some dead code and combine some repeated code that's left.

If the width is 256 bits, then we must have AVX so the else here
was unnecessary. Once that's removed then the >= 256 bit code is
identical to the 128 bit code with a different VT so combine them.

llvm-svn: 368956

4 years ago[NFC] Update doc comment to fix warning.
Jonas Devlieghere [Thu, 15 Aug 2019 03:59:30 +0000 (03:59 +0000)]
[NFC] Update doc comment to fix warning.

This fixes the warning: parameter 'EnableNullFPSuppression' not found in
the function declaration [-Wdocumentation]

llvm-svn: 368954

4 years agoRevert "Expose TailCallKind via the LLVM C API"
Jonas Devlieghere [Thu, 15 Aug 2019 03:49:51 +0000 (03:49 +0000)]
Revert "Expose TailCallKind via the LLVM C API"

This is failing on several build bots. Reverting as discussed in
https://reviews.llvm.org/D66061.

llvm-svn: 368953

4 years agoRevert "[compiler-rt] Migrate llvm::make_unique to std::make_unique"
Jonas Devlieghere [Thu, 15 Aug 2019 03:02:57 +0000 (03:02 +0000)]
Revert "[compiler-rt] Migrate llvm::make_unique to std::make_unique"

The X-ray unit tests in compiler-rt are overriding the C++ version by
explicitly passing -std=c++11 in the compiler invocation. This poses a
problem as these tests are including LLVM headers that can now use C++14
features. I'm temporarily reverting this as I investigate the correct
solution.

llvm-svn: 368952

4 years agogn build: Merge r368918
Vitaly Buka [Thu, 15 Aug 2019 01:38:30 +0000 (01:38 +0000)]
gn build: Merge r368918

llvm-svn: 368951