platform/upstream/llvm.git
5 years ago[gn build] Process .def.in files in llvm/Config and add lib/Target/BUILD.gn
Nico Weber [Thu, 6 Dec 2018 17:42:35 +0000 (17:42 +0000)]
[gn build] Process .def.in files in llvm/Config and add lib/Target/BUILD.gn

Tweak write_cmake_config.py to also handle variable references looking @FOO@
(matching CMake's configure_file() function), and make it replace '\' 'n' in
values with a newline literal since there's no good portable way of passing a
real newline literal on a command line.

Use that to process all the .def.in files in llvm/include/Config and add
llvm/lib/Target/BUILD.gn, which (indirectly, through llvm-c/Target.h) includes
them.

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

llvm-svn: 348503

5 years agoAdd another ArchSpec unit test.
Adrian Prantl [Thu, 6 Dec 2018 17:11:45 +0000 (17:11 +0000)]
Add another ArchSpec unit test.

llvm-svn: 348502

5 years ago[DAGCombiner] refactor function that hoists bitwise logic; NFCI
Sanjay Patel [Thu, 6 Dec 2018 17:08:03 +0000 (17:08 +0000)]
[DAGCombiner] refactor function that hoists bitwise logic; NFCI

Added FIXME and TODO comments for lack of safety checks.
This function is a suspect in out-of-memory errors as discussed in
the follow-up thread to r347917:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20181203/608593.html

llvm-svn: 348501

5 years ago[Sanitizer] getmntinfo support in FreeBSD
David Carlier [Thu, 6 Dec 2018 17:04:18 +0000 (17:04 +0000)]
[Sanitizer] getmntinfo support in FreeBSD

Reviewers: krytarowski

Reviewed By: krytarowski

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

llvm-svn: 348500

5 years agoSupport skewed stream arrays.
Zachary Turner [Thu, 6 Dec 2018 16:55:00 +0000 (16:55 +0000)]
Support skewed stream arrays.

VarStreamArray was built on the assumption that it is backed by a
StreamRef, and offset 0 of that StreamRef is the first byte of the first
record in the array.

This is a logical and intuitive assumption, but unfortunately we have
use cases where it doesn't hold. Specifically, a PDB module's symbol
stream is prefixed by 4 bytes containing a magic value, and the first
byte of record data in the array is actually at offset 4 of this byte
sequence.

Previously, we would just truncate the first 4 bytes and then construct
the VarStreamArray with the resulting StreamRef, so that offset 0 of the
underlying stream did correspond to the first byte of the first record,
but this is problematic, because symbol records reference other symbol
records by the absolute offset including that initial magic 4 bytes. So
if another record wants to refer to the first record in the array, it
would say "the record at offset 4".

This led to extremely confusing hacks and semantics in loading code, and
after spending 30 minutes trying to get some math right and failing, I
decided to fix this in the underlying implementation of VarStreamArray.
Now, we can say that a stream is skewed by a particular amount. This
way, when we access a record by absolute offset, we can use the same
values that the records themselves contain, instead of having to do
fixups.

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

llvm-svn: 348499

5 years ago[X86] Refactored IsSplatVector to use switch. NFCI.
Simon Pilgrim [Thu, 6 Dec 2018 16:29:14 +0000 (16:29 +0000)]
[X86] Refactored IsSplatVector to use switch. NFCI.

Initial step towards making the function more generic (and probably move into SelectionDAG).

This is necessary to avoid massive codegen bloat for PR38243 (Add modulo rotate support to LowerRotate).

llvm-svn: 348498

5 years ago[DEBUGINFO, NVPTX] Disable emission of ',debug' option if only debug directives are...
Alexey Bataev [Thu, 6 Dec 2018 16:25:35 +0000 (16:25 +0000)]
[DEBUGINFO, NVPTX] Disable emission of ',debug' option if only debug directives are allowed.

Summary:
If the output of debug directives only is requested, we should drop
emission of ',debug' option from the target directive. Required for
supporting of nvprof profiler.

Reviewers: echristo

Subscribers: llvm-commits

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

llvm-svn: 348497

5 years ago[GVN] Don't perform scalar PRE on GEPs
Alexandros Lamprineas [Thu, 6 Dec 2018 16:11:58 +0000 (16:11 +0000)]
[GVN] Don't perform scalar PRE on GEPs

Partial Redundancy Elimination of GEPs prevents CodeGenPrepare from
sinking the addressing mode computation of memory instructions back
to its uses. The problem comes from the insertion of PHIs, which
confuse CGP and make it bail.

I've autogenerated the check lines of an existing test and added a
store instruction to demonstrate the motivation behind this change.
The store is now using the gep instead of a phi.

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

llvm-svn: 348496

5 years ago[DEBUGINFO, NVPTX]Emit last debugging directives.
Alexey Bataev [Thu, 6 Dec 2018 16:02:09 +0000 (16:02 +0000)]
[DEBUGINFO, NVPTX]Emit last debugging directives.

Summary:
We may end up with not emitted debug directives at the end of the module
emission. Patch fixes this problem emitting those last directives the
end of the module emission.

Reviewers: echristo

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 348495

5 years agoDAGCombiner::visitINSERT_VECTOR_ELT - pull out repeated VT.getVectorNumElements(...
Simon Pilgrim [Thu, 6 Dec 2018 15:39:25 +0000 (15:39 +0000)]
DAGCombiner::visitINSERT_VECTOR_ELT - pull out repeated VT.getVectorNumElements(). NFCI.

llvm-svn: 348494

5 years ago[NFC][AArch64] Split out backend features
Diogo N. Sampaio [Thu, 6 Dec 2018 15:39:17 +0000 (15:39 +0000)]
[NFC][AArch64] Split out backend features

This patch splits backend features currently
hidden behind architecture versions.

For example, currently the only way to activate
complex numbers extension is targeting an v8.3
architecture, where after the patch this extension
can be added separately.

This refactoring is required by the new command lines proposal:
http://lists.llvm.org/pipermail/llvm-dev/2018-September/126346.html

Reviewers: DavidSpickett, olista01, t.p.northover

Subscribers: kristof.beyls, bryanpkc, javed.absar, pbarrio

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

--

It was reverted in rL348249 due a build bot failure in one of the
regression tests:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/14386

The problem seems to be that FileCheck behaves
different in windows and linux. This new patch
splits the test file in multiple,
and does more exact pattern matching attempting
to circumvent the issue.

llvm-svn: 348493

5 years ago[OPENMP][NVPTX] Fix globalization of the mapped array sections.
Alexey Bataev [Thu, 6 Dec 2018 15:35:13 +0000 (15:35 +0000)]
[OPENMP][NVPTX] Fix globalization of the mapped array sections.

If the array section is based on pointer and this sections is mapped in
target region + then it is used in the inner parallel region, it also
must be globalized as the pointer itself is passed by value, not by
reference.

llvm-svn: 348492

5 years ago[OPENMP][NVPTX]Fix __kmpc_flush to flush the memory per system, not per block.
Alexey Bataev [Thu, 6 Dec 2018 15:27:58 +0000 (15:27 +0000)]
[OPENMP][NVPTX]Fix __kmpc_flush to flush the memory per system, not per block.

Summary:
According to the standard, after memory flushing the changes in the
memory must be visible to all the threads in all teams. Patch fixes
this.

Reviewers: gtbercea, kkwli0

Subscribers: guansong, jfb, caomhin, openmp-commits

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

llvm-svn: 348491

5 years ago[clangd] Remove the test that sometimes deadlocks
Ilya Biryukov [Thu, 6 Dec 2018 15:14:11 +0000 (15:14 +0000)]
[clangd] Remove the test that sometimes deadlocks

Will figure out how to properly rewrite it and recommit.

llvm-svn: 348490

5 years ago[ARM][NFC] Adding another test for armcgp
Sam Parker [Thu, 6 Dec 2018 15:13:44 +0000 (15:13 +0000)]
[ARM][NFC] Adding another test for armcgp

llvm-svn: 348489

5 years agoAMDGPU: Generate VALU ThreeOp Integer instructions
Nicolai Haehnle [Thu, 6 Dec 2018 14:33:40 +0000 (14:33 +0000)]
AMDGPU: Generate VALU ThreeOp Integer instructions

Summary:
Original patch by: Fabian Wahlster <razor@singul4rity.com>

Change-Id: I148f692a88432541fad468963f58da9ddf79fac5

Reviewers: arsenm, rampitec

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, b-sumner, llvm-commits

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

llvm-svn: 348488

5 years ago[AMDGPU] Partial revert of rL348371: Turn on the DPP combiner by default
Valery Pykhtin [Thu, 6 Dec 2018 14:20:02 +0000 (14:20 +0000)]
[AMDGPU] Partial revert of rL348371: Turn on the DPP combiner by default

Turn the combiner back off as there're failures until the issue is fixed.

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

llvm-svn: 348487

5 years agoFix -Wcovered-switch-default warning. NFCI.
Simon Pilgrim [Thu, 6 Dec 2018 14:02:02 +0000 (14:02 +0000)]
Fix -Wcovered-switch-default warning. NFCI.

llvm-svn: 348486

5 years ago[libcxx] Make return value of array<T, 0>.data() checked only for libc++
Louis Dionne [Thu, 6 Dec 2018 13:52:20 +0000 (13:52 +0000)]
[libcxx] Make return value of array<T, 0>.data() checked only for libc++

The section array.zero says: "The return value of data() is unspecified".
This patch marks all checks of the array<T, 0>.data() return value as
libc++ specific.

Reviewed as https://reviews.llvm.org/D55364.
Thanks to Andrey Maksimov for the patch.

llvm-svn: 348485

5 years agoRevert "[LoopSimplifyCFG] Delete dead in-loop blocks"
Ilya Biryukov [Thu, 6 Dec 2018 13:21:01 +0000 (13:21 +0000)]
Revert "[LoopSimplifyCFG] Delete dead in-loop blocks"

This reverts commit r348457.
The original commit causes clang to crash when doing an instrumented
build with a new pass manager. Reverting to unbreak our integrate.

llvm-svn: 348484

5 years agoTest commit: Removed trailing space in .txt file.
Markus Lavin [Thu, 6 Dec 2018 13:20:27 +0000 (13:20 +0000)]
Test commit: Removed trailing space in .txt file.

llvm-svn: 348483

5 years ago[ARM][NFC] Added extra arm-cgp test
Sam Parker [Thu, 6 Dec 2018 12:58:58 +0000 (12:58 +0000)]
[ARM][NFC] Added extra arm-cgp test

llvm-svn: 348482

5 years agoAdd new `__sanitizer_mz_default_zone()` API which returns the address of the ASan...
Dan Liew [Thu, 6 Dec 2018 12:39:00 +0000 (12:39 +0000)]
Add new `__sanitizer_mz_default_zone()` API which returns the address of the ASan malloc zone. This API will be used for testing in future patches.

Summary:
The name of the function is based on `malloc_default_zone()` found
in Darwin's `malloc/malloc.h` header file.

Reviewers: kubamracek, george.karpenkov

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 348481

5 years ago[LLD][ELF] - Use auto. NFC.
George Rimar [Thu, 6 Dec 2018 10:56:11 +0000 (10:56 +0000)]
[LLD][ELF] - Use auto. NFC.

This addresses the missed review comment.

llvm-svn: 348480

5 years agoMake scripts/analyzer-project-deps compatible with python3
Pavel Labath [Thu, 6 Dec 2018 10:27:38 +0000 (10:27 +0000)]
Make scripts/analyzer-project-deps compatible with python3

llvm-svn: 348479

5 years ago[clangd] Update the test code
Haojian Wu [Thu, 6 Dec 2018 10:22:48 +0000 (10:22 +0000)]
[clangd] Update the test code

I forgot to update it in the last round of code review.

llvm-svn: 348478

5 years ago[X86][NFC] Convert memcpy/memset tests to update_llc_test_checks.
Clement Courbet [Thu, 6 Dec 2018 10:07:12 +0000 (10:07 +0000)]
[X86][NFC] Convert memcpy/memset tests to update_llc_test_checks.

llvm-svn: 348477

5 years agoRemove REQUIRES: darwin from a couple of MachO tests
Pavel Labath [Thu, 6 Dec 2018 09:41:50 +0000 (09:41 +0000)]
Remove REQUIRES: darwin from a couple of MachO tests

lldb is able to parse MachO files also on other platforms nowadays.

llvm-svn: 348476

5 years ago[clangd] C++ API for emitting file status.
Haojian Wu [Thu, 6 Dec 2018 09:41:04 +0000 (09:41 +0000)]
[clangd] C++ API for emitting file status.

Introduce clangd C++ API to emit the current status of file.

llvm-svn: 348475

5 years agodisable toolchain-clang-cl.test on non-windows
Pavel Labath [Thu, 6 Dec 2018 09:39:09 +0000 (09:39 +0000)]
disable toolchain-clang-cl.test on non-windows

The recently added test fail on non-windows platforms.

llvm-svn: 348474

5 years agoDiagnose friend function template redefinitions.
Serge Pavlov [Thu, 6 Dec 2018 09:35:04 +0000 (09:35 +0000)]
Diagnose friend function template redefinitions.

Friend function template defined in a class template becomes available if
the enclosing class template is instantiated. Until the function template
is used, it does not have a body, but still is considered a definition for
the purpose of redeclaration checks.

This change modifies redefinition check so that it can find the friend
function template definitions in instantiated classes.

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

llvm-svn: 348473

5 years ago[ARM GlobalISel] Nothing is legal for Thumb
Diana Picus [Thu, 6 Dec 2018 09:26:14 +0000 (09:26 +0000)]
[ARM GlobalISel] Nothing is legal for Thumb

...yet!

A lot of the current code should be shared for arm and thumb mode, but
until we add tests and work out some of the details (e.g. checking the
correct subtarget feature for G_SDIV) it's safer to bail out as early as
possible for thumb targets.

This should have arguably been part of r348347, which allowed Thumb
functions to be handled by the IR Translator.

llvm-svn: 348472

5 years agoAdd test for ObjC generics
Stephen Kelly [Thu, 6 Dec 2018 09:23:59 +0000 (09:23 +0000)]
Add test for ObjC generics

llvm-svn: 348471

5 years agoExtend OMP test
Stephen Kelly [Thu, 6 Dec 2018 09:23:53 +0000 (09:23 +0000)]
Extend OMP test

llvm-svn: 348470

5 years agoMake test resistant to line numbers changing
Stephen Kelly [Thu, 6 Dec 2018 09:22:12 +0000 (09:22 +0000)]
Make test resistant to line numbers changing

llvm-svn: 348469

5 years ago[ELF] - (-Map file) Implement printing of LMA for assignments outside of section...
George Rimar [Thu, 6 Dec 2018 09:04:52 +0000 (09:04 +0000)]
[ELF] - (-Map file) Implement printing of LMA for assignments outside of section declarations.

This was a missing piece.
We started to print LMAs and information about assignments,
but did not do that for assignments outside of section declarations yet.
The patch implements it.

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

llvm-svn: 348468

5 years ago[clangd] Fix a typo in TUSchedulerTests
Haojian Wu [Thu, 6 Dec 2018 08:55:24 +0000 (08:55 +0000)]
[clangd] Fix a typo in TUSchedulerTests

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 348467

5 years agoFixup r348306: Require x86 for test
Diana Picus [Thu, 6 Dec 2018 08:54:17 +0000 (08:54 +0000)]
Fixup r348306: Require x86 for test

The test breaks on buildbots that don't enable the x86 backend. Other
tests in this directory explicitly require x86, so this should do the
trick.

llvm-svn: 348466

5 years ago[X86][NFC] Add more tests for memset.
Clement Courbet [Thu, 6 Dec 2018 08:48:06 +0000 (08:48 +0000)]
[X86][NFC] Add more tests for memset.

llvm-svn: 348465

5 years ago[llvm-dwarfdump] - Simplify the test case.
George Rimar [Thu, 6 Dec 2018 08:42:57 +0000 (08:42 +0000)]
[llvm-dwarfdump] - Simplify the test case.

The test was fully rewritten for simplification.

New test code was suggested by David Blaikie.

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

llvm-svn: 348464

5 years ago[LLD][ELF] - Linker script: accept using a file name without a list of sections.
George Rimar [Thu, 6 Dec 2018 08:34:52 +0000 (08:34 +0000)]
[LLD][ELF] - Linker script: accept using a file name without a list of sections.

This is a part of
https://bugs.llvm.org/show_bug.cgi?id=39885

Linker script specification says:
"You can specify a file name to include sections from a particular file. You would
do this if one or more of your files contain special data that needs to be at a
particular location in memory."

LLD did not accept this syntax. The patch implements it.

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

llvm-svn: 348463

5 years ago[InstCombine] foldICmpWithLowBitMaskedVal(): don't miscompile -1 vector elts
Roman Lebedev [Thu, 6 Dec 2018 08:14:24 +0000 (08:14 +0000)]
[InstCombine] foldICmpWithLowBitMaskedVal(): don't miscompile -1 vector elts

I was finally able to quantify what i thought was missing in the fix,
it was vector constants. If we have a scalar (and %x, -1),
it will be instsimplified before we reach this code,
but if it is a vector, we may still have a -1 element.

Thus, we want to avoid the fold if *at least one* element is -1.
Or in other words, ignoring the undef elements, no sign bits
should be set. Thus, m_NonNegative().

A follow-up for rL348181
https://bugs.llvm.org/show_bug.cgi?id=39861

llvm-svn: 348462

5 years ago[NFC][InstCombine] Add more miscompile tests for foldICmpWithLowBitMaskedVal()
Roman Lebedev [Thu, 6 Dec 2018 08:11:20 +0000 (08:11 +0000)]
[NFC][InstCombine] Add more miscompile tests for foldICmpWithLowBitMaskedVal()

We also have to me aware of vector constants. If at least one element
is -1, we can't transform.

llvm-svn: 348461

5 years ago[X86] Remove some leftover code for handling an i1 setcc type. NFC
Craig Topper [Thu, 6 Dec 2018 07:00:02 +0000 (07:00 +0000)]
[X86] Remove some leftover code for handling an i1 setcc type. NFC

We should only need to handle i8 now.

llvm-svn: 348460

5 years agoRemove unnecessary include.
Richard Trieu [Thu, 6 Dec 2018 06:32:40 +0000 (06:32 +0000)]
Remove unnecessary include.

llvm-svn: 348459

5 years agoRemove CodeGen dependencies on Sema.
Richard Trieu [Thu, 6 Dec 2018 06:12:20 +0000 (06:12 +0000)]
Remove CodeGen dependencies on Sema.

Move diagnostics from Sema to Frontend (or Common) so that CodeGen no longer
needs to include the Sema diagnostic IDs.

llvm-svn: 348458

5 years ago[LoopSimplifyCFG] Delete dead in-loop blocks
Max Kazantsev [Thu, 6 Dec 2018 05:45:02 +0000 (05:45 +0000)]
[LoopSimplifyCFG] Delete dead in-loop blocks

This patch teaches LoopSimplifyCFG to delete loop blocks that have
become unreachable after terminator folding has been done.

Differential Revision: https://reviews.llvm.org/D54023
Reviewed By: anna

llvm-svn: 348457

5 years agoInstCombine: Add some missing tests for scalarization
Matt Arsenault [Thu, 6 Dec 2018 03:32:50 +0000 (03:32 +0000)]
InstCombine: Add some missing tests for scalarization

llvm-svn: 348456

5 years agoRevert "[XRay] Move-only Allocator, FunctionCallTrie, and Array"
Dean Michael Berris [Thu, 6 Dec 2018 03:28:57 +0000 (03:28 +0000)]
Revert "[XRay] Move-only Allocator, FunctionCallTrie, and Array"

This reverts commits r348438, r348445, and r348449 due to breakages with
gcc-4.8 builds.

llvm-svn: 348455

5 years agoARM, AArch64: support `__attribute__((__swiftcall__))`
Saleem Abdulrasool [Thu, 6 Dec 2018 03:28:37 +0000 (03:28 +0000)]
ARM, AArch64: support `__attribute__((__swiftcall__))`

Support the Swift calling convention on Windows ARM and AArch64.  Both
of these conform to the AAPCS, AAPCS64 calling convention, and LLVM has
been adjusted to account for the register usage.  Ensure that the
frontend passes this into the backend.  This allows the swift runtime to
be built for Windows.

llvm-svn: 348454

5 years ago[XRay] Use a local lvalue as arg to AppendEmplace(...)
Dean Michael Berris [Thu, 6 Dec 2018 02:55:47 +0000 (02:55 +0000)]
[XRay] Use a local lvalue as arg to AppendEmplace(...)

This is a follow-up to D54989.

Further work-around gcc-4.8 failing to handle brace-init with temporaries.

llvm-svn: 348449

5 years ago[darwin] remove version number check when enabling -fobjc-subscripting-legacy-runtime
Alex Lorenz [Thu, 6 Dec 2018 02:44:23 +0000 (02:44 +0000)]
[darwin] remove version number check when enabling -fobjc-subscripting-legacy-runtime

This subscripting feature actually works on older OS versions anyway.

rdar://36287065

llvm-svn: 348448

5 years agoReapply fix from r348062 to fix test on Windows.
Douglas Yung [Thu, 6 Dec 2018 02:13:09 +0000 (02:13 +0000)]
Reapply fix from r348062 to fix test on Windows.

llvm-svn: 348447

5 years ago[llvm-objcopy] Change --only-keep to --only-section
Jake Ehrlich [Thu, 6 Dec 2018 02:03:53 +0000 (02:03 +0000)]
[llvm-objcopy] Change --only-keep to --only-section

I just hard core goofed when I wrote this and created a different name
for no good reason. I'm failry aware of most "fresh" users of llvm-objcopy
(that is, users which are not using it as a drop in replacement for GNU
objcopy) and can say that only "-j" is being used by such people so this
patch should strictly increase compatibility and not remove it.

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

llvm-svn: 348446

5 years ago[XRay] Use default-constructed struct as argument to Append(...)
Dean Michael Berris [Thu, 6 Dec 2018 01:56:27 +0000 (01:56 +0000)]
[XRay] Use default-constructed struct as argument to Append(...)

This is a follow-up to D54989.

Work-around gcc-4.8 failing to handle brace-init for structs to imply
default-construction of an aggregate, and treats it as an initialiser
list instead.

llvm-svn: 348445

5 years agoAArch64: Fix invalid CCMP emission
Matthias Braun [Thu, 6 Dec 2018 01:40:23 +0000 (01:40 +0000)]
AArch64: Fix invalid CCMP emission

The code emitting AND-subtrees used to check whether any of the operands
was an OR in order to figure out if the result needs to be negated.
However the OR could be hidden in further subtrees and not immediately
visible.

Change the code so that canEmitConjunction() determines whether the
result of the generated subtree needs to be negated. Cleanup emission
logic to use this. I also changed the code a bit to make all negation
decisions early before we actually emit the subtrees.

This fixes http://llvm.org/PR39550

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

llvm-svn: 348444

5 years ago[attributes] Add more tests for os_returns_retained
George Karpenkov [Thu, 6 Dec 2018 01:21:38 +0000 (01:21 +0000)]
[attributes] Add more tests for os_returns_retained

llvm-svn: 348443

5 years ago[Sema/Attribute] Check for noderef attribute
Leonard Chan [Thu, 6 Dec 2018 01:05:54 +0000 (01:05 +0000)]
[Sema/Attribute] Check for noderef attribute

This patch adds the noderef attribute in clang and checks for dereferences of
types that have this attribute. This attribute is currently used by sparse and
would like to be ported to clang.

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

llvm-svn: 348442

5 years agoAdd objc.* ARC intrinsics and codegen them to their runtime methods.
Pete Cooper [Thu, 6 Dec 2018 00:52:54 +0000 (00:52 +0000)]
Add objc.* ARC intrinsics and codegen them to their runtime methods.

Reviewers: erik.pilkington, ahatanak

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

llvm-svn: 348441

5 years agoAdd a unit test for ArchSpec matching to document how it behaves (and test it).
Adrian Prantl [Thu, 6 Dec 2018 00:43:55 +0000 (00:43 +0000)]
Add a unit test for ArchSpec matching to document how it behaves (and test it).

llvm-svn: 348440

5 years ago[MachineOutliner][NFC] Move yet another std::vector out of a loop
Jessica Paquette [Thu, 6 Dec 2018 00:26:21 +0000 (00:26 +0000)]
[MachineOutliner][NFC] Move yet another std::vector out of a loop

Once again, following the wisdom of the LLVM Programmer's Manual.

I think that's enough refactoring for today. :)

llvm-svn: 348439

5 years agoRe-land r348335 "[XRay] Move-only Allocator, FunctionCallTrie, and Array"
Dean Michael Berris [Thu, 6 Dec 2018 00:25:56 +0000 (00:25 +0000)]
Re-land r348335 "[XRay] Move-only Allocator, FunctionCallTrie, and Array"

Continuation of D54989.

Additional changes:

  - Use `.AppendEmplace(...)` instead of `.Append(Type{...})` to appease
    GCC 4.8 with confusion on when an initializer_list is used as
    opposed to a temporary aggregate initialized object.

llvm-svn: 348438

5 years ago[libcxx] Mark some tests as failing on macosx 10.14
Louis Dionne [Thu, 6 Dec 2018 00:25:15 +0000 (00:25 +0000)]
[libcxx] Mark some tests as failing on macosx 10.14

llvm-svn: 348437

5 years ago[libcxx] Don't depend on availability markup to provide the streams in the dylib
Louis Dionne [Thu, 6 Dec 2018 00:24:58 +0000 (00:24 +0000)]
[libcxx] Don't depend on availability markup to provide the streams in the dylib

Whether an explicit instantiation declaration should be provided is not
a matter of availability markup.

This problem is exemplified by the fact that some tests were incorrectly
marked as XFAIL when they should instead have been using the definition
of streams from the headers, and hence passing, and that, regardless of
whether visibility annotations are enabled.

llvm-svn: 348436

5 years ago[lldbsuite] Disable TestStopPCs when there's no XML support
Stella Stamenova [Thu, 6 Dec 2018 00:11:17 +0000 (00:11 +0000)]
[lldbsuite] Disable TestStopPCs when there's no XML support

The test relies on xml support to setup the correct registers. If there's no XML support, the test is going to fail.

llvm-svn: 348435

5 years ago[Sema] Push and Pop Expression Evaluation Context Records at the start and end of...
Leonard Chan [Thu, 6 Dec 2018 00:10:36 +0000 (00:10 +0000)]
[Sema] Push and Pop Expression Evaluation Context Records at the start and end of function definitions

This patch creates a new context for every function definition we enter.
Currently we do not push and pop on these, usually working off of the global
context record added in the Sema constructor, which never gets popped.

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

llvm-svn: 348434

5 years ago[MachineOutliner][NFC] Move std::vector out of loop
Jessica Paquette [Thu, 6 Dec 2018 00:04:03 +0000 (00:04 +0000)]
[MachineOutliner][NFC] Move std::vector out of loop

See http://llvm.org/docs/ProgrammersManual.html#vector

llvm-svn: 348433

5 years ago[MachineOutliner][NFC] Remove IntegerInstructionMap from InstructionMapper
Jessica Paquette [Thu, 6 Dec 2018 00:01:51 +0000 (00:01 +0000)]
[MachineOutliner][NFC] Remove IntegerInstructionMap from InstructionMapper

Refactoring.

This map was only used when we used a string of integers to output the outlined
sequence. Since it's no longer used for anything, there's no reason to keep it
around.

llvm-svn: 348432

5 years agoFix title underlines being too short after r348429
Pete Cooper [Thu, 6 Dec 2018 00:01:44 +0000 (00:01 +0000)]
Fix title underlines being too short after r348429

llvm-svn: 348431

5 years ago[GlobalISel] Introduce G_BUILD_VECTOR, G_BUILD_VECTOR_TRUNC and G_CONCAT_VECTOR opcodes.
Amara Emerson [Wed, 5 Dec 2018 23:53:30 +0000 (23:53 +0000)]
[GlobalISel] Introduce G_BUILD_VECTOR, G_BUILD_VECTOR_TRUNC and G_CONCAT_VECTOR opcodes.

These opcodes are intended to subsume some of the capability of G_MERGE_VALUES,
as it was too powerful and thus complex to add deal with throughout the GISel
pipeline.

G_BUILD_VECTOR creates a vector value from a sequence of uniformly typed
scalar values. G_BUILD_VECTOR_TRUNC is a special opcode for handling scalar
operands which are larger than the destination vector element type, and
therefore does an implicit truncate.

G_CONCAT_VECTOR creates a vector by concatenating smaller, uniformly typed,
vectors together.

These will be used in a subsequent commit. This commit just adds the initial
infrastructure.

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

llvm-svn: 348430

5 years agoUpdate ARC docs as objc_storeStrong returns void not id
Pete Cooper [Wed, 5 Dec 2018 23:49:52 +0000 (23:49 +0000)]
Update ARC docs as objc_storeStrong returns void not id

llvm-svn: 348429

5 years ago[MachineOutliner][NFC] Remove buildCandidateList and replace with findCandidates
Jessica Paquette [Wed, 5 Dec 2018 23:39:07 +0000 (23:39 +0000)]
[MachineOutliner][NFC] Remove buildCandidateList and replace with findCandidates

More refactoring.

Since the pruning logic has changed, and the candidate list is gone,
everything can be sunk into findCandidates.

We no longer need to keep track of the length of the longest substring, so we
can drop all of that logic as well.

After this, we just find all of the candidates and move to outlining.

llvm-svn: 348428

5 years ago[MachineOutliner][NFC] Candidates don't need to be shared_ptrs anymore
Jessica Paquette [Wed, 5 Dec 2018 23:24:22 +0000 (23:24 +0000)]
[MachineOutliner][NFC] Candidates don't need to be shared_ptrs anymore

More refactoring.

After the changes to the pruning logic, and removing CandidateList, there's
no reason for Candiates to be shared_ptrs (or pointers at all).

std::shared_ptr<Candidate> -> Candidate.

llvm-svn: 348427

5 years agoRevert r347934 "[SCEV] Guard movement of insertion point for loop-invariants"
David L. Jones [Wed, 5 Dec 2018 23:13:50 +0000 (23:13 +0000)]
Revert r347934 "[SCEV] Guard movement of insertion point for loop-invariants"

This change caused SEGVs in instcombine. (The r347934 change seems to me to be a
precipitating cause, not a root cause. Details are on the llvm-commits thread
for r347934.)

llvm-svn: 348426

5 years agoFix test change from r348365 to deal with Windows paths correctly.
Douglas Yung [Wed, 5 Dec 2018 23:10:14 +0000 (23:10 +0000)]
Fix test change from r348365 to deal with Windows paths correctly.

llvm-svn: 348425

5 years ago[WebAssembly] Change event section code to 13
Heejin Ahn [Wed, 5 Dec 2018 23:10:09 +0000 (23:10 +0000)]
[WebAssembly] Change event section code to 13

Summary:
We decided to change the event section code from 12 to 13 as new
`DataCount` section in the bulk memory operations proposal will take the
code 12 instead.

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 348424

5 years ago[InstCombine] remove dead code from visitExtractElement
Sanjay Patel [Wed, 5 Dec 2018 23:09:33 +0000 (23:09 +0000)]
[InstCombine] remove dead code from visitExtractElement

Extracting from a splat constant is always handled by InstSimplify.
Move the test for this from InstCombine to InstSimplify to make
sure that stays true.

llvm-svn: 348423

5 years ago[MachineOutliner][NFC] Remove CandidateList, since it's now unused.
Jessica Paquette [Wed, 5 Dec 2018 22:50:26 +0000 (22:50 +0000)]
[MachineOutliner][NFC] Remove CandidateList, since it's now unused.

After removing the pruning logic, there's no reason to populate a list of
Candidates. Remove CandidateList and update comments.

llvm-svn: 348422

5 years agoFix buildbot capture warning
Jessica Paquette [Wed, 5 Dec 2018 22:47:25 +0000 (22:47 +0000)]
Fix buildbot capture warning

A bot didn't like my lambda. This ought to fix it.

Example:

http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/30139/steps/build%20lld/logs/stdio

error C3493: 'AlreadyRemoved' cannot be implicitly captured because no default
capture mode has been specified

llvm-svn: 348421

5 years ago[MachineOutliner][NFC] Simplify and unify pruning/outlining logic
Jessica Paquette [Wed, 5 Dec 2018 22:27:38 +0000 (22:27 +0000)]
[MachineOutliner][NFC] Simplify and unify pruning/outlining logic

Since we're now performing outlining per OutlinedFunction rather than per
Candidate, we can simply outline each candidate as it shows up.

Instead of having a pruning phase, instead, we'll outline entire functions.
Then we'll update the UnsignedVec we mapped to reflect the deletion. If any
candidate is in a space that's marked dirty, then we'll drop it.

This lets us remove the pruning logic entirely, and greatly simplifies the
code.

llvm-svn: 348420

5 years ago[Hexagon] Add intrinsics for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 22:03:04 +0000 (22:03 +0000)]
[Hexagon] Add intrinsics for Hexagon V66

llvm-svn: 348419

5 years ago[InstCombine] reduce duplication in visitExtractElementInst; NFC
Sanjay Patel [Wed, 5 Dec 2018 21:57:51 +0000 (21:57 +0000)]
[InstCombine] reduce duplication in visitExtractElementInst; NFC

llvm-svn: 348418

5 years ago[InstCombine] add/move tests for extractelement; NFC
Sanjay Patel [Wed, 5 Dec 2018 21:56:13 +0000 (21:56 +0000)]
[InstCombine] add/move tests for extractelement; NFC

llvm-svn: 348417

5 years agoThinLTO: Do not import debug info for imported global constants
David Blaikie [Wed, 5 Dec 2018 21:42:17 +0000 (21:42 +0000)]
ThinLTO: Do not import debug info for imported global constants

It looks like this isn't necessary (in any tests I've done, it results
in the global being described with no location or value in the imported
side - while it's still fully described in the place it's imported from)
& results in significant/pathological debug info growth to home these
location-less global variable descriptions on the import side.

This is a rather pressing/important issue to address - this regressed
executable size for one example I'm looking at by 15%, object size is probably
similar though I haven't measured it, and a 22x increase in the number of CUs
in the cu_index in split DWARF DWP files, creating a similarly large regression
in the time it takes llvm-symbolizer to run on such binaries.

Reviewers: tejohnson, evgeny777

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

llvm-svn: 348416

5 years ago[Hexagon] Add support for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 21:38:35 +0000 (21:38 +0000)]
[Hexagon] Add support for Hexagon V66

llvm-svn: 348415

5 years ago[MachineOutliner] Outline functions by order of benefit
Jessica Paquette [Wed, 5 Dec 2018 21:36:04 +0000 (21:36 +0000)]
[MachineOutliner] Outline functions by order of benefit

Mostly NFC, only change is the order of outlined function names.

Loop over the outlined functions instead of walking the candidate list.

This is a bit easier to understand. It's far more natural to create a function,
then replace all of its occurrences with calls than the other way around.

The functions outlined after this do not change, but their names will be
decided by their benefit. E.g, OUTLINED_FUNCTION_0 will now always be the
most beneficial function, rather than the first one seen.

This makes it easier to enforce an ordering on the outlined functions. So,
this also adds a test to make sure that the ordering works as expected.

llvm-svn: 348414

5 years ago[Hexagon] Add intrinsics for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 21:14:51 +0000 (21:14 +0000)]
[Hexagon] Add intrinsics for Hexagon V66

llvm-svn: 348413

5 years agoNFC: Extract TextNodeDumper class
Stephen Kelly [Wed, 5 Dec 2018 21:12:39 +0000 (21:12 +0000)]
NFC: Extract TextNodeDumper class

Summary:
Start by moving some utilities to it. It will eventually house dumping
of individual nodes (after indentation etc has already been accounted
for).

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 348412

5 years ago[Hexagon] Add instruction definitions for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 21:01:07 +0000 (21:01 +0000)]
[Hexagon] Add instruction definitions for Hexagon V66

llvm-svn: 348411

5 years agoNFC: Extract TextTreeStructure class
Stephen Kelly [Wed, 5 Dec 2018 20:53:14 +0000 (20:53 +0000)]
NFC: Extract TextTreeStructure class

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 348410

5 years agoNFC: Inline handling of DependentSizedArrayType
Stephen Kelly [Wed, 5 Dec 2018 20:34:07 +0000 (20:34 +0000)]
NFC: Inline handling of DependentSizedArrayType

Summary:
Re-order handling of getElementType and getBracketsRange. It is
necessary to perform all printing before any traversal to child nodes.

This causes no change in the output of ast-dump-array.cpp due to the way
child nodes are printed with a delay.  This new order of the code is
also the order that produces the expected output anyway.

Subscribers: cfe-commits

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

llvm-svn: 348409

5 years agoAdd dump tests for inherited default template parameters
Stephen Kelly [Wed, 5 Dec 2018 20:21:13 +0000 (20:21 +0000)]
Add dump tests for inherited default template parameters

llvm-svn: 348408

5 years ago[Hexagon] Foundation of support for Hexagon V66
Krzysztof Parzyszek [Wed, 5 Dec 2018 20:18:09 +0000 (20:18 +0000)]
[Hexagon] Foundation of support for Hexagon V66

llvm-svn: 348407

5 years ago[GISel]: Provide standard interface to observe changes in GISel passes
Aditya Nandakumar [Wed, 5 Dec 2018 20:14:52 +0000 (20:14 +0000)]
[GISel]: Provide standard interface to observe changes in GISel passes

https://reviews.llvm.org/D54980

This provides a standard API across GISel passes to observe and notify
passes about changes (insertions/deletions/mutations) to MachineInstrs.
This patch also removes the recordInsertion method in MachineIRBuilder
and instead provides method to setObserver.

Reviewed by: vkeles.

llvm-svn: 348406

5 years ago[CodeExtractor] Do not marked outlined calls which may resume EH as noreturn
Vedant Kumar [Wed, 5 Dec 2018 19:35:37 +0000 (19:35 +0000)]
[CodeExtractor] Do not marked outlined calls which may resume EH as noreturn

Treat terminators which resume exception propagation as returning instructions
(at least, for the purposes of marking outlined functions `noreturn`). This is
to avoid inserting traps after calls to outlined functions which unwind.

rdar://46129950

llvm-svn: 348404

5 years ago[X86][SSE] Fix a copy+paste typo that was folding the sext/zext of partial vectors
Simon Pilgrim [Wed, 5 Dec 2018 19:32:19 +0000 (19:32 +0000)]
[X86][SSE] Fix a copy+paste typo that was folding the sext/zext of partial vectors

llvm-svn: 348403

5 years agoRevert "[RISCV] Mark unit tests as "requires: riscv-registered-target""
Mandeep Singh Grang [Wed, 5 Dec 2018 19:19:38 +0000 (19:19 +0000)]
Revert "[RISCV] Mark unit tests as "requires: riscv-registered-target""

This reverts commit 8908dd12e7bbfc74e264233e900206ad31e285f0.

llvm-svn: 348402

5 years agoDo not use a hash table to uniquify mergeable strings.
Rui Ueyama [Wed, 5 Dec 2018 19:13:31 +0000 (19:13 +0000)]
Do not use a hash table to uniquify mergeable strings.

Previously, we have a hash table containing strings and their offsets
to manage mergeable strings. Technically we can live without that, because
we can do binary search on a vector of mergeable strings to find a mergeable
strings.

We did have both the hash table and the binary search because we thought
that that is faster.

We recently observed that lld tend to consume more memory than gold when
building an output with debug info. A few percent of memory is consumed by
the hash table. So, we needed to reevaluate whether or not having the extra
hash table is a good CPU/memory tradeoff. I run a few benchmarks with and
without the hash table.

I got a mixed result for the benchmark. We observed a regression for some
programs by removing the hash table (that's what we expected), but we also
observed that performance imrpovements for some programs. This is perhaps
due to reduced memory usage.

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

llvm-svn: 348401

5 years agoDo not check for parameters shadowing fields in function declarations.
Aaron Ballman [Wed, 5 Dec 2018 18:56:57 +0000 (18:56 +0000)]
Do not check for parameters shadowing fields in function declarations.

We would issue a false-positive diagnostic for parameters in function declarations shadowing fields; we now only issue the diagnostic on a function definition instead.

llvm-svn: 348400

5 years agoAdding tests for -ast-dump; NFC.
Aaron Ballman [Wed, 5 Dec 2018 18:53:57 +0000 (18:53 +0000)]
Adding tests for -ast-dump; NFC.

This adds tests for various function and class template declarations.

llvm-svn: 348399