platform/upstream/llvm.git
5 years agoRevert r360876 "[Object] Change object::SectionRef::getContents() to return Expected...
Hans Wennborg [Thu, 16 May 2019 12:08:34 +0000 (12:08 +0000)]
Revert r360876 "[Object] Change object::SectionRef::getContents() to return Expected<StringRef>"

It broke the Clang build, see llvm-commits thread.

> Expected<ArrayRef<uint8_t>> may be better but use Expected<StringRef> for now.
>
> Follow-up of D61781.

llvm-svn: 360878

5 years agoAMDGPU/GlobalISel: Correct regbank for 1-bit and/or/xor
Matt Arsenault [Thu, 16 May 2019 12:06:41 +0000 (12:06 +0000)]
AMDGPU/GlobalISel: Correct regbank for 1-bit and/or/xor

Bool values should use the scc/vcc regbank since r350611.

llvm-svn: 360877

5 years ago[Object] Change object::SectionRef::getContents() to return Expected<StringRef>
Fangrui Song [Thu, 16 May 2019 11:33:48 +0000 (11:33 +0000)]
[Object] Change object::SectionRef::getContents() to return Expected<StringRef>

Expected<ArrayRef<uint8_t>> may be better but use Expected<StringRef> for now.

Follow-up of D61781.

llvm-svn: 360876

5 years ago[lld-link] Add missing "REQUIRES: x86" to COFF/lib-module-asm.ll test.
Yvan Roux [Thu, 16 May 2019 11:29:30 +0000 (11:29 +0000)]
[lld-link] Add missing "REQUIRES: x86" to COFF/lib-module-asm.ll test.

This should fix ARM bots.

llvm-svn: 360875

5 years agoDWARFContext: Return empty data extractors instead of null pointers
Pavel Labath [Thu, 16 May 2019 11:19:02 +0000 (11:19 +0000)]
DWARFContext: Return empty data extractors instead of null pointers

Summary:
There are several reasons for doing this:
- generally, there's no reason to differentiate between a section being
  absent and it being present, but empty
- it matches more closely what llvm DWARF parser is doing (which also
  doesn't differentiate the two cases)
- SymbolFileDWARF also doesn't differentiate the two cases, which makes
  porting the rest of sections easier
- it fixes a bug in how the return-null-if-empty logic was implemented
  (it returned nullptr only the second time we tried to get the
  debug_aranges section), which meant that we hit an assert when trying
  to parse an empty-but-present section

Reviewers: JDevlieghere, clayborg, aprantl

Subscribers: zturner, lldb-commits

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

llvm-svn: 360874

5 years ago[crt] Mark dso_handle test as xfailing on ARM.
Yvan Roux [Thu, 16 May 2019 11:13:49 +0000 (11:13 +0000)]
[crt] Mark dso_handle test as xfailing on ARM.

This is a temporary action to fix the bots.

llvm-svn: 360873

5 years agoDWARF: Add ability to reference debug info coming from multiple sections
Pavel Labath [Thu, 16 May 2019 11:07:58 +0000 (11:07 +0000)]
DWARF: Add ability to reference debug info coming from multiple sections

Summary:
This patch adds the ability to precisely address debug info in
situations when a single file can have more than one debug-info-bearing
sections (as is the case with type units in DWARF v4).

The changes here can be classified into roughly three categories:
- the code which addresses a debug info by offset gets an additional
  argument, which specifies the section one should look into.
- the DIERef class also gets an additional member variable specifying
  the section. This way, code dealing with DIERefs can know which
  section is the object referring to.
- the user_id_t encoding steals one bit from the dwarf_id field to store
  the section. This means the total number of separate object files
  (apple .o, or normal .dwo) is limited to 2 billion, but that is fine
  as it's not possible to hit that number without switching to DWARF64
  anyway.

This patch is functionally equivalent to (and inspired by) the two
patches (D61503 and D61504) by Jan Kratochvil, but there are differences
in the implementation:
- it uses an enum instead of a bool flag to differentiate the sections
- it increases the size of DIERef struct instead of reducing the amount
  of addressable debug info
- it sets up DWARFDebugInfo to store the units in a single vector
  instead of two. This sets us up for the future in which type units can
  also live in the debug_info section, and I believe it's cleaner
  because there's no need for unit index remapping

There are no tests with this patch as this is essentially NFC until
we start parsing type units from the debug_types section.

Reviewers: JDevlieghere, clayborg, aprantl

Subscribers: arphaman, jankratochvil, lldb-commits

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

llvm-svn: 360872

5 years ago[AArch64][SVE2] Asm: implement CMLA/SQRDCMLAH instructions
Cullen Rhodes [Thu, 16 May 2019 09:42:22 +0000 (09:42 +0000)]
[AArch64][SVE2] Asm: implement CMLA/SQRDCMLAH instructions

Summary:
This patch adds support for the indexed and unpredicated vectors forms
of the CMLA and SQRDCMLAH instructions.

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: SjoerdMeijer

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

llvm-svn: 360871

5 years ago[AArch64][SVE2] Asm: implement CDOT instruction
Cullen Rhodes [Thu, 16 May 2019 09:33:44 +0000 (09:33 +0000)]
[AArch64][SVE2] Asm: implement CDOT instruction

Summary:
The complex DOT instructions perform a dot-product on quadtuplets from
two source vectors and the resuling wide real or wide imaginary is
accumulated into the destination register. The instructions come in two
forms:

Vector form, e.g.
  cdot z0.s, z1.b, z2.b, #90    - complex dot product on four 8-bit quad-tuplets,
                                  accumulating results in 32-bit elements. The
                                  complex numbers in the second source vector are
                                  rotated by 90 degrees.

  cdot z0.d, z1.h, z2.h, #180   - complex dot product on four 16-bit quad-tuplets,
                                  accumulating results in 64-bit elements.
                                  The complex numbers in the second source
                                  vector are rotated by 180 degrees.

Indexed form, e.g.
  cdot z0.s, z1.b, z2.b[3], #0  - complex dot product on four 8-bit quad-tuplets,
                                  with specified quadtuplet from second source vector,
                                  accumulating results in 32-bit elements.
  cdot z0.d, z1.h, z2.h[1], #0  - complex dot product on four 16-bit quad-tuplets,
                                  with specified quadtuplet from second source vector,
                                  accumulating results in 64-bit elements.

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: SjoerdMeijer, rovka

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

llvm-svn: 360870

5 years ago[clang-tidy] Do not list enabled checks when -quiet is given to run-clang-tidy.
Jonas Toth [Thu, 16 May 2019 09:22:39 +0000 (09:22 +0000)]
[clang-tidy] Do not list enabled checks when -quiet is given to run-clang-tidy.

Summary: When run-clang-tidy is given the -quiet flag, do not output the potentially hundreds of enabled check names at the beginning.

Patch by svenpanne.

Reviewers: alexfh, JonasToth

Reviewed By: JonasToth

Subscribers: JonasToth, cfe-commits

Tags: #clang

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

llvm-svn: 360869

5 years agoSimplify Triple::ppc64{,le} checks with Triple::isPPC64()
Fangrui Song [Thu, 16 May 2019 09:07:33 +0000 (09:07 +0000)]
Simplify Triple::ppc64{,le} checks with Triple::isPPC64()

While here, update some ppc64le specific check to isPPC64(), if it
applies to big-endian as well, in the hope that it will ease the support
of big-endian if people are interested in this area. The big-endian
variant is used by at least FreeBSD, Gentoo Linux, Adélie Linux, and
Void Linux.

llvm-svn: 360868

5 years ago[AArch64][SVE2] Asm: add unpredicated integer multiply instructions
Cullen Rhodes [Thu, 16 May 2019 09:07:26 +0000 (09:07 +0000)]
[AArch64][SVE2] Asm: add unpredicated integer multiply instructions

Summary:
Add support for the following instructions:

  * MUL (indexed and unpredicated vectors forms)
  * SQDMULH (indexed and unpredicated vectors forms)
  * SQRDMULH (indexed and unpredicated vectors forms)
  * SMULH (unpredicated, predicated form added in SVE)
  * UMULH (unpredicated, predicated form added in SVE)
  * PMUL (unpredicated)

The specification can be found here:
https://developer.arm.com/docs/ddi0602/latest

Reviewed By: SjoerdMeijer, rovka

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

llvm-svn: 360867

5 years agoAdd missing "REQUIRES: x86" to the lto/irmover-warning.ll test.
Igor Kudrin [Thu, 16 May 2019 09:04:52 +0000 (09:04 +0000)]
Add missing "REQUIRES: x86" to the lto/irmover-warning.ll test.

llvm-svn: 360866

5 years agoSimplify ArchSpec::IsMIPS()
Fangrui Song [Thu, 16 May 2019 08:37:32 +0000 (08:37 +0000)]
Simplify ArchSpec::IsMIPS()

llvm-svn: 360865

5 years agoAdd Triple::isPPC64()
Fangrui Song [Thu, 16 May 2019 08:31:22 +0000 (08:31 +0000)]
Add Triple::isPPC64()

llvm-svn: 360864

5 years ago[builtin] Fixed definitions of builtins that rely on the int/long long type is 32...
Karl-Johan Karlsson [Thu, 16 May 2019 07:18:02 +0000 (07:18 +0000)]
[builtin] Fixed definitions of builtins that rely on the int/long long type is 32/64 bits

Summary:
The definition of the builtins __builtin_bswap32, __builtin_bitreverse32, __builtin_rotateleft32 and __builtin_rotateright32 rely on that the int type is 32 bits wide on the target.
The defintions of the builtins __builtin_bswap64, __builtin_bitreverse64, __builtin_rotateleft64, and __builtin_rotateright64 rely on that the long long type is 64 bits wide.

On targets where this is not the case (e.g. AVR) clang will generate faulty code (wrong llvm assembler intrinsics).

This patch add support for using 'Z' (the int32_t type) in Bultins.def. The builtins above are changed to be based on the int32_t type instead of the int type, and the int64_t type instead of the long long type.

The AVR backend (experimental) have a native int type that is only 16 bits wide. The supplied testcase will therefore fail if running the testcase on trunk as clang will convert e.g. __builtin_bitreverse32 into llvm.bitreverse.i16 on AVR.

Reviewers: dylanmckay, spatel, rsmith, efriedma

Reviewed By: efriedma

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

llvm-svn: 360863

5 years ago[PPC] Fix 32-bit build of libunwind
Martin Storsjo [Thu, 16 May 2019 06:49:20 +0000 (06:49 +0000)]
[PPC] Fix 32-bit build of libunwind

Clang integrated assembler was unable to build libunwind PPC32 assembly code,
present in functions used to save/restore register context.

This change consists in replacing the assembly style used in libunwind source,
to one that is compatible with both Clang integrated assembler as well as
GNU assembler.

Patch by Leandro Lupori!

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

llvm-svn: 360862

5 years ago[PPC64][libunwind] Fix r2 not properly restored
Martin Storsjo [Thu, 16 May 2019 06:49:13 +0000 (06:49 +0000)]
[PPC64][libunwind] Fix r2 not properly restored

This change makes each unwind step inspect the instruction at the
return address and, if needed, read r2 from its saved location and
modify the context appropriately.

The unwind logic is able to handle both ELFv1 and ELFv2 stacks.

Reported by Bug 41050

Patch by Leandro Lupori!

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

llvm-svn: 360861

5 years ago[llvm-readobj] - Revert r360676 partially. NFC.
George Rimar [Thu, 16 May 2019 06:22:51 +0000 (06:22 +0000)]
[llvm-readobj] - Revert r360676 partially. NFC.

In the r360676 "Apply clang format. NFC" I applied clang-format
for whole ELFDumper.cpp. It caused a little discussion,
one of the points mentioned was that previously nicely lined up
tables are not so nice now.

This patch reverts them.

llvm-svn: 360860

5 years agoReland r360771 "[MergeICmps] Simplify the code."
Clement Courbet [Thu, 16 May 2019 06:18:02 +0000 (06:18 +0000)]
Reland r360771 "[MergeICmps] Simplify the code."

This revision does not seem to be the culprit.

llvm-svn: 360859

5 years ago[LTO] Improve readability of module IDs
Igor Kudrin [Thu, 16 May 2019 05:23:25 +0000 (05:23 +0000)]
[LTO] Improve readability of module IDs

Module IDs can appear in diagnostic messages.
This patch adds some auxiliary symbols to improve their readability.

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

llvm-svn: 360858

5 years ago[IRMover] Improve diagnostic messages for conflicting metadata
Igor Kudrin [Thu, 16 May 2019 05:23:13 +0000 (05:23 +0000)]
[IRMover] Improve diagnostic messages for conflicting metadata

This does the similar for error messages as rL344011 has done for warnings.

With llvm::lto::LTO, the error might appear when LTO::run() is executed.
In that case, the calling code cannot know which module causes the error
and, subsequently, cannot hint the user.

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

llvm-svn: 360857

5 years agoGlobalISel: Add buildFConstant for APFloat
Matt Arsenault [Thu, 16 May 2019 04:09:06 +0000 (04:09 +0000)]
GlobalISel: Add buildFConstant for APFloat

llvm-svn: 360853

5 years agoGlobalISel: Add some FP instructions to MachineIRBuilder
Matt Arsenault [Thu, 16 May 2019 04:08:55 +0000 (04:08 +0000)]
GlobalISel: Add some FP instructions to MachineIRBuilder

This makes FP legalization code more convenient.

llvm-svn: 360852

5 years agoGlobalISel: Fix indentation
Matt Arsenault [Thu, 16 May 2019 04:08:46 +0000 (04:08 +0000)]
GlobalISel: Fix indentation

llvm-svn: 360851

5 years agoGlobalISel: Add G_FCOPYSIGN
Matt Arsenault [Thu, 16 May 2019 04:08:39 +0000 (04:08 +0000)]
GlobalISel: Add G_FCOPYSIGN

llvm-svn: 360850

5 years agoFix missing const
Matt Arsenault [Thu, 16 May 2019 04:08:25 +0000 (04:08 +0000)]
Fix missing const

llvm-svn: 360849

5 years ago[libFuzzer] Increase merge-sigusr sleep after sending signal.
Matt Morehouse [Thu, 16 May 2019 04:00:41 +0000 (04:00 +0000)]
[libFuzzer] Increase merge-sigusr sleep after sending signal.

Test is flaky on buildbot at least partially due to the fuzz target not
exiting before we read its output.

llvm-svn: 360848

5 years agoPemove SymbolTable::addBitcode as it is redundant.
Rui Ueyama [Thu, 16 May 2019 03:54:50 +0000 (03:54 +0000)]
Pemove SymbolTable::addBitcode as it is redundant.

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

llvm-svn: 360846

5 years agoConsistently return `Symbol *` from SymbolTable's add-family functions.
Rui Ueyama [Thu, 16 May 2019 03:54:41 +0000 (03:54 +0000)]
Consistently return `Symbol *` from SymbolTable's add-family functions.

llvm-svn: 360845

5 years agoDe-template parseFile() and SymbolTable's add-family functions.
Rui Ueyama [Thu, 16 May 2019 03:45:13 +0000 (03:45 +0000)]
De-template parseFile() and SymbolTable's add-family functions.

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

llvm-svn: 360844

5 years agoFix prof branch_weights in entry_counts_missing_dbginfo.ll test
Yevgeny Rouban [Thu, 16 May 2019 03:39:09 +0000 (03:39 +0000)]
Fix prof branch_weights in entry_counts_missing_dbginfo.ll test

Removed extra parameter from !prof branch_weights metadata of
a call instruction according to the spec.

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

llvm-svn: 360843

5 years agoRevert r360833 until I can work out the issue with Win32 bots
Kristina Brooks [Thu, 16 May 2019 03:30:08 +0000 (03:30 +0000)]
Revert r360833 until I can work out the issue with Win32 bots

This reverts "r360833: [Clang][PP] Add the __FILE_NAME__ builtin macro."

The tests are failing on Windows bots, reverting the patchset until I can
work out why.

llvm-svn: 360842

5 years agoIntroduce CommonSymbol.
Rui Ueyama [Thu, 16 May 2019 03:29:03 +0000 (03:29 +0000)]
Introduce CommonSymbol.

Previously, we handled common symbols as a kind of Defined symbol,
but what we were doing for common symbols is pretty different from
regular defined symbols.

Common symbol and defined symbol are probably as different as shared
symbol and defined symbols are different.

This patch introduces CommonSymbol to represent common symbols.
After symbols are resolved, they are converted to Defined symbols
residing in a .bss section.

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

llvm-svn: 360841

5 years ago[libFuzzer] Also kill parent process in merge-siguser.test.
Matt Morehouse [Thu, 16 May 2019 03:04:44 +0000 (03:04 +0000)]
[libFuzzer] Also kill parent process in merge-siguser.test.

llvm-svn: 360840

5 years agoFix assumption about Win32 paths in r360833
Kristina Brooks [Thu, 16 May 2019 02:46:12 +0000 (02:46 +0000)]
Fix assumption about Win32 paths in r360833

Attempt to fix Windows buildbots due to differences in
path handling (caused by r360833).

llvm-svn: 360839

5 years agoSimplify SymbolTable::add{Defined,Undefined,...} functions.
Rui Ueyama [Thu, 16 May 2019 02:14:00 +0000 (02:14 +0000)]
Simplify SymbolTable::add{Defined,Undefined,...} functions.

SymbolTable's add-family functions have lots of parameters because
when they have to create a new symbol, they forward given arguments
to Symbol's constructors. Therefore, the functions take at least as
many arguments as their corresponding constructors.

This patch simplifies the add-family functions. Now, the functions
take a symbol instead of arguments to construct a symbol. If there's
no existing symbol, a given symbol is memcpy'ed to the symbol table.
Otherwise, the functions attempt to merge the existing and a given
new symbol.

I also eliminated `CanOmitFromDynSym` parameter, so that the functions
take really one argument.

Symbol classes are trivially constructible, so looks like constructing
them to pass to add-family functions is as cheap as passing a lot of
arguments to the functions. A quick benchmark showed that this patch
seems performance-neutral.

This is a preparation for
http://lists.llvm.org/pipermail/llvm-dev/2019-April/131902.html

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

llvm-svn: 360838

5 years agoFix regression in r360311 caused by reversed bool arguments.
Richard Smith [Thu, 16 May 2019 02:06:16 +0000 (02:06 +0000)]
Fix regression in r360311 caused by reversed bool arguments.

llvm-svn: 360837

5 years ago[libFuzzer] Fix typo in merge-sigusr.test.
Matt Morehouse [Thu, 16 May 2019 01:56:11 +0000 (01:56 +0000)]
[libFuzzer] Fix typo in merge-sigusr.test.

llvm-svn: 360836

5 years ago[libFuzzer] Use PID to send signals rather than process name.
Matt Morehouse [Thu, 16 May 2019 01:32:39 +0000 (01:32 +0000)]
[libFuzzer] Use PID to send signals rather than process name.

pkill reads the process name as a pattern, not a raw name.  This means
that if the process name contains + or other regex characters, pkill
fails.

llvm-svn: 360835

5 years agoFix typo in comment of CSAction -> Action.
Eric Christopher [Thu, 16 May 2019 01:07:54 +0000 (01:07 +0000)]
Fix typo in comment of CSAction -> Action.

llvm-svn: 360834

5 years ago[Clang][PP] Add the __FILE_NAME__ builtin macro.
Kristina Brooks [Thu, 16 May 2019 00:52:41 +0000 (00:52 +0000)]
[Clang][PP] Add the __FILE_NAME__ builtin macro.

This patch adds the `__FILE_NAME__` macro that expands to the
last component of the path, similar to `__FILE__` except with
a guarantee that only the last path component (without the
separator) will be rendered.

I intend to follow through with discussion of this with WG14
as a potential inclusion in the C standard or failing that,
try to discuss this with GCC developers since this extension
is desired by GCC and Clang users/developers alike.

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

llvm-svn: 360833

5 years ago[ELF] Fix typo in header guard. NFC.
Sam Clegg [Thu, 16 May 2019 00:45:50 +0000 (00:45 +0000)]
[ELF] Fix typo in header guard. NFC.

llvm-svn: 360832

5 years ago[ORC] Modify DenseMap hashing for SymbolStringPtrs.
Lang Hames [Thu, 16 May 2019 00:21:10 +0000 (00:21 +0000)]
[ORC] Modify DenseMap hashing for SymbolStringPtrs.

Modifies the DenseMapInfo<SymbolStringPtr>::getHashValue method to take its
argument by const-ref rather than by value (to avoid unnecessary ref-counting
operations) and to defer to DenseMapInfo<void*> for the hash value computation
(since SymbolStringPtrs are just pointers under the hood).

llvm-svn: 360831

5 years ago[JITLink][MachO] Use getSymbol64TableEntry for 64-bit MachO files.
Lang Hames [Thu, 16 May 2019 00:21:07 +0000 (00:21 +0000)]
[JITLink][MachO] Use getSymbol64TableEntry for 64-bit MachO files.

Fixes a think-o. No test case: The nlist and nlist64 data structures happen to
line up for this field, so there's no way to construct a failing test case.

llvm-svn: 360830

5 years agoFix GN build
Vitaly Buka [Thu, 16 May 2019 00:19:37 +0000 (00:19 +0000)]
Fix GN build

llvm-svn: 360829

5 years agoMake tentative parsing to detect template-argument-lists less aggressive
Richard Smith [Wed, 15 May 2019 23:36:14 +0000 (23:36 +0000)]
Make tentative parsing to detect template-argument-lists less aggressive
(and less wrong).

It's not correct to assume that X<something, Type> is always a
template-id; there are a few cases where the comma takes us into a
non-expression syntactic context in which 'Type' might be permissible.
Stop doing that.

This slightly regresses our error recovery on the cases where the
construct is intended to be a template-id. We typically do still manage
to diagnose a missing 'template' keyword, but we realize this too late
to properly recover from the error.

This fixes a regression introduced by r360308.

llvm-svn: 360827

5 years ago[mips] Always use _LARGEFILE_SOURCE / _FILE_OFFSET_BITS for building MIPS 32-bit
Simon Atanasyan [Wed, 15 May 2019 22:27:19 +0000 (22:27 +0000)]
[mips] Always use _LARGEFILE_SOURCE / _FILE_OFFSET_BITS for building MIPS 32-bit

When MIPS 32-bit compiler-rt is building on 32-bit host or using 32-bit
`DLLVM_HOST_TRIPLE` the `_LARGEFILE_SOURCE` and the `_FILE_OFFSET_BITS=64`
macros defined by statements from the `HandleLLVMOptions.cmake`. In case
of building 32-bit libraries on 64-bit host using default host triple
these macros are not defined. As a result assertions check a consistency
between the `struct_kernel_stat_sz` constant and the `struct_kernel_stat_sz`
start to fail.

To resolve this problem and enable building both 32/64-bit versions
of MIPS compiler-rt libraries on 64-bit host at once always explicitly
define the `_LARGEFILE_SOURCE` and the `_FILE_OFFSET_BITS=64` macros
for MIPS 32-bit.

llvm-svn: 360825

5 years ago[libFuzzer] Echo fuzzer output on sigusr tests.
Matt Morehouse [Wed, 15 May 2019 22:26:48 +0000 (22:26 +0000)]
[libFuzzer] Echo fuzzer output on sigusr tests.

Improves debuggability when the fuzz target crashes.

llvm-svn: 360824

5 years ago[X86] Delay creating index register negations during address matching until after...
Craig Topper [Wed, 15 May 2019 21:59:53 +0000 (21:59 +0000)]
[X86] Delay creating index register negations during address matching until after we know for sure the match will succeed

If we're trying to match an LEA, its possible the LEA match will be deemed unprofitable. In which case the negation we created in matchAddress would be left dangling in the SelectionDAG. This could artificially increase use counts for other nodes in the DAG. Though I don't have an example of that. But it just seems like bad form to have dangling nodes in isel.

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

llvm-svn: 360823

5 years agoUpdate LLDB license on the LLDB home page to Apache+LLVM.
Adrian Prantl [Wed, 15 May 2019 21:58:43 +0000 (21:58 +0000)]
Update LLDB license on the LLDB home page to Apache+LLVM.

llvm-svn: 360822

5 years agoGet back the navigation sidebar on the LLDB website.
Adrian Prantl [Wed, 15 May 2019 21:49:00 +0000 (21:49 +0000)]
Get back the navigation sidebar on the LLDB website.

This returns the look & feel of the Sphinx-generated LLDB website to
the original pre-Sphinx layout.

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

llvm-svn: 360819

5 years ago[codeview] Fix SDNode representation of annotation labels
Reid Kleckner [Wed, 15 May 2019 21:46:05 +0000 (21:46 +0000)]
[codeview] Fix SDNode representation of annotation labels

Before this change, they were erroneously constructed with the EH_LABEL
SDNode opcode, which caused other passes to interact with them in
incorrect ways. See the FIXME about fastisel that this addresses in the
existing test case.

Fixes PR41890

llvm-svn: 360818

5 years ago[mips] Use range-based `for` loops. NFC
Simon Atanasyan [Wed, 15 May 2019 21:26:25 +0000 (21:26 +0000)]
[mips] Use range-based `for` loops. NFC

llvm-svn: 360817

5 years ago[AArch64] only indicate CFI on Windows if we emitted CFI
Mandeep Singh Grang [Wed, 15 May 2019 21:23:41 +0000 (21:23 +0000)]
[AArch64] only indicate CFI on Windows if we emitted CFI

Summary:
Otherwise, we emit directives for CFI without any actual CFI opcodes to
go with them, which causes tools to malfunction.  The technique is
similar to what the x86 backend already does.

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

Patch by: froydnj (Nathan Froyd)

Reviewers: mstorsjo, eli.friedman, rnk, mgrang, ssijaric

Reviewed By: rnk

Subscribers: javed.absar, kristof.beyls, llvm-commits, dmajor

Tags: #llvm

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

llvm-svn: 360816

5 years ago[X86] Strengthen type constraints on some specialized X86 ISD opcodes that don't...
Craig Topper [Wed, 15 May 2019 21:16:28 +0000 (21:16 +0000)]
[X86] Strengthen type constraints on some specialized X86 ISD opcodes that don't have any flexibility. NFC

These particular instructions only operate on 128-bit vectors and have no wider equivalents. And the
element size is always known.

One could argue that MOVSS/MOVSD could be merged, but that's probably disruptive to code in
X86ISelLowering and probably low value.

llvm-svn: 360815

5 years ago[NFC][InstCombine] Add some more tests for pulling binops through shifts
Roman Lebedev [Wed, 15 May 2019 21:15:44 +0000 (21:15 +0000)]
[NFC][InstCombine] Add some more tests for pulling binops through shifts

The ashr variant may see relaxation in https://reviews.llvm.org/D61938

llvm-svn: 360814

5 years ago[codeview] Finish support for reading and writing S_ANNOTATION records
Reid Kleckner [Wed, 15 May 2019 20:53:39 +0000 (20:53 +0000)]
[codeview] Finish support for reading and writing S_ANNOTATION records

Implement dumping via llvm-pdbutil and llvm-readobj.

llvm-svn: 360813

5 years agoRevert llvm-svn: 360807
Cameron McInally [Wed, 15 May 2019 20:48:50 +0000 (20:48 +0000)]
Revert llvm-svn: 360807

Somehow submitted this patch twice.

llvm-svn: 360812

5 years ago[clang-format] Fixed self assignment
David Bolvansky [Wed, 15 May 2019 20:29:33 +0000 (20:29 +0000)]
[clang-format] Fixed self assignment

Reviewers: MyDeveloperDay, RKSimon

Reviewed By: MyDeveloperDay

Subscribers: RKSimon, cfe-commits

Tags: #clang

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

llvm-svn: 360810

5 years ago[OpenMP][Bugfix] Move double and float versions of abs under c++ macro
Gheorghe-Teodor Bercea [Wed, 15 May 2019 20:28:23 +0000 (20:28 +0000)]
[OpenMP][Bugfix] Move double and float versions of abs under c++ macro

Summary:
This is a fix for the reported bug:

[[ https://bugs.llvm.org/show_bug.cgi?id=41861 | 41861 ]]

abs functions need to be moved under the c++ macro to avoid conflicts with included headers.

Reviewers: tra, jdoerfert, hfinkel, ABataev, caomhin

Reviewed By: jdoerfert

Subscribers: guansong, cfe-commits

Tags: #clang

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

llvm-svn: 360809

5 years agoPre-commit unary fneg tests to InstSimplify
Cameron McInally [Wed, 15 May 2019 20:27:37 +0000 (20:27 +0000)]
Pre-commit unary fneg tests to InstSimplify

llvm-svn: 360808

5 years agoAdd unary fneg to InstSimplify/fp-nan.ll
Cameron McInally [Wed, 15 May 2019 20:27:35 +0000 (20:27 +0000)]
Add unary fneg to InstSimplify/fp-nan.ll

llvm-svn: 360807

5 years ago[c++20] For P1327R1: support dynamic_cast in constant expression
Richard Smith [Wed, 15 May 2019 20:22:21 +0000 (20:22 +0000)]
[c++20] For P1327R1: support dynamic_cast in constant expression
evaluation.

llvm-svn: 360806

5 years agoRevert "[analyzer] Add a test for plugins using checker dependencies"
Kristof Umann [Wed, 15 May 2019 20:19:51 +0000 (20:19 +0000)]
Revert "[analyzer] Add a test for plugins using checker dependencies"

Buildbots don't seem to find the new plugin.

llvm-svn: 360805

5 years ago[OpenMP][bugfix] Fix issues with C++ 17 compilation when handling math functions
Gheorghe-Teodor Bercea [Wed, 15 May 2019 20:18:21 +0000 (20:18 +0000)]
[OpenMP][bugfix] Fix issues with C++ 17 compilation when handling math functions

Summary: In OpenMP device offloading we must ensure that unde C++ 17, the inclusion of cstdlib will works correctly.

Reviewers: ABataev, tra, jdoerfert, hfinkel, caomhin

Reviewed By: jdoerfert

Subscribers: Hahnfeld, guansong, cfe-commits

Tags: #clang

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

llvm-svn: 360804

5 years ago[CodeGenObjC] invoke objc_autorelease, objc_retain when necessary
Erik Pilkington [Wed, 15 May 2019 20:15:01 +0000 (20:15 +0000)]
[CodeGenObjC] invoke objc_autorelease, objc_retain when necessary

Any of these methods can be overridden, so we need to invoke these functions.

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

llvm-svn: 360802

5 years ago[lldb] [test] Skip one more TestMiBreak on NetBSD
Michal Gorny [Wed, 15 May 2019 20:03:31 +0000 (20:03 +0000)]
[lldb] [test] Skip one more TestMiBreak on NetBSD

llvm-svn: 360800

5 years ago[analyzer] Add a test for plugins using checker dependencies
Kristof Umann [Wed, 15 May 2019 19:47:26 +0000 (19:47 +0000)]
[analyzer] Add a test for plugins using checker dependencies

Also, I moved the existing analyzer plugin to test/ as well, in order not to
give the illusion that the analyzer supports plugins -- it's capable of handling
them, but does not _support_ them.

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

llvm-svn: 360799

5 years agoUncomment LLVM_FALLTHROUGH.
Pete Couperus [Wed, 15 May 2019 19:46:17 +0000 (19:46 +0000)]
Uncomment LLVM_FALLTHROUGH.

llvm-svn: 360798

5 years agoAdd unary fneg to InstSimplify/fp-nan.ll
Cameron McInally [Wed, 15 May 2019 19:37:03 +0000 (19:37 +0000)]
Add unary fneg to InstSimplify/fp-nan.ll

llvm-svn: 360797

5 years ago[PredicateInfo] Do not process unreachable operands.
Taewook Oh [Wed, 15 May 2019 19:35:38 +0000 (19:35 +0000)]
[PredicateInfo] Do not process unreachable operands.

Summary: We should excluded unreachable operands from processing as their DFS visitation order is undefined. When `renameUses` function sorts `OpsToRename` (https://fburl.com/d2wubn60), the comparator assumes that the parent block of the operand has a corresponding dominator tree node. This is not the case for unreachable operands and crashes the compiler.

Reviewers: dberlin, mgrang, davide

Subscribers: efriedma, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 360796

5 years agoPermit cross-CU references
Jan Kratochvil [Wed, 15 May 2019 19:22:33 +0000 (19:22 +0000)]
Permit cross-CU references

So far dw_offset_t was global for the whole SymbolFileDWARF but with
.debug_types the same dw_offset_t may mean two different things depending on
its section (=CU). So references now return whole new referenced DWARFDIE
instead of just dw_offset_t.

This means that some functions have to now handle 16 bytes instead of 8 bytes
but I do not see that anywhere performance critical.

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

llvm-svn: 360795

5 years ago[lld] Remove 2>&1 from --trace-symbol tests
Sam Clegg [Wed, 15 May 2019 19:01:51 +0000 (19:01 +0000)]
[lld] Remove 2>&1 from --trace-symbol tests

The tracing goes to stdout so this is not needed.

Also remove the "not" from the final check in ELF/trace-symbols.s.
According the comment the check is that we don't crash, so we should
be checking for success here. Previously this step is error'ing with
undefined symbols because it didn't include all the needed objects.

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

llvm-svn: 360794

5 years ago[analyzer] RetainCount: Fix os_returns_retained_on_zero with weird return types.
Artem Dergachev [Wed, 15 May 2019 18:41:32 +0000 (18:41 +0000)]
[analyzer] RetainCount: Fix os_returns_retained_on_zero with weird return types.

The checker was crashing when it was trying to assume a structure
to be null or non-null so that to evaluate the effect of the annotation.

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

llvm-svn: 360790

5 years ago[MachineOperand] Add a ChangeToGA method
Nicolai Haehnle [Wed, 15 May 2019 17:48:10 +0000 (17:48 +0000)]
[MachineOperand] Add a ChangeToGA method

Summary:
Analogous to the other ChangeToXXX methods. See the next patch for a
use case.

Change-Id: I6548d614706834fb9109ab3c8fe915e9c6ece2a7

Reviewers: arsenm, kzhuravl

Subscribers: wdng, llvm-commits

Tags: #llvm

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

llvm-svn: 360789

5 years ago[clang-tidy] Recommit r360785 "modernize-loop-convert: impl const cast iter" with...
Don Hinton [Wed, 15 May 2019 17:47:51 +0000 (17:47 +0000)]
[clang-tidy] Recommit r360785 "modernize-loop-convert: impl const cast iter" with correct attribution

Summary:
modernize-loop-convert was not detecting implicit casts to
const_iterator as convertible to range-based loops:

    std::vector<int> vec{1,2,3,4}
    for(std::vector<int>::const_iterator i = vec.begin();
        i != vec.end();
        ++i) { }

Thanks to Don Hinton for advice.

As well, this change adds a note for this check's applicability to code
targeting OpenMP prior version 5 as this check will continue breaking
compilation with `-fopenmp`. Thanks to Roman Lebedev for pointing this
out.

Fixes PR#35082

Patch by Torbjörn Klatt!

Reviewed By: hintonda

Tags: #clang-tools-extra, #clang

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

llvm-svn: 360788

5 years agoRevert [clang-tidy] modernize-loop-convert: impl const cast iter
Don Hinton [Wed, 15 May 2019 17:36:54 +0000 (17:36 +0000)]
Revert [clang-tidy] modernize-loop-convert: impl const cast iter

This reverts r360785 (git commit 42d28be802fe5beab18bc1a27f89894c0a290d44)

llvm-svn: 360787

5 years agoRegAlloc: try to fail more gracefully when out of registers
Nicolai Haehnle [Wed, 15 May 2019 17:29:58 +0000 (17:29 +0000)]
RegAlloc: try to fail more gracefully when out of registers

Summary:
The emitError path allows the program to continue, unlike report_fatal_error.
This is friendlier to use cases where LLVM is embedded in a larger program,
because the caller may be able to deal with the error somewhat gracefully.

Change the number of requested NOP bytes in the AArch64 and PowerPC
test cases to avoid triggering an unrelated assertion. The compilation
still fails, as verified by the test.

Change-Id: Iafb9ca341002a597b82e59ddc7a1f13c78758e3d

Reviewers: arsenm, MatzeB

Subscribers: qcolombet, nemanjai, wdng, javed.absar, kristof.beyls, kbarton, jsji, llvm-commits

Tags: #llvm

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

llvm-svn: 360786

5 years ago[clang-tidy] modernize-loop-convert: impl const cast iter
Don Hinton [Wed, 15 May 2019 16:58:58 +0000 (16:58 +0000)]
[clang-tidy] modernize-loop-convert: impl const cast iter

Summary:
modernize-loop-convert was not detecting implicit casts to
const_iterator as convertible to range-based loops:

    std::vector<int> vec{1,2,3,4}
    for(std::vector<int>::const_iterator i = vec.begin();
        i != vec.end();
        ++i) { }

Thanks to Don Hinton for advice.

As well, this change adds a note for this check's applicability to code
targeting OpenMP prior to version 5 as this check will continue breaking
compilation with `-fopenmp`. Thanks to Roman Lebedev for pointing this
out.

Fixes PR#35082

Reviewed By: hintonda

Tags: #clang-tools-extra, #clang

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

llvm-svn: 360785

5 years agoFixed https://bugs.llvm.org/show_bug.cgi?id=41584.
Andrey Churbanov [Wed, 15 May 2019 16:53:45 +0000 (16:53 +0000)]
Fixed https://bugs.llvm.org/show_bug.cgi?id=41584.

Removed unconditional and unsafe decrement of counter
of active threads in pool at shutdown time.

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

llvm-svn: 360784

5 years agoTest commit
Kevin Petit [Wed, 15 May 2019 16:39:28 +0000 (16:39 +0000)]
Test commit

Remove stray space.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
llvm-svn: 360783

5 years ago[WebAssembly] LTO: Honor comdat groups when loading bitcode files
Sam Clegg [Wed, 15 May 2019 16:03:28 +0000 (16:03 +0000)]
[WebAssembly] LTO: Honor comdat groups when loading bitcode files

But don't apply comdat groups when loading the LTO object files.
This is basically the same logic used by the ELF linker.

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

llvm-svn: 360782

5 years ago[FileCheck] Fix sphinx error: Make input be gas block
Thomas Preud'homme [Wed, 15 May 2019 15:20:45 +0000 (15:20 +0000)]
[FileCheck] Fix sphinx error: Make input be gas block

Summary:
Change example of input text from being llvm block to being gas block
since that text is made-up assembly.

Reviewers: jhenderson, jdenny, probinson, arichardson

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 360781

5 years ago[JumpThreading] A bug fix for stale loop info after unfold select
Hiroshi Yamauchi [Wed, 15 May 2019 15:15:16 +0000 (15:15 +0000)]
[JumpThreading] A bug fix for stale loop info after unfold select

Summary:
The return value of a TryToUnfoldSelect call was not checked, which led to an
incorrectly preserved loop info and some crash.

The original crash was reported on https://reviews.llvm.org/D59514.

Reviewers: davidxl, amehsan

Reviewed By: davidxl

Subscribers: fhahn, brzycki, llvm-commits

Tags: #llvm

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

llvm-svn: 360780

5 years ago[clang-tidy] new check: bugprone-branch-clone
Kristof Umann [Wed, 15 May 2019 15:06:25 +0000 (15:06 +0000)]
[clang-tidy] new check: bugprone-branch-clone

Implement a check for detecting if/else if/else chains where two or more
branches are Type I clones of each other (that is, they contain identical code)
and for detecting switch statements where two or more consecutive branches are
Type I clones of each other.

Patch by Donát Nagy!

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

llvm-svn: 360779

5 years ago[AMDGPU] Increases available SGPR for Calling Convention
Ryan Taylor [Wed, 15 May 2019 14:43:55 +0000 (14:43 +0000)]
[AMDGPU] Increases available SGPR for Calling Convention

Summary:
SGPR in CC can be either hw initialized or set by other chained shaders
and so this increases the SGPR count availalbe to CC to 105.

Change-Id: I3dfadc750fe4a3e2bd07117a2899fd13f3e2fef3

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

llvm-svn: 360778

5 years agoTeach InstSimplify -X + X --> 0.0 about unary FNeg
Cameron McInally [Wed, 15 May 2019 14:31:33 +0000 (14:31 +0000)]
Teach InstSimplify -X + X --> 0.0 about unary FNeg

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

llvm-svn: 360777

5 years agoRevert r360771 "[MergeICmps] Simplify the code."
Clement Courbet [Wed, 15 May 2019 14:21:59 +0000 (14:21 +0000)]
Revert r360771 "[MergeICmps] Simplify the code."

Breaks a bunch of builbdots.

llvm-svn: 360776

5 years ago[MergeICmps] Fix r360771.
Clement Courbet [Wed, 15 May 2019 14:00:45 +0000 (14:00 +0000)]
[MergeICmps] Fix r360771.

Twine references a StringRef by reference, not value...

llvm-svn: 360775

5 years agoIntroduce new OpenMP 5.0 depend object type.
Andrey Churbanov [Wed, 15 May 2019 13:45:36 +0000 (13:45 +0000)]
Introduce new OpenMP 5.0 depend object type.

The implementation should be done by compiler, user can only declare
objects of this type and use them in OpenMP directives.

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

llvm-svn: 360774

5 years agoRevert "[Salvage] Change salvage debug info implementation to use DW_OP_LLVM_convert...
Stephen Tozer [Wed, 15 May 2019 13:41:44 +0000 (13:41 +0000)]
Revert "[Salvage] Change salvage debug info implementation to use DW_OP_LLVM_convert where needed"

This reverts r360772 due to build issues.
Reverted commit: 17dd4d7403770bd683675e45f5517e0cdb8f9b2b.

llvm-svn: 360773

5 years ago[Salvage] Change salvage debug info implementation to use DW_OP_LLVM_convert where...
Stephen Tozer [Wed, 15 May 2019 13:15:48 +0000 (13:15 +0000)]
[Salvage] Change salvage debug info implementation to use DW_OP_LLVM_convert where needed

Fixes issue: https://bugs.llvm.org/show_bug.cgi?id=40645

Previously, LLVM had no functional way of performing casts inside of a
DIExpression(), which made salvaging cast instructions other than Noop
casts impossible. With the recent addition of DW_OP_LLVM_convert this
salvaging is now possible, and so can be used to fix the attached bug as
well as any cases where SExt instruction results are lost in the
debugging metadata. This patch introduces this fix by expanding the
salvage debug info method to cover these cases using the new operator.

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

llvm-svn: 360772

5 years ago[MergeICmps] Simplify the code.
Clement Courbet [Wed, 15 May 2019 13:04:24 +0000 (13:04 +0000)]
[MergeICmps] Simplify the code.

Instead of patching the original blocks, we now generate new blocks and
delete the old blocks. This results in simpler code with a less twisted
control flow (see the change in `entry-block-shuffled.ll`).

This will make https://reviews.llvm.org/D60318 simpler by making it more
obvious where control flow created and deleted.

Reviewers: gchatelet

Subscribers: hiraditya, llvm-commits, spatel

Tags: #llvm

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

llvm-svn: 360771

5 years agoRevert rL360675 : [APFloat] APFloat::Storage::Storage - fix use after move
Simon Pilgrim [Wed, 15 May 2019 13:03:10 +0000 (13:03 +0000)]
Revert rL360675 : [APFloat] APFloat::Storage::Storage - fix use after move

This was mentioned both in https://www.viva64.com/en/b/0629/ and by scan-build checks
........
There's concerns this may just introduce a use-after-free instead.....

llvm-svn: 360770

5 years ago[ARM] Don't use the Machine Scheduler for cortex-m at minsize
David Green [Wed, 15 May 2019 12:58:02 +0000 (12:58 +0000)]
[ARM] Don't use the Machine Scheduler for cortex-m at minsize

The new cortex-m schedule in rL360768 helps performance, but can increase the
amount of high-registers used. This, on average, ends up increasing the
codesize by a fair amount (because less instructions are converted from T2 to
T1). On cortex-m at -Oz, where we are quite size-paranoid, it is better to use
the existing DAG scheduler with the RegPressure scheduling preference (at least
until the issues around T2 vs T1 instructions can be improved).

I have also made sure that the Sched::RegPressure dag scheduler is always
chosen for MinSize.

The test shows one case where we increase the number of registers used.

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

llvm-svn: 360769

5 years ago[ARM] Cortex-M4 schedule
David Green [Wed, 15 May 2019 12:41:58 +0000 (12:41 +0000)]
[ARM] Cortex-M4 schedule

This patch adds a simple Cortex-M4 schedule, renaming the existing M3
schedule to M4 and filling in the latencies as-per the Cortex-M4 TRM:
https://developer.arm.com/docs/ddi0439/latest

Most of these are 1, with the important exception being loads taking 2
cycles. A few others are also higher, but I don't believe they make a
large difference. I've repurposed the M3 schedule as the latencies are
mostly the same between the two cores, with the M4 having more FP and
DSP instructions. We also turn on MISched and UseAA for the cores that
now use this.

It also adds some schedule Write's to various instruction to make things
simpler.

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

llvm-svn: 360768

5 years ago[lldb] [test] Mark frequently failing flaky tests skipped on NetBSD
Michal Gorny [Wed, 15 May 2019 12:13:20 +0000 (12:13 +0000)]
[lldb] [test] Mark frequently failing flaky tests skipped on NetBSD

llvm-svn: 360767

5 years agogn build: Merge r360671
Nico Weber [Wed, 15 May 2019 12:08:45 +0000 (12:08 +0000)]
gn build: Merge r360671

llvm-svn: 360766

5 years ago[mips] LLVM and GAS now use same instructions for CFA Definition. NFCI
Simon Atanasyan [Wed, 15 May 2019 12:05:27 +0000 (12:05 +0000)]
[mips] LLVM and GAS now use same instructions for CFA Definition. NFCI

LLVM previously used `DW_CFA_def_cfa` instruction in .eh_frame to set
the register and offset for current CFA rule. We change it to
`DW_CFA_def_cfa_register` which is the same one used by GAS that only
changes the register but keeping the old offset.

Patch by Mirko Brkusanin.

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

llvm-svn: 360765