platform/upstream/llvm.git
4 years agoInline diagnostic text into .td file. NFC.
Richard Trieu [Thu, 8 Aug 2019 01:45:31 +0000 (01:45 +0000)]
Inline diagnostic text into .td file.  NFC.

llvm-svn: 368244

4 years ago[Utility] Remove unused function 'GetMatchSpanningIndices'
Jonas Devlieghere [Thu, 8 Aug 2019 01:44:03 +0000 (01:44 +0000)]
[Utility] Remove unused function 'GetMatchSpanningIndices'

llvm-svn: 368243

4 years agoAdd LLD as a requirement for hwasan tests because of change in r368111.
Douglas Yung [Thu, 8 Aug 2019 01:08:22 +0000 (01:08 +0000)]
Add LLD as a requirement for hwasan tests because of change in r368111.

llvm-svn: 368242

4 years ago[llvm-strip] Support --strip-sections
Wolfgang Pieb [Thu, 8 Aug 2019 00:35:16 +0000 (00:35 +0000)]
[llvm-strip] Support --strip-sections

llvm-objcopy already supports --strip-sections. It is a good fit for its alias llvm-strip
to support it as well.

Reviewers: rupprecht, jhenderson

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

llvm-svn: 368241

4 years agoRevert "[libc++] Take 3: Do not cleverly link against libc++abi just because it happe...
Louis Dionne [Thu, 8 Aug 2019 00:28:06 +0000 (00:28 +0000)]
Revert "[libc++] Take 3: Do not cleverly link against libc++abi just because it happens to be there"

This also reverts "[libc++] Remove temporary hack for D63883".
Clearly, I don't understand how the Linux build bots are configured.

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

llvm-svn: 368238

4 years agoUpdate fix-it hints for std::move warnings.
Richard Trieu [Thu, 8 Aug 2019 00:12:51 +0000 (00:12 +0000)]
Update fix-it hints for std::move warnings.

Fix -Wpessimizing-move and -Wredundant-move when warning on initializer lists.
The new fix-it hints for removing the std::move call will now also suggest
removing the braces for the initializer list so that the resulting code will
still be compilable.

This fixes PR42832

llvm-svn: 368237

4 years ago[llvm-lipo] Update llvm-lipo docs for -info -thin -create -replace -segalign flags
Anusha Basana [Wed, 7 Aug 2019 23:25:12 +0000 (23:25 +0000)]
[llvm-lipo] Update llvm-lipo docs for -info -thin -create -replace -segalign flags

Summary:
The information for -info -thin -create -replace and -segalign flags are added to llvm-lipo.rst

Test Plan:

Reviewers: smeenai, alexshap, compnerd, mtrent

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 368235

4 years ago[ScalarizeMaskedMemIntrin] Add test case for expanding scatter.
Craig Topper [Wed, 7 Aug 2019 23:16:29 +0000 (23:16 +0000)]
[ScalarizeMaskedMemIntrin] Add test case for expanding scatter.

This pass expands 6 intrinsics, but we only had test for 5 of
them.

llvm-svn: 368234

4 years ago[Docs] Fix (incorrect) code highlighting
Jonas Devlieghere [Wed, 7 Aug 2019 23:12:40 +0000 (23:12 +0000)]
[Docs] Fix (incorrect) code highlighting

llvm-svn: 368233

4 years agoRecommit "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG"
Amy Huang [Wed, 7 Aug 2019 22:49:40 +0000 (22:49 +0000)]
Recommit "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG"
with a fix to clear the SDNode map when SelectionDAG is cleared.

llvm-svn: 368230

4 years agogdb-index: Wire up str_offsets section to avoid incorrect error message about offsets...
David Blaikie [Wed, 7 Aug 2019 22:49:14 +0000 (22:49 +0000)]
gdb-index: Wire up str_offsets section to avoid incorrect error message about offsets_base

There's still a need for a deeper fix to the way libDebugInfoDWARF error
messages are propagated up to lld - if lld had exited non-zero on this
error message we would've found the issue sooner.

llvm-svn: 368229

4 years ago[Attributor][NFC] remove leftover and format code
Johannes Doerfert [Wed, 7 Aug 2019 22:49:06 +0000 (22:49 +0000)]
[Attributor][NFC] remove leftover and format code

llvm-svn: 368228

4 years ago[Attributor][Stats] Locate statistics tracking with the attributes
Johannes Doerfert [Wed, 7 Aug 2019 22:46:11 +0000 (22:46 +0000)]
[Attributor][Stats] Locate statistics tracking with the attributes

Summary:
The ever growing switch required Attribute::AttrKind values but they
might not be available for all abstract attributes we deduce. With the
new method we track statistics at the abstract attribute level. The
provided macros simplify the usage and make the messages uniform.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 368227

4 years agoAdjust a ValueObjectChild's offset when the child is a bitfield
Adrian Prantl [Wed, 7 Aug 2019 22:40:05 +0000 (22:40 +0000)]
Adjust a ValueObjectChild's offset when the child is a bitfield

If a bitfield doesn't fit into the child_byte_size'd window at
child_byte_offset, move the window forward until it fits.  The problem
here is that Value has no notion of bitfields and thus the Value's
DataExtractor is sized like the bitfields CompilerType; a sequence of
bitfields, however, can be larger than their underlying type.

This was not in the big-endian-derived DWARF 2 bitfield attributes
because their offsets were counted from the end of the window, so they
always fit.

rdar://problem/53132189

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

llvm-svn: 368226

4 years ago[Attributor][NFC] Code simplification and style normalization
Johannes Doerfert [Wed, 7 Aug 2019 22:36:15 +0000 (22:36 +0000)]
[Attributor][NFC] Code simplification and style normalization

llvm-svn: 368225

4 years ago[Attributor] Introduce a state wrapper class
Johannes Doerfert [Wed, 7 Aug 2019 22:34:26 +0000 (22:34 +0000)]
[Attributor] Introduce a state wrapper class

Summary:
The wrapper reduces boilerplate code and also provide a nice way to
determine the state type used by an abstract attributes statically via
AAType::StateType.

This was already discussed as part of the review of D65711.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 368224

4 years ago[Attributor][NFC] Avoid unnecessary liveness queries
Johannes Doerfert [Wed, 7 Aug 2019 22:32:38 +0000 (22:32 +0000)]
[Attributor][NFC] Avoid unnecessary liveness queries

If we know everything is live there is no need to query for liveness.
Indicating a pessimistic fixpoint will cause the state to be "invalid"
which will cause the Attributor to not return the AAIsDead on request,
which will prevent us from querying isAssumedDead().

llvm-svn: 368223

4 years ago[Attributor] Provide easier checkForallReturnedValues functionality
Johannes Doerfert [Wed, 7 Aug 2019 22:27:24 +0000 (22:27 +0000)]
[Attributor] Provide easier checkForallReturnedValues functionality

Summary:
So far, whenever one wants to look at returned values, one had to deal
with the AAReturnedValues and potentially with the AAIsDead attribute.
In the same spirit as other checkForAllXXX methods, we add this
functionality now to the Attributor. By adopting the use sites we got
better results when return instructions were dead.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 368222

4 years ago[llvm-readobj][test] Add baseline tests for FreeBSD/AMD/AMDGPU note printing
Jordan Rupprecht [Wed, 7 Aug 2019 22:21:49 +0000 (22:21 +0000)]
[llvm-readobj][test] Add baseline tests for FreeBSD/AMD/AMDGPU note printing

llvm-svn: 368221

4 years agoAdd a test demonstrating DWARF parse failures are not causing lld to exit non-zero
David Blaikie [Wed, 7 Aug 2019 22:05:33 +0000 (22:05 +0000)]
Add a test demonstrating DWARF parse failures are not causing lld to exit non-zero

This bug was/is masking other issues - committing this to demonstrate
the problem/track fixing it.

llvm-svn: 368220

4 years agoRestrict the NetBSD ASan TSD fallback to !ASAN_DYNAMIC
Kamil Rytarowski [Wed, 7 Aug 2019 21:56:43 +0000 (21:56 +0000)]
Restrict the NetBSD ASan TSD fallback to !ASAN_DYNAMIC

The fallback to the alternative implementation of TSD with TLS
is only needed for the static version of ASan for NetBSD.

The same code cannot be reused for the dynamic version of ASan as
TLS breaks and TSD code works.

llvm-svn: 368219

4 years ago[HWASan] Use LLD for check-hwasan.
Mitch Phillips [Wed, 7 Aug 2019 21:56:21 +0000 (21:56 +0000)]
[HWASan] Use LLD for check-hwasan.

HWASan+globals build fix in rL368111 unfortunately didn't fix the
problem when clang_cflags specified -fuse-ld=ld.gold. Change the order
to force lld in an attempt to fix the Android sanitizer bot.

llvm-svn: 368218

4 years agoRevert Added Delta IR Reduction Tool
Diego Trevino Ferrer [Wed, 7 Aug 2019 21:51:54 +0000 (21:51 +0000)]
Revert Added Delta IR Reduction Tool

This reverts r368071 (git commit a2584978f5bb41973d65a145b0d9459b81e3ac6d)

llvm-svn: 368217

4 years ago[libc++] Remove temporary hack for D63883
Louis Dionne [Wed, 7 Aug 2019 21:51:01 +0000 (21:51 +0000)]
[libc++] Remove temporary hack for D63883

This should fix the build bots, who now specify explicitly that they're
building against libc++abi.

llvm-svn: 368216

4 years ago[LoopVectorize][X86] Clamp interleave factor if we have a known constant trip count...
Craig Topper [Wed, 7 Aug 2019 21:44:14 +0000 (21:44 +0000)]
[LoopVectorize][X86] Clamp interleave factor if we have a known constant trip count that is less than VF*interleave

If we know the trip count, we should make sure the interleave factor won't cause the vectorized loop to exceed it.

Improves one of the cases from PR42674

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

llvm-svn: 368215

4 years agoAdded Delta IR Reduction Tool
Diego Trevino Ferrer [Wed, 7 Aug 2019 21:37:11 +0000 (21:37 +0000)]
Added Delta IR Reduction Tool

Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file.

Reviewers: alexshap, chandlerc

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

> llvm-svn: 368071

llvm-svn: 368214

4 years ago[libc++] Take 3: Do not cleverly link against libc++abi just because it happens to...
Louis Dionne [Wed, 7 Aug 2019 21:36:03 +0000 (21:36 +0000)]
[libc++] Take 3: Do not cleverly link against libc++abi just because it happens to be there

Summary:
Otherwise, when libcxxabi is not an enabled project in the monorepo, we
get a link error because we try to link against non-existent cxxabi_shared.

More generally, we shouldn't change the behavior of the build based on
implicit things like whether a file happens to be at a specific path or
not.

This is a re-application of r365222 that had been reverted in r365233
and then r365359 because it broke the build bots. The build bots
should now specify explicitly what ABI library they want to use
(libc++abi), so this commit should now be OK to merge. It takes a while
for build bots to pick up configuration changes, which is why this failed
the last time around.

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

llvm-svn: 368213

4 years agoDebugInfo/DWARF: Remove unused return type from DWARFUnit::extractDIEsIfNeeded
David Blaikie [Wed, 7 Aug 2019 21:31:33 +0000 (21:31 +0000)]
DebugInfo/DWARF: Remove unused return type from DWARFUnit::extractDIEsIfNeeded

llvm-svn: 368212

4 years ago[NFC][LICM] Pre-commit test for unary FNeg support in LICM.
Cameron McInally [Wed, 7 Aug 2019 21:30:00 +0000 (21:30 +0000)]
[NFC][LICM] Pre-commit test for unary FNeg support in LICM.

llvm-svn: 368211

4 years ago[X86] Allow pack instructions to be used for 512->256 truncates when -mprefer-vector...
Craig Topper [Wed, 7 Aug 2019 21:16:10 +0000 (21:16 +0000)]
[X86] Allow pack instructions to be used for 512->256 truncates when -mprefer-vector-width=256 is causing 512-bit vectors to be split

If we're splitting the 512-bit vector anyway and we have zero/sign bits, then we might as well use pack instructions to concat and truncate at once.

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

llvm-svn: 368210

4 years ago[clang-doc] Add second index for sections within info's content
Diego Astiazaran [Wed, 7 Aug 2019 21:04:52 +0000 (21:04 +0000)]
[clang-doc] Add second index for sections within info's content

This new index contains links to the main section of infos: Namespaces, Records, Functions, Enums, Members.
Also to each child function or enum.
Index is currently rendered on top of the info content, this will be fixed later with CSS.

Depends on D65690.

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

llvm-svn: 368209

4 years ago[CommandObject] Remove unused function
Jonas Devlieghere [Wed, 7 Aug 2019 20:56:17 +0000 (20:56 +0000)]
[CommandObject] Remove unused function

llvm-svn: 368208

4 years ago[X86] Add test cases for missed opportunities to use pack instructions for 512->256...
Craig Topper [Wed, 7 Aug 2019 20:54:46 +0000 (20:54 +0000)]
[X86] Add test cases for missed opportunities to use pack instructions for 512->256 truncates with prefer-vector-width=256

If the 512-bit vectors are going to be split anyway, then we are
better off using pack to implicitly concatenate the 256 bit pieces.

llvm-svn: 368207

4 years ago[clang-doc] Parallelize reducing phase
Diego Astiazaran [Wed, 7 Aug 2019 20:54:26 +0000 (20:54 +0000)]
[clang-doc] Parallelize reducing phase

Reduce phase has been parallelized and a execution time was reduced by
60% with this.
The reading of bitcode (bitcode -> Info) was moved to this segment of
code parallelized so it now happens just before reducing.

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

llvm-svn: 368206

4 years ago[Symbol] Remove commented out code from CompileUnit
Alex Langford [Wed, 7 Aug 2019 20:51:21 +0000 (20:51 +0000)]
[Symbol] Remove commented out code from CompileUnit

llvm-svn: 368205

4 years agoRevert r367501 "Create unique, but identically-named ELF sections..."
Bob Haarman [Wed, 7 Aug 2019 20:45:23 +0000 (20:45 +0000)]
Revert r367501 "Create unique, but identically-named ELF sections..."

This reverts commit fbc563e2cb6c5f1d0200b390513506b6aca4d2e9 "Create
unique, but identically-named ELF sections for explicitly-sectioned
functions and globals when using -function-sections and
-data-sections."

Reason for revert: sections are created with potentially wrong
attributes.

llvm-svn: 368204

4 years ago[pstl] Make sure we install all of PSTL's include/ directory
Louis Dionne [Wed, 7 Aug 2019 20:29:04 +0000 (20:29 +0000)]
[pstl] Make sure we install all of PSTL's include/ directory

We want to install files directly in include/, not only in include/pstl.

llvm-svn: 368203

4 years agoAdd target requirements for those bots which don't handle x86.
Bill Wendling [Wed, 7 Aug 2019 19:36:48 +0000 (19:36 +0000)]
Add target requirements for those bots which don't handle x86.

llvm-svn: 368202

4 years ago[NFC] Fixed newly added tests
David Bolvansky [Wed, 7 Aug 2019 19:36:46 +0000 (19:36 +0000)]
[NFC] Fixed newly added tests

llvm-svn: 368201

4 years ago[NFC] Added tests for x/fabs(X) fold
David Bolvansky [Wed, 7 Aug 2019 19:35:25 +0000 (19:35 +0000)]
[NFC] Added tests for x/fabs(X) fold

llvm-svn: 368200

4 years agoAdd support for deterministically linked binaries on macOS to lldb.
Nico Weber [Wed, 7 Aug 2019 19:29:04 +0000 (19:29 +0000)]
Add support for deterministically linked binaries on macOS to lldb.

When ld64 links a binary deterministically using the flag ZERO_AR_DATE,
it sets a timestamp of 0 for N_OSO members in the symtab section, rather
than the usual last modified date of the object file. Prior to this
patch, lldb would compare the timestamp from the N_OSO member against
the last modified date of the object file, and skip loading the object
file if there was a mismatch. This patch updates the logic to ignore the
timestamp check if the N_OSO member has timestamp 0.

The original logic was added in https://reviews.llvm.org/rL181631 as a
safety check to avoid problems when debugging if the object file was out
of date. This was prior to the introduction of deterministic build in
ld64. lld still doesn't support deterministic build.

Other code in llvm already relies on and uses the assumption that a
timestamp of 0 means deterministic build. For example, commit
9ccfddc39d4d27f9b16fcc72ab30d483151d6d08 adds similar timestamp checking
logic to dsymutil, but special cases timestamp 0. Likewise, commit
0d1bb79a0413f221432a7b1d0d2d10c84c4bbb99 adds a long comment describing
deterministic archive, which mostly uses timestamp 0 for determinism.

Patch from Erik Chen <erikchen@chromium.org>!

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

llvm-svn: 368199

4 years agoFix indentation
David Blaikie [Wed, 7 Aug 2019 19:09:31 +0000 (19:09 +0000)]
Fix indentation

llvm-svn: 368198

4 years ago[LoopVectorize][X86] Add test case for missed vectorization from PR42674.
Craig Topper [Wed, 7 Aug 2019 19:07:10 +0000 (19:07 +0000)]
[LoopVectorize][X86] Add test case for missed vectorization from PR42674.

We do end vectorizing the code, but use an interleave factor that
is too high and causes the vector code to be dead.

llvm-svn: 368197

4 years ago[Tooling] Expose ExecutorConcurrency option.
Diego Astiazaran [Wed, 7 Aug 2019 18:35:28 +0000 (18:35 +0000)]
[Tooling] Expose ExecutorConcurrency option.

D65628 requires a flag to specify the number of threads for a clang-doc step. It would be good to use ExecutorConcurrency after exposing it instead of creating a new one that has the same purpose.

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

llvm-svn: 368196

4 years ago[ValueTracking] When calculating known bits for integer abs, make sure we're looking...
Craig Topper [Wed, 7 Aug 2019 18:28:16 +0000 (18:28 +0000)]
[ValueTracking] When calculating known bits for integer abs, make sure we're looking at a negate and not just any instruction with the nsw flag set.

The matchSelectPattern code can match patterns like (x >= 0) ? x : -x
for absolute value. But it can also match ((x-y) >= 0) ? (x-y) : (y-x).
If the latter form was matched we can only use the nsw flag if its
set on both subtracts.

This match makes sure we're looking at the former case only.

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

llvm-svn: 368195

4 years ago[Attributor] Introduce checkForAllReadWriteInstructions(...).
Stefan Stipanovic [Wed, 7 Aug 2019 18:26:02 +0000 (18:26 +0000)]
[Attributor] Introduce checkForAllReadWriteInstructions(...).

Summary: Similarly to D65731 `Attributor::checkForAllReadWriteInstructions` is introduced.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 368194

4 years ago[SCEV] Return zero from computeConstantDifference(X, X)
Nikolai Bozhenov [Wed, 7 Aug 2019 17:38:38 +0000 (17:38 +0000)]
[SCEV] Return zero from computeConstantDifference(X, X)

Without this patch computeConstantDifference returns None for cases like
these:

  computeConstantDifference(%x, %x)
  computeConstantDifference({%x,+,16}, {%x,+,16})

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

llvm-svn: 368193

4 years ago[OpenMP][libomptarget] Add support for unified memory for regular maps
Gheorghe-Teodor Bercea [Wed, 7 Aug 2019 17:29:45 +0000 (17:29 +0000)]
[OpenMP][libomptarget] Add support for unified memory for regular maps

Summary:
This patch adds support for using unified memory in the case of regular maps that happen when a target region is offloaded to the device.

For cases where only a single version of the data is required then the host address can be used. When variables need to be privatized in any way or globalized, then the copy to the device is still required for correctness.

Reviewers: ABataev, jdoerfert, Hahnfeld, AlexEichenberger, caomhin, grokos

Reviewed By: Hahnfeld

Subscribers: mgorny, guansong, openmp-commits

Tags: #openmp

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

llvm-svn: 368192

4 years ago[DataLayout] Check StackNatural and FunctionPtr alignments.
Florian Hahn [Wed, 7 Aug 2019 17:20:55 +0000 (17:20 +0000)]
[DataLayout] Check StackNatural and FunctionPtr alignments.

MaybeAlignment asserts that the passed in value is == 0 or a power of 2.

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

Reviewers: michaelplatings, gchatelet, jakehehrlich, jfb

Reviewed By: gchatelet

Tags: #llvm

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

llvm-svn: 368191

4 years agoAPI update for change to LLVM's lib/DebugInfo/DWARF
David Blaikie [Wed, 7 Aug 2019 17:18:18 +0000 (17:18 +0000)]
API update for change to LLVM's lib/DebugInfo/DWARF

llvm-svn: 368190

4 years agoDebugInfo/DWARF: Normalize DWARFObject members on the DWARF spec section names
David Blaikie [Wed, 7 Aug 2019 17:18:11 +0000 (17:18 +0000)]
DebugInfo/DWARF: Normalize DWARFObject members on the DWARF spec section names

Some of these names were abbreviated, some were not, some pluralised,
some not. Made the API difficult to use - since it's an exact 1:1
mapping to the DWARF sections - use those names (changing underscore
separation for camel casing).

llvm-svn: 368189

4 years ago[clang][NFC] Fix typo in matcher comment
Yitzhak Mandelbaum [Wed, 7 Aug 2019 17:01:31 +0000 (17:01 +0000)]
[clang][NFC] Fix typo in matcher comment

Also updates corresponding html doc.

llvm-svn: 368188

4 years agoSupport: Remove needless allocation when getMainExecutable() calls readlink()
Nico Weber [Wed, 7 Aug 2019 17:00:19 +0000 (17:00 +0000)]
Support: Remove needless allocation when getMainExecutable() calls readlink()

We built a StringRef from a string literal which we then converted to a
std::string to call c_str().  Just use a pointer to the string literal
instead of a StringRef.

No behavior change.

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

llvm-svn: 368187

4 years agoCode completion should not ignore default parameters in functions.
Sam McCall [Wed, 7 Aug 2019 16:52:21 +0000 (16:52 +0000)]
Code completion should not ignore default parameters in functions.

Summary:
Inorder to display the default arguments we must process the
CK_Optional chunks of CodeCompletionString while creating the Signature.

We do not create placeholders for default arguments.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 368186

4 years agoRecommit r368081 "[X86] Add more extract subvector cost model tests for smaller eleme...
Craig Topper [Wed, 7 Aug 2019 16:42:47 +0000 (16:42 +0000)]
Recommit r368081 "[X86] Add more extract subvector cost model tests for smaller element sizes and smaller than 128-bit vectors."

llvm-svn: 368185

4 years agoRecommit r368079 "[X86] Remove uses of the -x86-experimental-vector-widening-legaliza...
Craig Topper [Wed, 7 Aug 2019 16:33:37 +0000 (16:33 +0000)]
Recommit r368079 "[X86] Remove uses of the -x86-experimental-vector-widening-legalization flag from test/CodeGen/X86/"

llvm-svn: 368184

4 years agoRecommit r367901 "[X86] Enable -x86-experimental-vector-widening-legalization by...
Craig Topper [Wed, 7 Aug 2019 16:24:26 +0000 (16:24 +0000)]
Recommit r367901 "[X86] Enable -x86-experimental-vector-widening-legalization by default."

The assert that caused this to be reverted should be fixed now.

Original commit message:

This patch changes our defualt legalization behavior for 16, 32, and
64 bit vectors with i8/i16/i32/i64 scalar types from promotion to
widening. For example, v8i8 will now be widened to v16i8 instead of
promoted to v8i16. This keeps the elements widths the same and pads
with undef elements. We believe this is a better legalization strategy.
But it carries some issues due to the fragmented vector ISA. For
example, i8 shifts and multiplies get widened and then later have
to be promoted/split into vXi16 vectors.

This has the potential to cause regressions so we wanted to get
it in early in the 10.0 cycle so we have plenty of time to
address them.

Next steps will be to merge tests that explicitly test the command
line option. And then we can remove the option and its associated
code.

llvm-svn: 368183

4 years ago[Driver] Expand the executable path in the target create output
Jonas Devlieghere [Wed, 7 Aug 2019 16:21:40 +0000 (16:21 +0000)]
[Driver] Expand the executable path in the target create output

Resolve the path in the target create output. This is nice when passing
relative paths to the lldb command line driver.

  $ lldb ./binary
  (lldb) target create "./binary"
  Current executable set to '/absolute/path/to/binary' (x86_64).

This change only affects the target create output and does not change
the debugger's behavior. It doesn't resolve symbolic links so it won't
cause confusing when debugging something like clang++ that's symlinked
to clang.

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

llvm-svn: 368182

4 years ago[ExecutionContext] Return the target/process byte order.
Jonas Devlieghere [Wed, 7 Aug 2019 16:09:35 +0000 (16:09 +0000)]
[ExecutionContext] Return the target/process byte order.

Currently ExecutionContext::GetByteOrder() always returns the host byte
order. This seems like a simple mistake: the return keyword appears to
have been omitted by accident. This patch fixes that and adds a unit
test.

Bugreport: https://llvm.org/PR37950

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

llvm-svn: 368181

4 years ago[ARM] Expand CTPOP intrinsic for MVE
Oliver Cruickshank [Wed, 7 Aug 2019 15:47:45 +0000 (15:47 +0000)]
[ARM] Expand CTPOP intrinsic for MVE

llvm-svn: 368180

4 years agogn build: Merge r368158
Nico Weber [Wed, 7 Aug 2019 15:30:44 +0000 (15:30 +0000)]
gn build: Merge r368158

llvm-svn: 368179

4 years agogn build: Merge r368119
Nico Weber [Wed, 7 Aug 2019 15:29:01 +0000 (15:29 +0000)]
gn build: Merge r368119

llvm-svn: 368178

4 years agoUse forceinline. Necessary for nvcc to inline small functions within the bitcode...
Jon Chesterfield [Wed, 7 Aug 2019 15:24:12 +0000 (15:24 +0000)]
Use forceinline. Necessary for nvcc to inline small functions within the bitcode library

Summary:
[libomptarget] Use forceinline. Necessary for nvcc to inline small functions within the bitcode library
Suggested in D65836

Reviewers: ABataev, jdoerfert, grokos, gregrodgers

Subscribers: openmp-commits

Tags: #openmp

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

llvm-svn: 368177

4 years ago[InstCombine] Add a TODO comment
Jay Foad [Wed, 7 Aug 2019 15:18:34 +0000 (15:18 +0000)]
[InstCombine] Add a TODO comment

llvm-svn: 368176

4 years ago[InstCombine] Propagate fast math flags through selects
Jay Foad [Wed, 7 Aug 2019 15:16:28 +0000 (15:16 +0000)]
[InstCombine] Propagate fast math flags through selects

Summary:
In SimplifySelectsFeedingBinaryOp, propagate fast math flags from the
outer op into both arms of the new select, to take advantage of
simplifications that require fast math flags.

Reviewers: mcberg2017, majnemer, spatel, arsenm, xbolva00

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

Tags: #llvm

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

llvm-svn: 368175

4 years ago[UpdateTestChecks] Update tests option
David Bolvansky [Wed, 7 Aug 2019 14:44:50 +0000 (14:44 +0000)]
[UpdateTestChecks] Update tests option

Summary:
Port of new feature introduced https://reviews.llvm.org/D65610 to other update scripts.

- update_*_checks.py: add an alias -u for --update-only
- port --update-only to other update_*_test_checks.py scripts
- update script aborts if the test file was generated by another update_*_test_checks.py utility

Reviewers: lebedev.ri, RKSimon, MaskRay, reames, gbedwell

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 368174

4 years agoRemove LLVM mutexes from clang in favor of std::mutex
Benjamin Kramer [Wed, 7 Aug 2019 14:44:40 +0000 (14:44 +0000)]
Remove LLVM mutexes from clang in favor of std::mutex

None of those need to be recursive mutexes. No functionality change
intended.

llvm-svn: 368173

4 years ago[OPENMP]Set default version to OpenMP 4.5.
Alexey Bataev [Wed, 7 Aug 2019 14:39:17 +0000 (14:39 +0000)]
[OPENMP]Set default version to OpenMP 4.5.

Since clang fully supports OpenMP 4.5, set the default version to 4.5
instead of 3.1.

llvm-svn: 368172

4 years ago[EarlyCSE] Add support for unary FNeg to EarlyCSE
Cameron McInally [Wed, 7 Aug 2019 14:34:41 +0000 (14:34 +0000)]
[EarlyCSE] Add support for unary FNeg to EarlyCSE

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

llvm-svn: 368171

4 years ago[OPENMP]Add standard macro value _OPENMP for OpenMP 5.0.
Alexey Bataev [Wed, 7 Aug 2019 14:02:11 +0000 (14:02 +0000)]
[OPENMP]Add standard macro value _OPENMP for OpenMP 5.0.

According to the OpenMP standard, compiler must define _OPENMP macro,
which has value in format yyyymm, where yyyy is the year of the standard
and mm is the month of the standard. For OpenMP 5.0 this value must be
set to 201811.

llvm-svn: 368170

4 years agoTry to fix windows build bots after r368153.
Igor Kudrin [Wed, 7 Aug 2019 13:22:29 +0000 (13:22 +0000)]
Try to fix windows build bots after r368153.

llvm-svn: 368169

4 years agoProcessElfCore: Remove linux and freebsd NT_*** constants
Pavel Labath [Wed, 7 Aug 2019 13:12:59 +0000 (13:12 +0000)]
ProcessElfCore: Remove linux and freebsd NT_*** constants

These are already defined in llvm/BinaryFormat/ELF.h. Leaving the NetBSD
and OpenBSD constants as-is, as they have no llvm counterparts.

llvm-svn: 368168

4 years ago[RISCV][NFC] Document RISC-V-specific assembly constraints
Sam Elliott [Wed, 7 Aug 2019 13:08:07 +0000 (13:08 +0000)]
[RISCV][NFC] Document RISC-V-specific assembly constraints

llvm-svn: 368167

4 years agoGlobalISel: factor common code from translateCall and translateInvoke. NFC.
Tim Northover [Wed, 7 Aug 2019 12:43:53 +0000 (12:43 +0000)]
GlobalISel: factor common code from translateCall and translateInvoke. NFC.

llvm-svn: 368166

4 years ago[X86] EltsFromConsecutiveLoads - early out for non-byte sized memory (PR42909)
Simon Pilgrim [Wed, 7 Aug 2019 12:41:59 +0000 (12:41 +0000)]
[X86] EltsFromConsecutiveLoads - early out for non-byte sized memory (PR42909)

Don't attempt to merge loads for types that aren't modulo 8-bits.

llvm-svn: 368165

4 years ago[AArch64][WinCFI] Do not pair callee-save instructions in LoadStoreOptimizer
Sander de Smalen [Wed, 7 Aug 2019 12:41:38 +0000 (12:41 +0000)]
[AArch64][WinCFI] Do not pair callee-save instructions in LoadStoreOptimizer

Prevent the LoadStoreOptimizer from pairing any load/store instructions with
instructions from the prologue/epilogue if the CFI information has encoded the
operations as separate instructions.  This would otherwise lead to a mismatch
of the actual prologue size from the size as recorded in the Windows CFI.

Reviewers: efriedma, mstorsjo, ssijaric

Reviewed By: efriedma

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

llvm-svn: 368164

4 years ago[ASTImporter] Do not import FunctionTemplateDecl in record twice.
Balazs Keri [Wed, 7 Aug 2019 12:40:17 +0000 (12:40 +0000)]
[ASTImporter] Do not import FunctionTemplateDecl in record twice.

Summary:
For functions there is a check to not duplicate the declaration if it is in a
record (class). For function templates there was no similar check, if a
template (in the same class) was imported multiple times the
FunctionTemplateDecl was created multiple times with the same templated
FunctionDecl. This can result in problems with the declaration chain.

Reviewers: martong, a.sidorin, shafik, a_sidorin

Reviewed By: a_sidorin

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

Tags: #clang

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

llvm-svn: 368163

4 years ago[mips] Make a couple of class methods plain static functions. NFC
Simon Atanasyan [Wed, 7 Aug 2019 12:21:41 +0000 (12:21 +0000)]
[mips] Make a couple of class methods plain static functions. NFC

llvm-svn: 368162

4 years ago[mips] Use isMicroMips() function to check enabled feature flag. NFC
Simon Atanasyan [Wed, 7 Aug 2019 12:21:32 +0000 (12:21 +0000)]
[mips] Use isMicroMips() function to check enabled feature flag. NFC

llvm-svn: 368161

4 years ago[Mips] Instruction `sc` now accepts symbol as an argument
Simon Atanasyan [Wed, 7 Aug 2019 12:21:26 +0000 (12:21 +0000)]
[Mips] Instruction `sc` now accepts symbol as an argument

Function MipsAsmParser::expandMemInst() did not properly handle
instruction `sc` with a symbol as an argument because first argument
would be counted twice. We add additional checks and handle this case
separately.

Patch by Mirko Brkusanin.

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

llvm-svn: 368160

4 years agoObjectFileELF: Remove NT_*** constants
Pavel Labath [Wed, 7 Aug 2019 12:13:48 +0000 (12:13 +0000)]
ObjectFileELF: Remove NT_*** constants

llvm now has definitions of those in BinaryFormat/ELF.h. Use those
instead.

llvm-svn: 368159

4 years ago[Support] Base SmartMutex on std::recursive_mutex
Benjamin Kramer [Wed, 7 Aug 2019 11:59:57 +0000 (11:59 +0000)]
[Support] Base SmartMutex on std::recursive_mutex

- Remove support for non-recursive mutexes. This was unused.
- The std::recursive_mutex is now created/destroyed unconditionally.
  Locking is still only done if threading is enabled.
- Alias SmartScopedLock to std::lock_guard.

This should make no semantic difference on the existing APIs.

llvm-svn: 368158

4 years agoReplace non-recursive sys::Mutex users with std::mutex
Benjamin Kramer [Wed, 7 Aug 2019 11:59:44 +0000 (11:59 +0000)]
Replace non-recursive sys::Mutex users with std::mutex

Also remove a use of sys::MutexImpl, that's just evil. No functionality
change intended.

llvm-svn: 368157

4 years agoRemove support for 32-bit offsets in utility classes (5/5)
Igor Kudrin [Wed, 7 Aug 2019 11:44:47 +0000 (11:44 +0000)]
Remove support for 32-bit offsets in utility classes (5/5)

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

llvm-svn: 368156

4 years ago[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for...
Simon Pilgrim [Wed, 7 Aug 2019 11:43:13 +0000 (11:43 +0000)]
[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for ISD::VECTOR_SHUFFLE

In particular this helps the SSE vector shift cvttps2dq+add+shl pattern by avoiding the need for zeros in shuffle style extensions to vXi32 types as we'll be shifting out those bits anyway

llvm-svn: 368155

4 years agoA more robust way of testing debug_line parser near the end of module
Pavel Labath [Wed, 7 Aug 2019 11:33:56 +0000 (11:33 +0000)]
A more robust way of testing debug_line parser near the end of module

Summary:
While removing -z separate-code makes lld produce place the code at the
end of a segment right now, it's possible that future changes to the
linker will change that, thereby removing the coverage for the changes
in r367983. This patch adds a linker script to one of the line table
tests, which ensures that the code (and its line table) will be placed
at the very end of a module.

Reviewers: MaskRay

Subscribers: lldb-commits

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

llvm-svn: 368154

4 years ago[ELF] Fix splitting messages for duplicate symbols.
Igor Kudrin [Wed, 7 Aug 2019 11:32:43 +0000 (11:32 +0000)]
[ELF] Fix splitting messages for duplicate symbols.

D65213 (rL367536) does not work for the case when a source file path
includes subdirectories.

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

llvm-svn: 368153

4 years ago[clang] Fix mismatched args constructing AddressSpaceAttr.
Anton Bikineev [Wed, 7 Aug 2019 11:12:43 +0000 (11:12 +0000)]
[clang] Fix mismatched args constructing AddressSpaceAttr.

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

llvm-svn: 368152

4 years ago[lldb][CMake] Workaround debugserver code-signing issue in generated Xcode project
Stefan Granitz [Wed, 7 Aug 2019 11:02:04 +0000 (11:02 +0000)]
[lldb][CMake] Workaround debugserver code-signing issue in generated Xcode project

Summary:
Explicitly code-sign the LLDB.framework copy of debugserver in the build-tree. This is necessary, because the Xcode-specific logic in `llvm_codesign` [1] has the side-effect that Xcode code-signs after post-build steps (here: after copying debugserver over into the framework). The special case for Xcode was necessary to avoid double-signing errors in the past (see D55116 and D55816).

[1] https://github.com/llvm/llvm-project/blob/36fb93982f0e/llvm/cmake/modules/AddLLVM.cmake#L1676

Reviewers: jingham, davide, JDevlieghere, teemperor

Reviewed By: JDevlieghere

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

Tags: #lldb

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

llvm-svn: 368151

4 years ago[lldb][NFC] Remove commented out code in ClangASTContext::AddMethodToCXXRecordType
Raphael Isemann [Wed, 7 Aug 2019 10:59:34 +0000 (10:59 +0000)]
[lldb][NFC] Remove commented out code in ClangASTContext::AddMethodToCXXRecordType

llvm-svn: 368150

4 years agoReplace llvm::MutexGuard/UniqueLock with their standard equivalents
Benjamin Kramer [Wed, 7 Aug 2019 10:57:25 +0000 (10:57 +0000)]
Replace llvm::MutexGuard/UniqueLock with their standard equivalents

All supported platforms have <mutex> now, so we don't need our own
copies any longer. No functionality change intended.

llvm-svn: 368149

4 years ago[lldb][CMake] Fix one more detail in r368066
Stefan Granitz [Wed, 7 Aug 2019 10:47:49 +0000 (10:47 +0000)]
[lldb][CMake] Fix one more detail in r368066

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

llvm-svn: 368148

4 years agogsl::Owner/gsl::Pointer: Add implicit annotations for some std types
Matthias Gehre [Wed, 7 Aug 2019 10:45:36 +0000 (10:45 +0000)]
gsl::Owner/gsl::Pointer: Add implicit annotations for some std types

Summary:
Hard code gsl::Owner/gsl::Pointer for std types. The paper mentions
some types explicitly. Generally, all containers and their iterators are
covered. For iterators, we cover both the case that they are defined
as an nested class or as an typedef/using. I have started to test this
implementation against some real standard library implementations, namely
libc++ 7.1.0, libc++ 8.0.1rc2, libstdc++ 4.6.4, libstdc++ 4.8.5,
libstdc++ 4.9.4, libstdc++ 5.4.0, libstdc++ 6.5.0, libstdc++ 7.3.0,
libstdc++ 8.3.0 and libstdc++ 9.1.0.

The tests are currently here
  https://github.com/mgehre/llvm-project/blob/lifetime-ci/lifetime-attr-test.sh
  https://github.com/mgehre/llvm-project/blob/lifetime-ci/lifetime-attr-test.cpp
I think due to their dependency on a standard library, they are not a good fit
for clang/test/. Where else could I put them?

Reviewers: gribozavr, xazax.hun

Subscribers: rnkovacs, cfe-commits

Tags: #clang

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

llvm-svn: 368147

4 years ago[ARM] Generate MVE VHADDs/VHSUBs
Oliver Cruickshank [Wed, 7 Aug 2019 10:26:57 +0000 (10:26 +0000)]
[ARM] Generate MVE VHADDs/VHSUBs

llvm-svn: 368146

4 years agoHandle /align option.
Rui Ueyama [Wed, 7 Aug 2019 10:16:21 +0000 (10:16 +0000)]
Handle /align option.

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

llvm-svn: 368145

4 years agoSimplify error message output. NFC.
Rui Ueyama [Wed, 7 Aug 2019 10:11:24 +0000 (10:11 +0000)]
Simplify error message output. NFC.

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

llvm-svn: 368144

4 years ago[lldb][NFC] Fix typo in 368066
Stefan Granitz [Wed, 7 Aug 2019 10:03:11 +0000 (10:03 +0000)]
[lldb][NFC] Fix typo in 368066

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

llvm-svn: 368143

4 years ago[ELF][X86] Add --no-show-raw-insn and -soname to some i386 tests
Fangrui Song [Wed, 7 Aug 2019 09:43:54 +0000 (09:43 +0000)]
[ELF][X86] Add --no-show-raw-insn and -soname to some i386 tests

llvm-svn: 368142

4 years ago[InstCombine] Recommit: Shift amount reassociation: shl-trunc-shl pattern
Roman Lebedev [Wed, 7 Aug 2019 09:41:50 +0000 (09:41 +0000)]
[InstCombine] Recommit: Shift amount reassociation: shl-trunc-shl pattern

This was initially committed in r368059 but got reverted in r368084
because there was a faulty logic in how the shift amounts type mismatch
was being handled (it simply wasn't).

I've added an explicit bailout before we SimplifyAddInst() - i don't think
it's designed in general to handle differently-typed values, even though
the actual problem only comes from ConstantExpr's.

I have also changed the common type deduction, to not just blindly
look past zext, but try to do that so that in the end types match.

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

llvm-svn: 368141

4 years ago[obj2yaml] - MIPS: move and improve testing of the e_flags
George Rimar [Wed, 7 Aug 2019 09:35:04 +0000 (09:35 +0000)]
[obj2yaml] - MIPS: move and improve testing of the e_flags

Mips/elf-flags.yaml and Mips/elf-abi.yaml are tests that intention was to
show that yaml2obj/obj2yaml are able to read/dump MIPS specific e_flags.

They were not complete, contained an excessive YAML parts and were placed
at a wrong location.

I removed them and created the obj2yaml/elf-mips-eflags.yaml instead.

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

llvm-svn: 368140