platform/upstream/llvm.git
5 years ago[clangd] Add std::move for converting-return to satisfy older compilers
Sam McCall [Thu, 4 Oct 2018 17:15:41 +0000 (17:15 +0000)]
[clangd] Add std::move for converting-return to satisfy older compilers

llvm-svn: 343800

5 years agoAArch64: Fix XSeqPairs/WSeqPairs problems
Matthias Braun [Thu, 4 Oct 2018 17:02:53 +0000 (17:02 +0000)]
AArch64: Fix XSeqPairs/WSeqPairs problems

- Fix spill/reloads of XSeqPairs failing with vregs (only physregs
  worked correctly)
- Add missing spill/reload code for WSeqPairs class

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

llvm-svn: 343799

5 years ago[AMDGPU] Match signed dot4/8 pattern.
Farhana Aleen [Thu, 4 Oct 2018 16:57:37 +0000 (16:57 +0000)]
[AMDGPU] Match signed dot4/8 pattern.

Summary: This patch matches signed dot4 and dot8 pattern.

Author: FarhanaAleen

Reviewed By: msearles

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

llvm-svn: 343798

5 years ago[clang-tidy] fix failing unit tests
Jonas Toth [Thu, 4 Oct 2018 16:39:41 +0000 (16:39 +0000)]
[clang-tidy] fix failing unit tests

The removal from the FIX-IT notes through the check-clang-tidy
script was done incorrect. I did not detect beforehand but adjusted
the script and tests accordingly

llvm-svn: 343797

5 years ago[clangd] fix another ambigous constructor in DexTest
Jonas Toth [Thu, 4 Oct 2018 16:29:58 +0000 (16:29 +0000)]
[clangd] fix another ambigous constructor in DexTest

llvm-svn: 343796

5 years ago[llvm-mca][x86] Add PR36951 ReadAfterLd test case
Simon Pilgrim [Thu, 4 Oct 2018 16:26:56 +0000 (16:26 +0000)]
[llvm-mca][x86] Add PR36951 ReadAfterLd test case

llvm-svn: 343795

5 years ago[InstCombine] allow bitcast to/from FP for vector insert/extract transform
Sanjay Patel [Thu, 4 Oct 2018 16:25:05 +0000 (16:25 +0000)]
[InstCombine] allow bitcast to/from FP for vector insert/extract transform

This is a follow-up to rL343482 / D52439.
This was a pattern that initially caused the commit to be reverted because
the transform requires a bitcast as shown here.

llvm-svn: 343794

5 years ago[clangd] Fix ambiguous constructor in DexTest
Sam McCall [Thu, 4 Oct 2018 16:05:22 +0000 (16:05 +0000)]
[clangd] Fix ambiguous constructor in DexTest

llvm-svn: 343793

5 years ago[clang-tidy] NFC use CHECK-NOTES in tests for fuchsia-default-arguments
Jonas Toth [Thu, 4 Oct 2018 15:59:30 +0000 (15:59 +0000)]
[clang-tidy] NFC use CHECK-NOTES in tests for fuchsia-default-arguments

Reviewers: alexfh, aaron.ballman, hokein

Reviewed By: alexfh

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 343792

5 years ago[clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init
Jonas Toth [Thu, 4 Oct 2018 15:55:37 +0000 (15:55 +0000)]
[clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init

Reviewers: alexfh, aaron.ballman, hokein

Reviewed By: alexfh

Subscribers: lebedev.ri, xazax.hun, cfe-commits

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

llvm-svn: 343791

5 years ago[clang] Add the exclude_from_explicit_instantiation attribute
Louis Dionne [Thu, 4 Oct 2018 15:49:42 +0000 (15:49 +0000)]
[clang] Add the exclude_from_explicit_instantiation attribute

Summary:
This attribute allows excluding a member of a class template from being part
of an explicit template instantiation of that class template. This also makes
sure that code using such a member will not take for granted that an external
instantiation exists in another translation unit. The attribute was discussed
on cfe-dev at [1] and is primarily motivated by the removal of always_inline
in libc++ to control what's part of the ABI (see links in [1]).

[1]: http://lists.llvm.org/pipermail/cfe-dev/2018-August/059024.html

rdar://problem/43428125

Reviewers: rsmith

Subscribers: dexonsmith, cfe-commits

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

llvm-svn: 343790

5 years ago[clang-tidy] fix PR39167, bugprone-exception-escape hangs-up
Jonas Toth [Thu, 4 Oct 2018 15:49:25 +0000 (15:49 +0000)]
[clang-tidy] fix PR39167, bugprone-exception-escape hangs-up

Summary:
The check bugprone-exception-escape should not register
if -fno-exceptions is set for the compile options. Bailing out on non-cplusplus
and non-exceptions language options resolves the issue.

Reviewers: alexfh, aaron.ballman, baloghadamsoftware

Reviewed By: alexfh

Subscribers: lebedev.ri, xazax.hun, rnkovacs, cfe-commits

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

llvm-svn: 343789

5 years ago[clang-tidy] Added pointer types to clang-tidy readability-identifier-naming check.
Jonas Toth [Thu, 4 Oct 2018 15:47:57 +0000 (15:47 +0000)]
[clang-tidy] Added pointer types to clang-tidy readability-identifier-naming check.

Summary:

Option to check for different naming conventions on the following types:

  - GlobalConstantPointer
  - GlobalPointer
  - LocalConstantPointer
  - LocalPointer
  - PointerParameter
  - ConstantPointerParameter

When not specified, the conventions for the non pointer types will be applied (GlobalConstant, GlobalVariable, LocalConstant, ...).

Patch by ffigueras!

Reviewers: alexfh, kbobyrev

Reviewed By: alexfh

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 343788

5 years ago[llvm-mca] Move field 'AllowZeroMoveEliminationOnly' to class RegisterFile. NFC.
Andrea Di Biagio [Thu, 4 Oct 2018 15:20:56 +0000 (15:20 +0000)]
[llvm-mca] Move field 'AllowZeroMoveEliminationOnly' to class RegisterFile. NFC.

Flag 'AllowZeroMoveEliminationOnly' should have been a property of the PRF, and
not set at register granularity.

This change also restricts move elimination to writes that update a full
physical register. We assume that there is a strong correlation between
logical registers that allow move elimination, and how those same registers are
allocated to physical registers by the register renamer.

This is still a no functional change, because this experimental code path is
disabled for now. This is done in preparation for another patch that will add
the ability to describe how move elimination works in scheduling models.

llvm-svn: 343787

5 years ago[X86][AVX] Add PR39161 test case for v4f64 zzww shuffle
Simon Pilgrim [Thu, 4 Oct 2018 15:06:09 +0000 (15:06 +0000)]
[X86][AVX] Add PR39161 test case for v4f64 zzww shuffle

llvm-svn: 343786

5 years ago[OpenMP][OMPT] Fix unsafe initialization of ompt_data_t objects
Jonathan Peyton [Thu, 4 Oct 2018 14:57:04 +0000 (14:57 +0000)]
[OpenMP][OMPT] Fix unsafe initialization of ompt_data_t objects

Initializing an ompt_data_t object using the pointer union member is potentially
unsafe in 32-bit programs.  This change fixes the issue
by using the constant, ompt_data_none.

Patch by Hansang Bae

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

llvm-svn: 343785

5 years ago[ELF][HEXAGON] Add support for GOT relocations.
Sid Manning [Thu, 4 Oct 2018 14:54:17 +0000 (14:54 +0000)]
[ELF][HEXAGON] Add support for GOT relocations.

The GOT is referenced through the symbol _GLOBAL_OFFSET_TABLE_ .

The relocation added calculates the offset into the global offset table for
the entry of a symbol.  In order to get the correct TargetVA I needed to
create an new relocation expression, HEXAGON_GOT.  It does
Sym.getGotVA() - In.GotPlt->getVA().

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

llvm-svn: 343784

5 years ago[utils] Ensure that update_mca_test_checks.py writes prefixes in alphabetical order
Greg Bedwell [Thu, 4 Oct 2018 14:42:19 +0000 (14:42 +0000)]
[utils] Ensure that update_mca_test_checks.py writes prefixes in alphabetical order

llvm-svn: 343783

5 years ago[utils] simple refactor in update_mca_test_checks.py to make intent more readable
Greg Bedwell [Thu, 4 Oct 2018 14:42:06 +0000 (14:42 +0000)]
[utils] simple refactor in update_mca_test_checks.py to make intent more readable

llvm-svn: 343782

5 years ago[RISCV] Remove overzealous is64Bit checks
Alex Bradbury [Thu, 4 Oct 2018 14:30:03 +0000 (14:30 +0000)]
[RISCV] Remove overzealous is64Bit checks

lowerGlobalAddress, lowerBlockAddress, and insertIndirectBranch contain
overzealous checks for is64Bit. These functions are all safe as-implemented
for RV64.

llvm-svn: 343781

5 years ago[clangd] expose MergedIndex class
Sam McCall [Thu, 4 Oct 2018 14:20:22 +0000 (14:20 +0000)]
[clangd] expose MergedIndex class

Summary:
This allows inheriting from it, so index() can ga away and allowing
TestTU::index) to be fixed.

Reviewers: ioeric

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

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

llvm-svn: 343780

5 years ago[clangd] clangd-indexer gathers refs and stores them in index files.
Sam McCall [Thu, 4 Oct 2018 14:09:55 +0000 (14:09 +0000)]
[clangd] clangd-indexer gathers refs and stores them in index files.

Reviewers: ioeric

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

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

llvm-svn: 343778

5 years ago[clangd] Remove one-segment-skipping from Dex trigrams.
Sam McCall [Thu, 4 Oct 2018 14:08:11 +0000 (14:08 +0000)]
[clangd] Remove one-segment-skipping from Dex trigrams.

Summary:
Currently queries like "ab" can match identifiers like a_yellow_bee.
The value of allowing this for exactly one segment but no more seems dubious.
It costs ~3% of overall ram (~9% of posting list ram) and some quality.

Reviewers: ilya-biryukov, ioeric

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

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

llvm-svn: 343777

5 years ago[X86] Set correct MMO offset on scalarized load pieces
David Greene [Thu, 4 Oct 2018 14:07:59 +0000 (14:07 +0000)]
[X86] Set correct MMO offset on scalarized load pieces

When scalarizing a load, be sure to update the offset in the
MachineMemOperand for each scalar load.

llvm-svn: 343776

5 years ago[cland] Dex: fix/simplify short-trigram generation
Sam McCall [Thu, 4 Oct 2018 14:01:55 +0000 (14:01 +0000)]
[cland] Dex: fix/simplify short-trigram generation

Summary:
1) Instead of x$$ for a short-query trigram, just use x
2) Make rules more coherent: prefixes of length 1-2, and first char + next head
3) Fix Dex::fuzzyFind to mark results as incomplete, because
   short-trigram rules only yield a subset of results.

Reviewers: ioeric

Subscribers: ilya-biryukov, jkorous, mgrang, arphaman, kadircet, cfe-commits

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

llvm-svn: 343775

5 years ago[clangd] Dex: FALSE iterator, peephole optimizations, fix AND bug
Sam McCall [Thu, 4 Oct 2018 13:12:23 +0000 (13:12 +0000)]
[clangd] Dex: FALSE iterator, peephole optimizations, fix AND bug

Summary:
The FALSE iterator will be used in a followup patch to fix a logic bug in Dex
(currently, tokens that don't have posting lists in the index are simply dropped
from the query, changing semantics).

It can usually be optimized away, so added the following opmitizations:
 - simplify booleans inside AND/OR
 - replace effectively-empty AND/OR with booleans
 - flatten nested AND/ORs

While working on this, found a bug in the AND iterator: its constructor sync()
assumes that ReachedEnd is set if applicable, but the constructor never sets it.
This crashes if a non-first iterator is nonempty.

Reviewers: ilya-biryukov

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

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

llvm-svn: 343774

5 years ago[llvm-mca][x86] Add tests demonstrating ReadAfterLd delay
Simon Pilgrim [Thu, 4 Oct 2018 13:05:42 +0000 (13:05 +0000)]
[llvm-mca][x86] Add tests demonstrating ReadAfterLd delay

llvm-svn: 343773

5 years ago[PassTimingInfo] cleanup on TimingData's Timer handling
Fedor Sergeev [Thu, 4 Oct 2018 12:49:57 +0000 (12:49 +0000)]
[PassTimingInfo] cleanup on TimingData's Timer handling

Replacing Timer* with unique_ptr<Timer> in a pass-to-timer map.
That allows to get rid of unpretty raw deletes in PassTimingInfo destructor.
Strictly cleanup, not intended to change any visible behavior.

llvm-svn: 343772

5 years ago[llvm-exegesis][NFC] Improve parsing of the YAML files
Guillaume Chatelet [Thu, 4 Oct 2018 12:33:46 +0000 (12:33 +0000)]
[llvm-exegesis][NFC] Improve parsing of the YAML files

Summary: sscanf turns out to be slow for reading floating points.

Reviewers: courbet

Subscribers: tschuett, llvm-commits, RKSimon

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

llvm-svn: 343771

5 years ago[doc] Update the programmer's manual about SmallSet's iterator
Kristof Umann [Thu, 4 Oct 2018 12:33:33 +0000 (12:33 +0000)]
[doc] Update the programmer's manual about SmallSet's iterator

Since rL337818, you can now iterate the SmallSet.

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

llvm-svn: 343770

5 years agoRe-commit r343500 "Fix build with GCC < 5.0 (PR39131)"
Tatyana Krasnukha [Thu, 4 Oct 2018 11:39:55 +0000 (11:39 +0000)]
Re-commit r343500 "Fix build with GCC < 5.0 (PR39131)"

Occasionally didn't commit actual fix the first time.

llvm-svn: 343769

5 years ago[clang-tidy] Sequence statements with multiple parents correctly (PR39149)
Martin Bohme [Thu, 4 Oct 2018 11:36:39 +0000 (11:36 +0000)]
[clang-tidy] Sequence statements with multiple parents correctly (PR39149)

Summary:
Before this fix, the bugprone-use-after-move check could incorrectly
conclude that a use and move in a function template were not sequenced.
For details, see

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

Reviewers: alexfh, hokein, aaron.ballman, JonasToth

Reviewed By: aaron.ballman

Subscribers: xazax.hun, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 343768

5 years ago[Index] Respect "IndexFunctionLocals" option for type loc.
Haojian Wu [Thu, 4 Oct 2018 11:03:55 +0000 (11:03 +0000)]
[Index] Respect "IndexFunctionLocals" option for type loc.

Summary:
Previously, clang index ignored local symbols defined in the function body even
IndexFunctionLocals is true.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, ioeric, arphaman, kadircet, cfe-commits

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

llvm-svn: 343767

5 years ago[llvm-mca] Check for inconsistencies when constructing instruction descriptors.
Andrea Di Biagio [Thu, 4 Oct 2018 10:36:49 +0000 (10:36 +0000)]
[llvm-mca] Check for inconsistencies when constructing instruction descriptors.

This should help with catching inconsistent definitions of instructions with
zero opcodes, which also declare to consume scheduler/pipeline resources.

llvm-svn: 343766

5 years agoFix MSVC "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Thu, 4 Oct 2018 10:25:52 +0000 (10:25 +0000)]
Fix MSVC "not all control paths return a value" warning. NFCI.

llvm-svn: 343765

5 years ago[clangd] Revert accidental flag change
Sam McCall [Thu, 4 Oct 2018 10:10:35 +0000 (10:10 +0000)]
[clangd] Revert accidental flag change

llvm-svn: 343764

5 years ago[clangd] Use canonical declarations in ReferenceFinder.
Haojian Wu [Thu, 4 Oct 2018 09:56:08 +0000 (09:56 +0000)]
[clangd] Use canonical declarations in ReferenceFinder.

Summary:
handleDeclOccurrencce reports a canonical declartion, so stick to use
canonical declarations to determine whether a declaration is in the
target set.

Also fix a previous ref test which misses a matched label (it fails without this
patch).

Reviewers: sammccall

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 343763

5 years ago[ELF] - Simplify. NFCI.
George Rimar [Thu, 4 Oct 2018 09:31:15 +0000 (09:31 +0000)]
[ELF] - Simplify. NFCI.

Assign the `Link` to parent directly.

llvm-svn: 343762

5 years ago[constexpr] Fix ICE when memcpy() is given a pointer to an incomplete array
Petr Pavlu [Thu, 4 Oct 2018 09:25:44 +0000 (09:25 +0000)]
[constexpr] Fix ICE when memcpy() is given a pointer to an incomplete array

Fix code for constant evaluation of __builtin_memcpy() and
__builtin_memmove() that would attempt to divide by zero when given two
pointers to an incomplete array.

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

llvm-svn: 343761

5 years ago[clangd] Support refs() in dex. Largely cloned from MemIndex.
Sam McCall [Thu, 4 Oct 2018 09:16:12 +0000 (09:16 +0000)]
[clangd] Support refs() in dex. Largely cloned from MemIndex.

Reviewers: hokein

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 343760

5 years ago[clangd] clangd-indexer: Drop support for MR-via-YAML
Sam McCall [Thu, 4 Oct 2018 08:30:03 +0000 (08:30 +0000)]
[clangd] clangd-indexer: Drop support for MR-via-YAML

Summary:
It's slow, and the open-source reduce implementation doesn't scale properly.
While here, tidy up some dead headers and comments.

Reviewers: kadircet

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 343759

5 years ago[AArch64][ARM] Context sensitive meaning of crypto
Sjoerd Meijer [Thu, 4 Oct 2018 07:38:53 +0000 (07:38 +0000)]
[AArch64][ARM] Context sensitive meaning of crypto

For AArch64, crypto means:
- sm4 + sha3 + sha2 + aes for Armv8.4-A and up, and
- sha2 + aes for Armv8.3-A and earlier.

For AArch32:
Crypto means sha2 + aes, because the Armv8.2-A crypto instructions
were added to AArch64 only.

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

llvm-svn: 343758

5 years ago[RISCV][NFC] Remove dead CHECK lines from vararg.ll test
Alex Bradbury [Thu, 4 Oct 2018 07:35:52 +0000 (07:35 +0000)]
[RISCV][NFC] Remove dead CHECK lines from vararg.ll test

The RISCV32 check prefix is no longer used so these lines are dead.

llvm-svn: 343757

5 years ago[RISCV] Bugfix for floats passed on the stack with the ILP32 ABI on RV32F
Alex Bradbury [Thu, 4 Oct 2018 07:28:49 +0000 (07:28 +0000)]
[RISCV] Bugfix for floats passed on the stack with the ILP32 ABI on RV32F

f32 values passed on the stack would previously cause an assertion in
unpackFromMemLoc.. This would only trigger in the presence of the F extension
making f32 a legal type. Otherwise the f32 would be legalized.

This patch fixes that by keeping LocVT=f32 when a float is passed on the
stack. It also adds test coverage for this case, and tests that also
demonstrate lw/sw/flw/fsw will be selected when most profitable. i.e. there is
no unnecessary i32<->f32 conversion in registers.

llvm-svn: 343756

5 years ago[llvm-exegesis][NFC] Test sched class names only in !NDEBUG mode.
Clement Courbet [Thu, 4 Oct 2018 07:07:16 +0000 (07:07 +0000)]
[llvm-exegesis][NFC] Test sched class names only in !NDEBUG mode.

Sched classes have no names in NDEBUG.

llvm-svn: 343755

5 years ago[X86] Merge matchANDXORWithAllOnesAsANDNP into combineANDXORWithAllOnesIntoANDNP...
Craig Topper [Thu, 4 Oct 2018 06:13:27 +0000 (06:13 +0000)]
[X86] Merge matchANDXORWithAllOnesAsANDNP into combineANDXORWithAllOnesIntoANDNP. NFCI

It's the only caller and the logic pretty easy to combine.

llvm-svn: 343754

5 years ago[CMake] Use just basename when copying C++ ABI headers
Petr Hosek [Thu, 4 Oct 2018 05:38:53 +0000 (05:38 +0000)]
[CMake] Use just basename when copying C++ ABI headers

This avoids duplicate directories when the filename includes path.

Fixes PR39145

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

llvm-svn: 343753

5 years ago[RISCV][NFC] Fix naming of RISCVISelLowering::{LowerRETURNADDR,LowerFRAMEADDR}
Alex Bradbury [Thu, 4 Oct 2018 05:27:50 +0000 (05:27 +0000)]
[RISCV][NFC] Fix naming of RISCVISelLowering::{LowerRETURNADDR,LowerFRAMEADDR}

Rename to lowerRETURNADDR, lowerFRAMEADDR in order to be consistent with the
LLVM coding style and the other functions in this file.

llvm-svn: 343752

5 years ago[llvm-exegesis] Unbreak analysis-uops-variant.test introduced in D52825
Fangrui Song [Thu, 4 Oct 2018 03:32:47 +0000 (03:32 +0000)]
[llvm-exegesis] Unbreak analysis-uops-variant.test introduced in D52825

A `defined(NDEBUG) && !defined(LLVM_ENABLE_DUMP)` build does not call
writeEscaped and there will be no `SBWriteZeroLatency` in the output.

llvm-svn: 343751

5 years ago[LegalizeIntegerTypes] Fix typo in comment. NFC
Craig Topper [Thu, 4 Oct 2018 02:40:35 +0000 (02:40 +0000)]
[LegalizeIntegerTypes] Fix typo in comment. NFC

llvm-svn: 343750

5 years agoUse std::make_pair rather than brace initialization.
Matt Morehouse [Thu, 4 Oct 2018 00:35:24 +0000 (00:35 +0000)]
Use std::make_pair rather than brace initialization.

r343732 broke the Windows bot.  Seems like the compiler on that bot
doesn't like brace initialization.

llvm-svn: 343749

5 years ago[ELF] Fix typo. NFC
Shoaib Meenai [Thu, 4 Oct 2018 00:07:59 +0000 (00:07 +0000)]
[ELF] Fix typo. NFC

llvm-svn: 343748

5 years ago[analyzer] [quickfix] Temporarily disabling a failing test.
George Karpenkov [Thu, 4 Oct 2018 00:07:45 +0000 (00:07 +0000)]
[analyzer] [quickfix] Temporarily disabling a failing test.

llvm-svn: 343747

5 years ago[WebAssembly] Add WebAssembly to LLVM_ALL_TARGETS
Derek Schuff [Wed, 3 Oct 2018 23:56:52 +0000 (23:56 +0000)]
[WebAssembly] Add WebAssembly to LLVM_ALL_TARGETS

Summary:
After fixing memory leaks in rL343362 and rL343733 the sanitizer builds are
clean and we should be good to build by default again.

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

llvm-svn: 343746

5 years ago[ELF] Fix crash on invalid undefined local symbols
Shoaib Meenai [Wed, 3 Oct 2018 23:53:11 +0000 (23:53 +0000)]
[ELF] Fix crash on invalid undefined local symbols

r320770 made LLD handle invalid DSOs where local symbols were found in
the global part of the symbol table. Unfortunately, it didn't handle the
case where those local symbols were also undefined, and r326242 exposed
an assertion failure in that case. Just warn on that case instead of
crashing, by moving the local binding check before the undefined symbol
addition.

The input file for the test is crafted by hand, since I don't know of
any tool that would produce such a broken DSO. I also don't understand
what it even means for a symbol to be undefined but have STB_LOCAL
binding - I don't think that combination makes any sense - but we have
found broken DSOs of this nature that we were linking against. I've
included detailed instructions on how to produce the DSO in the test.

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

llvm-svn: 343745

5 years ago[llvm-nm] Update clang tests based on changed llvm-nm output
Jordan Rupprecht [Wed, 3 Oct 2018 23:40:04 +0000 (23:40 +0000)]
[llvm-nm] Update clang tests based on changed llvm-nm output

llvm-svn: 343744

5 years ago[llvm-nm] Update lld tests based on changed llvm-nm output
Jordan Rupprecht [Wed, 3 Oct 2018 23:39:59 +0000 (23:39 +0000)]
[llvm-nm] Update lld tests based on changed llvm-nm output

llvm-svn: 343743

5 years ago[llvm-nm] Print an explicit "no symbols" message when an object file has no symbols
Jordan Rupprecht [Wed, 3 Oct 2018 23:39:49 +0000 (23:39 +0000)]
[llvm-nm] Print an explicit "no symbols" message when an object file has no symbols

Summary:
GNU nm (and other nm implementations, such as "go tool nm") prints an explicit "no symbols" message when an object file has no symbols. Currently llvm-nm just doesn't print anything. Adding an explicit "no symbols" message will allow llvm-nm to be used in place of nm: some scripts and build processes use `nm <file> | grep "no symbols"` as a test to see if a file has no symbols. It will also be more familiar to anyone used to nm.

That said, the format implemented here is slightly different, in that it doesn't print the tool name in the message (which IMHO is not useful to include).

Demo:
```
$ for nm in nm bin/llvm-nm ; do echo "nm implementation: $nm"; $nm /tmp/foo{1,2}.o; echo; done
nm implementation: nm

/tmp/foo1.o:
nm: /tmp/foo1.o: no symbols

/tmp/foo2.o:
0000000000000000 T foo2

nm implementation: bin/llvm-nm

/tmp/foo1.o:
no symbols

/tmp/foo2.o:
0000000000000000 T foo2
```

Reviewers: MaskRay

Reviewed By: MaskRay

Subscribers: llvm-commits

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

llvm-svn: 343742

5 years ago[RISCV] Handle redundant SplitF64+BuildPairF64 pairs in a DAGCombine
Alex Bradbury [Wed, 3 Oct 2018 23:30:16 +0000 (23:30 +0000)]
[RISCV] Handle redundant SplitF64+BuildPairF64 pairs in a DAGCombine

r343712 performed this optimisation during instruction selection. As Eli
Friedman pointed out in post-commit review, implementing this as a DAGCombine
might allow opportunities for further optimisations.

llvm-svn: 343741

5 years ago[SEMA] split ExtWarn dupl-decl-spec's into Extension and ExtWarn
Nick Desaulniers [Wed, 3 Oct 2018 23:09:29 +0000 (23:09 +0000)]
[SEMA] split ExtWarn dupl-decl-spec's into Extension and ExtWarn

Summary:
For types deduced from typedef's and typeof's, don't warn for duplicate
declaration specifiers in C90 unless -pedantic.

Create a third diagnostic type for duplicate declaration specifiers.
Previously, we had an ExtWarn and a Warning. This change adds a third,
Extension, which only warns when -pedantic is set, staying silent
otherwise.

Fixes PR32985.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: srhines, cfe-commits

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

llvm-svn: 343740

5 years ago[WebAssembly] Bitselect intrinsic and instruction
Thomas Lively [Wed, 3 Oct 2018 23:02:23 +0000 (23:02 +0000)]
[WebAssembly] Bitselect intrinsic and instruction

Summary: Depends on D52755.

Reviewers: aheejin, dschuff

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

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

llvm-svn: 343739

5 years agoRevert "[ASTMatchers] Fix DynamicASTMatchersTests again"
Fangrui Song [Wed, 3 Oct 2018 22:56:26 +0000 (22:56 +0000)]
Revert "[ASTMatchers] Fix DynamicASTMatchersTests again"

This reverts commit 8a6631a983ec9c1d22cc77c5f55a524a651740f0.

The last fix seems good in Debug mode.

llvm-svn: 343738

5 years ago[RISCV][NFC] Refactor LocVT<->ValVT converstion in RISCVISelLowering
Alex Bradbury [Wed, 3 Oct 2018 22:53:25 +0000 (22:53 +0000)]
[RISCV][NFC] Refactor LocVT<->ValVT converstion in RISCVISelLowering

There was some duplicated logic for using the LocInfo of a CCValAssign in
order to convert from the ValVT to LocVT or vice versa. Resolve this by
factoring out convertLocVTFromValVT from unpackFromRegLoc. Also rename
packIntoRegLoc to the more appropriate convertValVTToLocVT and call these
helper functions consistently.

llvm-svn: 343737

5 years ago[analyzer] [tests] [quickfix] Make more test more resilient for non-defaut -std.
Artem Dergachev [Wed, 3 Oct 2018 22:48:00 +0000 (22:48 +0000)]
[analyzer] [tests] [quickfix] Make more test more resilient for non-defaut -std.

It is important to specify the version of the standard because tests should
test the same thing regardless of the current default version of the standard.

llvm-svn: 343736

5 years ago[analyzer] Do not crash if the assumption added in TrustNonNullChecker is enough...
George Karpenkov [Wed, 3 Oct 2018 22:31:09 +0000 (22:31 +0000)]
[analyzer] Do not crash if the assumption added in TrustNonNullChecker is enough to make the state unfeasible

rdar://43541814

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

llvm-svn: 343735

5 years ago[WebAssembly] Refactor use of signatures
Derek Schuff [Wed, 3 Oct 2018 22:25:32 +0000 (22:25 +0000)]
[WebAssembly] Refactor use of signatures

Update use of WebAssemblySignature to go along with D52580

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

llvm-svn: 343734

5 years ago[WebAssembly] Refactor WasmSignature and use it for MCSymbolWasm
Derek Schuff [Wed, 3 Oct 2018 22:22:48 +0000 (22:22 +0000)]
[WebAssembly] Refactor WasmSignature and use it for MCSymbolWasm

MCContext does not destroy MCSymbols on shutdown. So, rather than putting
SmallVectors (which may heap-allocate) inside MCSymbolWasm, use unowned pointer
to a WasmSignature instead. The signatures are now owned by the AsmPrinter.
Also uses WasmSignature instead of param and result vectors in TargetStreamer,
and leaves some TODOs for further simplification.

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

llvm-svn: 343733

5 years agoMinor refacotring of Relocations.cpp. NFC.
Rui Ueyama [Wed, 3 Oct 2018 22:20:26 +0000 (22:20 +0000)]
Minor refacotring of Relocations.cpp. NFC.

This patch splits ThunkCreator::mergeThunks into two smaller functions.
Also adds blank lines to various places so that the code doesn't look
too dense.

llvm-svn: 343732

5 years ago[machineverifier] Detect PHI's that are preceeded by non-PHI's
Daniel Sanders [Wed, 3 Oct 2018 22:05:31 +0000 (22:05 +0000)]
[machineverifier] Detect PHI's that are preceeded by non-PHI's

If present, PHI nodes must appear before non-PHI nodes in a basic block. The
register allocator relies on this and will fail to eliminate PHI's that do not
meet this requirement.

llvm-svn: 343731

5 years ago[mips] Remove -allow-deprecated-dag-overlap flag from tests. NFC
Simon Atanasyan [Wed, 3 Oct 2018 22:02:23 +0000 (22:02 +0000)]
[mips] Remove -allow-deprecated-dag-overlap flag from tests. NFC

Fix DAG check statements in MIPS codegen tests to remove
-allow-deprecated-dag-overlap flag.

llvm-svn: 343730

5 years ago[PPC64] Test documenting toc-restore after interposable recursive call. [NFC]
Sean Fertile [Wed, 3 Oct 2018 21:58:44 +0000 (21:58 +0000)]
[PPC64] Test documenting toc-restore after interposable recursive call. [NFC]

A test verifying that toc restores are properly inserted following recursive
calls, as well as briefly describing why they are needed.

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

llvm-svn: 343729

5 years ago[PPC64] Add test documenting toc-restore when linking with -Bsymbolic. [NFC]
Sean Fertile [Wed, 3 Oct 2018 21:58:42 +0000 (21:58 +0000)]
[PPC64] Add test documenting toc-restore when linking with -Bsymbolic. [NFC]

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

llvm-svn: 343728

5 years ago[InstCombine] allow SimplifyDemandedVectorElts to work with FP binops
Sanjay Patel [Wed, 3 Oct 2018 21:44:59 +0000 (21:44 +0000)]
[InstCombine] allow SimplifyDemandedVectorElts to work with FP binops

We're a long way from D50992 and D51553, but this is where we have to start.
We weren't back-propagating undefs into binop constant values for anything but
add/sub/mul/and/or/xor.

This is likely because we have to be careful about not introducing UB/poison
with div/rem/shift. But I suspect we already are getting the poison part wrong
for add/sub/mul (although it may not be possible to expose the bug currently
because we use SimplifyDemandedVectorElts from a limited set of opcodes).
See the discussion/implementation from D48987 and D49047.

This patch just enables functionality for FP ops because those do not have
UB/poison potential.

llvm-svn: 343727

5 years agoFix buildbot regression by rL339929: NameError: global name 'test_directory' is not...
Jan Kratochvil [Wed, 3 Oct 2018 21:42:54 +0000 (21:42 +0000)]
Fix buildbot regression by rL339929: NameError: global name 'test_directory' is not defined

With buildbot slave under test - I get after rL339929:
http://lab.llvm.org:8014/builders/lldb-x86_64-fedora-28-cmake/builds/243/steps/test1/logs/stdio

  File "/home/buildbot/lldbroot/lldb-x86_64-fedora-28-cmake/scripts/../llvm/tools/lldb/test/dotest.py", line 7, in <module>
    lldbsuite.test.run_suite()
  File "/quad/home/buildbot/lldbroot/lldb-x86_64-fedora-28-cmake/llvm/tools/lldb/packages/Python/lldbsuite/test/dotest.py", line 1177, in run_suite
    configuration.results_formatter_object)
  File "/quad/home/buildbot/lldbroot/lldb-x86_64-fedora-28-cmake/llvm/tools/lldb/packages/Python/lldbsuite/test/dosep.py", line 1692, in main
    dst = core.replace(test_directory, "")[1:]
NameError: global name 'test_directory' is not defined

Patch by Vedant Kumar.

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

llvm-svn: 343726

5 years ago[libc++][NFC] Add error messages to a couple of static_asserts in span
Louis Dionne [Wed, 3 Oct 2018 21:36:16 +0000 (21:36 +0000)]
[libc++][NFC] Add error messages to a couple of static_asserts in span

Summary:
Add error messages to a couple of static_asserts in span to match the
style used in the rest of the file. Also fix an extra paren typo in a
assert error message.

Committed on behalf of Jason Lovett.

Reviewers: ldionne

Subscribers: libcxx-commits

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

llvm-svn: 343725

5 years agoMake meanings of variables clearer in action table generation (NFC)
Heejin Ahn [Wed, 3 Oct 2018 21:30:15 +0000 (21:30 +0000)]
Make meanings of variables clearer in action table generation (NFC)

Summary:

Reviewers: kristina, zhmu, dschuff, rnk

Subscribers: llvm-commits

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

llvm-svn: 343724

5 years ago[X86] Stop promoting vector ISD::SELECT to vXi64.
Craig Topper [Wed, 3 Oct 2018 21:10:29 +0000 (21:10 +0000)]
[X86] Stop promoting vector ISD::SELECT to vXi64.

The additional patterns needed for this aren't overwhelming and introducing extra bitcasts during lowering limits our ability to do computeNumSignBits. Not that I have a good example of that for select. I'm just becoming increasingly grumpy about promotion of AND/OR/XOR. SELECT was just a lot easier to fix.

llvm-svn: 343723

5 years ago[ASTMatchers] Fix DynamicASTMatchersTests again
Fangrui Song [Wed, 3 Oct 2018 21:00:44 +0000 (21:00 +0000)]
[ASTMatchers] Fix DynamicASTMatchersTests again

llvm-svn: 343722

5 years ago[test] Fix -Wunused-variable in rC343665
Fangrui Song [Wed, 3 Oct 2018 20:53:53 +0000 (20:53 +0000)]
[test] Fix -Wunused-variable in rC343665

llvm-svn: 343721

5 years agoRemove stray character from docs
Stephen Kelly [Wed, 3 Oct 2018 20:53:02 +0000 (20:53 +0000)]
Remove stray character from docs

llvm-svn: 343720

5 years agoUpdate documentation for correctness
Stephen Kelly [Wed, 3 Oct 2018 20:52:57 +0000 (20:52 +0000)]
Update documentation for correctness

llvm-svn: 343719

5 years agoAdding skipIf to std::variant libc++ data-formatter test since get is not available...
Shafik Yaghmour [Wed, 3 Oct 2018 20:52:56 +0000 (20:52 +0000)]
Adding skipIf to std::variant libc++ data-formatter test since get is not available before macOS 10.14

Patch by Shafik Yaghmour

llvm-svn: 343718

5 years agoAdd matchers missing from dynamic AST registry
Stephen Kelly [Wed, 3 Oct 2018 20:52:51 +0000 (20:52 +0000)]
Add matchers missing from dynamic AST registry

llvm-svn: 343717

5 years agoSort list of matchers
Stephen Kelly [Wed, 3 Oct 2018 20:52:45 +0000 (20:52 +0000)]
Sort list of matchers

llvm-svn: 343716

5 years ago[analyzer] [tests] [quickfix] Make the test more resilient for a non-defaut std confi...
George Karpenkov [Wed, 3 Oct 2018 20:46:50 +0000 (20:46 +0000)]
[analyzer] [tests] [quickfix] Make the test more resilient for a non-defaut std configuration

llvm-svn: 343715

5 years ago[InstCombine] add tests for binop undef-into-constant propagation; NFC
Sanjay Patel [Wed, 3 Oct 2018 20:35:25 +0000 (20:35 +0000)]
[InstCombine] add tests for binop undef-into-constant propagation; NFC

llvm-svn: 343714

5 years ago[X86] Add CMOV_VK2/VK4 pseudos and remove lowering code that turned v2i1/v4i1 SELECT...
Craig Topper [Wed, 3 Oct 2018 20:28:43 +0000 (20:28 +0000)]
[X86] Add CMOV_VK2/VK4 pseudos and remove lowering code that turned v2i1/v4i1 SELECT into v8i1.

llvm-svn: 343713

5 years ago[RISCV][NFCI] Handle redundant splitf64+buildpairf64 pairs during instruction selection
Alex Bradbury [Wed, 3 Oct 2018 20:12:10 +0000 (20:12 +0000)]
[RISCV][NFCI] Handle redundant splitf64+buildpairf64 pairs during instruction selection

Although we can't write a tablegen pattern to remove redundant
splitf64+buildf64 pairs due to the multiple return values, we can handle it
with some C++ selection code. This is simpler than removing them after
instruction selection through RISCVDAGToDAGISel::PostprocessISelDAG, as was
done previously.

llvm-svn: 343712

5 years ago[OPENMP] Add reverse_offload clause to requires directive
Patrick Lyster [Wed, 3 Oct 2018 20:07:58 +0000 (20:07 +0000)]
[OPENMP] Add reverse_offload clause to requires directive

llvm-svn: 343711

5 years ago[X86] Add CMOV pseudos for VR128X and VR256X register classes. Use them when AVX512VL...
Craig Topper [Wed, 3 Oct 2018 19:48:26 +0000 (19:48 +0000)]
[X86] Add CMOV pseudos for VR128X and VR256X register classes. Use them when AVX512VL is enabled.

This allows the phi nodes to be generated with the correct register class when expanded.

llvm-svn: 343710

5 years ago[X86] Don't break CMOV pseudo instructions down by type. Just by register class.
Craig Topper [Wed, 3 Oct 2018 19:48:23 +0000 (19:48 +0000)]
[X86] Don't break CMOV pseudo instructions down by type. Just by register class.

The register class is all that's important for the pseudo instructions. We can use patterns to handle the different types.

llvm-svn: 343709

5 years ago[X86] PUSH/POP 'mem-mem' instructions are not RMW - these are 2 different addresses
Simon Pilgrim [Wed, 3 Oct 2018 19:02:38 +0000 (19:02 +0000)]
[X86] PUSH/POP 'mem-mem' instructions are not RMW - these are 2 different addresses

This patch adds a 'WriteCopy' [WriteLoad, WriteStore] schedule sequence instead to better model the behaviour

Found by @andreadb during llvm-mca testing on btver2 which was crashing on "zero uop" WriteRMW only instructions

llvm-svn: 343708

5 years agoAdd template type and value parameter metadata nodes to template variable specializations
Matthew Voss [Wed, 3 Oct 2018 18:45:04 +0000 (18:45 +0000)]
Add template type and value parameter metadata nodes to template variable specializations

Summary: Add an optional attribute referring to a tuple of type and value template parameter nodes to the DIGlobalVariable node. This allows us to record the parameters of template variable specializations.

Reviewers: dblaikie, aprantl, probinson, JDevlieghere, clayborg, jingham

Reviewed By: JDevlieghere

Subscribers: cfe-commits

Tags: #debug-info

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

llvm-svn: 343707

5 years agoEmit template type and value parameter DIEs for template variables.
Matthew Voss [Wed, 3 Oct 2018 18:44:53 +0000 (18:44 +0000)]
Emit template type and value parameter DIEs for template variables.

Summary:
Ensure the TemplateParam attribute of the DIGlobalVariable node is translated into the proper DIEs.

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

Reviewers: dblaikie, probinson, aprantl, JDevlieghere, clayborg, whitequark, deadalnix

Reviewed By: dblaikie

Subscribers: llvm-commits

Tags: #debug-info

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

llvm-svn: 343706

5 years ago[X86] Move Atomic binops to use WriteALURMW schedule class
Simon Pilgrim [Wed, 3 Oct 2018 18:38:28 +0000 (18:38 +0000)]
[X86] Move Atomic binops to use WriteALURMW schedule class

These were being tagged as <WriteALULd, WriteRMW> instead of properly using the RMW sequence

llvm-svn: 343705

5 years ago[COFF] Cope with weak aliases produced by GNU tools
Martin Storsjo [Wed, 3 Oct 2018 18:31:53 +0000 (18:31 +0000)]
[COFF] Cope with weak aliases produced by GNU tools

When GNU tools create a weak alias, they produce a strong symbol
named .weak.<weaksymbol>.<relatedstrongsymbol>.

GNU ld allows many such weak alternatives for the same weak symbol, and
the linker picks the first one encountered.

This can't be reproduced by assembling from .s files, since llvm-mc
produces symbols named .weak.<weaksymbol>.default in these cases.

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

llvm-svn: 343704

5 years ago[clang-doc] Avoid parsing undefined base classes
Julie Hockett [Wed, 3 Oct 2018 18:25:27 +0000 (18:25 +0000)]
[clang-doc] Avoid parsing undefined base classes

Don't try to parse base classes for declarations that are not
definitions (segfaults, as there is no DefinitionData to access).

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

llvm-svn: 343703

5 years ago[test] Use --sysroot instead of -B in print-multi-directory.c
Martin Storsjo [Wed, 3 Oct 2018 18:24:05 +0000 (18:24 +0000)]
[test] Use --sysroot instead of -B in print-multi-directory.c

This avoids finding a similar matching GCC installation outside
of the test directory tree in the surrounding environment, which
would make the test fail. (This happened on Ubuntu 16.04.)

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

llvm-svn: 343702

5 years ago[X86][Btver2] Fix MMX PSHUFB schedule
Simon Pilgrim [Wed, 3 Oct 2018 18:18:50 +0000 (18:18 +0000)]
[X86][Btver2] Fix MMX PSHUFB schedule

Match AMD Fam16h SOG + llvm-exegesis tests

llvm-svn: 343701

5 years ago[X86] Move Atomic CMPXCHG to WriteCMPXCHGRMW schedule class
Simon Pilgrim [Wed, 3 Oct 2018 18:05:01 +0000 (18:05 +0000)]
[X86] Move Atomic CMPXCHG to WriteCMPXCHGRMW schedule class

llvm-svn: 343700