Commit Graph

299483 Commits

Author SHA1 Message Date
Roman Lebedev fb697d0f1b [NFC][CodeGen][X86][AArch64] More tests for 'bit field extract' w/ constants
It would be best to introduce ISD::BitFieldExtract,
because clearly more than one backend faces the same problem.
But for now let's solve this in the x86-specific DAG combine.

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

llvm-svn: 342880
2018-09-24 13:24:20 +00:00
Matt Arsenault f432011d33 AMDGPU: Fix private handling for allowsMisalignedMemoryAccesses
If the alignment is at least 4, this should report true.

Something still seems off with how < 4-byte types are
handled here though.

Fixing this seems to change how some combines get
to where they get, but somehow isn't changing the net
result.

llvm-svn: 342879
2018-09-24 13:18:15 +00:00
Matt Arsenault b53feca372 Fix some missing opcodes in bcanalyzer
llvm-svn: 342878
2018-09-24 12:47:17 +00:00
Andrea Di Biagio 86502ddeaa [llvm-mca] Improve code comments in LSUnit.{h, cpp}. NFC
llvm-svn: 342877
2018-09-24 12:45:26 +00:00
Sven van Haastregt 7b39a085d9 Fix Wundef NDEBUG warning; NFC
Check for definedness of the NDEBUG macro rather than its value,
to be consistent with other uses.

llvm-svn: 342876
2018-09-24 12:12:03 +00:00
Pavel Labath 27104981ad Add NativeProcessProtocol unit tests
Summary:
NativeProcessProtocol is an abstract class, but it still contains a
significant amount of code. Some of that code is tested via tests of
specific derived classes, but these tests don't run everywhere, as they
are OS and arch-specific. They are also relatively high-level, which
means some functionalities (particularly the failure cases) are
hard/impossible to test.

In this approach, I replace the abstract methods with mocks, which
allows me to inject failures into the lowest levels of breakpoint
setting code and test the class behavior in this situation.

Reviewers: zturner, teemperor

Subscribers: mgorny, lldb-commits

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

llvm-svn: 342875
2018-09-24 12:11:04 +00:00
Sjoerd Meijer d986ede313 [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
2018-09-24 12:02:50 +00:00
Hans Wennborg 5555c00902 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
2018-09-24 11:40:07 +00:00
Luke Cheeseman bda54bca39 [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
2018-09-24 10:42:22 +00:00
Petar Jovanovic c451c9ef50 [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
2018-09-24 10:01:24 +00:00
Sam Parker a7b2405b06 [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
2018-09-24 09:34:06 +00:00
Dan Liew c0ba5dc47b 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
2018-09-24 09:30:33 +00:00
Dan Liew 071fdc1b01 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
2018-09-24 09:28:35 +00:00
Kirill Bobyrev 94af0612e0 [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
2018-09-24 08:45:18 +00:00
Clement Courbet 1e8fdbe3c3 [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
2018-09-24 08:39:48 +00:00
Hans Wennborg cd23593f02 Fix llvm-diff anon-func.ll test
llvm-svn: 342864
2018-09-24 08:34:17 +00:00
Hans Wennborg 83d15dfe2d Remove debug printf leftover from r342397
llvm-svn: 342863
2018-09-24 08:18:47 +00:00
Sjoerd Meijer c017656202 [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
2018-09-24 07:55:20 +00:00
Michael Kruse 4c99f5fe2b 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
2018-09-24 06:31:37 +00:00
Craig Topper 2b8107614c [X86] Add 512-bit test cases to setcc-wide-types.ll. NFC
llvm-svn: 342860
2018-09-24 05:46:01 +00:00
Dean Michael Berris f578aaa058 [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
2018-09-24 05:28:01 +00:00
Matt Arsenault 9a71e80645 Fix asserts when linking wrong address space declarations
llvm-svn: 342858
2018-09-24 04:42:14 +00:00
Matt Arsenault ce5f203415 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
2018-09-24 04:42:13 +00:00
Craig Topper 5bef27e808 [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
2018-09-24 02:03:11 +00:00
Louis Dionne 255f376f6b [libcxx] Fix the binder deprecation tests on Clang 5.
Tested on Docker containers with Clang 4, 5 and 6.

llvm-svn: 342855
2018-09-23 23:17:48 +00:00
Louis Dionne 593b23f6a7 [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
2018-09-23 22:16:35 +00:00
Lang Hames bfd93e5ff6 [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
2018-09-23 21:30:05 +00:00
Simon Pilgrim f3f3dd584a [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
2018-09-23 21:19:15 +00:00
Craig Topper b3b94a8e8b [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
2018-09-23 21:17:56 +00:00
Craig Topper bec5967176 [LegalizeTypes] Fix bad indentation. NFC
llvm-svn: 342850
2018-09-23 21:17:55 +00:00
Louis Dionne 436a40128c [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
2018-09-23 21:10:06 +00:00
Simon Pilgrim 6d95a8521f [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
2018-09-23 19:33:58 +00:00
Simon Pilgrim e7938423b2 Fix line ending mismatches. NFCI.
llvm-svn: 342847
2018-09-23 19:16:32 +00:00
Simon Pilgrim 9202c9fb47 [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
2018-09-23 19:16:01 +00:00
Benjamin Kramer b3478fcf0e [Aarch64] Fix memcpy that was copying 4x too many bytes
Found by asan.

llvm-svn: 342845
2018-09-23 18:43:28 +00:00
Sanjay Patel 0027946915 [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
2018-09-23 18:41:38 +00:00
Louis Dionne ea5cd3b476 [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
2018-09-23 18:35:00 +00:00
Simon Pilgrim 19952add7c [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
2018-09-23 17:40:24 +00:00
Simon Pilgrim 22d31c5e0f [X86] Remove unnecessary WriteRotate overrides. NFCI.
llvm-svn: 342841
2018-09-23 16:53:02 +00:00
Louis Dionne 0805a4fa9c [NFC][libcxx] Rename helpers with 4 underscores to something more reasonable
llvm-svn: 342840
2018-09-23 16:44:50 +00:00
Simon Pilgrim 4b50086013 [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
2018-09-23 16:17:13 +00:00
Sanjay Patel 151efca3fe [x86] add tests for mul decomposition with negative constant; NFC
llvm-svn: 342838
2018-09-23 16:07:46 +00:00
Simon Pilgrim 5f9d912095 [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
2018-09-23 15:12:10 +00:00
Eugene Leviant 2b70d616f0 [WholeProgramDevirt] Don't process declarations when building type id map
Differential revision: https://reviews.llvm.org/D52175

llvm-svn: 342836
2018-09-23 13:27:47 +00:00
Simon Pilgrim baf09e5d18 Build PassBuilder.cpp with /bigobj to try and appease MSVC EXPENSIVE_CHECKS buildbot
llvm-svn: 342835
2018-09-23 11:28:47 +00:00
Kristof Umann 82eeca363a [analyzer][UninitializedObjectChecker] Using the new const methods of ImmutableList
Differential Revision: https://reviews.llvm.org/D51886

llvm-svn: 342834
2018-09-23 09:16:27 +00:00
Petr Hosek b2de4b39be [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
2018-09-23 08:46:31 +00:00
David Carlier 75cb0dd5ed [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
2018-09-23 08:30:17 +00:00
Fangrui Song f750f7f3fb [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
2018-09-23 08:23:48 +00:00
Craig Topper c296436a30 [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
2018-09-23 06:49:48 +00:00