platform/upstream/llvm.git
4 years ago[OPENMP]Use new interface for task reduction.
Alexey Bataev [Thu, 23 Apr 2020 17:27:03 +0000 (13:27 -0400)]
[OPENMP]Use new interface for task reduction.

Summary:
Patch forces codegen to use the new runtime functions for task reductions where
the issue with passing the address of the original variables to the UDR
initializers is fixed. Also, this patch is required for upcoming
support of task modifier inreduction clause.

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, cfe-commits, caomhin

Tags: #clang

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

4 years ago[mlir][drr] NFC: avoid SmallVector when collecting substitution values
Lei Zhang [Thu, 23 Apr 2020 22:28:22 +0000 (18:28 -0400)]
[mlir][drr] NFC: avoid SmallVector when collecting substitution values

Now both Operation::operand_range and Operation::result_range have
.begin() and .end() for ranged-based for loop and we have
ValueRange for wrapping a single Value. We can remove the SmallVector
materialization!

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

4 years ago[Debuginfo] Remove redundand variable from getAttributeValue()
Alexey Lapshin [Wed, 22 Apr 2020 21:05:56 +0000 (00:05 +0300)]
[Debuginfo] Remove redundand variable from getAttributeValue()

Summary: AttrIndex could be removed from DWARFAbbreviationDeclaration::getAttributeValue.

Reviewers: clayborg, dblaikie

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

4 years ago[SveEmitter] Add builtins for compares and ReverseCompare flag.
Sander de Smalen [Fri, 24 Apr 2020 10:31:34 +0000 (11:31 +0100)]
[SveEmitter] Add builtins for compares and ReverseCompare flag.

The IsReverseCompare flag tells CGBuiltin to swap the operands,
so that a LT/LE intrinsics can be expressed in terms of GE/GT
intrinsics.

This patch also adds builtins for the wide-variants of the compares.

Reviewers: SjoerdMeijer, efriedma, ctetreau

Reviewed By: efriedma

Tags: #clang

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

4 years ago[gn build] (manually) merge 8f766e382b77eef in a minimal way
Nico Weber [Fri, 24 Apr 2020 13:32:10 +0000 (09:32 -0400)]
[gn build] (manually) merge 8f766e382b77eef in a minimal way

4 years agoARCRuntimeEntryPoints.h - remove unnecessary includes. NFC.
Simon Pilgrim [Fri, 24 Apr 2020 13:16:31 +0000 (14:16 +0100)]
ARCRuntimeEntryPoints.h - remove unnecessary includes. NFC.

4 years ago[LLD][ELF][ARM] recommit Fix ARM Exidx order for non monotonic section order
Peter Smith [Fri, 24 Apr 2020 10:23:23 +0000 (11:23 +0100)]
[LLD][ELF][ARM] recommit Fix ARM Exidx order for non monotonic section order

Fixed error detected by msan. The size field of the .ARM.exidx synthetic
section needs to be initialized to at least estimation level before
calling assignAddresses as that will use the size field.

This was previously reverted in 1ca16fc4f5146b90512d4740cfcc4d4c34640853.

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

4 years agoFix minor bug in CommonArgs.cpp
Yaxun (Sam) Liu [Fri, 24 Apr 2020 12:46:27 +0000 (08:46 -0400)]
Fix minor bug in CommonArgs.cpp

Change-Id: Ibe87b1633cc7516479bb08bf51b6860a1585a94f

4 years agoLLVMContextImpl.h - remove defunct getOrAddScope* helpers declarations. NFC.
Simon Pilgrim [Fri, 24 Apr 2020 12:27:42 +0000 (13:27 +0100)]
LLVMContextImpl.h - remove defunct getOrAddScope* helpers declarations. NFC.
The implementation and uses were removed back at rL223802 (IR: Split Metadata from Value) but these were missed.

4 years agoLLVMContextImpl.h - cleanup includes and forward declarations. NFC.
Simon Pilgrim [Fri, 24 Apr 2020 12:07:02 +0000 (13:07 +0100)]
LLVMContextImpl.h - cleanup includes and forward declarations. NFC.
Reduce StringRef.h include to forward declaration.
Remove unnecessary ConstantFP/ConstantInt forward declarations as we have to include Constants.h

4 years agoFileCheckImpl.h - remove unnecessary FileCheckDiag forward declaration. NFC.
Simon Pilgrim [Fri, 24 Apr 2020 11:49:12 +0000 (12:49 +0100)]
FileCheckImpl.h - remove unnecessary FileCheckDiag forward declaration. NFC.

4 years agoSIRegisterInfo.h - remove unnecessary MachineRegisterInfo forward declaration. NFC.
Simon Pilgrim [Fri, 24 Apr 2020 11:43:46 +0000 (12:43 +0100)]
SIRegisterInfo.h - remove unnecessary MachineRegisterInfo forward declaration. NFC.
We already need to include MachineRegisterInfo.h

4 years agoLLLexer.h - reduce SourceMgr.h include to SMLoc.h. NFC
Simon Pilgrim [Fri, 24 Apr 2020 11:37:25 +0000 (12:37 +0100)]
LLLexer.h - reduce SourceMgr.h include to SMLoc.h. NFC
We only need the SMLoc definition and the SourceMgr forward declaration.

4 years agoHexagonShuffler.h - remove duplicate STLExtras.h include. NFC.
Simon Pilgrim [Fri, 24 Apr 2020 11:35:59 +0000 (12:35 +0100)]
HexagonShuffler.h - remove duplicate STLExtras.h include. NFC.

4 years ago[clangd] NFC: Omit deduced template parameters
Kirill Bobyrev [Fri, 24 Apr 2020 12:26:35 +0000 (14:26 +0200)]
[clangd] NFC: Omit deduced template parameters

Related revision: D78521

4 years ago[obj2yaml] - Program headers: simplify the computation of p_filesz.
Georgii Rymar [Wed, 22 Apr 2020 11:00:33 +0000 (14:00 +0300)]
[obj2yaml] - Program headers: simplify the computation of p_filesz.

Currently we have computations of `p_filesz` and `p_memsz` mixed together
with the use of a loop over fragments. After recent changes it is possible to
avoid using a loop for the computation of `p_filesz`, since we know that fragments
are sorted by their file offsets.

The main benefit of this change is that splits the computation of `p_filesz`
and `p_memsz` what is simpler and allows us to fix the computation of the
`p_memsz` independently (D78005 shows the issue that we have currently).

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

4 years ago[clangd] Fix build when CLANGD_REMOTE is not enabled
Kirill Bobyrev [Fri, 24 Apr 2020 12:07:03 +0000 (14:07 +0200)]
[clangd] Fix build when CLANGD_REMOTE is not enabled

4 years ago[mlir] Add missing llvm::iterator_facade_base<...>::operator++ for
Haojian Wu [Fri, 24 Apr 2020 12:02:58 +0000 (14:02 +0200)]
[mlir] Add missing llvm::iterator_facade_base<...>::operator++ for
UseIterator;

This would fix our internal build.

4 years ago[clangd] Extend dexp to support remote index
Kirill Bobyrev [Fri, 24 Apr 2020 11:46:45 +0000 (13:46 +0200)]
[clangd] Extend dexp to support remote index

Summary:
* Merge clangd-remote-client into dexp
* Implement `clangd::remote::IndexClient` that is derived from `SymbolIndex`
* Upgrade remote mode-related CMake infrastructure

Reviewers: sammccall

Reviewed By: sammccall

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

Tags: #clang

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

4 years ago[AMDGPU] Skip generating cache invalidating instructions on AMDPAL
Piotr Sobczak [Fri, 24 Apr 2020 07:56:41 +0000 (09:56 +0200)]
[AMDGPU] Skip generating cache invalidating instructions on AMDPAL

Summary:
Frontend guarantees that coherent accesses have
corresponding cache policy bits set (glc, dlc).
Therefore there is no need for extra instructions
that invalidate cache.

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

Tags: #llvm

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

4 years ago[ADT] Move allocate_buffer to MemAlloc.h and out of line
Benjamin Kramer [Fri, 24 Apr 2020 11:22:40 +0000 (13:22 +0200)]
[ADT] Move allocate_buffer to MemAlloc.h and out of line

There's an ABI breakage here if LLVM is compiled in C++14 without
aligned allocation and a user tries to use the result with aligned
allocation. If DenseMap or unique_function is used across that ABI
boundary it will break (PR45413). Moving it out of line is a bit of
a band-aid and LLVM doesn't really give ABI guarantees at this level,
but given the number of complaints I've received over this it still
seems worth fixing.

4 years agoPassAnalysisSupport.h - reduce StringRef.h include to forward declaration. NFC.
Simon Pilgrim [Fri, 24 Apr 2020 11:13:28 +0000 (12:13 +0100)]
PassAnalysisSupport.h - reduce StringRef.h include to forward declaration. NFC.

4 years ago[ARM] Various tests for MVE and FP16 codegen. NFC
David Green [Thu, 23 Apr 2020 20:58:00 +0000 (21:58 +0100)]
[ARM] Various tests for MVE and FP16 codegen. NFC

4 years ago[libc++] Improve the detection of whether the blocks runtime is available
Louis Dionne [Thu, 23 Apr 2020 20:47:52 +0000 (16:47 -0400)]
[libc++] Improve the detection of whether the blocks runtime is available

The runtime for Blocks may not be available even though the Blocks
language extension _is_ available. Instead of potentially failing,
this commit is much more conservative and assumes the runtime for
Blocks is only provided on Apple platforms.

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

4 years ago[SVE][CodeGen] Lower SDIV & UDIV to SVE intrinsics
Kerry McLaughlin [Fri, 24 Apr 2020 09:45:25 +0000 (10:45 +0100)]
[SVE][CodeGen] Lower SDIV & UDIV to SVE intrinsics

Summary:
This patch maps IR operations for sdiv & udiv to the
@llvm.aarch64.sve.[s|u]div intrinsics.

A ptrue must be created during lowering as the div instructions
have only a predicated form.

Patch contains changes by Andrzej Warzynski.

Reviewers: sdesmalen, c-rhodes, efriedma, cameron.mcinally, rengolin

Reviewed By: efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, andwar, cfe-commits, llvm-commits

Tags: #llvm

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

4 years ago[SveEmitter] Add builtins for contiguous prefetches
Sander de Smalen [Fri, 24 Apr 2020 10:31:34 +0000 (11:31 +0100)]
[SveEmitter] Add builtins for contiguous prefetches

This patch also adds the enum `sv_prfop` for the prefetch operation specifier
and checks to ensure the passed enum values are valid.

Reviewers: SjoerdMeijer, efriedma, ctetreau

Reviewed By: efriedma

Tags: #clang

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

4 years ago[LoopVectorize] Preserve CFG analyses if CFG wasn't modified
Max Kazantsev [Fri, 24 Apr 2020 10:02:37 +0000 (17:02 +0700)]
[LoopVectorize] Preserve CFG analyses if CFG wasn't modified

One of transforms the loop vectorizer makes is LCSSA formation. In some cases it
is the only transform it makes. We should not drop CFG analyzes if only LCSSA was
formed and no actual CFG changes was made.

We should think of expanding this logic to other passes as well, and maybe make
it a part of PM framework.

Reviewed By: Florian Hahn
Differential Revision: https://reviews.llvm.org/D78360

4 years ago[SveEmitter] Add builtins for svld1rq
Sander de Smalen [Fri, 24 Apr 2020 10:10:28 +0000 (11:10 +0100)]
[SveEmitter] Add builtins for svld1rq

Reviewed By: efriedma

Tags: #clang

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

4 years ago[SveEmitter] Add builtins for scatter stores
Sander de Smalen [Fri, 24 Apr 2020 09:57:10 +0000 (10:57 +0100)]
[SveEmitter] Add builtins for scatter stores

D77735 only added scatters for the non-temporal variants.

Reviewers: SjoerdMeijer, efriedma, andwar

Reviewed By: efriedma

Tags: #clang

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

4 years agoDo not declare compiler extension member as const
serge-sans-paille [Fri, 24 Apr 2020 09:44:42 +0000 (11:44 +0200)]
Do not declare compiler extension member as const

It keeps them default constructible.

4 years ago[clangd] Fix modernize-loop-convert "multiple diag in flight" crash.
Haojian Wu [Thu, 23 Apr 2020 14:20:56 +0000 (16:20 +0200)]
[clangd] Fix modernize-loop-convert "multiple diag in flight" crash.

Summary:
this maybe not ideal, but it is trivial and does fix the crash.

Fixes https://github.com/clangd/clangd/issues/156.

Reviewers: sammccall

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

Tags: #clang

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

4 years ago[MC][mips] Replace setRType## methods by single setRTypes function. NFC
Simon Atanasyan [Fri, 24 Apr 2020 08:54:23 +0000 (11:54 +0300)]
[MC][mips] Replace setRType## methods by single setRTypes function. NFC

MCELFObjectWriter::setRType## methods are always used altogether to
build complete MIPS N64 ABI "chain" of relocations. Using single
function for this task makes code less verbose.

4 years ago[VE] Update floating-point arithmetic instructions
Kazushi (Jam) Marukawa [Fri, 24 Apr 2020 09:11:33 +0000 (11:11 +0200)]
[VE] Update floating-point arithmetic instructions

Summary:
Changing all mnemonic to match assembly instructions to simplify mnemonic
naming rules. This time update all floating-point arithmetic instructions.

Reviewed By: simoll

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

4 years agoFix -Wunused-variable warning, NFC.
Haojian Wu [Fri, 24 Apr 2020 09:03:53 +0000 (11:03 +0200)]
Fix -Wunused-variable warning, NFC.

4 years ago[NFC][PowerPC] Fix the liveins for 3 mir test cases
Kang Zhang [Fri, 24 Apr 2020 08:03:02 +0000 (08:03 +0000)]
[NFC][PowerPC] Fix the liveins for 3 mir test cases

4 years agoRevert "[Attributor][NFC] Encode IRPositions in the bits of a single pointer"
Johannes Doerfert [Fri, 24 Apr 2020 07:53:51 +0000 (02:53 -0500)]
Revert "[Attributor][NFC] Encode IRPositions in the bits of a single pointer"

A dependent patch has been reverted [0]. Until it goes back in this one
has to stay out.

[0] ebdb89399499cfca56fbf98c5f97d892d5976237

This reverts commit d254b50b2b5b22368780c6003c419ffa1e23fa93.

4 years agoUpdate compiler extension integration into the build system
serge-sans-paille [Mon, 20 Apr 2020 10:39:32 +0000 (12:39 +0200)]
Update compiler extension integration into the build system

The approach here is to create a new (empty) component, `Extensions', where all
statically compiled extensions dynamically register their dependencies. That way
we're more natively compatible with LLVMBuild and llvm-config.

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

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

4 years agoRevert "[Attributor][NFC] Let AbstractAttribute be an IRPosition"
Johannes Doerfert [Fri, 24 Apr 2020 07:23:13 +0000 (02:23 -0500)]
Revert "[Attributor][NFC] Let AbstractAttribute be an IRPosition"

It seems this breaks the windows builds:
  http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64/builds/7454/steps/build-llvm-project/logs/stdio

This reverts commit 6782635e90c11a4535e5b08212c8bbd3b3486f8d.

4 years ago[MLIR] Ensure `gpu.func` must be inside a `gpu.module`.
Frederik Gossen [Tue, 21 Apr 2020 10:05:17 +0000 (10:05 +0000)]
[MLIR] Ensure `gpu.func` must be inside a `gpu.module`.

Ensure that `gpu.func` is only used within the dedicated `gpu.module`.
Implement the constraint to the GPU dialect and adopt test cases.

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

4 years ago[Attributor][NFC] Encode IRPositions in the bits of a single pointer
Johannes Doerfert [Fri, 17 Apr 2020 23:03:04 +0000 (18:03 -0500)]
[Attributor][NFC] Encode IRPositions in the bits of a single pointer

This reduces memory consumption for IRPositions by eliminating the
vtable pointer and the `KindOrArgNo` integer. Since each abstract
attribute has an associated IRPosition, the 12-16 bytes we save add up
quickly.

No functional change is intended.

---

Single run of the Attributor module and then CGSCC pass (oldPM)
for SPASS/clause.c (~10k LLVM-IR loc):

Before:
```
calls to allocation functions: 469545 (260135/s)
temporary memory allocations: 77137 (42735/s)
peak heap memory consumption: 30.50MB
peak RSS (including heaptrack overhead): 119.50MB
total memory leaked: 269.07KB
```

After:
```
calls to allocation functions: 468999 (274108/s)
temporary memory allocations: 77002 (45004/s)
peak heap memory consumption: 28.83MB
peak RSS (including heaptrack overhead): 118.05MB
total memory leaked: 269.07KB
```

Difference:
```
calls to allocation functions: -546 (5808/s)
temporary memory allocations: -135 (1436/s)
peak heap memory consumption: -1.67MB
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B
```

---

CTMark 15 runs

Metric: compile_time

Program                                        lhs    rhs    diff
 test-suite...:: CTMark/sqlite3/sqlite3.test    25.07  24.09 -3.9%
 test-suite...Mark/mafft/pairlocalalign.test    14.58  14.14 -3.0%
 test-suite...-typeset/consumer-typeset.test    21.78  21.58 -0.9%
 test-suite :: CTMark/SPASS/SPASS.test          21.95  22.03  0.4%
 test-suite :: CTMark/lencod/lencod.test        25.43  25.50  0.3%
 test-suite...ark/tramp3d-v4/tramp3d-v4.test    23.88  23.83 -0.2%
 test-suite...TMark/7zip/7zip-benchmark.test    60.24  60.11 -0.2%
 test-suite :: CTMark/kimwitu++/kc.test         15.69  15.69 -0.0%
 test-suite...:: CTMark/ClamAV/clamscan.test    25.43  25.42 -0.0%
 test-suite :: CTMark/Bullet/bullet.test        37.63  37.62 -0.0%
 Geomean difference                                          -0.8%

---

Reviewed By: lebedev.ri

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

4 years ago[Attributor][NFC] Let AbstractAttribute be an IRPosition
Johannes Doerfert [Thu, 23 Apr 2020 03:03:44 +0000 (22:03 -0500)]
[Attributor][NFC] Let AbstractAttribute be an IRPosition

Since every AbstractAttribute so far, and for the foreseeable future,
corresponds to a single IRPosition we can simplify the class structure.
We already did this for IRAttribute but there is no reason to stop
there.

4 years ago[AMDGPU] Add the SGPR used for FP copy to block livein lists.
Christudasan Devadasan [Wed, 22 Apr 2020 19:20:45 +0000 (00:50 +0530)]
[AMDGPU] Add the SGPR used for FP copy to block livein lists.

The temporary register used for FP copy
should be live throughout the function.

4 years ago[Attributor][NFC] Remove and update old check lines
Johannes Doerfert [Thu, 23 Apr 2020 02:00:12 +0000 (21:00 -0500)]
[Attributor][NFC] Remove and update old check lines

4 years ago[Attributor][NFC] Strip check lines not used while 3 tests are partially disable
Johannes Doerfert [Wed, 22 Apr 2020 23:06:02 +0000 (18:06 -0500)]
[Attributor][NFC] Strip check lines not used while 3 tests are partially disable

The three tests modified by this commit have been partially disabled
(one run line is commented out). As a consequence subsequent updates
will have weird effects on the check lines. This is a commit to avoid
such effects by making the check lines match the three remaining run
lines.

4 years ago[Attributor][NFC] Add `const` and missing state constructors
Johannes Doerfert [Wed, 22 Apr 2020 21:02:10 +0000 (16:02 -0500)]
[Attributor][NFC] Add `const` and missing state constructors

4 years ago[lldb][NFC][CallSite] Remove CallSite use
Mircea Trofin [Fri, 24 Apr 2020 05:06:55 +0000 (22:06 -0700)]
[lldb][NFC][CallSite] Remove CallSite use

Reviewers: dblaikie, craig.topper

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[llvm][NFC][CallSite] Remove remaining {Immutable}CallSite uses
Mircea Trofin [Fri, 24 Apr 2020 05:00:10 +0000 (22:00 -0700)]
[llvm][NFC][CallSite] Remove remaining {Immutable}CallSite uses

Reviewers: dblaikie, craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoRevert "[VPlan] Add & use VPValue operands for VPWidenRecipe (NFC)."
Mehdi Amini [Fri, 24 Apr 2020 05:07:32 +0000 (05:07 +0000)]
Revert "[VPlan] Add & use VPValue operands for VPWidenRecipe (NFC)."

This reverts commit 9245c7ac13480ed48ae339ad0e68cbe680cd0642.

This is triggering a segfault in XLA downstream, we'll follow-up with
a reproducer, it is likely influenced by TTI/TLI settings or other
options as a simple `opt -loop-vectorize` invocation on the IR
before the crash does not reproduce immediately.

4 years ago[llvm][NFC][CallSite] Remove ImmutableCallSite from a few locations
Mircea Trofin [Thu, 23 Apr 2020 17:35:10 +0000 (10:35 -0700)]
[llvm][NFC][CallSite] Remove ImmutableCallSite from a few locations

Reviewers: craig.topper, dblaikie

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[CallSite removal] Remove unneeded includes of CallSite.h. NFC
Craig Topper [Fri, 24 Apr 2020 04:01:42 +0000 (21:01 -0700)]
[CallSite removal] Remove unneeded includes of CallSite.h. NFC

4 years ago[CallSite removal][Transform] Replace CallSite with CallBase in Utils. NFC
Craig Topper [Fri, 24 Apr 2020 01:19:04 +0000 (18:19 -0700)]
[CallSite removal][Transform] Replace CallSite with CallBase in Utils. NFC

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

4 years agoAMDGPU: Fix redundant members
Matt Arsenault [Fri, 24 Apr 2020 02:58:25 +0000 (22:58 -0400)]
AMDGPU: Fix redundant members

4 years agoAMDGPU: Use Register
Matt Arsenault [Fri, 24 Apr 2020 02:00:15 +0000 (22:00 -0400)]
AMDGPU: Use Register

4 years ago[CallSite removal] Remove the text describing CallSite from the manual.
James Y Knight [Fri, 24 Apr 2020 02:01:09 +0000 (22:01 -0400)]
[CallSite removal] Remove the text describing CallSite from the manual.

4 years ago[mlir] DenseStringElementsAttr added to default attribute types
Rob Suderman [Fri, 24 Apr 2020 02:01:51 +0000 (19:01 -0700)]
[mlir] DenseStringElementsAttr added to default attribute types

Summary:
Implemented a DenseStringsElements attr for handling arrays / tensors of strings. This includes the
necessary logic for parsing and printing the attribute from MLIR's text format.

To store the attribute we perform a single allocation that includes all wrapped string data tightly packed.
This means no padding characters and no null terminators (as they could be present in the string). This
buffer includes a first chunk of data that represents an array of StringRefs, that contain address pointers
into the string data, with the length of each string wrapped. At this point there is no Sparse representation
however strings are not typically represented sparsely.

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

4 years ago[Sema][test] Fix implicit-int-float-conversion.c on Windows
Fangrui Song [Fri, 24 Apr 2020 01:45:48 +0000 (18:45 -0700)]
[Sema][test] Fix implicit-int-float-conversion.c on Windows

4 years ago[Sema] Split off warn_impcast_integer_float_precision_constant into -Wimplicit-const...
Fangrui Song [Wed, 22 Apr 2020 16:53:35 +0000 (09:53 -0700)]
[Sema] Split off warn_impcast_integer_float_precision_constant into -Wimplicit-const-int-float-conversion

Currently, both `warn_impcast_integer_float_precision_constant` and
`warn_impcast_integer_float_precision` are covered by
-Wimplicit-int-float-conversion, but only the ..._constant warning is on
by default.

`warn_impcast_integer_float_precision_constant` likely flags real problems
while `warn_impcast_integer_float_precision` may flag legitimate use
cases (for example, `int` used with limited range supported by `float`).

If -Wno-implicit-int-float-conversion is used, currently there is no way
to restore the ..._constant warning. This patch adds
-Wimplicit-const-int-float-conversion to address the issue. (Similar to
the reasoning in https://reviews.llvm.org/D64666#1598194)

Adapted from a patch by Brooks Moses.

Reviewed By: nickdesaulniers

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

4 years ago[llvm-objdump][ELF][NFC] Create ELFDump.h
Hubert Tong [Fri, 24 Apr 2020 01:20:45 +0000 (21:20 -0400)]
[llvm-objdump][ELF][NFC] Create ELFDump.h

Summary:
Continuing from D77285, the external interfaces implemented by
`ELFDump.cpp` are now declared in `ELFDump.h` and moved into the
`llvm::objdump` namespace. Externs defined in `ELFDump.cpp` that are
unreferenced externally are also made static.

Reviewers: jhenderson, MaskRay, DiggerLin, jasonliu, daltenty

Reviewed By: jhenderson, MaskRay

Subscribers: RKSimon, rupprecht, llvm-commits

Tags: #llvm

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

4 years ago[ValueTracking] Handle shufflevector constants in ComputeNumSignBits
Eli Friedman [Thu, 23 Apr 2020 00:15:39 +0000 (17:15 -0700)]
[ValueTracking] Handle shufflevector constants in ComputeNumSignBits

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

4 years agoAdd support for IndexType inside DenseIntElementsAttr.
Sean Silva [Thu, 23 Apr 2020 22:47:31 +0000 (15:47 -0700)]
Add support for IndexType inside DenseIntElementsAttr.

This also fixes issues discovered in the parsing/printing path.

4 years ago[Hexagon] Fix result word order when bitcasting vector pred to int64/128
Krzysztof Parzyszek [Fri, 24 Apr 2020 00:13:21 +0000 (19:13 -0500)]
[Hexagon] Fix result word order when bitcasting vector pred to int64/128

4 years ago[libc] Add spec for sigdelset and sigfillset.
Paula Toth [Thu, 23 Apr 2020 23:30:23 +0000 (16:30 -0700)]
[libc] Add spec for sigdelset and sigfillset.

Summary: Caught by libc-tidy from patch D77281.

Reviewers: abrachet, sivachandra

Reviewed By: abrachet

Subscribers: mgorny, tschuett, libc-commits

Tags: #libc-project

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

4 years agoChange callbr to only define its output SSA variable on the normal
James Y Knight [Fri, 17 Apr 2020 02:14:21 +0000 (22:14 -0400)]
Change callbr to only define its output SSA variable on the normal
path, not the indirect targets.

Fixes: PR45565.

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

4 years ago[mlir] Give each OpResult its own use list
River Riddle [Thu, 23 Apr 2020 23:23:34 +0000 (16:23 -0700)]
[mlir] Give each OpResult its own use list

This revision removes the multi use-list to ensure that each result gets its own. This decision was made by doing some extensive benchmarking of programs that actually use multiple results. This results in a size increase of 1-word per result >1, but the common case of 1-result remains unaffected. A side benefit is that 0-result operations now shrink by 1-word.

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

4 years agoRe-land "[MS] Fix assert handling enum forward decls in hasVisibleDefinition"
Reid Kleckner [Mon, 20 Apr 2020 19:50:20 +0000 (12:50 -0700)]
Re-land "[MS] Fix assert handling enum forward decls in hasVisibleDefinition"

This reverts commit 9b2ab41037f45ad92ab4e850591093ffc45d3e10 and
reinstates e62dc1f6252c1dcdcc2a64e8e3b07a32412e9d89 with changes.

This fix is speculative, since I don't have access to a crashing test
case for the old code, and fixing the crash bug on Windows when C++20 is
enabled seems more important than running it down.

4 years agoRemove InvokeInst methods which duplicate those of its superclass CallBase.
James Y Knight [Thu, 23 Apr 2020 18:06:58 +0000 (14:06 -0400)]
Remove InvokeInst methods which duplicate those of its superclass CallBase.

4 years ago[AArch64][FIX] FPR16_lo for f16 indexed patterns.
Pavel Iliin [Thu, 23 Apr 2020 21:03:42 +0000 (22:03 +0100)]
[AArch64][FIX] FPR16_lo for f16 indexed patterns.

4 years ago[SVE] Remove VectorType::isScalable()
Christopher Tetreault [Thu, 23 Apr 2020 22:11:04 +0000 (15:11 -0700)]
[SVE] Remove VectorType::isScalable()

Summary:
* This is a property of the instance of VectorType. If
isa<ScalableVectorType>(T) is true, then T->isScalable() would have
returned true and vice-versa. Most code that checks this function uses
the result to bail out if a vector is a scalable vector. This code will
be cleaner if it just calls isa<ScalableVectorType>(T)

Reviewers: efriedma, craig.topper, huntergr, sdesmalen

Reviewed By: sdesmalen

Subscribers: tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[CallSite removal][ValueTracking] Replace CallSite with CallBase. NFC"
Craig Topper [Thu, 23 Apr 2020 21:22:14 +0000 (14:22 -0700)]
[CallSite removal][ValueTracking] Replace CallSite with CallBase. NFC"

4 years ago[ASTImporter] Fix handling of not defined FromRecord in ImportContext(...)
shafik [Thu, 23 Apr 2020 22:16:34 +0000 (15:16 -0700)]
[ASTImporter] Fix handling of not defined FromRecord in ImportContext(...)

In ImportContext(…) we may call into CompleteDecl(…) which if FromRecrord is not
defined will start the definition of a ToRecord but from what I can tell at least
one of the paths though here don't ensure we complete the definition.
For a RecordDecl this can be problematic since this means we won’t import base
classes and we won’t have any of the methods or types we inherit from these bases.

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

4 years ago[libc] Surround get_start_args_addr in __llvm_libc namespace.
Paula Toth [Thu, 23 Apr 2020 22:09:40 +0000 (15:09 -0700)]
[libc] Surround get_start_args_addr in __llvm_libc namespace.

Summary: Caught by libc-tidy from patch D77281.

Reviewers: sivachandra

Reviewed By: sivachandra

Subscribers: tschuett, libc-commits

Tags: #libc-project

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

4 years ago[llvm] [CodeGen] Fixed vector halving bug for masked load
aartbik [Thu, 23 Apr 2020 18:28:34 +0000 (11:28 -0700)]
[llvm] [CodeGen] Fixed vector halving bug for masked load

Summary:
Given a VL=14 that is enveloped by a proper VL=16, splitting the
masked load using the enveloping halving VL=8/8 should yields
should eventually yield V=8/5. This fixes various assert failures
in getHalfNumVectorElementsVT() and IncrementMemoryAddress().

Note, I suspect similar fixes will be needed for other masked
operations, but for now I send out a fix for masked load only.

Bugzilla issue 45563
https://bugs.llvm.org/show_bug.cgi?id=45563

Reviewers: craig.topper, mehdi_amini, nicolasvasilache

Reviewed By: craig.topper

Subscribers: hiraditya, dmgreen, llvm-commits

Tags: #llvm

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

4 years ago[llvm] [X86] Processed test with update_llc_test_checks
aartbik [Thu, 23 Apr 2020 18:41:58 +0000 (11:41 -0700)]
[llvm] [X86] Processed test with update_llc_test_checks

Summary:
As requested in another review for a similar regression test,
I updated this test with the same utility.

Reviewers: dmgreen, craig.topper, mehdi_amini, nicolasvasilache

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[flang] Compute sizes and offsets for symbols
Tim Keith [Wed, 22 Apr 2020 22:39:24 +0000 (15:39 -0700)]
[flang] Compute sizes and offsets for symbols

Summary:
Add size and offset properties to symbols, representing their byte size
and offset within their enclosing scope.

Add size and align properties to scopes so that they are available for
scopes representing derived types.

Add ComputeOffsets pass over the symbol table to fill in those fields.

Compute descriptor size based on rank and length parameters. Extract
DerivedTypeSpec::NumLengthParameters from DynamicType::RequiresDescriptor
to share the code.

Add Scope::GetSymbols to get symbols in canonical order.
compute-offsets.cpp and mod-file.cpp both need to process symbols in the
order in which they are declared. Move the collecting of those symbols
into Scope so that it can be shared.

Add symbol size and offset to output of `-fdebug-dump-symbols` and use
that in some tests.

Still to do:
- make size and alignment rules configurable based on target
- use offsets to check EQUIVALENCE statements

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

4 years agoMake "#pragma clang attribute" support uninitialized attribute.
Jian Cai [Thu, 23 Apr 2020 19:11:50 +0000 (12:11 -0700)]
Make "#pragma clang attribute" support uninitialized attribute.

Summary:
When using -ftrivial-auto-var-init=* options to initiate automatic
variables in a file, to disable initialization on some variables,
currently we have to manually annotate the variables with uninitialized
attribute, such as

int dont_initialize_me __attribute((uninitialized));

Making pragma clang attribute to support this attribute would make
annotating variables much easier, and could be particular useful for
bisection efforts, e.g.

void use(void*);

void buggy() {
    int arr[256];
    int boom;
    float bam;
    struct { int oops; } oops;
    union { int oof; float aaaaa; } oof;

    use(&arr);
    use(&boom);
    use(&bam);
    use(&oops);
    use(&oof);
}

Reviewers: jfb, rjmccall, aaron.ballman

Reviewed By: jfb, aaron.ballman

Subscribers: aaron.ballman, george.burgess.iv, dexonsmith, MaskRay, phosek, hubert.reinterpretcast, gbiv, manojgupta, llozano, srhines, cfe-commits

Tags: #clang

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

4 years ago[NFC] Refactoring PropertyAttributeKind for ObjCPropertyDecl and ObjCDeclSpec.
Puyan Lotfi [Thu, 23 Apr 2020 06:20:56 +0000 (02:20 -0400)]
[NFC] Refactoring PropertyAttributeKind for ObjCPropertyDecl and ObjCDeclSpec.

This is a code clean up of the PropertyAttributeKind and
ObjCPropertyAttributeKind enums in ObjCPropertyDecl and ObjCDeclSpec that are
exactly identical. This non-functional change consolidates these enums
into one. The changes are to many files across clang (and comments in LLVM) so
that everything refers to the new consolidated enum in DeclObjCCommon.h.

2nd Landing Attempt...

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

4 years ago[x86] add tests for FP->int->FP with different FP types; NFC
Sanjay Patel [Thu, 23 Apr 2020 20:47:32 +0000 (16:47 -0400)]
[x86] add tests for FP->int->FP with different FP types; NFC

4 years ago[SVE] Remove calls to isScalable from Hexagon
Christopher Tetreault [Thu, 23 Apr 2020 20:53:31 +0000 (13:53 -0700)]
[SVE] Remove calls to isScalable from Hexagon

Reviewers: efriedma, sdesmalen, kparzysz, colinl

Reviewed By: kparzysz

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[InstCombine] Negator: don't negate multi-use `sub`
Roman Lebedev [Thu, 23 Apr 2020 18:07:23 +0000 (21:07 +0300)]
[InstCombine] Negator: don't negate multi-use `sub`

While we can do that, it doesn't increase instruction count,
if the old `sub` sticks around then the transform is not only
not a unlikely win, but a likely regression, since we likely
now extended live range and use count of both of the `sub` operands,
as opposed to just the result of `sub`.

As Kostya Serebryany notes in post-commit review in
https://reviews.llvm.org/D68408#1998112
this indeed can degrade final assembly,
increase register pressure, and spilling.

This isn't what we want here,
so at least for now let's guard it with an use check.

4 years ago[SVE] Remove calls to isScalable from Transforms
Christopher Tetreault [Thu, 23 Apr 2020 20:30:30 +0000 (13:30 -0700)]
[SVE] Remove calls to isScalable from Transforms

Reviewers: efriedma, chandlerc, reames, aprantl, sdesmalen

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[mlir][Linalg] Add support for fusing linalg.tensor_reshape with
MaheshRavishankar [Thu, 23 Apr 2020 20:41:02 +0000 (13:41 -0700)]
[mlir][Linalg] Add support for fusing linalg.tensor_reshape with
linalg.generic operations.

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

4 years ago[mlir][Linalg] NFC: Refactor fusion on tensors to enable extending
MaheshRavishankar [Thu, 23 Apr 2020 20:40:55 +0000 (13:40 -0700)]
[mlir][Linalg] NFC: Refactor fusion on tensors to enable extending
it to fusing different kinds of linalg operations on tensors.

The implementation of fusion on tensor was initially planned for just
GenericOps (and maybe IndexedGenericOps). With addition of
linalg.tensor_reshape, and potentially other such non-structured ops,
refactor the existing implementation to allow easier specification of
fusion between different linalg operations on tensors.

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

4 years ago[SVE] Remove isScalable from Bitcode
Christopher Tetreault [Thu, 23 Apr 2020 20:10:17 +0000 (13:10 -0700)]
[SVE] Remove isScalable from Bitcode

Reviewers: efriedma, dexonsmith, tejohnson, sdesmalen

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[libcxx] Add FILE_DEPENDENCIES line to the func.blocks.sh.cpp test
Sergej Jaskiewicz [Thu, 23 Apr 2020 20:17:57 +0000 (23:17 +0300)]
[libcxx] Add FILE_DEPENDENCIES line to the func.blocks.sh.cpp test

This should fix the bots that use ssh.py to execute tests

4 years ago[SVE] Remove calls to isScalable from AARCH64
Christopher Tetreault [Thu, 23 Apr 2020 20:00:59 +0000 (13:00 -0700)]
[SVE] Remove calls to isScalable from AARCH64

Reviewers: efriedma, sdesmalen, t.p.northover, mcrosier

Reviewed By: efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[AMDGPU] Avoid hard-coded line numbers in error message checks
Jay Foad [Thu, 23 Apr 2020 14:32:27 +0000 (15:32 +0100)]
[AMDGPU] Avoid hard-coded line numbers in error message checks

This makes it easier for us to maintain downstream changes to some of
these tests. NFC.

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

4 years ago[SVE] Remove calls to isScalable from CodeGen
Christopher Tetreault [Thu, 23 Apr 2020 19:45:34 +0000 (12:45 -0700)]
[SVE] Remove calls to isScalable from CodeGen

Reviewers: efriedma, sdesmalen, stoklund, sunfish

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[SVE] Remove calls to VectorType::isScalable from analysis
Christopher Tetreault [Thu, 23 Apr 2020 19:19:54 +0000 (12:19 -0700)]
[SVE] Remove calls to VectorType::isScalable from analysis

Reviewers: efriedma, sdesmalen, chandlerc, sunfish

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years agoAMDGPU: Fix inlining logic for denormals
Matt Arsenault [Wed, 22 Apr 2020 21:17:46 +0000 (17:17 -0400)]
AMDGPU: Fix inlining logic for denormals

This was backwards from intended and missing a test. We perhaps should
just ignored the FP mode here, since it shouldn't be legal to mix code
with different default modes in the absence of strictfp.

4 years agoAMDGPU: Change pre-gfx9 implementation of fcanonicalize to mul
Matt Arsenault [Wed, 22 Apr 2020 21:34:10 +0000 (17:34 -0400)]
AMDGPU: Change pre-gfx9 implementation of fcanonicalize to mul

If f32 denormals were enabled pre-gfx9, we would still try to
implement this with v_max_f32. Pre-gfx9, these instructions ignored
the denormal mode and did not flush. Switch to the multiply form for
f32 as a workaround which should always work in any case.

This fixes conformance failures when the library implementation of
fmin/fmax were accidentally not inlined, forcing the assumption of no
flushing on targets where denormals are not enabled by default. This
is a workaround, since really we should not be mixing code with
different FP mode expectations, but prefer the lowering that will work
in any mode.

Now this will always use max to implement canonicalize on gfx9+. This
is only really beneficial for f64. For f32/f16 it's a neutral choice
(and worse in terms of code size in 1 case), but possibly worse for
the compiler since it does add an extra register use operand. Leave
this change for later.

4 years ago[llvm-objcopy][MachO] Copy LC_LOAD_WEAK_DYLIB load commands
Alexander Shaposhnikov [Thu, 23 Apr 2020 18:37:39 +0000 (11:37 -0700)]
[llvm-objcopy][MachO] Copy LC_LOAD_WEAK_DYLIB load commands

LC_LOAD_WEAK_DYLIB is analogous to LC_LOAD_DYLIB and doesn't require any special handling.

Test plan: make check-all

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

4 years agoAMDGPU/GlobalISel: Add new baseline checks for canonicalize
Matt Arsenault [Thu, 23 Apr 2020 13:45:54 +0000 (09:45 -0400)]
AMDGPU/GlobalISel: Add new baseline checks for canonicalize

4 years ago[SVE] Remove calls to isScalable from IR
Christopher Tetreault [Thu, 23 Apr 2020 17:58:37 +0000 (10:58 -0700)]
[SVE] Remove calls to isScalable from IR

Reviewers: efriedma, sdesmalen, dexonsmith, dblaikie

Reviewed By: sdesmalen

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[X86][SSE] Add SSE2 extract-concat tests
Simon Pilgrim [Thu, 23 Apr 2020 18:20:54 +0000 (19:20 +0100)]
[X86][SSE] Add SSE2 extract-concat tests

Check pre-SSE41 codegen where we have less PEXTR*/PINSR* instructions

4 years ago[libc] Link mpfr and gmp wrapper to the libcMPFRWrapper.
Siva Chandra Reddy [Thu, 23 Apr 2020 17:57:28 +0000 (10:57 -0700)]
[libc] Link mpfr and gmp wrapper to the libcMPFRWrapper.

This will fix building the wrapper shared library when
BUILD_SHARED_LIBS is ON.

Reviewers: PaulkaToast

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

4 years ago[libc++] Update scripts to build libc++/libc++abi for Apple
Louis Dionne [Thu, 23 Apr 2020 17:53:14 +0000 (13:53 -0400)]
[libc++] Update scripts to build libc++/libc++abi for Apple

Also, make sure we test them.

4 years ago[mlir][EDSC] Hotfix - Provide impl for `negate`
Nicolas Vasilache [Thu, 23 Apr 2020 18:10:24 +0000 (14:10 -0400)]
[mlir][EDSC] Hotfix - Provide impl for `negate`

367229e100eca714276253bf95a0dd3d084a9624 retired ValueHandle but
mistakenly removed the implementation for `negate` which was not
tested and would result in linking errors.

This revision adds the implementation back and provides a test.

4 years ago[mlir/Quant] Allows to use 32 bits storage type
Feng Liu [Wed, 22 Apr 2020 21:14:29 +0000 (14:14 -0700)]
[mlir/Quant] Allows to use 32 bits storage type

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

4 years ago[llvm][NFC] Factor out cost-model independent inling decision
Mircea Trofin [Thu, 23 Apr 2020 16:14:08 +0000 (09:14 -0700)]
[llvm][NFC] Factor out cost-model independent inling decision

Summary:
llvm::getInlineCost starts off by determining whether inlining should
happen or not because of user directives or easily determinable
unviability. This CL refactors this functionality as a reusable API.

Reviewers: davidxl, eraman

Reviewed By: davidxl, eraman

Subscribers: hiraditya, haicheng, llvm-commits

Tags: #llvm

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

4 years ago[SVE] Make VectorType::getNumElements() complain for scalable vectors
Christopher Tetreault [Thu, 23 Apr 2020 16:52:49 +0000 (09:52 -0700)]
[SVE] Make VectorType::getNumElements() complain for scalable vectors

Summary:
Piggy-back off of TypeSize's STRICT_FIXED_SIZE_VECTORS flag and:
- if it is defined, assert that the vector is not scalable
- if it is not defined, complain if the vector is scalable

Reviewers: efriedma, sdesmalen, c-rhodes

Reviewed By: sdesmalen

Subscribers: hiraditya, mgorny, tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

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