platform/upstream/llvm.git
5 years ago[ARM] Do not fuse VADD and VMUL on the Cortex-M4 and Cortex-M33
Sjoerd Meijer [Mon, 24 Sep 2018 12:02:50 +0000 (12:02 +0000)]
[ARM] Do not fuse VADD and VMUL on the Cortex-M4 and Cortex-M33

A sequence of VMUL and VADD instructions always give the same or better
performance than a fused VMLA instruction on the Cortex-M4 and Cortex-M33.
Executing the VMUL and VADD back-to-back requires the same cycles, but
having separate instructions allows scheduling to avoid the hazard between
these 2 instructions.

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

llvm-svn: 342874

5 years agoRevert r341932 "[ARM] Enable ARMCodeGenPrepare by default"
Hans Wennborg [Mon, 24 Sep 2018 11:40:07 +0000 (11:40 +0000)]
Revert r341932 "[ARM] Enable ARMCodeGenPrepare by default"

This caused miscompilation of WebRTC for Android: PR39060.

> We've had the pass enabled downstream for a couple of weeks and it
> seems to be okay, so enable it by default.
>
> Differential Revision: https://reviews.llvm.org/D51920

llvm-svn: 342873

5 years ago[ARM][ARMLoadStoreOptimizer]
Luke Cheeseman [Mon, 24 Sep 2018 10:42:22 +0000 (10:42 +0000)]
[ARM][ARMLoadStoreOptimizer]

- The load store optimizer is currently merging multiple loads/stores into VLDM/VSTM with more than 16 doubleword registers
- This is an UNPREDICTABLE instruction and shouldn't be done
- It looks like the Limit for how many registers included in a merge got dropped at some point so I am reintroducing it in this patch
- This fixes https://bugs.llvm.org/show_bug.cgi?id=38389

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

llvm-svn: 342872

5 years ago[deadargelim] Update dbg.value of 'unused' parameters
Petar Jovanovic [Mon, 24 Sep 2018 10:01:24 +0000 (10:01 +0000)]
[deadargelim] Update dbg.value of 'unused' parameters

DeadArgElim pass marks unused function arguments as ‘undef’ without updating
existing dbg.values referring to it. As a consequence the debug info
metadata in the final executable was wrong.

Patch by Djordje Todorovic.

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

llvm-svn: 342871

5 years ago[ARM] bottom-top mul support ARMParallelDSP
Sam Parker [Mon, 24 Sep 2018 09:34:06 +0000 (09:34 +0000)]
[ARM] bottom-top mul support ARMParallelDSP

Originally committed in rL342210 but was reverted in rL342260 because
it was causing issues in vectorized code, because I had forgotten to
ensure that we're operating on scalar values.

Original commit message:

On failing to find sequences that can be converted into dual macs,
try to find sequential 16-bit loads that are used by muls which we
can then use smultb, smulbt, smultt with a wide load.

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

llvm-svn: 342870

5 years agoWhen running the ios/iossim prepare script show the script output when it returns...
Dan Liew [Mon, 24 Sep 2018 09:30:33 +0000 (09:30 +0000)]
When running the ios/iossim prepare script show the script output when it returns with a non-zero exit code.

Summary:
Previously we'd just show the exception and not the output from the
executed script. This is unhelpful in the case that the script actually
reports some useful information on the failure.

Now we print the output and re-raise the exception.

Reviewers: kubamracek, george.karpenkov

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 342869

5 years agoFix the configuration of the Primary allocator for Darwin ARM64 by
Dan Liew [Mon, 24 Sep 2018 09:28:35 +0000 (09:28 +0000)]
Fix the configuration of the Primary allocator for Darwin ARM64 by
changing the value of `SANITIZER_MMAP_RANGE_SIZE` to something more
sensible. The available VMA is at most 64GiB and not 256TiB that
was previously being used.

This change gives us several wins:

* Drastically improves LeakSanitizer performance on
  Darwin ARM64 devices. On a simple synthentic benchmark
  this took leak detection time from ~30 seconds to 0.5 seconds
  due to the `ForEachChunk(...)` method enumerating a much smaller
  number of regions. Previously we would pointlessly iterate
  over a large portion of the SizeClassAllocator32's ByteMap
  that would could never be set due it being configured for a much
  larger VM space than is actually availble.

* Decreases the memory required for the Primary allocator.
  Previously the ByteMap inside the the allocator used
  an array of pointers that took 512KiB of space. Now the required
  space for the array is 128 bytes.

rdar://problem/43509428

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

llvm-svn: 342868

5 years ago[clangd] Force Dex to respect symbol collector flags
Kirill Bobyrev [Mon, 24 Sep 2018 08:45:18 +0000 (08:45 +0000)]
[clangd] Force Dex to respect symbol collector flags

`Dex` should utilize `FuzzyFindRequest.RestrictForCodeCompletion` flags
and omit symbols not meant for code completion when asked for it.

The measurements below were conducted with setting
`FuzzyFindRequest.RestrictForCodeCompletion` to `true` (so that it's
more realistic). Sadly, the average latency goes down, I suspect that is
mostly because of the empty queries where the number of posting lists is
critical.

| Metrics  | Before | After | Relative difference
| -----  | -----  | -----   | -----
| Cumulative query latency (7000 `FuzzyFindRequest`s over LLVM static index)  | 6182735043 ns    | 7202442053 ns | +16%
| Whole Index size | 81.24 MB    | 81.79 MB | +0.6%

Out of 292252 symbols collected from LLVM codebase 136926 appear to be
restricted for code completion.

Reviewers: ioeric

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

llvm-svn: 342866

5 years ago[llvm-exegesis] Fix PR39021.
Clement Courbet [Mon, 24 Sep 2018 08:39:48 +0000 (08:39 +0000)]
[llvm-exegesis] Fix PR39021.

Summary:
The `set` statements was incorrectly reading the value of the local variable and
setting the value of the parent variable.

Reviewers: tycho, gchatelet, john.brawn

Subscribers: mgorny, tschuett, llvm-commits

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

llvm-svn: 342865

5 years agoFix llvm-diff anon-func.ll test
Hans Wennborg [Mon, 24 Sep 2018 08:34:17 +0000 (08:34 +0000)]
Fix llvm-diff anon-func.ll test

llvm-svn: 342864

5 years agoRemove debug printf leftover from r342397
Hans Wennborg [Mon, 24 Sep 2018 08:18:47 +0000 (08:18 +0000)]
Remove debug printf leftover from r342397

llvm-svn: 342863

5 years ago[ARM][AArch64] Add feature +fp16fml
Sjoerd Meijer [Mon, 24 Sep 2018 07:55:20 +0000 (07:55 +0000)]
[ARM][AArch64] Add feature +fp16fml

Armv8.4-A adds a few FP16 instructions that can optionally be implemented
in CPUs of Armv8.2-A and above.

This patch adds a feature to clang to permit selection of these
instructions. This interacts with the +fp16 option as follows:

Prior to Armv8.4-A:
*) +fp16fml implies +fp16
*) +nofp16 implies +nofp16fml

From Armv8.4-A:
*) The above conditions apply, additionally: +fp16 implies +fp16fml

Patch by Bernard Ogden.

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

llvm-svn: 342862

5 years agoAdd inherited attributes before parsed attributes.
Michael Kruse [Mon, 24 Sep 2018 06:31:37 +0000 (06:31 +0000)]
Add inherited attributes before parsed attributes.

Currently, attributes from previous declarations ('inherited attributes')
are added to the end of a declaration's list of attributes. Before
r338800, the attribute list was in reverse. r338800 changed the order
of non-inherited (parsed from the current declaration) attributes, but
inherited attributes are still appended to the end of the list.

This patch appends inherited attributes after other inherited
attributes, but before any non-inherited attribute. This is to make the
order of attributes in the AST correspond to the order in the source
code.

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

llvm-svn: 342861

5 years ago[X86] Add 512-bit test cases to setcc-wide-types.ll. NFC
Craig Topper [Mon, 24 Sep 2018 05:46:01 +0000 (05:46 +0000)]
[X86] Add 512-bit test cases to setcc-wide-types.ll. NFC

llvm-svn: 342860

5 years ago[XRay] Clean up XRay build configuration
Dean Michael Berris [Mon, 24 Sep 2018 05:28:01 +0000 (05:28 +0000)]
[XRay] Clean up XRay build configuration

Summary:
This change spans both LLVM and compiler-rt, where we do the following:

- Add XRay to the LLVMBuild system, to allow for distributing the XRay
  trace loading library along with the LLVM distributions.

- Use `llvm-config` better in the compiler-rt XRay implementation, to
  depend on the potentially already-distributed LLVM XRay library.

While this is tested with the standalone compiler-rt build, it does
require that the LLVMXRay library (and LLVMSupport as well) are
available during the build. In case the static libraries are available,
the unit tests will build and work fine. We're still having issues with
attempting to use a shared library version of the LLVMXRay library since
the shared library might not be accessible from the standard shared
library lookup paths.

The larger change here is the inclusion of the LLVMXRay library in the
distribution, which allows for building tools around the XRay traces and
profiles that the XRay runtime already generates.

Reviewers: echristo, beanz

Subscribers: mgorny, hiraditya, mboerger, llvm-commits

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

llvm-svn: 342859

5 years agoFix asserts when linking wrong address space declarations
Matt Arsenault [Mon, 24 Sep 2018 04:42:14 +0000 (04:42 +0000)]
Fix asserts when linking wrong address space declarations

llvm-svn: 342858

5 years agollvm-diff: Fix crash on anonymous functions
Matt Arsenault [Mon, 24 Sep 2018 04:42:13 +0000 (04:42 +0000)]
llvm-diff: Fix crash on anonymous functions

Not sure what the correct behavior is for this.
Skip them and report how many there were.

llvm-svn: 342857

5 years ago[DAGCombiner] Remove some dead code from ConstantFoldBITCASTofBUILD_VECTOR
Craig Topper [Mon, 24 Sep 2018 02:03:11 +0000 (02:03 +0000)]
[DAGCombiner] Remove some dead code from ConstantFoldBITCASTofBUILD_VECTOR

This code handled SCALAR_TO_VECTOR being returned by the recursion, but the code that used to return SCALAR_TO_VECTOR was removed in 2015.

llvm-svn: 342856

5 years ago[libcxx] Fix the binder deprecation tests on Clang 5.
Louis Dionne [Sun, 23 Sep 2018 23:17:48 +0000 (23:17 +0000)]
[libcxx] Fix the binder deprecation tests on Clang 5.

Tested on Docker containers with Clang 4, 5 and 6.

llvm-svn: 342855

5 years ago[libcxx] Fix buildbots on Debian
Louis Dionne [Sun, 23 Sep 2018 22:16:35 +0000 (22:16 +0000)]
[libcxx] Fix buildbots on Debian

Debian build bots are running Clang 4, which apparently does not support
the "deprecated" attribute properly. Clang pretends to support the attribute,
but the attribute doesn't do anything.

(live example: https://wandbox.org/permlink/0De69aXns0t1D59r)

On a separate note, I'm not sure I understand why we're even running the
libc++ tests under Clang-4. Is this a configuration we support? I can
understand that libc++ should _build_ with Clang 4, but it's not clear
to me that new libc++ headers should be usable under older compilers
like that.

llvm-svn: 342854

5 years ago[ORC] Add some debugging output to Core.h/Core.cpp
Lang Hames [Sun, 23 Sep 2018 21:30:05 +0000 (21:30 +0000)]
[ORC] Add some debugging output to Core.h/Core.cpp

Core now logs when materialization units are dispatched or return to JITDylibs.

llvm-svn: 342853

5 years ago[X86] Split WriteShift/WriteRotate schedule classes by CL usage.
Simon Pilgrim [Sun, 23 Sep 2018 21:19:15 +0000 (21:19 +0000)]
[X86] Split WriteShift/WriteRotate schedule classes by CL usage.

Variable Shifts/Rotates using the CL register have different behaviours to the immediate instructions - split accordingly to help remove yet more repeated overrides from the schedule models.

llvm-svn: 342852

5 years ago[DAGCombiner] Clarify a comment. NFC
Craig Topper [Sun, 23 Sep 2018 21:17:56 +0000 (21:17 +0000)]
[DAGCombiner] Clarify a comment. NFC

This comment was misleading about why we were restricting to before legalize types. The reason given would only apply to before legalize ops. But there is a before legalize types reason that should also be listed.

llvm-svn: 342851

5 years ago[LegalizeTypes] Fix bad indentation. NFC
Craig Topper [Sun, 23 Sep 2018 21:17:55 +0000 (21:17 +0000)]
[LegalizeTypes] Fix bad indentation. NFC

llvm-svn: 342850

5 years ago[libcxx] Document new symbols __u64toa and __u32toa on Darwin
Louis Dionne [Sun, 23 Sep 2018 21:10:06 +0000 (21:10 +0000)]
[libcxx] Document new symbols __u64toa and __u32toa on Darwin

Summary:
This is the counterpart for https://reviews.llvm.org/D50130 and
https://reviews.llvm.org/D52391 on Darwin.

Reviewers: EricWF

Subscribers: christof, dexonsmith, cfe-commits, libcxx-commits, lichray

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

llvm-svn: 342849

5 years ago[X86] Remove unnecessary WriteRotate override. NFCI.
Simon Pilgrim [Sun, 23 Sep 2018 19:33:58 +0000 (19:33 +0000)]
[X86] Remove unnecessary WriteRotate override. NFCI.

SNB was the last override for ROT(L|R)r(1|i) - they now all use WriteRotate correctly.

llvm-svn: 342848

5 years agoFix line ending mismatches. NFCI.
Simon Pilgrim [Sun, 23 Sep 2018 19:16:32 +0000 (19:16 +0000)]
Fix line ending mismatches. NFCI.

llvm-svn: 342847

5 years ago[X86] ROR*mCL instruction models should match ROL*mCL etc.
Simon Pilgrim [Sun, 23 Sep 2018 19:16:01 +0000 (19:16 +0000)]
[X86] ROR*mCL instruction models should match ROL*mCL etc.

Confirmed with Craig Topper - fix a typo that was missing a Port4 uop for ROR*mCL instructions on some Intel models.

Yet another step on the scheduler model cleanup marathon......

llvm-svn: 342846

5 years ago[Aarch64] Fix memcpy that was copying 4x too many bytes
Benjamin Kramer [Sun, 23 Sep 2018 18:43:28 +0000 (18:43 +0000)]
[Aarch64] Fix memcpy that was copying 4x too many bytes

Found by asan.

llvm-svn: 342845

5 years ago[DAGCombiner][x86] extend decompose of integer multiply into shift/add with negation
Sanjay Patel [Sun, 23 Sep 2018 18:41:38 +0000 (18:41 +0000)]
[DAGCombiner][x86] extend decompose of integer multiply into shift/add with negation

This is an alternative to https://reviews.llvm.org/D37896. We can't decompose
multiplies generically without a target hook to tell us when it's profitable.

ARM and AArch64 may be able to remove some existing code that overlaps with
this transform.

This extends D52195 and may resolve PR34474:
https://bugs.llvm.org/show_bug.cgi?id=34474
(still an open question about transforming legal vector multiplies, but we
could open another bug report for those)

llvm-svn: 342844

5 years ago[libc++] Add deprecated attributes to many deprecated components
Louis Dionne [Sun, 23 Sep 2018 18:35:00 +0000 (18:35 +0000)]
[libc++] Add deprecated attributes to many deprecated components

Summary:
These deprecation warnings are opt-in: they are only enabled when the
_LIBCXX_DEPRECATION_WARNINGS macro is defined, which is not the case
by default. Note that this is a first step in the right direction, but
I wasn't able to get an exhaustive list of all deprecated components
per standard, so there's certainly stuff that's missing. The list of
components this commit marks as deprecated is:

in C++11:
- auto_ptr, auto_ptr_ref
- binder1st, binder2nd, bind1st(), bind2nd()
- pointer_to_unary_function, pointer_to_binary_function, ptr_fun()
- mem_fun_t, mem_fun1_t, const_mem_fun_t, const_mem_fun1_t, mem_fun()
- mem_fun_ref_t, mem_fun1_ref_t, const_mem_fun_ref_t, const_mem_fun1_ref_t, mem_fun_ref()

in C++14:
- random_shuffle()

in C++17:
- unary_negate, binary_negate, not1(), not2()

<rdar://problem/18168350>

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, llvm-commits

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

llvm-svn: 342843

5 years ago[X86] Added missing RCL/RCR schedule overrides to the generic SNB model
Simon Pilgrim [Sun, 23 Sep 2018 17:40:24 +0000 (17:40 +0000)]
[X86] Added missing RCL/RCR schedule overrides to the generic SNB model

The SandyBridge model was missing schedule values for the RCL/RCR values - instead using the (incredibly optimistic) WriteShift (now WriteRotate) defaults.

I've added overrides with more realistic (slow) values, based on a mixture of Agner/instlatx64 numbers and what later Intel models do as well.

This is necessary to allow WriteRotate to be updated to remove other rotate overrides.

It'd probably be a good idea to investigate a WriteRotateCarry class at some point but its not high priority given the unusualness of these instructions.

llvm-svn: 342842

5 years ago[X86] Remove unnecessary WriteRotate overrides. NFCI.
Simon Pilgrim [Sun, 23 Sep 2018 16:53:02 +0000 (16:53 +0000)]
[X86] Remove unnecessary WriteRotate overrides. NFCI.

llvm-svn: 342841

5 years ago[NFC][libcxx] Rename helpers with 4 underscores to something more reasonable
Louis Dionne [Sun, 23 Sep 2018 16:44:50 +0000 (16:44 +0000)]
[NFC][libcxx] Rename helpers with 4 underscores to something more reasonable

llvm-svn: 342840

5 years ago[X86] Move RORX instructions back to WriteShift schedule class
Simon Pilgrim [Sun, 23 Sep 2018 16:17:13 +0000 (16:17 +0000)]
[X86] Move RORX instructions back to WriteShift schedule class

Despite being rotates, these more modern instructions avoid many of the quirks of the regular x86 rotate instructions and consistently have a schedule closer to shifts.

llvm-svn: 342839

5 years ago[x86] add tests for mul decomposition with negative constant; NFC
Sanjay Patel [Sun, 23 Sep 2018 16:07:46 +0000 (16:07 +0000)]
[x86] add tests for mul decomposition with negative constant; NFC

llvm-svn: 342838

5 years ago[X86] Add WriteRotate schedule class, splitting off from WriteShift.
Simon Pilgrim [Sun, 23 Sep 2018 15:12:10 +0000 (15:12 +0000)]
[X86] Add WriteRotate schedule class, splitting off from WriteShift.

NFCI for now, but it should make it easier to remove a lot of unnecessary overrides in a future commit.

Now that funnel shift intrinsics are coming online we need to get this cleaned up to make vectorization costs from scalar rotate patterns more straightforward.

llvm-svn: 342837

5 years ago[WholeProgramDevirt] Don't process declarations when building type id map
Eugene Leviant [Sun, 23 Sep 2018 13:27:47 +0000 (13:27 +0000)]
[WholeProgramDevirt] Don't process declarations when building type id map

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

llvm-svn: 342836

5 years agoBuild PassBuilder.cpp with /bigobj to try and appease MSVC EXPENSIVE_CHECKS buildbot
Simon Pilgrim [Sun, 23 Sep 2018 11:28:47 +0000 (11:28 +0000)]
Build PassBuilder.cpp with /bigobj to try and appease MSVC EXPENSIVE_CHECKS buildbot

llvm-svn: 342835

5 years ago[analyzer][UninitializedObjectChecker] Using the new const methods of ImmutableList
Kristof Umann [Sun, 23 Sep 2018 09:16:27 +0000 (09:16 +0000)]
[analyzer][UninitializedObjectChecker] Using the new const methods of ImmutableList

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

llvm-svn: 342834

5 years ago[CMake] Use internal_linkage rather than always_inline for libc++
Petr Hosek [Sun, 23 Sep 2018 08:46:31 +0000 (08:46 +0000)]
[CMake] Use internal_linkage rather than always_inline for libc++

This is a workaround for PR39053 which was uncovered by D50652 when
the default attribute has been changed from internal_linkage to
always_inline.

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

llvm-svn: 342833

5 years ago[CStringSyntaxChecker] Check strlcat sizeof check
David Carlier [Sun, 23 Sep 2018 08:30:17 +0000 (08:30 +0000)]
[CStringSyntaxChecker] Check strlcat sizeof check

Assuming strlcat is used with strlcpy we check as we can if the last argument does not equal os not larger than the buffer.
Advising the proper usual pattern.

Reviewers: george.karpenkov, NoQ, MaskRay

Reviewed By: MaskRay

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

llvm-svn: 342832

5 years ago[Index] Report specialization bases as references when IndexImplicitInstantiation...
Fangrui Song [Sun, 23 Sep 2018 08:23:48 +0000 (08:23 +0000)]
[Index] Report specialization bases as references when IndexImplicitInstantiation is true

Summary:
    template <typename T> struct B {};
    template <typename T> struct D : B<T> {}; // `B` was not reported as a reference

This patch fixes this.

Reviewers: akyrtzi, arphaman, devnexen

Reviewed By: devnexen

Subscribers: cfe-commits

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

llvm-svn: 342831

5 years ago[X86] Add isel pattern for (v8i16 (sext (v8i1))) with DQI and no BWI.
Craig Topper [Sun, 23 Sep 2018 06:49:48 +0000 (06:49 +0000)]
[X86] Add isel pattern for (v8i16 (sext (v8i1))) with DQI and no BWI.

Our lowering that tries to avoid this sign extend can be defeated by the DAG combine folding it with a truncate.

The pattern needs to extend to an v8i32 then truncate back down to v8i16.

llvm-svn: 342830

5 years ago[X86] Fix a few typos in comments.
Craig Topper [Sun, 23 Sep 2018 06:49:47 +0000 (06:49 +0000)]
[X86] Fix a few typos in comments.

llvm-svn: 342829

5 years ago[ORC] Update ORC C bindings to use the new llvm::Error C API.
Lang Hames [Sun, 23 Sep 2018 02:09:18 +0000 (02:09 +0000)]
[ORC] Update ORC C bindings to use the new llvm::Error C API.

This replaces instances of the LLVMOrcErrorCode type with LLVMErrorRef,
simplifying the implementation of the OrcCBindingsStack class and ORC
C API bindings and making it possible to return arbitrary (wrapped)
llvm::Errors.

llvm-svn: 342828

5 years agoFix modules build with shared library.
Eric Fiselier [Sun, 23 Sep 2018 00:48:05 +0000 (00:48 +0000)]
Fix modules build with shared library.

r341994 caused clangAnalysis to pull all of the AST matchers
library into clang. Due to inline key functions in the headers,
importing the AST matchers library gives a link dependency on the
AST matchers (and thus the AST), which clang should not
have.

This patch works around the issues by excluding the offending
libclangAnalysis header in the modulemap.

llvm-svn: 342827

5 years ago[DAGCombiner] Simplify some code in visitBITCAST. NFCI
Craig Topper [Sat, 22 Sep 2018 23:12:34 +0000 (23:12 +0000)]
[DAGCombiner] Simplify some code in visitBITCAST. NFCI

llvm-svn: 342826

5 years ago[Index] Fix header guard naming
Fangrui Song [Sat, 22 Sep 2018 22:49:38 +0000 (22:49 +0000)]
[Index] Fix header guard naming

llvm-svn: 342825

5 years ago[AArch64] Support adding X[8-15,18] registers as CSRs.
Tri Vo [Sat, 22 Sep 2018 22:17:50 +0000 (22:17 +0000)]
[AArch64] Support adding X[8-15,18] registers as CSRs.

Summary:
Specifying X[8-15,18] registers as callee-saved is used to support
CONFIG_ARM64_LSE_ATOMICS in Linux kernel. As part of this patch we:
- use custom CSR list/mask when user specifies custom CSRs
- update Machine Register Info's list of CSRs with additional custom CSRs in
LowerCall and LowerFormalArguments.

Reviewers: srhines, nickdesaulniers, efriedma, javed.absar

Reviewed By: nickdesaulniers

Subscribers: kristof.beyls, jfb, llvm-commits

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

llvm-svn: 342824

5 years agoEliminate some unneeded signed/unsigned conversions
Aaron Puchert [Sat, 22 Sep 2018 21:56:16 +0000 (21:56 +0000)]
Eliminate some unneeded signed/unsigned conversions

No functional change is intended, but generally this should be a bit
more safe.

llvm-svn: 342823

5 years ago[NFC][libc++] Fix typo in the description of LIBCXX_INCLUDE_BENCHMARKS
Louis Dionne [Sat, 22 Sep 2018 21:30:12 +0000 (21:30 +0000)]
[NFC][libc++] Fix typo in the description of LIBCXX_INCLUDE_BENCHMARKS

llvm-svn: 342822

5 years agoMark [[nodiscard]] tests unsupported on GCC prior to 7.0
Eric Fiselier [Sat, 22 Sep 2018 21:01:07 +0000 (21:01 +0000)]
Mark [[nodiscard]] tests unsupported on GCC prior to 7.0

llvm-svn: 342821

5 years agoFix UB in SIMD tests.
Eric Fiselier [Sat, 22 Sep 2018 20:09:02 +0000 (20:09 +0000)]
Fix UB in SIMD tests.

One of the SIMD tests attempted to left shift a value by 42, which
is UB when the left hand side is a 32 bit integer type.

This patch adjusts the test to use the value 4 instead of 42.

llvm-svn: 342820

5 years ago[libcxx] Readjust nodiscard_extensions.pass.cpp test - just disable for ASAN
Roman Lebedev [Sat, 22 Sep 2018 20:07:02 +0000 (20:07 +0000)]
[libcxx] Readjust nodiscard_extensions.pass.cpp test - just disable for ASAN

In rL342814, i have committed a blind fix to unbreak the asan buildbot,
but as it was later discussed, the leak is intentional,
so we can not fix the failure that way.

So this reverts the leak 'fix',
and simply disables the test in the presence of ASAN.

llvm-svn: 342819

5 years agoMark test as flaky
Eric Fiselier [Sat, 22 Sep 2018 20:03:47 +0000 (20:03 +0000)]
Mark test as flaky

llvm-svn: 342818

5 years agoUpdate docs to reference new libc++ mailing lists.
Eric Fiselier [Sat, 22 Sep 2018 19:52:12 +0000 (19:52 +0000)]
Update docs to reference new libc++ mailing lists.

llvm-svn: 342817

5 years agoCorrect docs to reference the new libc++ lists.
Eric Fiselier [Sat, 22 Sep 2018 19:49:29 +0000 (19:49 +0000)]
Correct docs to reference the new libc++ lists.

We recently added libcxx-dev and libcxx-commits mailing lists.
This patch updates the libc++ documentation to correctly reference
the libc++ lists instead of the old Clang ones.

llvm-svn: 342816

5 years agoFix incorrectly aligned exceptions in 32 bit builds.
Eric Fiselier [Sat, 22 Sep 2018 19:22:36 +0000 (19:22 +0000)]
Fix incorrectly aligned exceptions in 32 bit builds.

This patch fixes a bug where exceptions in 32 bit builds
would be incorrectly aligned because malloc only provides 8 byte aligned
memory where 16 byte alignment is needed.

This patch makes libc++abi correctly use posix_memalign when it's
available. This requires defining _LIBCPP_BUILDING_LIBRARY so that
libc++ only defines _LIBCPP_HAS_NO_ALIGNED_ALLOCATION when libc doesn't
support it and not when aligned new/delete are disable for other
reasons.

This bug somehow made it into the 7.0 release, making it a regression.
Therefore this patch should be included in the next dot release.

llvm-svn: 342815

5 years ago[libcxx] Blind attempt to fix harmless leak in nodiscard_extensions.pass.cpp test
Roman Lebedev [Sat, 22 Sep 2018 19:09:57 +0000 (19:09 +0000)]
[libcxx] Blind attempt to fix harmless leak in nodiscard_extensions.pass.cpp test

libcxx-libcxxabi-x86_64-linux-ubuntu-asan complains about a leak here.

llvm-svn: 342814

5 years ago[libcxx] Fix the definition of the check-cxx-abilist target on Darwin
Louis Dionne [Sat, 22 Sep 2018 18:39:38 +0000 (18:39 +0000)]
[libcxx] Fix the definition of the check-cxx-abilist target on Darwin

Summary:
r342805 added support for the check-cxx-abilist target on FreeBSD, but broke
the target on macOS in doing so. The problem is that the GENERIC_TARGET_TRIPLE
gets overwritten after replacing the FreeBSD regular expression, which
nullifies the replacement done with the darwin regular expression.

Reviewers: dim, EricWF

Subscribers: emaste, mgorny, krytarowski, christof, dexonsmith, cfe-commits, libcxx-commits

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

llvm-svn: 342813

5 years agoFix codemodels.c test case (only test mcmodel=medium on X86).
Caroline Tice [Sat, 22 Sep 2018 18:25:58 +0000 (18:25 +0000)]
Fix codemodels.c test case (only test mcmodel=medium on X86).

aarch64 testing is broken because "medium" is not a valid
code-model on aarch64, and codemodels.c tests that.  This fixes
that problem by adding "-triple x86_64-unknown-linux-gnu" to the
test with "-mcode-model moedium".

llvm-svn: 342812

5 years ago[libunwind][NFC] Suppress unused parameter warnings
Louis Dionne [Sat, 22 Sep 2018 18:18:34 +0000 (18:18 +0000)]
[libunwind][NFC] Suppress unused parameter warnings

Reviewers: EricWF

Subscribers: christof, chrib, dexonsmith, cfe-commits

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

llvm-svn: 342811

5 years agoDocument new symbols for __u64toa and __u32toa
Zhihao Yuan [Sat, 22 Sep 2018 18:05:28 +0000 (18:05 +0000)]
Document new symbols for __u64toa and __u32toa

Summary:
They are introduced in r338479; their Linux ABI changes are recorded in r338486.

TODO: Record the Mac OS X ABI changes.

Reviewers: EricWF

Reviewed By: EricWF

Subscribers: christof, ldionne, libcxx-commits, cfe-commits

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

llvm-svn: 342810

5 years ago[DAGCombiner] Rewrite r331896 in a different way to address a FIXME. NFCI
Craig Topper [Sat, 22 Sep 2018 18:03:14 +0000 (18:03 +0000)]
[DAGCombiner] Rewrite r331896 in a different way to address a FIXME. NFCI

llvm-svn: 342809

5 years ago[libc++] Add _LIBCPP_ENABLE_NODISCARD and _LIBCPP_NODISCARD_EXT to allow pre-C++2a...
Roman Lebedev [Sat, 22 Sep 2018 17:54:48 +0000 (17:54 +0000)]
[libc++] Add _LIBCPP_ENABLE_NODISCARD and _LIBCPP_NODISCARD_EXT to allow pre-C++2a [[nodiscard]]

Summary:
The `[[nodiscard]]` attribute is intended to help users find bugs where
function return values are ignored when they shouldn't be. After C++17 the
C++ standard has started to declared such library functions as `[[nodiscard]]`.
However, this application is limited and applies only to dialects after C++17.
Users who want help diagnosing misuses of STL functions may desire a more
liberal application of `[[nodiscard]]`.

For this reason libc++ provides an extension that does just that! The
extension must be enabled by defining `_LIBCPP_ENABLE_NODISCARD`. The extended
applications of `[[nodiscard]]` takes two forms:

1. Backporting `[[nodiscard]]` to entities declared as such by the
   standard in newer dialects, but not in the present one.

2. Extended applications of `[[nodiscard]]`, at the libraries discretion,
   applied to entities never declared as such by the standard.

Users may also opt-out of additional applications `[[nodiscard]]` using
additional macros.

Applications of the first form, which backport `[[nodiscard]]` from a newer
dialect may be disabled using macros specific to the dialect it was added. For
example `_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17`.

Applications of the second form, which are pure extensions, may be disabled
by defining `_LIBCPP_DISABLE_NODISCARD_EXT`.

This patch was originally written by me (Roman Lebedev),
then but then reworked by Eric Fiselier.

Reviewers: mclow.lists, thakis, EricWF

Reviewed By: thakis, EricWF

Subscribers: llvm-commits, mclow.lists, lebedev.ri, EricWF, rjmccall, Quuxplusone, cfe-commits, christof

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

llvm-svn: 342808

5 years ago[bpf] Test case for symbol information in object file
Yonghong Song [Sat, 22 Sep 2018 17:31:01 +0000 (17:31 +0000)]
[bpf] Test case for symbol information in object file

This patch tests the change introduced in r342556.

Signed-off-by: Paul Chaignon <paul.chaignon@orange.com>
llvm-svn: 342807

5 years ago[InstCombine][x86] try even harder to convert blendv intrinsic to generic IR (PR38814)
Sanjay Patel [Sat, 22 Sep 2018 14:43:55 +0000 (14:43 +0000)]
[InstCombine][x86] try even harder to convert blendv intrinsic to generic IR (PR38814)

Follow-up to rL342324 (D52059):

Missing optimizations with blendv are shown in:
https://bugs.llvm.org/show_bug.cgi?id=38814

This is an easier and more powerful solution than adding pattern matching for a few
special cases in the backend. The potential danger with this transform in IR is that
the condition value can get separated from the select, and the backend might not be
able to make a blendv out of it again.

llvm-svn: 342806

5 years agoSimilar to the handling of darwin target triples, strip the version
Dimitry Andric [Sat, 22 Sep 2018 14:37:49 +0000 (14:37 +0000)]
Similar to the handling of darwin target triples, strip the version
numbers off of freebsd target triples, when generating the name of the
ABI list file for check-cxx-abilist target.

Also remove unnecessary parentheses in the regex for darwin, and
slightly reword the comment.

llvm-svn: 342805

5 years agoChange type of m_user_expression_start_pos to size_t
Raphael Isemann [Sat, 22 Sep 2018 13:33:08 +0000 (13:33 +0000)]
Change type of m_user_expression_start_pos to size_t

AbsPosToLineColumnPos is the only reader of m_user_expression_start_pos
and actually treats it like a size_t. Also the value we store in
m_user_expression_start_pos is originally a size_t, so it makes sense
to change the type of this variable to size_t.

llvm-svn: 342804

5 years agoRemove a bunch of empty subdirectories. NFCI.
Dimitry Andric [Sat, 22 Sep 2018 13:32:37 +0000 (13:32 +0000)]
Remove a bunch of empty subdirectories. NFCI.

llvm-svn: 342803

5 years agouse the current url for bugzilla
Sylvestre Ledru [Sat, 22 Sep 2018 07:41:09 +0000 (07:41 +0000)]
use the current url for bugzilla

llvm-svn: 342802

5 years agoupdate the links to use https
Sylvestre Ledru [Sat, 22 Sep 2018 07:39:44 +0000 (07:39 +0000)]
update the links to use https

llvm-svn: 342801

5 years ago[lib/MC] - Set SHF_EXCLUDE flag for .dwo sections.
George Rimar [Sat, 22 Sep 2018 07:36:20 +0000 (07:36 +0000)]
[lib/MC] - Set SHF_EXCLUDE flag for .dwo sections.

DWARF5 spec says about single file split case:

"The sections that do not require relocation, however, can be written
to the relocatable object (.o) file but ignored by the
the linker or they can be written to a separate DWARF object (.dwo) file
that need not be accessed by the linker."

Nice way to make linker to ignore them is to set SHF_EXCLUDE flag.
It seems to be not harmful to always set it for .dwo sections.
That is what this patch does.

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

llvm-svn: 342800

5 years ago[mips] Provide more detailed description for MIPS targets. NFC
Simon Atanasyan [Sat, 22 Sep 2018 06:04:32 +0000 (06:04 +0000)]
[mips] Provide more detailed description for MIPS targets. NFC

llvm-svn: 342799

5 years ago[mips] Remove obsoleted "experimental" tag from MIPS 64-bit targets. NFC
Simon Atanasyan [Sat, 22 Sep 2018 06:04:26 +0000 (06:04 +0000)]
[mips] Remove obsoleted "experimental" tag from MIPS 64-bit targets. NFC

llvm-svn: 342798

5 years ago[InstCombine] Fold (min/max ~X, Y) -> ~(max/min X, ~Y) when Y is freely invertible
Craig Topper [Sat, 22 Sep 2018 05:53:27 +0000 (05:53 +0000)]
[InstCombine] Fold (min/max ~X, Y) -> ~(max/min X, ~Y) when Y is freely invertible

Summary: This restores the combine that was reverted in r341883. The infinite loop from the failing test no longer occurs due to changes from r342163.

Reviewers: spatel, dmgreen

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 342797

5 years ago[X86] Fix inline expansion for memset in x32
Craig Topper [Sat, 22 Sep 2018 05:16:35 +0000 (05:16 +0000)]
[X86] Fix inline expansion for memset in x32

Summary: Similar to D51893 which was for memcpy

Reviewers: efriedma

Reviewed By: efriedma

Subscribers: llvm-commits

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

llvm-svn: 342796

5 years ago[X86] Fold (movmsk (setne (and X, (1 << C)), 0)) -> (movmsk (X << C)) for vXi8 vectors.
Craig Topper [Sat, 22 Sep 2018 05:08:38 +0000 (05:08 +0000)]
[X86] Fold (movmsk (setne (and X, (1 << C)), 0)) -> (movmsk (X << C)) for vXi8 vectors.

We don't have a vXi8 shift left so we need to bitcast to a vXi16 vector to perform the shift. If we let lowering legalize the vXi8 shift we get an extra and that we don't need and fail to remove.

llvm-svn: 342795

5 years agoUpdate smart pointer detection for thread safety analysis.
Richard Trieu [Sat, 22 Sep 2018 01:50:52 +0000 (01:50 +0000)]
Update smart pointer detection for thread safety analysis.

Objects are determined to be smart pointers if they have both a star and arrow
operator.  Some implementations of smart pointers have these overloaded
operators in a base class, while the check only searched the derived class.
This fix will also look for the operators in the base class.

llvm-svn: 342794

5 years ago[Lexer] Add udefined_behavior_sanitizer feature
Leonard Chan [Sat, 22 Sep 2018 01:03:16 +0000 (01:03 +0000)]
[Lexer] Add udefined_behavior_sanitizer feature

This can be used to detect whether the code is being built with UBSan using
the __has_feature(undefined_behavior_sanitizer) predicate.

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

llvm-svn: 342793

5 years agoTest commit.
Vyacheslav Zakharin [Sat, 22 Sep 2018 01:01:03 +0000 (01:01 +0000)]
Test commit.

llvm-svn: 342792

5 years ago[llvm-size] Berkeley formatting: use tabs instead of spaces as field delimeters.
Jordan Rupprecht [Fri, 21 Sep 2018 23:48:12 +0000 (23:48 +0000)]
[llvm-size] Berkeley formatting: use tabs instead of spaces as field delimeters.

This matches GNU behavior for size and allows use of cut to parse the output of llvm-size.

llvm-svn: 342791

5 years agoThread safety analysis: Make printSCFG compile again [NFC]
Aaron Puchert [Fri, 21 Sep 2018 23:46:35 +0000 (23:46 +0000)]
Thread safety analysis: Make printSCFG compile again [NFC]

Not used productively, so no observable functional change.

Note that printSCFG doesn't yet work reliably, it seems to crash
sometimes.

llvm-svn: 342790

5 years agoFix codemodels.c test case (only test mcmodel-kernel on x86)
Caroline Tice [Fri, 21 Sep 2018 23:19:49 +0000 (23:19 +0000)]
Fix codemodels.c test case (only test mcmodel-kernel on x86)

A recent commit I made broke aarch64 testing, because "kernel"
apparently is not a valid code-model on aarch64, and one of my tests
tested that. This fixes the problem (hopefully) by adding "-triple
x86_64-unknown-linux-gnu" to the test build with "-mcodel-model
kernel".

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

llvm-svn: 342789

5 years ago[X86] Teach fast isel to use MOV32ri64 for loading an unsigned 32 immediate into...
Craig Topper [Fri, 21 Sep 2018 23:14:05 +0000 (23:14 +0000)]
[X86] Teach fast isel to use MOV32ri64 for loading an unsigned 32 immediate into a 64-bit register.

Previously we used SUBREG_TO_REG+MOV32ri. But regular isel was changed recently to use the MOV32ri64 pseudo. Fast isel now does the same.

llvm-svn: 342788

5 years agoThread safety analysis: Make sure FactEntrys stored in FactManager are immutable...
Aaron Puchert [Fri, 21 Sep 2018 23:08:30 +0000 (23:08 +0000)]
Thread safety analysis: Make sure FactEntrys stored in FactManager are immutable [NFC]

Since FactEntrys are stored in the FactManager, we can't manipulate them
anymore when they are stored there.

llvm-svn: 342787

5 years ago[Loop Vectorizer] Abandon vectorization when no integer IV found
Warren Ristow [Fri, 21 Sep 2018 23:03:50 +0000 (23:03 +0000)]
[Loop Vectorizer] Abandon vectorization when no integer IV found

Support for vectorizing loops with secondary floating-point induction
variables was added in r276554.  A primary integer IV is still required
for vectorization to be done.  If an FP IV was found, but no integer IV
was found at all (primary or secondary), the attempt to vectorize still
went forward, causing a compiler-crash.  This change abandons that
attempt when no integer IV is found.  (Vectorizing FP-only cases like
this, rather than bailing out, is discussed as possible future work
in D52327.)

See PR38800 for more information.

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

llvm-svn: 342786

5 years agoMove individual benchmark targets into the Utils folder in IDEs.
Aaron Ballman [Fri, 21 Sep 2018 23:01:32 +0000 (23:01 +0000)]
Move individual benchmark targets into the Utils folder in IDEs.

llvm-svn: 342785

5 years agoTry moving this function to another file.
Zachary Turner [Fri, 21 Sep 2018 23:00:37 +0000 (23:00 +0000)]
Try moving this function to another file.

I can't reproduce this compilation failure so I can't really
test this fix.

llvm-svn: 342784

5 years ago[ORC] In RTDyldObjectLinkingLayer, only call NotifyFreed if the object file
Lang Hames [Fri, 21 Sep 2018 22:59:48 +0000 (22:59 +0000)]
[ORC] In RTDyldObjectLinkingLayer, only call NotifyFreed if the object file
has been finalized.

This prevents crashes on unfinalized objects for clients using
JITEventListeners.

Patch by Geoff Levner. Thanks Geoff!

llvm-svn: 342783

5 years agoAdd benchmark and benchmark_main to the Utils folder in IDEs.
Aaron Ballman [Fri, 21 Sep 2018 22:55:57 +0000 (22:55 +0000)]
Add benchmark and benchmark_main to the Utils folder in IDEs.

llvm-svn: 342782

5 years agoAdd missing include.
Zachary Turner [Fri, 21 Sep 2018 22:44:31 +0000 (22:44 +0000)]
Add missing include.

llvm-svn: 342781

5 years ago[NativePDB] Add support for reading function signatures.
Zachary Turner [Fri, 21 Sep 2018 22:36:28 +0000 (22:36 +0000)]
[NativePDB] Add support for reading function signatures.

This adds support for parsing function signature records and returning
them through the native DIA interface.

llvm-svn: 342780

5 years ago[PDB] Add native reading support for UDT / class types.
Zachary Turner [Fri, 21 Sep 2018 22:36:04 +0000 (22:36 +0000)]
[PDB] Add native reading support for UDT / class types.

This allows the native reader to find records of class/struct/
union type and dump them.  This behavior is tested by using the
diadump subcommand against golden output produced by actual DIA
SDK on the same PDB file, and again using pretty -native to
confirm that we actually dump the classes.  We don't find class
members or anything like that yet, for now it's just the class
itself.

llvm-svn: 342779

5 years ago[New PM][PassInstrumentation] Adding PassInstrumentation to the AnalysisManager runs
Fedor Sergeev [Fri, 21 Sep 2018 22:10:17 +0000 (22:10 +0000)]
[New PM][PassInstrumentation] Adding PassInstrumentation to the AnalysisManager runs

As a prerequisite to time-passes implementation which needs to time both passes
and analyses, adding instrumentation points to the Analysis Manager.
The are two functional differences between Pass and Analysis instrumentation:
  - the latter does not increment pass execution counter
  - it does not provide ability to skip execution of the corresponding analysis

Reviewers: chandlerc, philip.pfaffe
Differential Revision: https://reviews.llvm.org/D51275

llvm-svn: 342778

5 years ago[COFF] Support linking to import libraries from GNU binutils
Martin Storsjo [Fri, 21 Sep 2018 22:01:06 +0000 (22:01 +0000)]
[COFF] Support linking to import libraries from GNU binutils

GNU binutils import libraries aren't the same kind of short import
libraries as link.exe and LLD produce, but are a plain static library
containing .idata section chunks. MSVC link.exe can successfully link
to them.

In order for imports from GNU import libraries to mix properly with the
normal import chunks, the chunks from the existing mechanism needs to
be added into named sections like .idata$2.

These GNU import libraries consist of one header object, a number of
object files, one for each imported function/variable, and one trailer.
Within the import libraries, the object files are ordered alphabetically
in this order. The chunks stemming from these libraries have to be
grouped by what library they originate from and sorted, to make sure
the section chunks for headers and trailers for the lists are ordered
as intended. This is done on all sections named .idata$*, before adding
the synthesized chunks to them.

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

llvm-svn: 342777

5 years agollvm-dwarfdump --statistics: Unique abstract origins across multiple CUs.
Adrian Prantl [Fri, 21 Sep 2018 21:59:34 +0000 (21:59 +0000)]
llvm-dwarfdump --statistics: Unique abstract origins across multiple CUs.

Instead of indexing local variables by DIE offset, use the variable
name + the path through the lexical block tree. This makes the lookup
key consistent across duplicate abstract origins in different CUs.

llvm-svn: 342776

5 years ago[x86] add more tests for poetntial andnp splitting with AVX1; NFC
Sanjay Patel [Fri, 21 Sep 2018 21:25:16 +0000 (21:25 +0000)]
[x86] add more tests for poetntial andnp splitting with AVX1; NFC

llvm-svn: 342775

5 years agoMake compare function in r342648 have strict weak ordering.
Richard Trieu [Fri, 21 Sep 2018 21:20:33 +0000 (21:20 +0000)]
Make compare function in r342648 have strict weak ordering.

Comparison functions used in sorting algorithms need to have strict weak
ordering.  Remove the assert and allow comparisons on all lists.

llvm-svn: 342774