platform/upstream/llvm.git
4 years ago[lldb][CMake] Disable modules in Xcode projects
Stefan Granitz [Thu, 8 Aug 2019 13:39:25 +0000 (13:39 +0000)]
[lldb][CMake] Disable modules in Xcode projects

Summary: Apparently, module-enabled builds clash with Xcode's analysis.

Reviewers: aprantl, jingham, davide, teemperor

Reviewed By: davide

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

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

llvm-svn: 368294

4 years ago[ELF][AArch64] Support for movz, movk tprel relocations
Peter Smith [Thu, 8 Aug 2019 13:38:09 +0000 (13:38 +0000)]
[ELF][AArch64] Support for movz, movk tprel relocations

This patch Implements the R_AARCH64_TLSLE_MOVW_TPREL_G*[_NC]. These are
logically the same calculation as the existing TLSLE relocations with
the result written back to mov[nz] and movk instructions. A typical code
sequence is:
movz x0, #:tprel_g2:foo    // bits [47:32] of R_TLS with overflow check
movk x0, #:tprel_g1_nc:foo // bits [31:16] of R_TLS with no overflow check
movk x0, #:tprel_g0_nc:foo // bits [15:0] of R_TLS with no overflow check

This type of code sequence is usually used with a large code model.

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

Fixes: PR42853
llvm-svn: 368293

4 years ago[X86][SSE] matchBinaryPermuteShuffle - split INSERTPS combines
Simon Pilgrim [Thu, 8 Aug 2019 13:23:53 +0000 (13:23 +0000)]
[X86][SSE] matchBinaryPermuteShuffle - split INSERTPS combines

We need to prefer INSERTPS with zeros over SHUFPS, but fallback to INSERTPS if that fails.

llvm-svn: 368292

4 years ago[clangd] Added semantic highlighting support for primitives.
Johan Vikstrom [Thu, 8 Aug 2019 13:10:30 +0000 (13:10 +0000)]
[clangd] Added semantic highlighting support for primitives.

Summary:
Adds a new HighlightingKind "Primitive". Adds a special case for TypeLocs that have an underlying TypePtr that is are builtin types, adding them as primitives.
The primary reason for this change is because otherwise typedefs that typedef primitives `typedef int A` would not get highlighted (so in the example `A` would not get any highlightings.)

Reviewers: hokein, ilya-biryukov

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

Tags: #clang

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

llvm-svn: 368291

4 years ago[Reassociate] add more tests with negative FP constants; NFC
Sanjay Patel [Thu, 8 Aug 2019 13:08:17 +0000 (13:08 +0000)]
[Reassociate] add more tests with negative FP constants; NFC

llvm-svn: 368290

4 years agoObjectFileELF: Convert a unit test to a lit test
Pavel Labath [Thu, 8 Aug 2019 12:57:46 +0000 (12:57 +0000)]
ObjectFileELF: Convert a unit test to a lit test

It is much easier to test this functionality via lldb-test.

llvm-svn: 368289

4 years ago[ARM] Set default alignment to 64bits
Diogo N. Sampaio [Thu, 8 Aug 2019 12:50:36 +0000 (12:50 +0000)]
[ARM] Set default alignment to 64bits

Summary:
The maximum alignment used by ARM arch
is 64bits, not 128.

This could cause overaligned memory
access for 128 bit neon vector that
have unpredictable behaviour.

This fixes: https://bugs.llvm.org/show_bug.cgi?id=42668

Reviewers: ostannard, dmgreen, srhines, danalbert, pirama, peter.smith

Reviewed By: pirama, peter.smith

Subscribers: phosek, thegameg, thakis, llvm-commits, carwil, peter.smith, javed.absar, kristof.beyls, cfe-commits

Tags: #clang, #llvm

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

llvm-svn: 368288

4 years ago[clangd] Added an early return from VisitMemberExpr in SemanticHighlighting if underl...
Johan Vikstrom [Thu, 8 Aug 2019 12:43:55 +0000 (12:43 +0000)]
[clangd] Added an early return from VisitMemberExpr in SemanticHighlighting if underlying MemberDecl is a CXXConversionDecl.

Summary:
Conversion operators contain invalid MemberLocs which caused SemanticHighlighting
to emit a lot of error logs in large files as they can occur fairly
often (for example converting StringRef to std string).
As the only thing happening was a lot of error logs being
emited there doesn't really seem to be any way to test this
(no erroneous tokens are added). But emiting as many logs as
were being emited is not wanted.

This also adds a test to guard against regressions for highlightings
disapearing from places where the conversion operators are used as their
behaviour differ from the other CXXMethodDecls.

Reviewers: hokein, ilya-biryukov

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

Tags: #clang

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

llvm-svn: 368287

4 years ago[libc++abi] Fix tests when pstl is enabled
Louis Dionne [Thu, 8 Aug 2019 12:43:20 +0000 (12:43 +0000)]
[libc++abi] Fix tests when pstl is enabled

llvm-svn: 368286

4 years ago[pstl] Error out when the backend is left unspecified
Louis Dionne [Thu, 8 Aug 2019 12:43:13 +0000 (12:43 +0000)]
[pstl] Error out when the backend is left unspecified

Instead of silently falling back to the serial backend, it's better if
we fail loudly when the parallel backend is left unspecified. Since we
have a __pstl_config_site header, a backend should always be specified.

llvm-svn: 368285

4 years ago[pstl] Add a __pstl_config_site header to record the CMake configuration
Louis Dionne [Thu, 8 Aug 2019 12:43:04 +0000 (12:43 +0000)]
[pstl] Add a __pstl_config_site header to record the CMake configuration

This commit adds a __pstl_config_site header that contains the value of
macros specified at CMake configuration time. It works similarly to
libc++'s __config_site header, except we always include it as a separate
file instead of concatenating it to the main configuration header.

It is necessary to thread the includes for that header into libc++'s
lit configuration, otherwise we'd be requiring an installation step
prior to running the test suite.

llvm-svn: 368284

4 years ago[clangd] Don't include internal gtest header.
Haojian Wu [Thu, 8 Aug 2019 12:33:12 +0000 (12:33 +0000)]
[clangd] Don't include internal gtest header.

llvm-svn: 368283

4 years ago[clangd] Remove a function accidently being added in rL368261.
Haojian Wu [Thu, 8 Aug 2019 12:19:01 +0000 (12:19 +0000)]
[clangd] Remove a function accidently being added in rL368261.

llvm-svn: 368282

4 years agoFix check in tools/gold/X86/strip_names.ll regarding unnamed args
Bjorn Pettersson [Thu, 8 Aug 2019 12:11:13 +0000 (12:11 +0000)]
Fix check in tools/gold/X86/strip_names.ll regarding unnamed args

After r367755 value numbers are printed for unnamed
function arguments. The tools/gold/X86/strip_names.ll
was not updated in that commit, so this patch can be
seen as a follow up to r367755.

llvm-svn: 368281

4 years ago[clang-format] fix crash involving invalid preprocessor line
Krasimir Georgiev [Thu, 8 Aug 2019 11:56:18 +0000 (11:56 +0000)]
[clang-format] fix crash involving invalid preprocessor line

Summary:
This (invalid) fragment is crashing clang-format:
```
#if 1
int x;
#elif
int y;
#endif
```

The reason being that the parser expects a token after `#elif`, and the
subsequent parsing of the next line does not check if `CurrentToken` is null.

Reviewers: gribozavr

Reviewed By: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 368280

4 years agoFix LLDB_CONFIGURATION_DEBUG builds for the GetSymbolVendor removal
Pavel Labath [Thu, 8 Aug 2019 11:49:55 +0000 (11:49 +0000)]
Fix LLDB_CONFIGURATION_DEBUG builds for the GetSymbolVendor removal

fix one usage that is ifdefed-out in non-debug builds.

llvm-svn: 368279

4 years ago[X86][SSE] Add x64 load use test case
Simon Pilgrim [Thu, 8 Aug 2019 11:24:23 +0000 (11:24 +0000)]
[X86][SSE] Add x64 load use test case

llvm-svn: 368278

4 years ago[clangd] Correct the documentation, NFC.
Haojian Wu [Thu, 8 Aug 2019 10:58:16 +0000 (10:58 +0000)]
[clangd] Correct the documentation, NFC.

llvm-svn: 368277

4 years ago[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for...
Simon Pilgrim [Thu, 8 Aug 2019 10:37:03 +0000 (10:37 +0000)]
[TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for ISD::EXTRACT_VECTOR_ELT

This patch attempts to peek through vectors based on the demanded bits/elt of a particular ISD::EXTRACT_VECTOR_ELT node, allowing us to avoid dependencies on ops that have no impact on the extract.

In particular this helps remove some unnecessary scalar->vector->scalar patterns.

The wasm shift patterns are annoying - @tlively has indicated that the wasm vector shift codegen are to be refactored in the near-term and isn't considered a major issue.

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

llvm-svn: 368276

4 years ago[MCA] Remove dependency from InstrBuilder in mca::Context. NFC
Andrea Di Biagio [Thu, 8 Aug 2019 10:30:58 +0000 (10:30 +0000)]
[MCA] Remove dependency from InstrBuilder in mca::Context. NFC

InstrBuilder is not required to construct the default pipeline.

llvm-svn: 368275

4 years ago[MIPS GlobalISel] Select jump_table and brjt
Petar Avramovic [Thu, 8 Aug 2019 10:21:12 +0000 (10:21 +0000)]
[MIPS GlobalISel] Select jump_table and brjt

G_JUMP_TABLE and G_BRJT appear from translation of switch statement.
Select these two instructions for MIPS32, both pic and non-pic.

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

llvm-svn: 368274

4 years ago[llcm-readobj] - Fix BB after t368272.
George Rimar [Thu, 8 Aug 2019 10:05:00 +0000 (10:05 +0000)]
[llcm-readobj] - Fix BB after t368272.

Seems I forgot to update this test case.

llvm-svn: 368273

4 years ago[yaml2obj/obj2yaml] - Add a basic support for extended section indexes.
George Rimar [Thu, 8 Aug 2019 09:49:05 +0000 (09:49 +0000)]
[yaml2obj/obj2yaml] - Add a basic support for extended section indexes.

In some cases a symbol might have section index == SHN_XINDEX.
This is an escape value indicating that the actual section header index
is too large to fit in the containing field.
Then the SHT_SYMTAB_SHNDX section is used. It contains the 32bit values
that stores section indexes.

ELF gABI says that there can be multiple SHT_SYMTAB_SHNDX sections,
i.e. for example one for .symtab and one for .dynsym
(1) https://groups.google.com/forum/#!topic/generic-abi/-XJAV5d8PRg
(2) DT_SYMTAB_SHNDX: http://www.sco.com/developers/gabi/latest/ch5.dynamic.html

In this patch I am only supporting a single SHT_SYMTAB_SHNDX associated
with a .symtab. This is a more or less common case which is used a few tests I saw in LLVM.

I decided not to create the SHT_SYMTAB_SHNDX section as "implicit",
but implement is like a kind of regular section for now.
i.e. tools do not recreate this section or its content, like they do for
symbol table sections, for example. That should allow to write all kind of
possible broken test cases for our needs and keep the output closer to requested.

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

llvm-svn: 368272

4 years agoAdd a missing include to SymbolFilePDBTests.cpp
Pavel Labath [Thu, 8 Aug 2019 09:43:20 +0000 (09:43 +0000)]
Add a missing include to SymbolFilePDBTests.cpp

This should _really_ fix the pdb unit tests.

llvm-svn: 368271

4 years ago[Extract] Fixed SemicolonExtractionPolicy for SwitchStmt and SwitchCase
Shaurya Gupta [Thu, 8 Aug 2019 08:37:49 +0000 (08:37 +0000)]
[Extract] Fixed SemicolonExtractionPolicy for SwitchStmt and SwitchCase

Reviewers: arphaman, sammccall

Subscribers: dexonsmith, cfe-commits

Tags: #clang

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

llvm-svn: 368267

4 years agoRemove xcode-specific Config.h
Pavel Labath [Thu, 8 Aug 2019 08:27:25 +0000 (08:27 +0000)]
Remove xcode-specific Config.h

Summary:
Now that the xcode project is removed, we no longer need/use the
hand-maintained Config.h file, as everything is configured through
cmake.

This patch deletes that file and reverts some of the changes from
r300372, which were made to support this use case.

Reviewers: sgraenitz, beanz

Subscribers: mgorny, lldb-commits

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

llvm-svn: 368266

4 years agoFix PDB unit tests for the GetSymbolVendor deletion
Pavel Labath [Thu, 8 Aug 2019 08:22:26 +0000 (08:22 +0000)]
Fix PDB unit tests for the GetSymbolVendor deletion

llvm-svn: 368265

4 years ago[ARM] Select VFMA
Sam Tebbs [Thu, 8 Aug 2019 08:21:01 +0000 (08:21 +0000)]
[ARM] Select VFMA

llvm-svn: 368264

4 years agoRemove Module::GetSymbolVendor
Pavel Labath [Thu, 8 Aug 2019 07:34:07 +0000 (07:34 +0000)]
Remove Module::GetSymbolVendor

Summary:
This patch removes the GetSymbolVendor function, and the various
mentions of the SymbolVendor in the Module class. The implementation of
GetSymbolVendor is "inlined" into the GetSymbolFile class which I
created earlier.

After this patch, the SymbolVendor class still exists inside the Module
object, but only as an implementation detail -- a fancy holder for the
SymbolFile. That will be removed in the next patch.

Reviewers: clayborg, JDevlieghere, jingham, jdoerfert

Subscribers: jfb, lldb-commits

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

llvm-svn: 368263

4 years ago[ELF] - An attemp to fix builld bit after r368260
George Rimar [Thu, 8 Aug 2019 07:29:07 +0000 (07:29 +0000)]
[ELF] - An attemp to fix builld bit after r368260

BB: http://lab.llvm.org:8011/builders/lld-perf-testsuite/builds/17577/steps/build-bin%2Flld/logs/stdio

The error is:
/home/buildslave/slave_as-bldslv8/lld-perf-testsuite/llvm/include/llvm/Object/ELF.h:67:14:
error: 'static' function 'defaultWarningHandler' declared in header file should be declared 'static inline' [-Werror,-Wunneeded-internal-declaration]
static Error defaultWarningHandler(const Twine &Msg) { return createError(Msg); }
             ^

llvm-svn: 368262

4 years ago[clangd] Fix implicit template instatiations appearing as topLevelDecls.
Johan Vikstrom [Thu, 8 Aug 2019 07:21:06 +0000 (07:21 +0000)]
[clangd] Fix implicit template instatiations appearing as topLevelDecls.

Summary: The parser gives implicit template instantiations to the action's HandleTopLevelDecls callback. This makes semantic highlighting highlight these templated functions multiple times. Fixed by filtering on if a Decl is an implicit function/variable/class instantiation. Also added a testcase to semantic highlighting on this.

Reviewers: hokein, ilya-biryukov

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

Tags: #clang

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

llvm-svn: 368261

4 years ago[llvm-readobj/libObject] - Introduce a custom warning handler for `ELFFile<ELFT>...
George Rimar [Thu, 8 Aug 2019 07:17:35 +0000 (07:17 +0000)]
[llvm-readobj/libObject] - Introduce a custom warning handler for `ELFFile<ELFT>` methods.

Currently, we have a code duplication in llvm-readobj which was introduced in D63266.
The duplication was introduced to allow llvm-readobj to dump the partially
broken object. Methods in ELFFile<ELFT> perform a strict validation of the inputs,
what is itself good, but not for dumper tools, that might want to dump the information,
even if some pieces are broken/unexpected.

This patch introduces a warning handler which can be passed to ELFFile<ELFT> methods
and can allow skipping the non-critical errors when needed/possible.

For demonstration, I removed the duplication from llvm-readobj and implemented a warning using
the new custom warning handler. It also deduplicates the strings printed, making the output less verbose.

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

llvm-svn: 368260

4 years ago[diagtool] Use `operator<<(Colors)` to print out colored output.
Rui Ueyama [Thu, 8 Aug 2019 07:04:01 +0000 (07:04 +0000)]
[diagtool] Use `operator<<(Colors)` to print out colored output.

r368131 introduced this new API to print out messages in colors.
If the colored output is disabled, `operator<<(Colors)` becomes nop.
No functionality change intended.

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

llvm-svn: 368259

4 years ago[X86] Remove -x86-experimental-vector-widening-legalization command line option and...
Craig Topper [Thu, 8 Aug 2019 06:48:22 +0000 (06:48 +0000)]
[X86] Remove -x86-experimental-vector-widening-legalization command line option and all its uses.

This option is now defaulted to true and we don't want to support
turning it off so remove the option.

llvm-svn: 368258

4 years ago[ARM] Tighten up VLDRH.32 with low alignments
David Green [Thu, 8 Aug 2019 06:22:03 +0000 (06:22 +0000)]
[ARM] Tighten up VLDRH.32 with low alignments

VLDRH needs to have an alignment of at least 2, including the
widening/narrowing versions. This tightens up the ISel patterns for it and
alters allowsMisalignedMemoryAccesses so that unaligned accesses are expanded
through the stack. It also fixed some incorrect shift amounts, which seemed to
be passing a multiple not a shift.

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

llvm-svn: 368256

4 years ago[ARM] Rejig MVE load store tests. NFC
David Green [Thu, 8 Aug 2019 05:58:48 +0000 (05:58 +0000)]
[ARM] Rejig MVE load store tests. NFC

This adjusts the load/store tests for better testing of alignments. It also
adds some extra alignment 1 tests, useful for future commits.

llvm-svn: 368255

4 years agoRevert "Temporarily bump minimum compiler version"
JF Bastien [Thu, 8 Aug 2019 05:47:59 +0000 (05:47 +0000)]
Revert "Temporarily bump minimum compiler version"

It's been in for more than 30 min and no bots have complained. Let's see if some
slow ones catch up. I'll do another manual pass on bots later (in case some that
were down are back up), and then turn this on permanently through a regular
review.

llvm-svn: 368253

4 years agoTemporarily bump minimum compiler version
JF Bastien [Thu, 8 Aug 2019 05:12:20 +0000 (05:12 +0000)]
Temporarily bump minimum compiler version

It's pretty hard to find a reliable list of which bots use which compiler version... so I'm going to commit this change which allows us to mandate the compilers required for C++14. This bump is what we've already agreed to do, so I'll use the list of failures to figure out which bots need to bump their compiler version. I'll revert the change in a few minutes.

The last discussion of this is here: http://lists.llvm.org/pipermail/llvm-dev/2019-August/134360.html

llvm-svn: 368252

4 years ago[Driver] Delete XFAIL: windows-msvc after D65880/r368245
Fangrui Song [Thu, 8 Aug 2019 04:56:21 +0000 (04:56 +0000)]
[Driver] Delete XFAIL: windows-msvc after D65880/r368245

`-target %itanium_abi_triple` fixed the problem.

llvm-svn: 368251

4 years ago[X86] Add CMOV_FR32X and CMOV_FR64X to the isCMOVPseudo function.
Craig Topper [Thu, 8 Aug 2019 04:40:59 +0000 (04:40 +0000)]
[X86] Add CMOV_FR32X and CMOV_FR64X to the isCMOVPseudo function.

llvm-svn: 368250

4 years ago[Materializer] Remove wrong SetSizeAndAlignmentFromType().
Davide Italiano [Thu, 8 Aug 2019 03:15:48 +0000 (03:15 +0000)]
[Materializer] Remove wrong SetSizeAndAlignmentFromType().

This function is unused.  It's also wrong, because it computes
the size and the alignment of the type without asking the runtime,
so it doesn't work for any language that has one (e.g. swift).

One could consider re-implementing this passing an execution scope
context, and modifying GetTypeBitAlign() to do the right thing,
but given there are no uses, it's not really useful.

llvm-svn: 368249

4 years ago[GISel][NFC]: Make members of CombinerHelper accessible in derived classes
Aditya Nandakumar [Thu, 8 Aug 2019 02:24:57 +0000 (02:24 +0000)]
[GISel][NFC]: Make members of CombinerHelper accessible in derived classes

https://reviews.llvm.org/D65842

Make some members protected to enable access in derived classes.

llvm-svn: 368248

4 years agoSync ioctl(2) list with NetBSD 9.99.3
Kamil Rytarowski [Thu, 8 Aug 2019 02:21:44 +0000 (02:21 +0000)]
Sync ioctl(2) list with NetBSD 9.99.3

Register 36 new ioctl(2) calls.

Enable NVMM for amd64 as the API has been stabilized.

llvm-svn: 368247

4 years agoUpdate generate_netbsd_ioctls.awk for NetBSD 9.99.3
Kamil Rytarowski [Thu, 8 Aug 2019 02:08:23 +0000 (02:08 +0000)]
Update generate_netbsd_ioctls.awk for NetBSD 9.99.3

Register new ioctl argument types passed in ioctl(2) calls.

llvm-svn: 368246

4 years ago[Driver] Move LIBRARY_PATH before user inputs
Fangrui Song [Thu, 8 Aug 2019 01:55:27 +0000 (01:55 +0000)]
[Driver] Move LIBRARY_PATH before user inputs

Fixes PR16786

Currently, library paths specified by LIBRARY_PATH are placed after inputs: `inputs LIBRARY_PATH stdlib`
In gcc, the order is: `LIBRARY_PATH inputs stdlib` if not cross compiling.
(On Darwin targets, isCrossCompiling() always returns false.)

This patch changes the behavior to match gcc.

Reviewed By: hfinkel

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

llvm-svn: 368245

4 years agoInline diagnostic text into .td file. NFC.
Richard Trieu [Thu, 8 Aug 2019 01:45:31 +0000 (01:45 +0000)]
Inline diagnostic text into .td file.  NFC.

llvm-svn: 368244

4 years ago[Utility] Remove unused function 'GetMatchSpanningIndices'
Jonas Devlieghere [Thu, 8 Aug 2019 01:44:03 +0000 (01:44 +0000)]
[Utility] Remove unused function 'GetMatchSpanningIndices'

llvm-svn: 368243

4 years agoAdd LLD as a requirement for hwasan tests because of change in r368111.
Douglas Yung [Thu, 8 Aug 2019 01:08:22 +0000 (01:08 +0000)]
Add LLD as a requirement for hwasan tests because of change in r368111.

llvm-svn: 368242

4 years ago[llvm-strip] Support --strip-sections
Wolfgang Pieb [Thu, 8 Aug 2019 00:35:16 +0000 (00:35 +0000)]
[llvm-strip] Support --strip-sections

llvm-objcopy already supports --strip-sections. It is a good fit for its alias llvm-strip
to support it as well.

Reviewers: rupprecht, jhenderson

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

llvm-svn: 368241

4 years agoRevert "[libc++] Take 3: Do not cleverly link against libc++abi just because it happe...
Louis Dionne [Thu, 8 Aug 2019 00:28:06 +0000 (00:28 +0000)]
Revert "[libc++] Take 3: Do not cleverly link against libc++abi just because it happens to be there"

This also reverts "[libc++] Remove temporary hack for D63883".
Clearly, I don't understand how the Linux build bots are configured.

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

llvm-svn: 368238

4 years agoUpdate fix-it hints for std::move warnings.
Richard Trieu [Thu, 8 Aug 2019 00:12:51 +0000 (00:12 +0000)]
Update fix-it hints for std::move warnings.

Fix -Wpessimizing-move and -Wredundant-move when warning on initializer lists.
The new fix-it hints for removing the std::move call will now also suggest
removing the braces for the initializer list so that the resulting code will
still be compilable.

This fixes PR42832

llvm-svn: 368237

4 years ago[llvm-lipo] Update llvm-lipo docs for -info -thin -create -replace -segalign flags
Anusha Basana [Wed, 7 Aug 2019 23:25:12 +0000 (23:25 +0000)]
[llvm-lipo] Update llvm-lipo docs for -info -thin -create -replace -segalign flags

Summary:
The information for -info -thin -create -replace and -segalign flags are added to llvm-lipo.rst

Test Plan:

Reviewers: smeenai, alexshap, compnerd, mtrent

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 368235

4 years ago[ScalarizeMaskedMemIntrin] Add test case for expanding scatter.
Craig Topper [Wed, 7 Aug 2019 23:16:29 +0000 (23:16 +0000)]
[ScalarizeMaskedMemIntrin] Add test case for expanding scatter.

This pass expands 6 intrinsics, but we only had test for 5 of
them.

llvm-svn: 368234

4 years ago[Docs] Fix (incorrect) code highlighting
Jonas Devlieghere [Wed, 7 Aug 2019 23:12:40 +0000 (23:12 +0000)]
[Docs] Fix (incorrect) code highlighting

llvm-svn: 368233

4 years agoRecommit "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG"
Amy Huang [Wed, 7 Aug 2019 22:49:40 +0000 (22:49 +0000)]
Recommit "[MS] Emit S_HEAPALLOCSITE debug info in Selection DAG"
with a fix to clear the SDNode map when SelectionDAG is cleared.

llvm-svn: 368230

4 years agogdb-index: Wire up str_offsets section to avoid incorrect error message about offsets...
David Blaikie [Wed, 7 Aug 2019 22:49:14 +0000 (22:49 +0000)]
gdb-index: Wire up str_offsets section to avoid incorrect error message about offsets_base

There's still a need for a deeper fix to the way libDebugInfoDWARF error
messages are propagated up to lld - if lld had exited non-zero on this
error message we would've found the issue sooner.

llvm-svn: 368229

4 years ago[Attributor][NFC] remove leftover and format code
Johannes Doerfert [Wed, 7 Aug 2019 22:49:06 +0000 (22:49 +0000)]
[Attributor][NFC] remove leftover and format code

llvm-svn: 368228

4 years ago[Attributor][Stats] Locate statistics tracking with the attributes
Johannes Doerfert [Wed, 7 Aug 2019 22:46:11 +0000 (22:46 +0000)]
[Attributor][Stats] Locate statistics tracking with the attributes

Summary:
The ever growing switch required Attribute::AttrKind values but they
might not be available for all abstract attributes we deduce. With the
new method we track statistics at the abstract attribute level. The
provided macros simplify the usage and make the messages uniform.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 368227

4 years agoAdjust a ValueObjectChild's offset when the child is a bitfield
Adrian Prantl [Wed, 7 Aug 2019 22:40:05 +0000 (22:40 +0000)]
Adjust a ValueObjectChild's offset when the child is a bitfield

If a bitfield doesn't fit into the child_byte_size'd window at
child_byte_offset, move the window forward until it fits.  The problem
here is that Value has no notion of bitfields and thus the Value's
DataExtractor is sized like the bitfields CompilerType; a sequence of
bitfields, however, can be larger than their underlying type.

This was not in the big-endian-derived DWARF 2 bitfield attributes
because their offsets were counted from the end of the window, so they
always fit.

rdar://problem/53132189

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

llvm-svn: 368226

4 years ago[Attributor][NFC] Code simplification and style normalization
Johannes Doerfert [Wed, 7 Aug 2019 22:36:15 +0000 (22:36 +0000)]
[Attributor][NFC] Code simplification and style normalization

llvm-svn: 368225

4 years ago[Attributor] Introduce a state wrapper class
Johannes Doerfert [Wed, 7 Aug 2019 22:34:26 +0000 (22:34 +0000)]
[Attributor] Introduce a state wrapper class

Summary:
The wrapper reduces boilerplate code and also provide a nice way to
determine the state type used by an abstract attributes statically via
AAType::StateType.

This was already discussed as part of the review of D65711.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 368224

4 years ago[Attributor][NFC] Avoid unnecessary liveness queries
Johannes Doerfert [Wed, 7 Aug 2019 22:32:38 +0000 (22:32 +0000)]
[Attributor][NFC] Avoid unnecessary liveness queries

If we know everything is live there is no need to query for liveness.
Indicating a pessimistic fixpoint will cause the state to be "invalid"
which will cause the Attributor to not return the AAIsDead on request,
which will prevent us from querying isAssumedDead().

llvm-svn: 368223

4 years ago[Attributor] Provide easier checkForallReturnedValues functionality
Johannes Doerfert [Wed, 7 Aug 2019 22:27:24 +0000 (22:27 +0000)]
[Attributor] Provide easier checkForallReturnedValues functionality

Summary:
So far, whenever one wants to look at returned values, one had to deal
with the AAReturnedValues and potentially with the AAIsDead attribute.
In the same spirit as other checkForAllXXX methods, we add this
functionality now to the Attributor. By adopting the use sites we got
better results when return instructions were dead.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 368222

4 years ago[llvm-readobj][test] Add baseline tests for FreeBSD/AMD/AMDGPU note printing
Jordan Rupprecht [Wed, 7 Aug 2019 22:21:49 +0000 (22:21 +0000)]
[llvm-readobj][test] Add baseline tests for FreeBSD/AMD/AMDGPU note printing

llvm-svn: 368221

4 years agoAdd a test demonstrating DWARF parse failures are not causing lld to exit non-zero
David Blaikie [Wed, 7 Aug 2019 22:05:33 +0000 (22:05 +0000)]
Add a test demonstrating DWARF parse failures are not causing lld to exit non-zero

This bug was/is masking other issues - committing this to demonstrate
the problem/track fixing it.

llvm-svn: 368220

4 years agoRestrict the NetBSD ASan TSD fallback to !ASAN_DYNAMIC
Kamil Rytarowski [Wed, 7 Aug 2019 21:56:43 +0000 (21:56 +0000)]
Restrict the NetBSD ASan TSD fallback to !ASAN_DYNAMIC

The fallback to the alternative implementation of TSD with TLS
is only needed for the static version of ASan for NetBSD.

The same code cannot be reused for the dynamic version of ASan as
TLS breaks and TSD code works.

llvm-svn: 368219

4 years ago[HWASan] Use LLD for check-hwasan.
Mitch Phillips [Wed, 7 Aug 2019 21:56:21 +0000 (21:56 +0000)]
[HWASan] Use LLD for check-hwasan.

HWASan+globals build fix in rL368111 unfortunately didn't fix the
problem when clang_cflags specified -fuse-ld=ld.gold. Change the order
to force lld in an attempt to fix the Android sanitizer bot.

llvm-svn: 368218

4 years agoRevert Added Delta IR Reduction Tool
Diego Trevino Ferrer [Wed, 7 Aug 2019 21:51:54 +0000 (21:51 +0000)]
Revert Added Delta IR Reduction Tool

This reverts r368071 (git commit a2584978f5bb41973d65a145b0d9459b81e3ac6d)

llvm-svn: 368217

4 years ago[libc++] Remove temporary hack for D63883
Louis Dionne [Wed, 7 Aug 2019 21:51:01 +0000 (21:51 +0000)]
[libc++] Remove temporary hack for D63883

This should fix the build bots, who now specify explicitly that they're
building against libc++abi.

llvm-svn: 368216

4 years ago[LoopVectorize][X86] Clamp interleave factor if we have a known constant trip count...
Craig Topper [Wed, 7 Aug 2019 21:44:14 +0000 (21:44 +0000)]
[LoopVectorize][X86] Clamp interleave factor if we have a known constant trip count that is less than VF*interleave

If we know the trip count, we should make sure the interleave factor won't cause the vectorized loop to exceed it.

Improves one of the cases from PR42674

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

llvm-svn: 368215

4 years agoAdded Delta IR Reduction Tool
Diego Trevino Ferrer [Wed, 7 Aug 2019 21:37:11 +0000 (21:37 +0000)]
Added Delta IR Reduction Tool

Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file.

Reviewers: alexshap, chandlerc

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

> llvm-svn: 368071

llvm-svn: 368214

4 years ago[libc++] Take 3: Do not cleverly link against libc++abi just because it happens to...
Louis Dionne [Wed, 7 Aug 2019 21:36:03 +0000 (21:36 +0000)]
[libc++] Take 3: Do not cleverly link against libc++abi just because it happens to be there

Summary:
Otherwise, when libcxxabi is not an enabled project in the monorepo, we
get a link error because we try to link against non-existent cxxabi_shared.

More generally, we shouldn't change the behavior of the build based on
implicit things like whether a file happens to be at a specific path or
not.

This is a re-application of r365222 that had been reverted in r365233
and then r365359 because it broke the build bots. The build bots
should now specify explicitly what ABI library they want to use
(libc++abi), so this commit should now be OK to merge. It takes a while
for build bots to pick up configuration changes, which is why this failed
the last time around.

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

llvm-svn: 368213

4 years agoDebugInfo/DWARF: Remove unused return type from DWARFUnit::extractDIEsIfNeeded
David Blaikie [Wed, 7 Aug 2019 21:31:33 +0000 (21:31 +0000)]
DebugInfo/DWARF: Remove unused return type from DWARFUnit::extractDIEsIfNeeded

llvm-svn: 368212

4 years ago[NFC][LICM] Pre-commit test for unary FNeg support in LICM.
Cameron McInally [Wed, 7 Aug 2019 21:30:00 +0000 (21:30 +0000)]
[NFC][LICM] Pre-commit test for unary FNeg support in LICM.

llvm-svn: 368211

4 years ago[X86] Allow pack instructions to be used for 512->256 truncates when -mprefer-vector...
Craig Topper [Wed, 7 Aug 2019 21:16:10 +0000 (21:16 +0000)]
[X86] Allow pack instructions to be used for 512->256 truncates when -mprefer-vector-width=256 is causing 512-bit vectors to be split

If we're splitting the 512-bit vector anyway and we have zero/sign bits, then we might as well use pack instructions to concat and truncate at once.

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

llvm-svn: 368210

4 years ago[clang-doc] Add second index for sections within info's content
Diego Astiazaran [Wed, 7 Aug 2019 21:04:52 +0000 (21:04 +0000)]
[clang-doc] Add second index for sections within info's content

This new index contains links to the main section of infos: Namespaces, Records, Functions, Enums, Members.
Also to each child function or enum.
Index is currently rendered on top of the info content, this will be fixed later with CSS.

Depends on D65690.

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

llvm-svn: 368209

4 years ago[CommandObject] Remove unused function
Jonas Devlieghere [Wed, 7 Aug 2019 20:56:17 +0000 (20:56 +0000)]
[CommandObject] Remove unused function

llvm-svn: 368208

4 years ago[X86] Add test cases for missed opportunities to use pack instructions for 512->256...
Craig Topper [Wed, 7 Aug 2019 20:54:46 +0000 (20:54 +0000)]
[X86] Add test cases for missed opportunities to use pack instructions for 512->256 truncates with prefer-vector-width=256

If the 512-bit vectors are going to be split anyway, then we are
better off using pack to implicitly concatenate the 256 bit pieces.

llvm-svn: 368207

4 years ago[clang-doc] Parallelize reducing phase
Diego Astiazaran [Wed, 7 Aug 2019 20:54:26 +0000 (20:54 +0000)]
[clang-doc] Parallelize reducing phase

Reduce phase has been parallelized and a execution time was reduced by
60% with this.
The reading of bitcode (bitcode -> Info) was moved to this segment of
code parallelized so it now happens just before reducing.

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

llvm-svn: 368206

4 years ago[Symbol] Remove commented out code from CompileUnit
Alex Langford [Wed, 7 Aug 2019 20:51:21 +0000 (20:51 +0000)]
[Symbol] Remove commented out code from CompileUnit

llvm-svn: 368205

4 years agoRevert r367501 "Create unique, but identically-named ELF sections..."
Bob Haarman [Wed, 7 Aug 2019 20:45:23 +0000 (20:45 +0000)]
Revert r367501 "Create unique, but identically-named ELF sections..."

This reverts commit fbc563e2cb6c5f1d0200b390513506b6aca4d2e9 "Create
unique, but identically-named ELF sections for explicitly-sectioned
functions and globals when using -function-sections and
-data-sections."

Reason for revert: sections are created with potentially wrong
attributes.

llvm-svn: 368204

4 years ago[pstl] Make sure we install all of PSTL's include/ directory
Louis Dionne [Wed, 7 Aug 2019 20:29:04 +0000 (20:29 +0000)]
[pstl] Make sure we install all of PSTL's include/ directory

We want to install files directly in include/, not only in include/pstl.

llvm-svn: 368203

4 years agoAdd target requirements for those bots which don't handle x86.
Bill Wendling [Wed, 7 Aug 2019 19:36:48 +0000 (19:36 +0000)]
Add target requirements for those bots which don't handle x86.

llvm-svn: 368202

4 years ago[NFC] Fixed newly added tests
David Bolvansky [Wed, 7 Aug 2019 19:36:46 +0000 (19:36 +0000)]
[NFC] Fixed newly added tests

llvm-svn: 368201

4 years ago[NFC] Added tests for x/fabs(X) fold
David Bolvansky [Wed, 7 Aug 2019 19:35:25 +0000 (19:35 +0000)]
[NFC] Added tests for x/fabs(X) fold

llvm-svn: 368200

4 years agoAdd support for deterministically linked binaries on macOS to lldb.
Nico Weber [Wed, 7 Aug 2019 19:29:04 +0000 (19:29 +0000)]
Add support for deterministically linked binaries on macOS to lldb.

When ld64 links a binary deterministically using the flag ZERO_AR_DATE,
it sets a timestamp of 0 for N_OSO members in the symtab section, rather
than the usual last modified date of the object file. Prior to this
patch, lldb would compare the timestamp from the N_OSO member against
the last modified date of the object file, and skip loading the object
file if there was a mismatch. This patch updates the logic to ignore the
timestamp check if the N_OSO member has timestamp 0.

The original logic was added in https://reviews.llvm.org/rL181631 as a
safety check to avoid problems when debugging if the object file was out
of date. This was prior to the introduction of deterministic build in
ld64. lld still doesn't support deterministic build.

Other code in llvm already relies on and uses the assumption that a
timestamp of 0 means deterministic build. For example, commit
9ccfddc39d4d27f9b16fcc72ab30d483151d6d08 adds similar timestamp checking
logic to dsymutil, but special cases timestamp 0. Likewise, commit
0d1bb79a0413f221432a7b1d0d2d10c84c4bbb99 adds a long comment describing
deterministic archive, which mostly uses timestamp 0 for determinism.

Patch from Erik Chen <erikchen@chromium.org>!

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

llvm-svn: 368199

4 years agoFix indentation
David Blaikie [Wed, 7 Aug 2019 19:09:31 +0000 (19:09 +0000)]
Fix indentation

llvm-svn: 368198

4 years ago[LoopVectorize][X86] Add test case for missed vectorization from PR42674.
Craig Topper [Wed, 7 Aug 2019 19:07:10 +0000 (19:07 +0000)]
[LoopVectorize][X86] Add test case for missed vectorization from PR42674.

We do end vectorizing the code, but use an interleave factor that
is too high and causes the vector code to be dead.

llvm-svn: 368197

4 years ago[Tooling] Expose ExecutorConcurrency option.
Diego Astiazaran [Wed, 7 Aug 2019 18:35:28 +0000 (18:35 +0000)]
[Tooling] Expose ExecutorConcurrency option.

D65628 requires a flag to specify the number of threads for a clang-doc step. It would be good to use ExecutorConcurrency after exposing it instead of creating a new one that has the same purpose.

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

llvm-svn: 368196

4 years ago[ValueTracking] When calculating known bits for integer abs, make sure we're looking...
Craig Topper [Wed, 7 Aug 2019 18:28:16 +0000 (18:28 +0000)]
[ValueTracking] When calculating known bits for integer abs, make sure we're looking at a negate and not just any instruction with the nsw flag set.

The matchSelectPattern code can match patterns like (x >= 0) ? x : -x
for absolute value. But it can also match ((x-y) >= 0) ? (x-y) : (y-x).
If the latter form was matched we can only use the nsw flag if its
set on both subtracts.

This match makes sure we're looking at the former case only.

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

llvm-svn: 368195

4 years ago[Attributor] Introduce checkForAllReadWriteInstructions(...).
Stefan Stipanovic [Wed, 7 Aug 2019 18:26:02 +0000 (18:26 +0000)]
[Attributor] Introduce checkForAllReadWriteInstructions(...).

Summary: Similarly to D65731 `Attributor::checkForAllReadWriteInstructions` is introduced.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 368194

4 years ago[SCEV] Return zero from computeConstantDifference(X, X)
Nikolai Bozhenov [Wed, 7 Aug 2019 17:38:38 +0000 (17:38 +0000)]
[SCEV] Return zero from computeConstantDifference(X, X)

Without this patch computeConstantDifference returns None for cases like
these:

  computeConstantDifference(%x, %x)
  computeConstantDifference({%x,+,16}, {%x,+,16})

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

llvm-svn: 368193

4 years ago[OpenMP][libomptarget] Add support for unified memory for regular maps
Gheorghe-Teodor Bercea [Wed, 7 Aug 2019 17:29:45 +0000 (17:29 +0000)]
[OpenMP][libomptarget] Add support for unified memory for regular maps

Summary:
This patch adds support for using unified memory in the case of regular maps that happen when a target region is offloaded to the device.

For cases where only a single version of the data is required then the host address can be used. When variables need to be privatized in any way or globalized, then the copy to the device is still required for correctness.

Reviewers: ABataev, jdoerfert, Hahnfeld, AlexEichenberger, caomhin, grokos

Reviewed By: Hahnfeld

Subscribers: mgorny, guansong, openmp-commits

Tags: #openmp

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

llvm-svn: 368192

4 years ago[DataLayout] Check StackNatural and FunctionPtr alignments.
Florian Hahn [Wed, 7 Aug 2019 17:20:55 +0000 (17:20 +0000)]
[DataLayout] Check StackNatural and FunctionPtr alignments.

MaybeAlignment asserts that the passed in value is == 0 or a power of 2.

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16272

Reviewers: michaelplatings, gchatelet, jakehehrlich, jfb

Reviewed By: gchatelet

Tags: #llvm

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

llvm-svn: 368191

4 years agoAPI update for change to LLVM's lib/DebugInfo/DWARF
David Blaikie [Wed, 7 Aug 2019 17:18:18 +0000 (17:18 +0000)]
API update for change to LLVM's lib/DebugInfo/DWARF

llvm-svn: 368190

4 years agoDebugInfo/DWARF: Normalize DWARFObject members on the DWARF spec section names
David Blaikie [Wed, 7 Aug 2019 17:18:11 +0000 (17:18 +0000)]
DebugInfo/DWARF: Normalize DWARFObject members on the DWARF spec section names

Some of these names were abbreviated, some were not, some pluralised,
some not. Made the API difficult to use - since it's an exact 1:1
mapping to the DWARF sections - use those names (changing underscore
separation for camel casing).

llvm-svn: 368189

4 years ago[clang][NFC] Fix typo in matcher comment
Yitzhak Mandelbaum [Wed, 7 Aug 2019 17:01:31 +0000 (17:01 +0000)]
[clang][NFC] Fix typo in matcher comment

Also updates corresponding html doc.

llvm-svn: 368188

4 years agoSupport: Remove needless allocation when getMainExecutable() calls readlink()
Nico Weber [Wed, 7 Aug 2019 17:00:19 +0000 (17:00 +0000)]
Support: Remove needless allocation when getMainExecutable() calls readlink()

We built a StringRef from a string literal which we then converted to a
std::string to call c_str().  Just use a pointer to the string literal
instead of a StringRef.

No behavior change.

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

llvm-svn: 368187

4 years agoCode completion should not ignore default parameters in functions.
Sam McCall [Wed, 7 Aug 2019 16:52:21 +0000 (16:52 +0000)]
Code completion should not ignore default parameters in functions.

Summary:
Inorder to display the default arguments we must process the
CK_Optional chunks of CodeCompletionString while creating the Signature.

We do not create placeholders for default arguments.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 368186

4 years agoRecommit r368081 "[X86] Add more extract subvector cost model tests for smaller eleme...
Craig Topper [Wed, 7 Aug 2019 16:42:47 +0000 (16:42 +0000)]
Recommit r368081 "[X86] Add more extract subvector cost model tests for smaller element sizes and smaller than 128-bit vectors."

llvm-svn: 368185