platform/upstream/llvm.git
5 years ago[x86] remove duplicate tests
Sanjay Patel [Wed, 3 Apr 2019 14:45:45 +0000 (14:45 +0000)]
[x86] remove duplicate tests

Accidentally double-committed these.

llvm-svn: 357593

5 years ago[x86] add negative tests for FP scalarization; NFC
Sanjay Patel [Wed, 3 Apr 2019 14:41:28 +0000 (14:41 +0000)]
[x86] add negative tests for FP scalarization; NFC

These go with the proposal in D60150.

llvm-svn: 357592

5 years ago[x86] add tests with constants for FP scalarization; NFC
Sanjay Patel [Wed, 3 Apr 2019 14:41:24 +0000 (14:41 +0000)]
[x86] add tests with constants for FP scalarization; NFC

llvm-svn: 357591

5 years ago[llvm-objcopy] Make section rename/set flags case-insensitive
James Henderson [Wed, 3 Apr 2019 14:40:27 +0000 (14:40 +0000)]
[llvm-objcopy] Make section rename/set flags case-insensitive

This fixes https://bugs.llvm.org/show_bug.cgi?id=41305. GNU objcopy
--set-section-flags/--rename-section flags are case-insensitive, so this
patch updates llvm-objcopy to match.

Reviewed by: grimar

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

llvm-svn: 357590

5 years agoWhitespace and formatting changes; NFC.
Aaron Ballman [Wed, 3 Apr 2019 14:40:00 +0000 (14:40 +0000)]
Whitespace and formatting changes; NFC.

llvm-svn: 357589

5 years ago[libc++][NFC] Rename test file according to the libc++ convention
Louis Dionne [Wed, 3 Apr 2019 14:38:28 +0000 (14:38 +0000)]
[libc++][NFC] Rename test file according to the libc++ convention

llvm-svn: 357588

5 years ago[x86] add tests with constants for FP scalarization; NFC
Sanjay Patel [Wed, 3 Apr 2019 14:36:47 +0000 (14:36 +0000)]
[x86] add tests with constants for FP scalarization; NFC

llvm-svn: 357587

5 years ago[libc++] (Take 2) Correctly handle Objective-C++ ARC qualifiers in std::is_pointer
Louis Dionne [Wed, 3 Apr 2019 14:29:52 +0000 (14:29 +0000)]
[libc++] (Take 2) Correctly handle Objective-C++ ARC qualifiers in std::is_pointer

Summary:
Otherwise, std::is_pointer<id __strong> works, but std::is_pointer<id __weak>
(and others) don't work as expected.

The previous patch (r357517) had to be reverted in r357569 because it
broke the Chromium build. This patch shouldn't have the same problem.

rdar://problem/49126333

Reviewers: ahatanak, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

llvm-svn: 357586

5 years agoAdd a new attribute documentation category for declarations.
Aaron Ballman [Wed, 3 Apr 2019 14:26:32 +0000 (14:26 +0000)]
Add a new attribute documentation category for declarations.

This moves documentation for some attributes into new categories that are hopefully a bit more clear. In general, "Type" documentation should be for attributes that appertain to types while "Declaration" documentation should be for attributes that appertain to declarations other than functions or variables.

llvm-svn: 357585

5 years ago[MIPS GlobalISel] Select floating point arithmetic operations
Petar Avramovic [Wed, 3 Apr 2019 14:12:59 +0000 (14:12 +0000)]
[MIPS GlobalISel] Select floating point arithmetic operations

Select 32 and 64 bit floating point add, sub, mul and div for MIPS32.

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

llvm-svn: 357584

5 years ago[AArch64] Update v8.5a MTE LDG/STG instructions
Javed Absar [Wed, 3 Apr 2019 14:12:13 +0000 (14:12 +0000)]
[AArch64] Update v8.5a MTE LDG/STG instructions

The latest MTE specification adds register Xt to the STG instruction family:
  STG [Xn, #offset] -> STG Xt, [Xn, #offset]
The tag written to memory is taken from Xt rather than Xn.
Also, the LDG instruction also was changed to read return address from Xt:
  LDG Xt, [Xn, #offset].
This patch includes those changes and tests.
Specification is at: https://developer.arm.com/docs/ddi0596/c
Differential Revision: https://reviews.llvm.org/D60188

llvm-svn: 357583

5 years ago[clang-tidy] Remove the old ClangTidyCheck::registerPPCallbacks method
Alexander Kornienko [Wed, 3 Apr 2019 14:03:43 +0000 (14:03 +0000)]
[clang-tidy] Remove the old ClangTidyCheck::registerPPCallbacks method

Summary:
All in-tree clang-tidy checks have been migrated to the new
ClangTidyCheck::registerPPCallbacks method. Time to drop the old one.

Reviewers: sammccall, hokein

Reviewed By: hokein

Subscribers: xazax.hun, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 357582

5 years agoAMDGPU: Fix copy/paste error in intrnsic comment
Matt Arsenault [Wed, 3 Apr 2019 13:56:36 +0000 (13:56 +0000)]
AMDGPU: Fix copy/paste error in intrnsic comment

llvm-svn: 357581

5 years ago[DAGCombiner] loosen restrictions for moving shuffles after vector binop
Sanjay Patel [Wed, 3 Apr 2019 13:42:06 +0000 (13:42 +0000)]
[DAGCombiner] loosen restrictions for moving shuffles after vector binop

There are 3 changes to make this correspond to the same transform in instcombine:
1. Remove the legality check - we can't create anything less legal than we started with.
2. Ease the use restriction, so we only bail out if both operands have >1 use.
3. Ease the use restriction for binops with a repeated operand (eg, mul x, x).

As discussed in D60150, there's a scalarization opportunity that will be made
easier by allowing this transform more generally.

llvm-svn: 357580

5 years agoFixing a typo; NFC.
Aaron Ballman [Wed, 3 Apr 2019 13:37:56 +0000 (13:37 +0000)]
Fixing a typo; NFC.

llvm-svn: 357579

5 years ago[llvm-readobj] Add GNU style dumper for .gnu.version section
Xing GUO [Wed, 3 Apr 2019 13:32:49 +0000 (13:32 +0000)]
[llvm-readobj] Add GNU style dumper for .gnu.version section

Summary: Currently, `llvm-readobj` do not support GNU style dumper for symbol versioning sections. In this patch, I would like to implement dumper for `.gnu.version` section

Reviewers: jhenderson, rupprecht, grimar

Reviewed By: jhenderson, rupprecht

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 357578

5 years agoFix typos in tests. NFC.
Xing GUO [Wed, 3 Apr 2019 13:15:09 +0000 (13:15 +0000)]
Fix typos in tests. NFC.

Reviewers: Higuoxing

Reviewed By: Higuoxing

Subscribers: kubamracek, cfe-commits, #sanitizers, llvm-commits

Tags: #clang, #sanitizers, #llvm

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

llvm-svn: 357577

5 years ago[LibTooling] Add Transformer, a library for source-to-source transformations.
Yitzhak Mandelbaum [Wed, 3 Apr 2019 13:05:19 +0000 (13:05 +0000)]
[LibTooling] Add Transformer, a library for source-to-source transformations.

Summary: Adds a basic version of Transformer, a library supporting the concise specification of clang-based source-to-source transformations.  A full discussion of the end goal can be found on the cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling".

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: mgorny, jfb, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 357576

5 years ago[llvm-nm]Add support for --no-demangle
James Henderson [Wed, 3 Apr 2019 12:57:46 +0000 (12:57 +0000)]
[llvm-nm]Add support for --no-demangle

GNU nm has --no-demangle, so llvm-nm should too. It disables the
--demangle switch. The patch also allows --demangle to be specified
multiple times (the last of all --no-demangle/--demangle switches
takes precedence).

Reviewed by: grimar, rupprecht, mattd

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

llvm-svn: 357575

5 years agogn build: Add build files for clangd xpc framework code
Nico Weber [Wed, 3 Apr 2019 12:33:19 +0000 (12:33 +0000)]
gn build: Add build files for clangd xpc framework code

This is a bit of a larger change since this is the first (and as far as
I can tell only) place where the LLVM build produces macOS framework
bundles.

GN has some built-in support for this, so use that.
`gn help create_bundle` has a terse description (but it's a bit
outdated: `deps` must be `public_deps` and the conditionals in the
example in the help aren't quite right on non-iOS).

We need a new 'copy_bundle_data' tool, and since we copy the clangd.xpc
bundle as bundle_data into ClangdXPC.framework it needs to be able to
handle directories in addition to files.

GN also insists we have a compile_xcassets tool even though it's not
used. I just made that run `false`.

Despite GN's support for bundles, we still need to manually create the
expected symlink structure in the .framework bundle. Since this code
never runs on Windows, it's safe to create the symlinks before the
symlink targets exist, so we can just make the bundle depend on the
steps that create the symlinks. For this to work, change the symlink
script to create the symlink's containing directory if it doesn't yet
exist.

I locally verified that CMake and GN build create the same bundle
structure. (I noticed that both builds set LC_ID_DYLIB to the pre-copy
libClangdXPCLib.dylib name, but that seems to not cause any issues and
it happens in the CMake build too.)

(Also add an error message to clangd-xpc-test-client for when loading
the dylib fails – this was useful while locally debugging this.)

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

llvm-svn: 357574

5 years ago[X86] Regenerate LEA codegen tests
Simon Pilgrim [Wed, 3 Apr 2019 12:33:16 +0000 (12:33 +0000)]
[X86] Regenerate LEA codegen tests

llvm-svn: 357573

5 years agomodify-python-lldb.py: clean up __iter__ and __len__ support
Pavel Labath [Wed, 3 Apr 2019 11:48:38 +0000 (11:48 +0000)]
modify-python-lldb.py: clean up __iter__ and __len__ support

Summary:
Instead of modifying the swig-generated code, just add the appropriate
methods to the interface files in order to get the swig to do the
generation for us.

This is a straight-forward move from the python script to the interface
files. The single class which has nontrivial handling in the script
(SBModule) has been left for a separate patch.

For the cases where I did not find any tests exercising the
iteration/length methods (i.e., no tests failed after I stopped emitting
them), I tried to add basic tests for that functionality.

Reviewers: zturner, jingham, amccarth

Subscribers: jdoerfert, lldb-commits

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

llvm-svn: 357572

5 years ago[DAGCombine] Don't use getZExtValue() until we know the constant is in range.
Simon Pilgrim [Wed, 3 Apr 2019 11:00:55 +0000 (11:00 +0000)]
[DAGCombine] Don't use getZExtValue() until we know the constant is in range.

Noticed during prep for a patch for PR40758.

llvm-svn: 357571

5 years ago[mips] Remove unused FGRH32 register class. NFC
Simon Atanasyan [Wed, 3 Apr 2019 10:08:27 +0000 (10:08 +0000)]
[mips] Remove unused FGRH32 register class. NFC

If we need this class in the future we will easily restore it.

Differential Revision: http://reviews.llvm.org/D60132

llvm-svn: 357570

5 years agoRevert "[libc++] Correctly handle Objective-C++ ARC qualifiers in std::is_pointer"
Hans Wennborg [Wed, 3 Apr 2019 10:07:37 +0000 (10:07 +0000)]
Revert "[libc++] Correctly handle Objective-C++ ARC qualifiers in std::is_pointer"

This broke the Chromium build on Mac, see https://crbug.com/949071

> Summary:
> Otherwise, std::is_pointer<id __strong> works, but std::is_pointer<id __weak>
> (and others) don't work as expected.
>
> rdar://problem/49126333
>
> Reviewers: ahatanak, EricWF
>
> Subscribers: christof, jkorous, dexonsmith, libcxx-commits
>
> Differential Revision: https://reviews.llvm.org/D60087

llvm-svn: 357569

5 years ago[X86] Make the post machine scheduler macrofusion-aware.
Clement Courbet [Wed, 3 Apr 2019 09:37:30 +0000 (09:37 +0000)]
[X86] Make the post machine scheduler macrofusion-aware.

Summary:
Given that X86 does not use this currently, this is an NFC. I'll
experiment with enabling and will report numbers.

Reviewers: andreadb, lebedev.ri

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 357568

5 years ago[clang-format] Regroup #includes into blocks for Google style
Eric Liu [Wed, 3 Apr 2019 09:25:16 +0000 (09:25 +0000)]
[clang-format] Regroup #includes into blocks for Google style

Summary:
Regrouping #includes in blocks separated by blank lines when sorting C++ #include
headers was implemented recently, and it has been preferred in Google's C++ style guide:
https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes

Reviewers: sammccall, klimek

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 357567

5 years agoAdding 'CLion integration' to clang-format doc
Sylvestre Ledru [Wed, 3 Apr 2019 08:56:30 +0000 (08:56 +0000)]
Adding 'CLion integration' to clang-format doc

Summary:
This commit adds a chapter 'CLion integration' to ClangFormat.rst.
The official announcement of clang-format support in CLion 2019.1: https://blog.jetbrains.com/clion/2019/03/clion-2019-1-embedded-dev-clangformat-memory-view/

Patch by Marina Kalashina

Reviewers: djasper, sylvestre.ledru, krasimir

Reviewed By: sylvestre.ledru

Subscribers: jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 357566

5 years ago[X86][NFC] Add tests for misched macro-fusion.
Clement Courbet [Wed, 3 Apr 2019 08:21:54 +0000 (08:21 +0000)]
[X86][NFC] Add tests for misched macro-fusion.

llvm-svn: 357565

5 years ago[InstCombine] Simplify ctpop with bitreverse/bswap
David Bolvansky [Wed, 3 Apr 2019 08:08:44 +0000 (08:08 +0000)]
[InstCombine] Simplify ctpop with bitreverse/bswap

Summary: Fixes PR41337

Reviewers: spatel

Reviewed By: spatel

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 357564

5 years agoRevert r357256 "[DAGCombine] Improve Lifetime node chains."
Hans Wennborg [Wed, 3 Apr 2019 07:41:58 +0000 (07:41 +0000)]
Revert r357256 "[DAGCombine] Improve Lifetime node chains."

As it caused a pathological compile-time regressionin V8, see PR41352.

> Improve both start and end lifetime nodes chain dependencies.
>
> Reviewers: courbet
>
> Reviewed By: courbet
>
> Subscribers: hiraditya, llvm-commits
>
> Tags: #llvm
>
> Differential Revision: https://reviews.llvm.org/D59795

This also reverts the follow-up r357309:

> [DAGCombiner] Rewrite ImproveLifetimeNodeChain to avoid DAG loop.
>
> Avoid EXPENSIVE_CHECK failure. NFCI.

llvm-svn: 357563

5 years ago[libclang][test] Suppress annoying 'LIBCLANG TOOLING ERROR' output
Fangrui Song [Wed, 3 Apr 2019 07:25:04 +0000 (07:25 +0000)]
[libclang][test] Suppress annoying 'LIBCLANG TOOLING ERROR' output

check-all invokes check-clang-python which prints the annoying message:

LIBCLANG TOOLING ERROR: fixed-compilation-database: Error while opening fixed database: No such file or directory
json-compilation-database: Error while opening JSON database: No such file or directory

Let's fix it now with os.dup os.dup2 trick.

llvm-svn: 357562

5 years ago[clangd] Return clangd::TextEdit in ClangdServer::rename. NFC
Ilya Biryukov [Wed, 3 Apr 2019 07:18:43 +0000 (07:18 +0000)]
[clangd] Return clangd::TextEdit in ClangdServer::rename. NFC

Summary:
Instead of tooling::Replacement. To avoid the need to have contents of
the file at the caller site. This also aligns better with other methods
in ClangdServer, majority of those already return LSP-specific data
types.

Reviewers: hokein, ioeric, sammccall

Reviewed By: sammccall

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

Tags: #clang

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

llvm-svn: 357561

5 years ago[PowerPC]add testcase for ppcctrloops pass shortloop check
Chen Zheng [Wed, 3 Apr 2019 03:11:34 +0000 (03:11 +0000)]
[PowerPC]add testcase for ppcctrloops pass shortloop check

llvm-svn: 357560

5 years agoFix TargetLibraryInfoTest.ValidProto after rL357552
Sam Clegg [Wed, 3 Apr 2019 02:30:35 +0000 (02:30 +0000)]
Fix TargetLibraryInfoTest.ValidProto after rL357552

llvm-svn: 357559

5 years agoAMDGPU: Assume ECC is enabled by default if supported
Matt Arsenault [Wed, 3 Apr 2019 01:58:57 +0000 (01:58 +0000)]
AMDGPU: Assume ECC is enabled by default if supported

The test should really be checking for the property directly in the
code object headers, but there are problems with this. I don't see
this directly represented in the text form, and for the binary
emission this is depending on a function level subtarget feature to
emit a global flag.

llvm-svn: 357558

5 years ago[analyzer] When failing to evaluate a __builtin_constant_p, presume it's false.
Artem Dergachev [Wed, 3 Apr 2019 01:53:40 +0000 (01:53 +0000)]
[analyzer] When failing to evaluate a __builtin_constant_p, presume it's false.

__builtin_constant_p(x) is a compiler builtin that evaluates to 1 when
its argument x is a compile-time constant and to 0 otherwise. In CodeGen
it is simply lowered to the respective LLVM intrinsic. In the Analyzer
we've been trying to delegate modeling to Expr::EvaluateAsInt, which is
allowed to sometimes fail for no apparent reason.

When it fails, let's conservatively return false. Modeling it as false
is pretty much never wrong, and it is only required to return true
on a best-effort basis, which every user should expect.

Fixes VLAChecker false positives on code that tries to emulate
static asserts in C by constructing a VLA of dynamic size -1 under the
assumption that this dynamic size is actually a constant
in the sense of __builtin_constant_p.

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

llvm-svn: 357557

5 years ago[CMake] Differentiate between static and shared libc++abi
Petr Hosek [Wed, 3 Apr 2019 01:33:14 +0000 (01:33 +0000)]
[CMake] Differentiate between static and shared libc++abi

This addresses the issue introduced in r354212 which broke the case when
static libc++abi is merged into static libc++, but shared libc++ is
linked against shared libc++. There are 4 different possible
combinations which is difficult to capture using a single variable. This
change splits LIBCXX_CXX_ABI_LIBRARY into two:
LIBCXX_CXX_SHARED_ABI_LIBRARY and LIBCXX_CXX_STATIC_ABI_LIBRARY to
handle the shared and static cases. This in turn allows simplification
of some of the logic around merging of static archives.

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

llvm-svn: 357556

5 years ago[lit] Use 10 minute timeout by default.
Jonas Devlieghere [Wed, 3 Apr 2019 01:26:41 +0000 (01:26 +0000)]
[lit] Use 10 minute timeout by default.

Lit has the ability to set a timeout for individual tests. This patch
enables that functionality with a default of 10 minutes.

Currently we rely on the bots to kill the whole test suite. However this
doesn't tell us which test caused the timeout. Furthermore, when running
the test suite during development, I have to manually kill the tests
that time out to get the lit output at then end. This fixes both
inconveniences.

llvm-svn: 357555

5 years ago[lldb-dotest] Print dotest.py invocation.
Jonas Devlieghere [Wed, 3 Apr 2019 01:26:38 +0000 (01:26 +0000)]
[lldb-dotest] Print dotest.py invocation.

In order to debug a failing python test, you need to debug Python
instead of the wrapper. For a while I've been adding and removing this,
but I think it could be useful for everyone.

llvm-svn: 357554

5 years agoAvoid macro redefinition error if HAVE_LIBCOMPRESSION
Jason Molenda [Wed, 3 Apr 2019 01:16:54 +0000 (01:16 +0000)]
Avoid macro redefinition error if HAVE_LIBCOMPRESSION
is already defined.

llvm-svn: 357553

5 years ago[WebAssembly] Add Emscripten OS definition + small_printf
Alon Zakai [Wed, 3 Apr 2019 01:08:35 +0000 (01:08 +0000)]
[WebAssembly] Add Emscripten OS definition + small_printf

The Emscripten OS provides a definition of __EMSCRIPTEN__, and also that it
supports iprintf optimizations.

Also define small_printf optimizations, which is a printf with float support
but not long double (which in wasm can be useful since long doubles are 128
bit and force linking of float128 emulation code). This part is based on
sunfish's https://reviews.llvm.org/D57620 (which can't land yet since
the WASI integration isn't ready yet).

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

llvm-svn: 357552

5 years ago[libc++abi] Add LIBCXXABI_ENABLE_PIC cmake option
Sam Clegg [Wed, 3 Apr 2019 00:34:12 +0000 (00:34 +0000)]
[libc++abi] Add LIBCXXABI_ENABLE_PIC cmake option

This is on by default, since on many platforms and configurations
libc++abi.a gets statically linked into shared libraries and/or
PIE executables.

This change is a followup to https://reviews.llvm.org/D60005 which
allows us to default to PIC code, but disable this if needed (for
example on WebAssembly where PIC code its currently compatible with
static linking).

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

llvm-svn: 357551

5 years ago[libc++abi] Actually set POSITION_INDEPENDENT_CODE when building shared library
Sam Clegg [Wed, 3 Apr 2019 00:28:09 +0000 (00:28 +0000)]
[libc++abi] Actually set POSITION_INDEPENDENT_CODE when building shared library

This is a bug fix from https://reviews.llvm.org/D60005.

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

llvm-svn: 357550

5 years agoInstSimplify: Fold round intrinsics from sitofp/uitofp
Matt Arsenault [Wed, 3 Apr 2019 00:25:06 +0000 (00:25 +0000)]
InstSimplify: Fold round intrinsics from sitofp/uitofp

https://godbolt.org/z/gEMRZb

llvm-svn: 357549

5 years ago[WebAssembly] Remove unneeded target operand flags
Sam Clegg [Wed, 3 Apr 2019 00:17:29 +0000 (00:17 +0000)]
[WebAssembly] Remove unneeded target operand flags

This change is in preparation for the addition of new target
operand flags for new relocation types.  Have a symbol type as part
of the flag set makes it harder to use and AFAICT these are serving
no purpose.

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

llvm-svn: 357548

5 years ago[libcxx] [test] Add missing <stdexcept> to name std::out_of_range to string.conversio...
Billy Robert O'Neal III [Wed, 3 Apr 2019 00:08:42 +0000 (00:08 +0000)]
[libcxx] [test] Add missing <stdexcept> to name std::out_of_range to string.conversions\stold.pass.cpp.

llvm-svn: 357547

5 years ago[libcxx] [test] Use ptrdiff_t rather than int in splice_after_range.pass.cpp to avoid...
Billy Robert O'Neal III [Wed, 3 Apr 2019 00:07:18 +0000 (00:07 +0000)]
[libcxx] [test] Use ptrdiff_t rather than int in splice_after_range.pass.cpp to avoid narrowing from pointer subtraction to int warnings.

Reviewed as https://reviews.llvm.org/D60104

llvm-svn: 357546

5 years ago[libcxx] [test] Fix test bugs in string.cons/copy_alloc.pass.cpp.
Billy Robert O'Neal III [Wed, 3 Apr 2019 00:05:49 +0000 (00:05 +0000)]
[libcxx] [test] Fix test bugs in string.cons/copy_alloc.pass.cpp.

Fixed the inability to properly rebind the testing allocator, by making the
inner alloc_impl type a plain struct and making the operations templates. Before
rebind failed to compile complaining that a alloc_impl<T>* was not convertible
to an alloc_impl<U>*.

This enables the test to pass for MSVC++ once we provide the strong guarantee
for the copy assignment operator.

Reviewed as https://reviews.llvm.org/D60023

llvm-svn: 357545

5 years ago[X86] Update the test case for v4i1 bitselect in combine-bitselect.ll to not have...
Craig Topper [Wed, 3 Apr 2019 00:05:03 +0000 (00:05 +0000)]
[X86] Update the test case for v4i1 bitselect in combine-bitselect.ll to not have an infinite loop in IR.

In fact we don't even need a loop at all. I backed out the bug fix this was testing for and verified that this new case hit the same issue.

This should stop D59626 from deleting some of this code by realizing it was dead due to the loop.

llvm-svn: 357544

5 years ago[X86] Autogenerate complete checks. NFC
Craig Topper [Wed, 3 Apr 2019 00:04:57 +0000 (00:04 +0000)]
[X86] Autogenerate complete checks. NFC

llvm-svn: 357543

5 years agoAMDGPU: Remove unnecessary subtarget get
Matt Arsenault [Wed, 3 Apr 2019 00:01:05 +0000 (00:01 +0000)]
AMDGPU: Remove unnecessary subtarget get

llvm-svn: 357542

5 years agoAMDGPU: Fix names for generation features
Matt Arsenault [Wed, 3 Apr 2019 00:01:03 +0000 (00:01 +0000)]
AMDGPU: Fix names for generation features

We should overall stop using these, but the uppercase name didn't
work. Any feature string is converted to lowercase, so these
could never be found in the table.

llvm-svn: 357541

5 years agoFix backwards test that I committed yesterday. Sigh
Marshall Clow [Wed, 3 Apr 2019 00:01:03 +0000 (00:01 +0000)]
Fix backwards test that I committed yesterday. Sigh

llvm-svn: 357540

5 years agoAMDGPU: Don't use the default cpu in a few tests
Matt Arsenault [Wed, 3 Apr 2019 00:00:58 +0000 (00:00 +0000)]
AMDGPU: Don't use the default cpu in a few tests

Avoids unnecessary test changes in a future commit.

llvm-svn: 357539

5 years ago[GlobalISel] Add IRTranslator support for llvm.stacksave and llvm.stackrestore
Jessica Paquette [Tue, 2 Apr 2019 22:46:31 +0000 (22:46 +0000)]
[GlobalISel] Add IRTranslator support for llvm.stacksave and llvm.stackrestore

Also update arm64-irtranslator.ll.

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

llvm-svn: 357538

5 years agoX86: regenerate speculative-load-hardening-indirect.ll tests. NFC.
Stanislav Mekhanoshin [Tue, 2 Apr 2019 22:44:46 +0000 (22:44 +0000)]
X86: regenerate speculative-load-hardening-indirect.ll tests. NFC.

llvm-svn: 357537

5 years agoRevert "[libc++] Fix error flags and exceptions propagated from input stream operations"
Louis Dionne [Tue, 2 Apr 2019 22:21:27 +0000 (22:21 +0000)]
Revert "[libc++] Fix error flags and exceptions propagated from input stream operations"

This reverts commits r357533 and r357531, which broke the LLDB
data formatters. I'll hold off until we know how to fix the data
formatters accordingly.

llvm-svn: 357536

5 years ago[COFF] Reduce the size of Chunk and SectionChunk, NFC
Reid Kleckner [Tue, 2 Apr 2019 22:11:58 +0000 (22:11 +0000)]
[COFF] Reduce the size of Chunk and SectionChunk, NFC

Summary:
Reorder the fields in both to use padding more efficiently, and add more
comments on the purpose of the fields.

Replace `std::vector<SectionChunk*> AssociativeChildren` with a
singly-linked list. This avoids the separate vector allocation to list
associative children, and shrinks the 3 pointers used for the typically
empty vector down to 1.

In the end, this reduces the sum of heap allocations used to link
browser_tests.exe with NO PDB by 13.10%, going from 2,248,728 KB to
1,954,071 KB of heap. These numbers exclude memory mapped files, which
are of course a significant factor in LLD's memory usage.

Reviewers: ruiu, mstorsjo, aganea

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 357535

5 years agoRevert r357504, r357491, r357482 because of bot breakage.
Adrian Prantl [Tue, 2 Apr 2019 22:03:22 +0000 (22:03 +0000)]
Revert r357504, r357491, r357482 because of bot breakage.

See discussion in https://reviews.llvm.org/D60001.

Revert Clean up windows build bot.
This reverts r357504 (git commit 380c2420ecb0c3e809b04f385d37b89800df1ecf)
Revert Fix buildbot where paths were not matching up.
This reverts r357491 (git commit 5050586860140b55a0cc68c77dd1438f44a23ca5)
Revert Allow partial UUID matching in Minidump core file plug-in
This reverts r357482 (git commit 838bba9c34bf1e5500c2e100327bc764afc8d367)

llvm-svn: 357534

5 years ago[libc++] Fix build when exceptions are turned off
Louis Dionne [Tue, 2 Apr 2019 22:02:17 +0000 (22:02 +0000)]
[libc++] Fix build when exceptions are turned off

llvm-svn: 357533

5 years ago[HIP-Clang] Fat binary should not be produced for non GPU code
Aaron Enye Shi [Tue, 2 Apr 2019 21:54:41 +0000 (21:54 +0000)]
[HIP-Clang] Fat binary should not be produced for non GPU code

clang-format the changes to CUDA and HIP fat binary.

Reviewers: yaxunl, tra

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

llvm-svn: 357532

5 years ago[libc++] Fix error flags and exceptions propagated from input stream operations
Louis Dionne [Tue, 2 Apr 2019 21:43:07 +0000 (21:43 +0000)]
[libc++] Fix error flags and exceptions propagated from input stream operations

Summary:
Before this patch, we would only ever throw an exception if the badbit
was set on the stream. The Standard is currently very unclear on how
exceptions should be propagated and what error flags should be set by
the input stream operations. This commit changes libc++ to behave under
a different (but valid) interpretation of the Standard. This interpretation
of the Standard matches what other implementations are doing.

I will submit a paper in San Diego to clarify the Standard such that the
interpretation used in this commit (and other implementations) is the only
possible one.

PR21586
PR15949
rdar://problem/15347558

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, cfe-commits

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

llvm-svn: 357531

5 years ago[NFC][TSan][libdispatch] Cleanup test
Julian Lettner [Tue, 2 Apr 2019 20:58:49 +0000 (20:58 +0000)]
[NFC][TSan][libdispatch] Cleanup test

llvm-svn: 357530

5 years ago[X86] Mark the default case of the X86InstrInfo::convertToThreeAddress switch as...
Craig Topper [Tue, 2 Apr 2019 20:52:16 +0000 (20:52 +0000)]
[X86] Mark the default case of the X86InstrInfo::convertToThreeAddress switch as unreachable.

This function should only be called with instructions that are really convertible. And all
convertible instructions need to be handled by the switch. So nothing should use the default.

llvm-svn: 357529

5 years ago[X86] Check MI.isConvertibleTo3Addr() before calling convertToThreeAddress in X86Fixu...
Craig Topper [Tue, 2 Apr 2019 20:52:10 +0000 (20:52 +0000)]
[X86] Check MI.isConvertibleTo3Addr() before calling convertToThreeAddress in X86FixupLEAs.

X86FixupLEAs just assumes convertToThreeAddress will return nullptr for any instruction that isn't convertible.

But the code in convertToThreeAddress for X86 assumes that any instruction coming in has at least 2 operands and that the second one is a register. But those properties aren't guaranteed of all instructions. We should check the instruction property first.

llvm-svn: 357528

5 years ago[TableGen] Properly calculate the minimum size needed or ConvertFn in GenAsmmatcher...
Craig Topper [Tue, 2 Apr 2019 20:52:04 +0000 (20:52 +0000)]
[TableGen] Properly calculate the minimum size needed or ConvertFn in GenAsmmatcher.inc files

We were using the number of Matchables rather than the number of rows in the converter table.

This only matters for a few of the targets where the number of matchables is more than 255, but the number of converters is less than 255. Many of the targets have more than 256 converters. So already required a uint16_t.

llvm-svn: 357527

5 years ago[HIP-Clang] Fat binary should not be produced for non GPU code 2
Aaron Enye Shi [Tue, 2 Apr 2019 20:49:41 +0000 (20:49 +0000)]
[HIP-Clang] Fat binary should not be produced for non GPU code 2

Also for CUDA, we need to disable producing these fat binary functions when there is no GPU code.

Reviewers: yaxunl, tra

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

llvm-svn: 357526

5 years ago[LLD][COFF] Move type merging structures out of PDB.cpp. NFC
Alexandre Ganea [Tue, 2 Apr 2019 20:43:19 +0000 (20:43 +0000)]
[LLD][COFF] Move type merging structures out of PDB.cpp. NFC

Introduce a new TypeMerger class, out of some type-merge-specific structures from PDB.cpp

No changes intended / this is only moving code around.

This patch is step 3. in "Proposed commit strategy" in D59226

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

llvm-svn: 357525

5 years ago[NFC] Test is C++, not C
Julian Lettner [Tue, 2 Apr 2019 20:39:10 +0000 (20:39 +0000)]
[NFC] Test is C++, not C

llvm-svn: 357524

5 years ago[x86] add more tests for FP scalarization; NFC
Sanjay Patel [Tue, 2 Apr 2019 20:24:06 +0000 (20:24 +0000)]
[x86] add more tests for FP scalarization; NFC

llvm-svn: 357523

5 years ago[InstCombine] Added tests for PR41337
David Bolvansky [Tue, 2 Apr 2019 20:21:26 +0000 (20:21 +0000)]
[InstCombine] Added tests for PR41337

llvm-svn: 357522

5 years ago[InstCombine] Simplify ctlz/cttz with bitreverse
David Bolvansky [Tue, 2 Apr 2019 20:13:28 +0000 (20:13 +0000)]
[InstCombine] Simplify ctlz/cttz with bitreverse

Summary: Fixes PR41273

Reviewers: spatel

Reviewed By: spatel

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 357521

5 years ago[HIP-Clang] Fat binary should not be produced for non GPU code
Aaron Enye Shi [Tue, 2 Apr 2019 20:10:18 +0000 (20:10 +0000)]
[HIP-Clang] Fat binary should not be produced for non GPU code

Skip producing the fat binary functions for HIP when no device code is present.

Reviewers: yaxunl

Differential Review: https://reviews.llvm.org/D60141

llvm-svn: 357520

5 years ago[TSan][libdispatch] We don't require any setup on Darwin
Julian Lettner [Tue, 2 Apr 2019 20:04:32 +0000 (20:04 +0000)]
[TSan][libdispatch] We don't require any setup on Darwin

llvm-svn: 357519

5 years ago[AArch64][GlobalISel] Select llvm.aarch64.stlxr(i64, i64*)
Jessica Paquette [Tue, 2 Apr 2019 19:57:26 +0000 (19:57 +0000)]
[AArch64][GlobalISel] Select llvm.aarch64.stlxr(i64, i64*)

This adds partial instruction selection support for llvm.aarch64.stlxr. It also
factors out selection for G_INTRINSIC_W_SIDE_EFFECTS into its own function. The
new function removes the restriction that the intrinsic ID on the
G_INTRINSIC_W_SIDE_EFFECTS be on operand 0.

Also add a test, and add a GISel line to arm64-ldxr-stxr.ll.

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

llvm-svn: 357518

5 years ago[libc++] Correctly handle Objective-C++ ARC qualifiers in std::is_pointer
Louis Dionne [Tue, 2 Apr 2019 19:48:39 +0000 (19:48 +0000)]
[libc++] Correctly handle Objective-C++ ARC qualifiers in std::is_pointer

Summary:
Otherwise, std::is_pointer<id __strong> works, but std::is_pointer<id __weak>
(and others) don't work as expected.

rdar://problem/49126333

Reviewers: ahatanak, EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

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

llvm-svn: 357517

5 years ago[Sema] Fix a use-after-deallocate of a ParsedAttr
Erik Pilkington [Tue, 2 Apr 2019 19:48:11 +0000 (19:48 +0000)]
[Sema] Fix a use-after-deallocate of a ParsedAttr

moveAttrFromListToList only makes sense when moving an attribute to a list with
a pool that's either equivalent, or has a shorter lifetime. Therefore, using it
to move a ParsedAttr from a declarator to a declaration specifier doesn't make
sense, since the declaration specifier's pool outlives the declarator's. The
patch adds a new function, ParsedAttributes::takeOneFrom, which transfers the
attribute from one pool to another, fixing the use-after-deallocate.

rdar://49175426

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

llvm-svn: 357516

5 years ago[CodeGen] Fix a regression by emitting lambda expressions in EmitLValue
Erik Pilkington [Tue, 2 Apr 2019 19:48:07 +0000 (19:48 +0000)]
[CodeGen] Fix a regression by emitting lambda expressions in EmitLValue

This ability was removed in r351487, but it's needed when a lambda appears as an
OpaqueValueExpr subexpression of a PseudoObjectExpr.

rdar://49030379

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

llvm-svn: 357515

5 years ago[OPENMP]Add codegen for private vars with allocate clause.
Alexey Bataev [Tue, 2 Apr 2019 19:44:46 +0000 (19:44 +0000)]
[OPENMP]Add codegen for private vars with allocate clause.

Added codegen/test for the privatized variables with the allocate
clause.

llvm-svn: 357514

5 years ago[NativePDB] Don't fail on import modules.
Zachary Turner [Tue, 2 Apr 2019 19:39:45 +0000 (19:39 +0000)]
[NativePDB] Don't fail on import modules.

A recent patch to LLD started emitting information about import modules.
These are represented as compile units in the PDB, but with no
additional debug info.  This was confusing the native pdb reader, who
expected that the debug info stream be present.

This should fix failing tests on the Windows bots.

llvm-svn: 357513

5 years ago[libc++] Remove use of auto with actual type
Louis Dionne [Tue, 2 Apr 2019 19:20:47 +0000 (19:20 +0000)]
[libc++] Remove use of auto with actual type

For compatibility with C++03.

llvm-svn: 357512

5 years ago[libc++][NFC] Remove useless public: label at the end of class
Louis Dionne [Tue, 2 Apr 2019 19:11:22 +0000 (19:11 +0000)]
[libc++][NFC] Remove useless public: label at the end of class

llvm-svn: 357511

5 years ago[NFC][libdispatch] Improve a few tests
Julian Lettner [Tue, 2 Apr 2019 18:46:59 +0000 (18:46 +0000)]
[NFC][libdispatch] Improve a few tests

llvm-svn: 357510

5 years ago[FileCheck] Fix FileCheck.cpp compilation on Solaris
Rainer Orth [Tue, 2 Apr 2019 18:38:23 +0000 (18:38 +0000)]
[FileCheck] Fix FileCheck.cpp compilation on Solaris

Both LLVM 8.0.0 and current trunk fail to compile on Solaris with GCC 8.1.0:

  /vol/llvm/src/llvm/dist/utils/FileCheck/FileCheck.cpp: In function ‘void DumpAnnotatedInput(llvm::raw_ostream&, const llvm::FileCheckRequest&, llvm::StringRef, std::vector<InputAnnotation>&, unsigned int)’:
  /vol/llvm/src/llvm/dist/utils/FileCheck/FileCheck.cpp:408:41: error: call of overloaded ‘log10(unsigned int&)’ is ambiguous
     unsigned LineNoWidth = log10(LineCount) + 1;
                                           ^
  In file included from /vol/gcc-8/lib/gcc/i386-pc-solaris2.11/8.1.0/include-fixed/math.h:24,
                   from /vol/gcc-8/include/c++/8.1.0/cmath:45,
                   from /vol/llvm/src/llvm/dist/include/llvm-c/DataTypes.h:28,
                   from /vol/llvm/src/llvm/dist/include/llvm/Support/DataTypes.h:16,
                   from /vol/llvm/src/llvm/dist/include/llvm/ADT/Hashing.h:47,
                   from /vol/llvm/src/llvm/dist/include/llvm/ADT/ArrayRef.h:12,
                   from /vol/llvm/src/llvm/dist/include/llvm/Support/CommandLine.h:22,
                   from /vol/llvm/src/llvm/dist/utils/FileCheck/FileCheck.cpp:18:
  /vol/gcc-8/lib/gcc/i386-pc-solaris2.11/8.1.0/include-fixed/iso/math_iso.h:209:21: note: candidate: ‘long double std::log10(long double)’
    inline long double log10(long double __X) { return __log10l(__X); }
                       ^~~~~
  /vol/gcc-8/lib/gcc/i386-pc-solaris2.11/8.1.0/include-fixed/iso/math_iso.h:170:15: note: candidate: ‘float std::log10(float)’
    inline float log10(float __X) { return __log10f(__X); }
                 ^~~~~
  /vol/gcc-8/lib/gcc/i386-pc-solaris2.11/8.1.0/include-fixed/iso/math_iso.h:70:15: note: candidate: ‘double std::log10(double)’
   extern double log10 __P((double));
                 ^~~~~

Fixed by using std::log10 instead, which allowed the compilation on i386-pc-solaris2.11
and sparc-sun-solaris2.11 to continue.

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

llvm-svn: 357509

5 years ago[InstCombine] Added tests for PR41273
David Bolvansky [Tue, 2 Apr 2019 18:33:54 +0000 (18:33 +0000)]
[InstCombine] Added tests for PR41273

llvm-svn: 357508

5 years ago[Reproducers] Print warning when generating the reproducer.
Jonas Devlieghere [Tue, 2 Apr 2019 18:23:16 +0000 (18:23 +0000)]
[Reproducers] Print warning when generating the reproducer.

Encourage users to look at the directory so they know what data they'd
be sharing by uploading the reproducer.

llvm-svn: 357507

5 years ago[driver][mips] Check both `gnuabi64` and `gnu` suffixes in `getMultiarchTriple`
Simon Atanasyan [Tue, 2 Apr 2019 18:03:31 +0000 (18:03 +0000)]
[driver][mips] Check both `gnuabi64` and `gnu` suffixes in `getMultiarchTriple`

In case of N64 ABI toolchain paths migth have `mips-linux-gnuabi64`
or `mips-linux-gnu` directory regardless of selected environment.
Check both variants while detecting a multiarch triple.

Fix for the bug https://bugs.llvm.org/show_bug.cgi?id=41204

llvm-svn: 357506

5 years ago[driver] clang-format. Fix indentation, split long lines. NFC
Simon Atanasyan [Tue, 2 Apr 2019 18:03:15 +0000 (18:03 +0000)]
[driver] clang-format. Fix indentation, split long lines. NFC

llvm-svn: 357505

5 years agoClean up windows build bot.
Greg Clayton [Tue, 2 Apr 2019 17:50:08 +0000 (17:50 +0000)]
Clean up windows build bot.

llvm-svn: 357504

5 years ago[Remarks][NFCI] Remove useless include
Francis Visoiu Mistrih [Tue, 2 Apr 2019 17:48:55 +0000 (17:48 +0000)]
[Remarks][NFCI] Remove useless include

Remarks.h only uses LLVMBool, which comes from llvm-c/Types.h. Nothing
from llvm-c/Core.h is used.

llvm-svn: 357503

5 years agoFix problem with ar_to_bc.sh script introduced by r357450.
Peter Collingbourne [Tue, 2 Apr 2019 17:47:38 +0000 (17:47 +0000)]
Fix problem with ar_to_bc.sh script introduced by r357450.

The new code wasn't matching absolute paths correctly. Should unbreak
sanitizer-x86_64-linux bot.

llvm-svn: 357502

5 years ago[os_log] Mark os_log_helper `nounwind`
Vedant Kumar [Tue, 2 Apr 2019 17:42:38 +0000 (17:42 +0000)]
[os_log] Mark os_log_helper `nounwind`

Allow the optimizer to remove unnecessary EH cleanups surrounding calls
to os_log_helper, to save some code size.

As a follow-up, it might be worthwhile to add a BasicNoexcept exception
spec to os_log_helper, and to then teach CGCall to emit direct calls for
callees which can't throw. This could save some compile-time.

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

llvm-svn: 357501

5 years ago[ArgPromotion] Set debug location at updated callsites
Vedant Kumar [Tue, 2 Apr 2019 17:42:17 +0000 (17:42 +0000)]
[ArgPromotion] Set debug location at updated callsites

Set the correct debug location on instructions which load arguments in
preparation for a call to an arg-promoted function.

This prevents location cascade from misattributing the line/scope of one
of these loads to the location of the instruction preceding the call.

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

llvm-svn: 357500

5 years ago[DebugInfo] Fix pr41180 : Loop Vectorization Debugify Failure
Vedant Kumar [Tue, 2 Apr 2019 17:28:34 +0000 (17:28 +0000)]
[DebugInfo] Fix pr41180 : Loop Vectorization Debugify Failure

Bug: https://bugs.llvm.org/show_bug.cgi?id=41180

In the bug test case the debug location was missing for the cmp instruction in
the "middle block" BB. This patch fixes the bug by copying the debug location
from the cmp of the scalar loop's terminator branch, if it exists.

The patch also fixes the debug location on the subsequent branch instruction.
It was previously using the location of the of the original loop's pre-header
block terminator. Both of these instructions will now map to the source line of
the conditional branch in the original loop.

A regression test has been added that covers these issues.

Patch by Orlando Cazalet-Hyams!

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

llvm-svn: 357499

5 years ago[DAGCombiner] reduce code duplication; NFC
Sanjay Patel [Tue, 2 Apr 2019 17:20:54 +0000 (17:20 +0000)]
[DAGCombiner] reduce code duplication; NFC

llvm-svn: 357498

5 years ago[X86] Allow FixupLEAs to form INC/DEC under OptSize not just MinSize
Craig Topper [Tue, 2 Apr 2019 17:13:03 +0000 (17:13 +0000)]
[X86] Allow FixupLEAs to form INC/DEC under OptSize not just MinSize

This matches our usual INC/DEC heuristic used during isel.

llvm-svn: 357497

5 years ago[lldb-server] Use llgs namespace to avoid conflicts with Win32 API
Aaron Smith [Tue, 2 Apr 2019 17:10:12 +0000 (17:10 +0000)]
[lldb-server] Use llgs namespace to avoid conflicts with Win32 API

llvm-svn: 357496

5 years agoFix typo; NFC
Aaron Smith [Tue, 2 Apr 2019 17:02:21 +0000 (17:02 +0000)]
Fix typo; NFC

llvm-svn: 357495

5 years ago[PowerPC] Fix reversed bit issue in DCMX mask for "xvtstdcdp" and "xvtstdcsp" P9...
Stefan Pintilie [Tue, 2 Apr 2019 16:56:01 +0000 (16:56 +0000)]
[PowerPC] Fix reversed bit issue in DCMX mask for "xvtstdcdp" and "xvtstdcsp" P9 implementation

Did experiments on power 9 machine, checked the outputs for NaN & Infinity+
cases with corresponding DCMX bit set. Confirmed the DCMX mask bit for NaN and
infinity+ are reversed.

This patch fixes the issue.

Patch by Victor Huang.

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

llvm-svn: 357494