platform/upstream/llvm.git
5 years ago[pecoff] Implement ObjectFilePECOFF::GetDependedModules()
Aaron Smith [Thu, 6 Dec 2018 21:36:39 +0000 (21:36 +0000)]
[pecoff] Implement ObjectFilePECOFF::GetDependedModules()

Summary:
This parses entries in pecoff import tables for imported DLLs and
is intended as the first step to allow LLDB to load a PE's shared
modules when creating a target on the LLDB console.

Reviewers: rnk, zturner, aleksandr.urakov, lldb-commits, labath, asmith

Reviewed By: labath, asmith

Subscribers: labath, lemo, clayborg, Hui, mgorny, mgrang, teemperor

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

llvm-svn: 348527

5 years agoImplement WindowsDYLD::DidAttach for use with gdb-server attach
Nathan Lanza [Thu, 6 Dec 2018 21:13:03 +0000 (21:13 +0000)]
Implement WindowsDYLD::DidAttach for use with gdb-server attach

Summary:
Windows lldb debugging currently uses a process plugin to handle
launching and attaching to a process. Launching a process via a debug
server (e.g. ds2) and attaching to it with `gdb-remote port` currently
doesn't communicate address information of the executable properly.

Implement DynamicLoaderWindowsDYLD::DidAttach which allow us to
obtain the proper executable load address.

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

llvm-svn: 348526

5 years ago[libcxx] Always convert 'use_system_cxx_lib' to an absolute path
Louis Dionne [Thu, 6 Dec 2018 20:09:15 +0000 (20:09 +0000)]
[libcxx] Always convert 'use_system_cxx_lib' to an absolute path

Otherwise, some tests would fail when a relative path was passed,
because they'd use the relative path from a different directory
than the current working directory.

llvm-svn: 348525

5 years ago[test] Add missing cmake include for building libFuzzer alone
Michal Gorny [Thu, 6 Dec 2018 20:04:08 +0000 (20:04 +0000)]
[test] Add missing cmake include for building libFuzzer alone

Include CompilerRTCompile in fuzzer tests explicitly.  Otherwise, when
building only libFuzzer, CMake fails due to:

CMake Error at cmake/Modules/AddCompilerRT.cmake:395 (sanitizer_test_compile):
  Unknown CMake command "sanitizer_test_compile".
Call Stack (most recent call first):
  lib/fuzzer/tests/CMakeLists.txt:53 (generate_compiler_rt_tests)

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

llvm-svn: 348524

5 years ago[DAGCombiner] reduce indent; NFC
Sanjay Patel [Thu, 6 Dec 2018 20:02:47 +0000 (20:02 +0000)]
[DAGCombiner] reduce indent; NFC

Unlike some of the folds in hoistLogicOpWithSameOpcodeHands()
above this shuffle transform, this has the expected hasOneUse()
checks in place.

llvm-svn: 348523

5 years ago[DagCombiner][X86] Simplify a ConcatVectors of a scalar_to_vector with undef.
Andrea Di Biagio [Thu, 6 Dec 2018 19:55:38 +0000 (19:55 +0000)]
[DagCombiner][X86] Simplify a ConcatVectors of a scalar_to_vector with undef.

This patch introduces a new DAGCombiner rule to simplify concat_vectors nodes:

concat_vectors( bitcast (scalar_to_vector %A), UNDEF)
    --> bitcast (scalar_to_vector %A)

This patch only partially addresses PR39257. In particular, it is enough to fix
one of the two problematic cases mentioned in PR39257. However, it is not enough
to fix the original test case posted by Craig; that particular case would
probably require a more complicated approach (and knowledge about used bits).

Before this patch, we used to generate the following code for function PR39257
(-mtriple=x86_64 , -mattr=+avx):

vmovsd  (%rdi), %xmm0           # xmm0 = mem[0],zero
vxorps  %xmm1, %xmm1, %xmm1
vblendps        $3, %xmm0, %xmm1, %xmm0 # xmm0 = xmm0[0,1],xmm1[2,3]
vmovaps %ymm0, (%rsi)
vzeroupper
retq

Now we generate this:

vmovsd  (%rdi), %xmm0           # xmm0 = mem[0],zero
vmovaps %ymm0, (%rsi)
vzeroupper
retq

As a side note: that VZEROUPPER is completely redundant...

I guess the vzeroupper insertion pass doesn't realize that the definition of
%xmm0 from vmovsd is already zeroing the upper half of %ymm0. Note that on
%-mcpu=btver2, we don't get that vzeroupper because pass vzeroupper insertion
%pass is disabled.

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

llvm-svn: 348522

5 years ago[OPENMP][NVPTX]Correct type casting for printf args + simplified shfl64 function.
Alexey Bataev [Thu, 6 Dec 2018 19:45:48 +0000 (19:45 +0000)]
[OPENMP][NVPTX]Correct type casting for printf args + simplified shfl64 function.

Summary:
Explicitly casted printf's args to the required types + simplified
shfl64 function.

Reviewers: gtbercea, kkwli0

Subscribers: guansong, jfb, caomhin, openmp-commits

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

llvm-svn: 348521

5 years ago[libcxx] Fix incorrect XFAILs for chrono tests on old macos deployment targets
Louis Dionne [Thu, 6 Dec 2018 19:24:20 +0000 (19:24 +0000)]
[libcxx] Fix incorrect XFAILs for chrono tests on old macos deployment targets

The tests were marked to fail based on the 'availability' LIT feature.
However, those tests should really only be failing when we run them
against the dylibs that were deployed on macosx10.7 and macosx10.8,
which the deployment target has nothing to do with.

This caused the tests to unexpectedly pass when running the tests
with deployment target macosx10.{7,8} but running with a recent dylib.

llvm-svn: 348520

5 years agoFix the Xcode project build for the addition of NativePDB/DWARFLocationExpression...
Jim Ingham [Thu, 6 Dec 2018 19:23:21 +0000 (19:23 +0000)]
Fix the Xcode project build for the addition of NativePDB/DWARFLocationExpression.{h,cpp}

llvm-svn: 348519

5 years ago[DAGCombiner] don't hoist logic op if operands have other uses, part 2
Sanjay Patel [Thu, 6 Dec 2018 19:18:56 +0000 (19:18 +0000)]
[DAGCombiner] don't hoist logic op if operands have other uses, part 2

The PPC test with 2 extra uses seems clearly better by avoiding this transform.
With 1 extra use, we also prevent an extra register move (although that might
be an RA problem). The general rule should be to only make a change here if
it is always profitable. The x86 diffs are all neutral.

llvm-svn: 348518

5 years agoFix Wdocumentation warning. NFCI.
Simon Pilgrim [Thu, 6 Dec 2018 19:17:28 +0000 (19:17 +0000)]
Fix Wdocumentation warning. NFCI.

llvm-svn: 348517

5 years ago[PowerPC] add tests for hoisting bitwise logic; NFC
Sanjay Patel [Thu, 6 Dec 2018 19:05:19 +0000 (19:05 +0000)]
[PowerPC] add tests for hoisting bitwise logic; NFC

llvm-svn: 348516

5 years agoAllow forwarding -fdebug-compilation-dir to cc1as
Nico Weber [Thu, 6 Dec 2018 18:50:39 +0000 (18:50 +0000)]
Allow forwarding -fdebug-compilation-dir to cc1as

The flag -fdebug-compilation-dir is useful to make generated .o files
independent of the path of the build directory, without making the compile
command-line dependent on the path of the build directory, like
-fdebug-prefix-map requires. This change makes it so that the driver can
forward the flag to -cc1as, like it already can for -cc1. We might want to
consider making -fdebug-compilation-dir a driver flag in a follow-up.

(Since -fdebug-compilation-dir defaults to PWD, it's already possible to get
this effect by setting PWD, but explicit compiler flags are better than env
vars, because e.g. ninja tracks command lines and reruns commands that change.)

Somewhat related to PR14625.

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

llvm-svn: 348515

5 years agoFix line endings in build.py
Zachary Turner [Thu, 6 Dec 2018 18:45:07 +0000 (18:45 +0000)]
Fix line endings in build.py

llvm-svn: 348514

5 years agoReapply "Avoid emitting redundant or unusable directories in DIFile metadata entries.""
Adrian Prantl [Thu, 6 Dec 2018 18:44:50 +0000 (18:44 +0000)]
Reapply "Avoid emitting redundant or unusable directories in DIFile metadata entries.""

This reverts commit r348280 and reapplies D55085 without modifications.

Original commit message:

    Avoid emitting redundant or unusable directories in DIFile metadata entries.

    As discussed on llvm-dev recently, Clang currently emits redundant
    directories in DIFile entries, such as

      .file      1 "/Volumes/Data/llvm" "/Volumes/Data/llvm/tools/clang/test/CodeGen/debug-info-abspath.c"

    This patch looks at any common prefix between the compilation
    directory and the (absolute) file path and strips the redundant
    part. More importantly it leaves the compilation directory empty if
    the two paths have no common prefix.

    After this patch the above entry is (assuming a compilation dir of "/Volumes/Data/llvm/_build"):

      .file 1 "/Volumes/Data/llvm" "tools/clang/test/CodeGen/debug-info-abspath.c"

    When building the FileCheck binary with debug info, this patch makes
    the build artifacts ~1kb smaller.

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

llvm-svn: 348513

5 years agoReapply "Adapt gcov to changes in CFE."
Adrian Prantl [Thu, 6 Dec 2018 18:44:48 +0000 (18:44 +0000)]
Reapply "Adapt gcov to changes in CFE."

This reverts commit r348203 and reapplies D55085 with an additional
GCOV bugfix to make the change NFC for relative file paths in .gcno files.

Thanks to Ilya Biryukov for additional testing!

Original commit message:

    Update Diagnostic handling for changes in CFE.

    The clang frontend no longer emits the current working directory for
    DIFiles containing an absolute path in the filename: and will move the
    common prefix between current working directory and the file into the
    directory: component.

    https://reviews.llvm.org/D55085

llvm-svn: 348512

5 years ago[build.py] Embed the output file name in generated object file names.
Zachary Turner [Thu, 6 Dec 2018 18:39:58 +0000 (18:39 +0000)]
[build.py] Embed the output file name in generated object file names.

In compile-and-link mode, the user doesn't specify the name of the
object files to generate, because there could be multiple inputs
on a single command line and this would be hard to specify.  So the
script just tries to be smart and figure out the best object file
names.  However, if two build scripts are running in parallel and
using the same source files as input, they would previously race
to write the same object files, since the computed name only considered
the source file names when computing the object file names.

With this patch, we also consider the final executable name.  In a
way, this "namespaces" the generated object files so that as long
as the final executable file names don't clash, the intermediate
object file names won't clash either.

llvm-svn: 348511

5 years ago[AArch64] Fix Exynos predicate
Evandro Menezes [Thu, 6 Dec 2018 18:25:37 +0000 (18:25 +0000)]
[AArch64] Fix Exynos predicate

Fix predicate for arithmetic instructions with shift and/or extend.

llvm-svn: 348510

5 years ago[libcxx] Add checks for unique value of array<T, 0>.begin() and array<T, 0>.end()
Louis Dionne [Thu, 6 Dec 2018 18:24:39 +0000 (18:24 +0000)]
[libcxx] Add checks for unique value of array<T, 0>.begin() and array<T, 0>.end()

The standard section [array.zero] requires the return value of begin()
and end() methods of a zero-sized array to be unique. Eric Fiselier
clarifies: "That unique value cannot be null, and must be properly aligned".
This patch adds checks for the first part of this clarification: unique
value returned by these methods cannot be null.

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

llvm-svn: 348509

5 years ago[DAGCombiner] don't hoist logic op if operands have other uses
Sanjay Patel [Thu, 6 Dec 2018 18:16:32 +0000 (18:16 +0000)]
[DAGCombiner] don't hoist logic op if operands have other uses

The AVX512 diffs are neutral, but the bswap test shows a clear overreach in
hoistLogicOpWithSameOpcodeHands(). If we don't check for other uses, we can
increase the instruction count.

This could also fight with transforms trying to go in the opposite direction
and possibly blow up/infinite loop. This might be enough to solve the bug
noted here:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20181203/608593.html

I did not add the hasOneUse() checks to all opcodes because I see a perf
regression for at least one opcode. We may decide that's irrelevant in the
face of potential compiler crashing, but I'll see if I can salvage that first.

llvm-svn: 348508

5 years ago[libcxx] Add XFAILs for aligned allocation tests on AppleClang 9
Louis Dionne [Thu, 6 Dec 2018 18:06:47 +0000 (18:06 +0000)]
[libcxx] Add XFAILs for aligned allocation tests on AppleClang 9

Some people are still running the test suite using AppleClang 9.

llvm-svn: 348507

5 years ago[x86] add test for hoistLogicOpWithSameOpcodeHands with extra uses; NFC
Sanjay Patel [Thu, 6 Dec 2018 18:06:10 +0000 (18:06 +0000)]
[x86] add test for hoistLogicOpWithSameOpcodeHands with extra uses; NFC

llvm-svn: 348506

5 years ago[PDB] Move some code around. NFC.
Zachary Turner [Thu, 6 Dec 2018 17:49:15 +0000 (17:49 +0000)]
[PDB] Move some code around.  NFC.

llvm-svn: 348505

5 years ago[CUDA] Fix nvidia-cuda-toolkit detection on Ubuntu
Joel E. Denny [Thu, 6 Dec 2018 17:46:17 +0000 (17:46 +0000)]
[CUDA] Fix nvidia-cuda-toolkit detection on Ubuntu

This just extends D40453 (r319317) to Ubuntu.

Reviewed By: Hahnfeld, tra

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

llvm-svn: 348504

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