Simon Pilgrim [Wed, 22 Apr 2020 14:53:06 +0000 (15:53 +0100)]
[AVR] Remove unused forward declarations. NFC.
Simon Pilgrim [Wed, 22 Apr 2020 14:52:19 +0000 (15:52 +0100)]
BPFMCTargetDesc.h - remove unused raw_ostream forward declaration. NFC.
Mikhail Maltsev [Wed, 22 Apr 2020 17:25:22 +0000 (18:25 +0100)]
[Docs] Fixed formatting in release notes, NFC
David Green [Wed, 22 Apr 2020 15:33:11 +0000 (16:33 +0100)]
[ARM] Replace arm vendor with none. NFC
Victor Huang [Wed, 22 Apr 2020 15:55:34 +0000 (10:55 -0500)]
[PowerPC][Future] Remove redundant r2 save and restore for indirect call
Currently an indirect call produces the following sequence on PCRelative mode:
extern void function( );
extern void (*ptrfunc) ( );
void g() {
ptrfunc=function;
}
void f() {
(*ptrfunc) ( );
}
Producing
paddi 3, 0, .LC0@PCREL, 1
ld 3, 0(3)
std 2, 24(1)
ld 12, 0(3)
mtctr 12
bctrl
ld 2, 24(1)
Though the caller does not use or preserve r2, it is still saved and restored
across a function call. This patch is added to remove these redundant save and
restores for indirect calls.
Differential Revision: https://reviews.llvm.org/D77749
Benjamin Kramer [Wed, 22 Apr 2020 17:02:01 +0000 (19:02 +0200)]
Benjamin Kramer [Wed, 22 Apr 2020 16:57:08 +0000 (18:57 +0200)]
[Hexagon] Silence warning
llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp:296:11: warning: enumeration value 'ScalableVectorTyID' not handled in switch [-Wswitch]
switch (Ty->getTypeID()) {
^
Denis Khalikov [Mon, 20 Apr 2020 20:31:24 +0000 (23:31 +0300)]
[mlir][vulkan-runner] Add support for integer types.
Summary:
Add support for memrefs with element type as integer type
and simple test.
Differential Revision: https://reviews.llvm.org/D78560
Jonas Devlieghere [Wed, 22 Apr 2020 15:48:31 +0000 (08:48 -0700)]
[lldb/Host] Remove TaskPool and replace its uses with llvm::ThreadPool
Remove LLDB's TaskPool and replace its uses with LLVM's ThreadPool.
Differential revision: https://reviews.llvm.org/D78337
Johannes Doerfert [Wed, 22 Apr 2020 15:17:32 +0000 (10:17 -0500)]
[OpenMP][FIX] Do not use InaccessibleMemOrArgMemOnly for barrier and flush
This was reported as PR45635, committed first as
72a9e7c926f4e32f209e528ec407fe526da5587e, reverted by
188f5cde9635a29a3f20ee2a73abd02890a752c7, and now recommitted with the
test change.
Christopher Tetreault [Wed, 22 Apr 2020 15:02:02 +0000 (08:02 -0700)]
[SVE] Add new VectorType subclasses
Summary:
Introduce new types for fixed width and scalable vectors.
Does not remove getNumElements yet so as to not break code during transition
period.
Reviewers: deadalnix, efriedma, sdesmalen, craig.topper, huntergr
Reviewed By: sdesmalen
Subscribers: jholewinski, arsenm, jvesely, nhaehnle, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, liufengdb, kerbowa, Joonsoo, grosul1, frgossen, lldb-commits, tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm, #lldb
Differential Revision: https://reviews.llvm.org/D77587
Mark Murray [Mon, 20 Apr 2020 15:21:46 +0000 (16:21 +0100)]
[ARM][MC][Thumb] Recommit: Revert relocation for some pc-relative fixups.
Summary:
This commit recommits the reversion of https://reviews.llvm.org/D75039.
Concensus appears to be in favour of assembly-time resolution of
these ADR and LDR relocations, in line with GNU. The previous
backout broke many lld tests, now fixed by Peter Smith in
61bccda9d9d920c72f49025f11e8601daeb096ec.
Reviewers: psmith
Subscribers: kristof.beyls, hiraditya, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78301
Victor Huang [Wed, 22 Apr 2020 15:45:01 +0000 (10:45 -0500)]
[PowerPC][Future] Initial support for PCRel addressing for jump tables.
Add initial support for PC Relative addressing to get jump table base
address instead of using TOC.
Differential Revision: https://reviews.llvm.org/D75931
Sander de Smalen [Wed, 22 Apr 2020 14:00:01 +0000 (15:00 +0100)]
[SveEmitter] Add IsOverloadNone flag and builtins for svpfalse and svcnt[bhwd]_pat
Add the IsOverloadNone flag to tell CGBuiltin that it does not have
an overloaded type. This is used for e.g. svpfalse which does
not take any arguments and always returns a svbool_t.
This patch also adds builtins for svcntb_pat, svcnth_pat, svcntw_pat
and svcntd_pat, as those don't require custom codegen.
Reviewers: SjoerdMeijer, efriedma, rovka
Reviewed By: efriedma
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77596
Mircea Trofin [Wed, 22 Apr 2020 04:56:04 +0000 (21:56 -0700)]
[llvm][NFC][CallSite] Remove CallSite from a few trivial locations
Summary: Implementation details and internal (to module) APIs.
Reviewers: craig.topper, dblaikie
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78610
Johannes Doerfert [Wed, 22 Apr 2020 15:36:23 +0000 (10:36 -0500)]
Revert "[OpenMP][FIX] Do not use InaccessibleMemOrArgMemOnly for barrier and flush"
Forgot to include test changes :(
This reverts commit
72a9e7c926f4e32f209e528ec407fe526da5587e.
Francois Ferrand [Mon, 22 May 2017 09:23:08 +0000 (11:23 +0200)]
clang-format: Introduce stricter AlignOperands flag
Summary:
Even when BreakBeforeBinaryOperators is set, AlignOperands kept
aligning the beginning of the line, even when it could align the
actual operands (e.g. after an assignment).
With this patch, there is an option to actually align the operands, so
that the operator gets right-aligned with the equal sign or return
operator:
int aaaaa = bbbbbb
+ cccccc;
return aaaaaaa
&& bbbbbbb;
This not happen in parentheses, to avoid 'breaking' the indentation:
if (aaaaa
&& bbbbb)
return;
Reviewers: krasimir, djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D32478
Francois Ferrand [Fri, 15 Jun 2018 12:22:23 +0000 (14:22 +0200)]
clang-format: support aligned nested conditionals formatting
When multiple ternary operators are chained, e.g. like an if/else-if/
else-if/.../else sequence, clang-format will keep aligning the colon
with the question mark, which increases the indent for each
conditionals:
int a = condition1 ? result1
: condition2 ? result2
: condition3 ? result3
: result4;
This patch detects the situation (e.g. conditionals used in false branch
of another conditional), to avoid indenting in that case:
int a = condition1 ? result1
: condition2 ? result2
: condition3 ? result3
: result4;
When BreakBeforeTernaryOperators is false, this will format like this:
int a = condition1 ? result1 :
condition2 ? result2 :
conditino3 ? result3 :
result4;
Mikhail Maltsev [Wed, 22 Apr 2020 15:34:19 +0000 (16:34 +0100)]
[ARM] Release notes for the Custom Datapath Extension (CDE)
Summary:
This change mentions CDE assembly in the LLVM release notes and CDE
intrinsics in both Clang and LLVM release notes.
Reviewers: kristof.beyls, simon_tatham
Reviewed By: kristof.beyls
Subscribers: danielkiss, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D78481
Dmitry Vyukov [Wed, 22 Apr 2020 14:01:33 +0000 (16:01 +0200)]
[TSAN] Add optional support for distinguishing volatiles
Add support to optionally emit different instrumentation for accesses to
volatile variables. While the default TSAN runtime likely will never
require this feature, other runtimes for different environments that
have subtly different memory models or assumptions may require
distinguishing volatiles.
One such environment are OS kernels, where volatile is still used in
various places for various reasons, and often declare volatile to be
"safe enough" even in multi-threaded contexts. One such example is the
Linux kernel, which implements various synchronization primitives using
volatile (READ_ONCE(), WRITE_ONCE()). Here the Kernel Concurrency
Sanitizer (KCSAN) [1], is a runtime that uses TSAN instrumentation but
otherwise implements a very different approach to race detection from
TSAN.
While in the Linux kernel it is generally discouraged to use volatiles
explicitly, the topic will likely come up again, and we will eventually
need to distinguish volatile accesses [2]. The other use-case is
ignoring data races on specially marked variables in the kernel, for
example bit-flags (here we may hide 'volatile' behind a different name
such as 'no_data_race').
[1] https://github.com/google/ktsan/wiki/KCSAN
[2] https://lkml.kernel.org/r/CANpmjNOfXNE-Zh3MNP=-gmnhvKbsfUfTtWkyg_=VqTxS4nnptQ@mail.gmail.com
Author: melver (Marco Elver)
Reviewed-in: https://reviews.llvm.org/D78554
Denis Khalikov [Wed, 22 Apr 2020 14:39:39 +0000 (17:39 +0300)]
[mlir][vulkan-runner] Fix testsuite.
Summary: Fix testsuite after D78542.
Differential Revision: https://reviews.llvm.org/D78639
Johannes Doerfert [Wed, 22 Apr 2020 15:17:32 +0000 (10:17 -0500)]
[OpenMP][FIX] Do not use InaccessibleMemOrArgMemOnly for barrier and flush
This was reported as PR45635.
Haojian Wu [Wed, 22 Apr 2020 15:17:41 +0000 (17:17 +0200)]
Fix -Wunused-variable error.
Jan Kratochvil [Wed, 22 Apr 2020 14:46:29 +0000 (16:46 +0200)]
[nfc] [lldb] DWARF callbacks: DIERef -> DWARFDIE
Pavel Labath wrote in D73206:
The internal representation of DebugNames and Apple indexes is fixed by
the relevant (pseudo-)standards, so we can't really change it. The
question is how to efficiently (and cleanly) convert from the internal
representation to some common thing. The conversion from AppleIndex to
DIERef is trivial (which is not surprising as it was the first and the
overall design was optimized for that). With debug_names, the situation
gets more tricky. The internal representation of debug_names uses
CU-relative DIE offsets, but DIERef wants an absolute offset. That means
the index has to do more work to produce the common representation. And
it needs to do that for all results, even though a lot of the index
users are really interested only in a single entry. With the switch to
user_id_t, _all_ indexes would have to do some extra work to encode it,
only for their users to have to immediately decode it back. Having
a iterator/callback based api would allow us to minimize the impact of
that, as it would only need to happen for the entries that are really
used. And /I think/ we could make it interface returns DWARFDies
directly, and each index converts to that using the most direct approach
available.
Jan Kratochvil:
It also makes all the callers shorter as they no longer need to fetch
DWARFDIE from DIERef (and handling if not found by ReportInvalidDIERef)
but the callers are already served DWARFDIE which they need.
In some cases the DWARFDIE had to be fetched both by callee (DWARFIndex
implementation) and caller.
Differential Revision: https://reviews.llvm.org/D77970
Louis Dionne [Wed, 8 Apr 2020 16:26:59 +0000 (12:26 -0400)]
[CMake] Add a warning message to prepare the upcoming upgrade to CMake 3.13.4
As discussed in http://lists.llvm.org/pipermail/llvm-dev/2020-March/140349.html,
the minimum version of CMake required to build LLVM will be upgraded to
3.13.4 right after we create the release branch for LLVM 11.0.0.
As part of this effort, this commit adds a warning to give a heads up
to folks regarding the upcoming upgrade. This should allow users to
upgrade their CMake in advance so that the upgrade can sail right
through when the time comes.
Differential Revision: https://reviews.llvm.org/D77740
Roman Lebedev [Wed, 22 Apr 2020 14:30:58 +0000 (17:30 +0300)]
[NFC][InstCombine] Tests for negation of sign-/zero- extensions
* sext of non-positive can be negated.
* zext of non-negative can be negated.
Simon Pilgrim [Wed, 22 Apr 2020 13:45:07 +0000 (14:45 +0100)]
[BPF] Remove unused forward declarations. NFC.
Simon Pilgrim [Wed, 22 Apr 2020 13:38:04 +0000 (14:38 +0100)]
BranchFolding.h - remove unused raw_ostream forward declaration. NFC.
Simon Pilgrim [Wed, 22 Apr 2020 13:36:44 +0000 (14:36 +0100)]
RecordStreamer.h - cleanup includes and forward declarations. NFC.
Reduce MCSymbol.h include to forward declaration.
Remove unused GlobalValue foward declaration.
Simon Pilgrim [Wed, 22 Apr 2020 13:16:40 +0000 (14:16 +0100)]
RuntimeDyldImpl.h - remove unused Twine forward declaration. NFC.
Sander de Smalen [Wed, 22 Apr 2020 13:42:44 +0000 (14:42 +0100)]
[NFC] Fix unused result of dyn_cast<VectorType> in non-assert build
jasonliu [Tue, 21 Apr 2020 21:52:08 +0000 (21:52 +0000)]
[llvm-objdump][XCOFF] Print more symbol info in relocation
Summary:
Print more symbol info in relocation printing when
--symbol-description is specified.
Differential Revision: https://reviews.llvm.org/D78499
John Brawn [Wed, 22 Apr 2020 11:07:15 +0000 (12:07 +0100)]
[ARM] Don't shrink STM if it would cause an unknown base register store
If a 16-bit thumb STM with writeback stores the base register but it isn't the
first register in the list, then an unknown value is stored. The load/store
optimizer knows this and generates a 32-bit STM without writeback instead, but
thumb2 size reduction converts it into a 16-bit STM. Fix this by having thumb2
size reduction notice such STMs and leave them as they are.
Differential Revision: https://reviews.llvm.org/D78493
Sander de Smalen [Wed, 22 Apr 2020 12:58:35 +0000 (13:58 +0100)]
[SveEmitter] Add support for _n form builtins
The ACLE has builtins that take a scalar value that is to be expanded
into a vector by the operation. While the ISA may have an instruction
that takes an immediate or a scalar to represent this, the LLVM IR
intrinsic may not, so Clang will have to splat the scalar value.
This patch also adds the _n forms for svabd, svadd, svdiv, svdivr,
svmax, svmin, svmul, svmulh, svub and svsubr.
Reviewers: SjoerdMeijer, efriedma, rovka
Reviewed By: SjoerdMeijer
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77594
Jay Foad [Wed, 22 Apr 2020 12:42:15 +0000 (13:42 +0100)]
[AMDGPU] Fix test failures caused by
dbdffe3ee9d.
David Green [Wed, 22 Apr 2020 12:30:22 +0000 (13:30 +0100)]
[ARM] Distribute MVE post-increments
This adds some extra processing into the Pre-RA ARM load/store optimizer
to detect and merge MVE loads/stores and adds of the same base. This we
don't always turn into a post-inc during ISel, and due to the nature of
it being a graph we don't always know an order to use for the nodes, not
knowing which nodes to make post-inc and which to use the new post-inc
of. After ISel, we have an order that we can use to post-inc the
following instructions.
So this looks for a loads/store with a starting offset of 0, and an
add/sub from the same base, plus a number of other loads/stores. We then
do some checks and convert the zero offset load/store into a postinc
variant. Any loads/stores after it have the offset subtracted from their
immediates. For example:
LDR #4 LDR #4
LDR #0 LDR_POSTINC #16
LDR #8 LDR #-8
LDR #12 LDR #-4
ADD #16
It only handles MVE loads/stores at the moment. Normal loads/store will
be added in a followup patch, they just have some extra details to
ensure that we keep generating LDRD/LDM successfully.
Differential Revision: https://reviews.llvm.org/D77813
Pavel Iliin [Wed, 22 Apr 2020 11:34:36 +0000 (12:34 +0100)]
[AArch64][FIX] f16 indexed patterns encoding restrictions.
Simon Pilgrim [Wed, 22 Apr 2020 12:44:58 +0000 (13:44 +0100)]
[AsmPrinter] Remove unused forward declarations. NFC.
Simon Pilgrim [Wed, 22 Apr 2020 11:43:58 +0000 (12:43 +0100)]
MetadataLoader.h - remove unused MDNode forward declaration. NFC.
Simon Pilgrim [Wed, 22 Apr 2020 11:41:50 +0000 (12:41 +0100)]
[AsmParser] Remove unused forward declarations. NFC.
Simon Pilgrim [Wed, 22 Apr 2020 11:40:39 +0000 (12:40 +0100)]
X86TargetMachine.h - remove unused X86RegisterBankInfo forward declaration. NFC.
Sanjay Patel [Wed, 22 Apr 2020 12:42:44 +0000 (08:42 -0400)]
[InstCombine] add tests for min/max FP intrinsics with FMF (PR45478); NFC
https://bugs.llvm.org/show_bug.cgi?id=45478
David Green [Wed, 22 Apr 2020 11:40:45 +0000 (12:40 +0100)]
[ARM] MVE FMA loop tests. NFC
Sebastian Neubauer [Wed, 22 Apr 2020 12:01:38 +0000 (14:01 +0200)]
[NFC][AMDGPU] Fix cmake when LLVM is a subproject
CMAKE_SOURCE_DIR is not the right directory if llvm is included in
another cmake project. PROJECT_SOURCE_DIR is always the same and should
be used instead.
Louis Dionne [Fri, 17 Apr 2020 14:29:15 +0000 (10:29 -0400)]
[libc++/abi/unwind] Rename Lit features for no exceptions to 'no-exceptions'
Instead of having different names for the same Lit feature accross code
bases, use the same name everywhere. This NFC commit is in preparation
for a refactor where all three projects will be using the same Lit
feature detection logic, and hence it won't be convenient to use
different names for the feature.
Differential Revision: https://reviews.llvm.org/D78370
Andrzej Warzynski [Tue, 7 Apr 2020 10:09:01 +0000 (11:09 +0100)]
[SveEmitter] Implement builtins for gathers/scatters
This patch adds builtins for:
* regular, first-faulting and non-temporal gather loads
* regular and non-temporal scatter stores
Differential Revision: https://reviews.llvm.org/D77735
Roman Lebedev [Wed, 22 Apr 2020 11:58:39 +0000 (14:58 +0300)]
[InstCombine] Negator: shufflevector is negatible
All these folds are correct as per alive-tv
Roman Lebedev [Wed, 22 Apr 2020 11:57:57 +0000 (14:57 +0300)]
[NFC][InstCombine] Add shuffle negation tests
Jay Foad [Thu, 16 Apr 2020 16:02:19 +0000 (17:02 +0100)]
[AMDGPU] Add 192-bit register classes
Differential Revision: https://reviews.llvm.org/D78312
Jay Foad [Fri, 17 Apr 2020 08:25:37 +0000 (09:25 +0100)]
[AMDGPU] Add missing AReg classes
Add 96-bit, 160-bit and 256-bit AReg classes to match VReg and SReg.
NFC as far as I know, but it may avoid weird legalization problems.
Differential Revision: https://reviews.llvm.org/D78348
David Zarzycki [Wed, 22 Apr 2020 11:45:47 +0000 (07:45 -0400)]
[libc++ testing] Fix unused variable warning turned error
Peter Smith [Wed, 22 Apr 2020 10:57:13 +0000 (11:57 +0100)]
[LLD][ELF][ARM] Replace adr, ldr with .inst .reloc in test [NFC]
After D78301 MC no longer emits a relocation for this case. Change to use
.inst and .reloc to synthesize the same instruction and relocation. One
more test case I missed.
James Henderson [Mon, 20 Apr 2020 13:23:01 +0000 (14:23 +0100)]
[llvm-objdump] Look in all viable sections for call/branch targets
Prior to this patch, llvm-objdump would only look in the last section
(according to the section header table order) that matched an address
for a symbol when identifying the target symbol of a call or branch
operation. If there are multiple sections with the same address, due to
some of them being empty, it did not look in those, even if the symbol
couldn't be found in the first section looked in.
This patch causes llvm-objdump to look in all sections for possible
candidate symbols. If there are multiple possible symbols, it picks one
from a non-empty section, if possible (as that is more likely to be the
"real" symbol since functions can't really be in emptiy sections),
before falling back to those in empty sections. If all else fails, it
falls back to absolute symbols as it did before.
Differential Revision: https://reviews.llvm.org/D78549
Reviewed by: grimar, Higuoxing
Lucas Prates [Wed, 22 Apr 2020 10:31:41 +0000 (11:31 +0100)]
[NFC][llvm][X86] Adding missing -mtiple to X86 test.
The modified test was missing the specification of the intended triple
in its run line, assuming X86 is the default.
Kerry McLaughlin [Wed, 22 Apr 2020 08:38:48 +0000 (09:38 +0100)]
[AArch64][SVE] Add SVE intrinsic for LD1RQ
Summary:
Adds the following intrinsic for contiguous load & replicate:
- @llvm.aarch64.sve.ld1rq
The LD1RQ intrinsic only needs the SImmS16XForm added by this
patch. The others (SImmS2XForm, SImmS3XForm & SImmS4XForm)
were added for consistency.
Reviewers: andwar, sdesmalen, efriedma, cameron.mcinally, dancgr, rengolin
Reviewed By: sdesmalen
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, danielkiss, cfe-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D76929
Benjamin Kramer [Wed, 22 Apr 2020 10:09:37 +0000 (12:09 +0200)]
Make some static class members constexpr
This allows them to be ODR used in C++17 mode. NFC.
Georgii Rymar [Thu, 16 Apr 2020 13:41:28 +0000 (16:41 +0300)]
[yaml2obj] - Program headers: add an additional check for `Offset`
The `Offset` field is used to set the file offset of a program header.
In a normal object it should not be greater than the minimal offset
of sections included into segment.
This patch adds a check for that and adds tests.
Differential revision: https://reviews.llvm.org/D78304
Georgii Rymar [Fri, 17 Apr 2020 12:06:04 +0000 (15:06 +0300)]
[yaml2obj] - Change how p_offset is calculated when creating segments. NFCI.
This depends on D78361 and simplifies the computation of the `p_offset`.
Differential revision: https://reviews.llvm.org/D78363
Georgii Rymar [Tue, 7 Apr 2020 15:20:51 +0000 (18:20 +0300)]
[obj2yaml] - Fix the issue with dumping empty sections when dumping program headers.
Imagine we have:
```
ProgramHeaders:
- Type: PT_LOAD
Flags: [ PF_W, PF_R ]
Sections:
- Section: .bar
VAddr: 0x2000
Sections:
- Name: .foo
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Address: 0x1000
- Name: .bar
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Address: 0x2000
```
Both `.foo` and `.bar` share the same starting file offset,
but `VA(.foo)` < `VA(PT_LOAD)`, we should not include it into segment.
This patch fixes the issue.
Differential revision: https://reviews.llvm.org/D77652
Sjoerd Meijer [Wed, 22 Apr 2020 09:17:28 +0000 (10:17 +0100)]
[ARM][MVE] Tail-predication: some more comments and debug messages. NFC.
Finding the loop tripcount is the first crucial step in preparing a loop for
tail-predication, and this adds a debug message if a tripcount cannot be found.
And while I was at it, I added some more comments here and there.
Differential Revision: https://reviews.llvm.org/D78485
Sam McCall [Tue, 21 Apr 2020 23:28:49 +0000 (01:28 +0200)]
[clangd] Remove vscode plugin: now https://github.com/clangd/vscode-clangd
Summary:
Moving this out of the monorepo for consistency with other editor plugins.
There's no version lock with clangd itself, and we never ran tests with lit.
The first version from the new repo has been published.
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D78598
Sjoerd Meijer [Wed, 22 Apr 2020 07:49:02 +0000 (08:49 +0100)]
[Driver][docs] Document option -mtune as a no-op.
This documents that option -mtune is accepted for compatibility with GCC,
currently it has no effect, and thus does not currently perform any CPU type
specific tuning.
Corresponding discussion on the cfe dev list:
http://lists.llvm.org/pipermail/cfe-dev/2020-April/065169.html
Differential Revision: https://reviews.llvm.org/D78511
Jay Foad [Wed, 22 Apr 2020 08:05:24 +0000 (09:05 +0100)]
[AMDGPU] Remove obsolete special case for 1024-bit vector types. NFC.
Jay Foad [Tue, 21 Apr 2020 10:50:49 +0000 (11:50 +0100)]
[AMDGPU] Simplify definition of VReg and AReg classes. NFC.
Differential Revision: https://reviews.llvm.org/D78553
Frederik Gossen [Tue, 21 Apr 2020 10:16:41 +0000 (10:16 +0000)]
[MLIR] Use nested symbol to identify kernel in `LaunchFuncOp`.
Summary:
Use a nested symbol to identify the kernel to be invoked by a `LaunchFuncOp` in the GPU dialect.
This replaces the two attributes that were used to identify the kernel module and the kernel within seperately.
Differential Revision: https://reviews.llvm.org/D78551
Frederik Gossen [Tue, 21 Apr 2020 07:11:10 +0000 (07:11 +0000)]
[MLIR] Use `kernel` as a short hand for `gpu.kernel` attribute.
Summary:
Use the shortcu `kernel` for the `gpu.kernel` attribute of `gpu.func`.
The parser supports this and test cases are easier to read.
Differential Revision: https://reviews.llvm.org/D78542
Sam Parker [Tue, 21 Apr 2020 14:57:28 +0000 (15:57 +0100)]
[NFC] Test changes
Add some more targets for the ARM cost model tests and add some tests
for icmps and bitcasts.
Frederik Gossen [Tue, 21 Apr 2020 07:00:37 +0000 (07:00 +0000)]
[MLIR] Fix test case for kernel attribute.
Summary:
Fix a broken test case in the `invalid.mlir` lit test case.
`expect` was missing its `e`.
Differential Revision: https://reviews.llvm.org/D78540
aartbik [Wed, 22 Apr 2020 03:43:00 +0000 (20:43 -0700)]
[llvm] [X86] Make test more robust against different builds
Summary:
Rationale:
Using the --debug-only flag requires a debug build. Also, the debug output is not always consistent over different builds.
This change avoids all problems by just testing the generated assembly for AVX.
Reviewers: craig.topper, mehdi_amini, nicolasvasilache
Reviewed By: craig.topper
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78609
Raphael Isemann [Wed, 22 Apr 2020 07:14:06 +0000 (09:14 +0200)]
[lldb] Fix modules build by adding missing include
This header is using FileSpec so we should at least include the forward header.
Kazushi (Jam) Marukawa [Wed, 22 Apr 2020 07:09:16 +0000 (09:09 +0200)]
[VE] Update shift operation instructions
Summary:
Changing all mnemonic to match assembly instructions to simplify mnemonic
naming rules. This time update all shift operation instructions. This also
corrects instruction's operation kinds.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D78468
Kazushi (Jam) Marukawa [Wed, 22 Apr 2020 07:07:28 +0000 (09:07 +0200)]
[VE] Add alternative names to registers
Summary:
VE uses identical names "%s0-63" to all generic registers. Change to use
alternative name mechanism among all generic registers instead of hard-
coding them.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D78174
Craig Topper [Wed, 22 Apr 2020 07:03:59 +0000 (00:03 -0700)]
[CallSite removal] Remove unneeded includes of CallSite.h. NFC
Alexander Belyaev [Wed, 22 Apr 2020 07:02:00 +0000 (09:02 +0200)]
[MLIR] Verify there are no side-effecting ops in GenericAtomicRMWOp body.
Differential Revision: https://reviews.llvm.org/D78559
Stephan Herhut [Tue, 21 Apr 2020 19:21:37 +0000 (21:21 +0200)]
[MLIR] Add extra locking during cubin generation.
We also need to lock the LLVMDialect mutex when initializing
LLVM targets or destroying llvm modules concurrently. Added another
scoped lock to that effect.
Differential Revision: https://reviews.llvm.org/D78580
Alexander Belyaev [Tue, 21 Apr 2020 14:00:28 +0000 (16:00 +0200)]
[MLIR] Update documentation for loop.parallel.
Differential Revision: https://reviews.llvm.org/D78562
Johannes Doerfert [Sat, 18 Apr 2020 01:47:38 +0000 (20:47 -0500)]
[Attributor] Replace AccessKind2Accesses map with an "array map"
The number of different access location kinds we track is relatively
small (8 so far). With this patch we replace the DenseMap that mapped
from index (0-7) to the access set pointer with an array of access set
pointers. This reduces memory consumption.
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: 472499 (215654/s)
temporary memory allocations: 77794 (35506/s)
peak heap memory consumption: 35.28MB
peak RSS (including heaptrack overhead): 125.46MB
total memory leaked: 269.04KB
```
After:
```
calls to allocation functions: 472270 (308673/s)
temporary memory allocations: 77578 (50704/s)
peak heap memory consumption: 32.70MB
peak RSS (including heaptrack overhead): 121.78MB
total memory leaked: 269.04KB
```
Difference:
```
calls to allocation functions: -229 (346/s)
temporary memory allocations: -216 (326/s)
peak heap memory consumption: -2.58MB
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B
```
---
Johannes Doerfert [Tue, 21 Apr 2020 16:13:20 +0000 (11:13 -0500)]
[Attributor] Run IRPosition::verify only with EXPENSIVE_CHECKS
Craig Topper [Wed, 22 Apr 2020 06:29:17 +0000 (23:29 -0700)]
[CallSite removal][Target] Replace CallSite with CallBase. NFC
In some cases just delete an unneeded include.
Qiu Chaofan [Fri, 17 Apr 2020 07:08:58 +0000 (15:08 +0800)]
[PowerPC] Exploit RLDIMI for OR with large immediates
This patch exploits rldimi instruction for patterns like
`or %a,
0b000011110000`, which saves number of instructions when the
operand has only one use, compared with `li-ori-sldi-or`.
Reviewed By: nemanjai
Differential Revision: https://reviews.llvm.org/D77850
Craig Topper [Tue, 21 Apr 2020 07:55:35 +0000 (00:55 -0700)]
[CallSite removal][TargetTransformInfoImpl] Replace CallSite with CallBase. NFC
Siva Chandra Reddy [Tue, 21 Apr 2020 16:58:12 +0000 (09:58 -0700)]
[libc][NFC] Cleanup dependencies in src/signal and test/src/signal.
Reviewers: abrachet
Differential Revision: https://reviews.llvm.org/D78585
Igor Kudrin [Wed, 22 Apr 2020 05:11:17 +0000 (12:11 +0700)]
[DebugInfo] Simplify DWARFUnit::determineStringOffsetsTableContribution(). NFC.
The method is called from only one place and the call is already guarded
by a condition which checks that IsDWO is false.
Differential Revision: https://reviews.llvm.org/D78482
Mehdi Amini [Wed, 22 Apr 2020 00:31:59 +0000 (00:31 +0000)]
Add `//` before the banner displayed in `--print-ir-before/after-all`
This is making the output file (when the stream is a file) a valid MLIR
file.
Differential Revision: https://reviews.llvm.org/D78604
Eli Friedman [Wed, 22 Apr 2020 04:00:19 +0000 (21:00 -0700)]
[TargetPassConfig] Run MachineVerifier after more passes.
We were disabling verification for no reason in a bunch of places; just
turn it on.
At this point, there are two key places where we don't run verification:
during register allocation, and after addPreEmitPass. Regalloc probably
isn't worth messing with; it has its own invariants, and verifying
afterwards is probably good enough. For after addPreEmitPass, it's
probably worth investigating improvements.
Ian Levesque [Tue, 21 Apr 2020 22:37:39 +0000 (18:37 -0400)]
[xray] Avoid text relocations in trampolines for ARM/AArch64
Summary: Switch to pc-relative lookup of the xray handler function to avoid text relocations.
Reviewers: MaskRay, dberris, johnislarry
Subscribers: kristof.beyls, danielkiss, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D78595
Ian Levesque [Tue, 21 Apr 2020 22:18:23 +0000 (18:18 -0400)]
[xray] Use hidden symbol visibility for xray trampolines
Summary: We load multiple copies of the trampolines into memory when instrumenting DSOs. Hidden visibility prevents conflicts in this scenario.
Reviewers: MaskRay, dberris, johnislarry
Subscribers: #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D78593
Fangrui Song [Wed, 22 Apr 2020 01:27:40 +0000 (18:27 -0700)]
[Frontend] Drop unneeded CC1 options
Sameer Sahasrabuddhe [Wed, 22 Apr 2020 01:57:26 +0000 (07:27 +0530)]
FixIrreducible: don't crash when moving a child loop
Summary:
When an irreducible SCC is converted into a new natural loop, existing
loops included in that SCC now become children of the new loop. The
logic that moves these loops from the parent loop to the new loop
invoked undefined behaviour when it modified the container that it was
iterating over. Fixed this by first extracting all the loops that are
to be removed from the parent.
Fixes bug 45623.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D78544
Dan Liew [Tue, 21 Apr 2020 01:52:26 +0000 (18:52 -0700)]
Add missing call to `__sanitizer::InitializePlatformEarly()` in UBSan's standalone init.
Summary:
While working on rdar://problem/
62083617 I noticed this call was
missing.
This is a no-op for all platforms except Darwin. For Darwin this
means the `use_xnu_fast_mmap` flag is initialized as it was intended
when using UBSan in standalone mode.
Reviewers: vitalybuka, vsk, kubamracek, yln, samsonov
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D78532
Dan Liew [Tue, 21 Apr 2020 01:27:43 +0000 (18:27 -0700)]
Add missing call to `Symbolizer::LateInitialize()` in UBSan's standalone init.
Summary:
This fixes symbolization in Standalone UBSan mode for the Darwin simulators.
861b69faee5df8d4e13ef316c7474a10e4069e81 (rdar://problem/
58789439) tried to fix
symbolization for all sanitizers on Darwin simulators but unfortunately it only
fixed the problem for TSan.
For UBSan in standalone mode the fix wasn't sufficient because UBSan's
standalone init doesn't call `Symbolizer::LateInitialize()` like ASan
and TSan do. This meant that `AtosSymbolizerProcess::LateInitialize()`
was never being called before
`AtosSymbolizerProcess::StartSymbolizerSubprocess()` which breaks an
invariant we expect to hold.
The missing call to `Symbolizer::LateInitialize()` during UBSan's
standalone init seems like an accidently omission so this patch simply
adds it.
rdar://problem/
62083617
Reviewers: vitalybuka, kubamracek, yln, samsonov
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D78530
Justin Hibbits [Tue, 21 Apr 2020 20:36:08 +0000 (15:36 -0500)]
[PowerPC] Add clang -msvr4-struct-return for 32-bit ELF
Summary:
Change the default ABI to be compatible with GCC. For 32-bit ELF
targets other than Linux, Clang now returns small structs in registers
r3/r4. This affects FreeBSD, NetBSD, OpenBSD. There is no change for
32-bit Linux, where Clang continues to return all structs in memory.
Add clang options -maix-struct-return (to return structs in memory) and
-msvr4-struct-return (to return structs in registers) to be compatible
with gcc. These options are only for PPC32; reject them on PPC64 and
other targets. The options are like -fpcc-struct-return and
-freg-struct-return for X86_32, and use similar code.
To actually return a struct in registers, coerce it to an integer of the
same size. LLVM may optimize the code to remove unnecessary accesses to
memory, and will return i32 in r3 or i64 in r3:r4.
Fixes PR#40736
Patch by George Koehler!
Reviewed By: jhibbits, nemanjai
Differential Revision: https://reviews.llvm.org/D73290
Andrew Browne [Mon, 6 Apr 2020 21:42:57 +0000 (14:42 -0700)]
Make SmallVector assert if it cannot grow.
Context:
/// Double the size of the allocated memory, guaranteeing space for at
/// least one more element or MinSize if specified.
void grow(size_t MinSize = 0) { this->grow_pod(MinSize, sizeof(T)); }
void push_back(const T &Elt) {
if (LLVM_UNLIKELY(this->size() >= this->capacity()))
this->grow();
memcpy(reinterpret_cast<void *>(this->end()), &Elt, sizeof(T));
this->set_size(this->size() + 1);
}
When grow is called in push_back() without a MinSize specified, this is
relying on the guarantee of space for at least one more element.
There is an edge case bug where the SmallVector is already at its maximum size
and push_back() calls grow() with default MinSize of zero. Grow is unable to
provide space for one more element, but push_back() assumes the additional
element it will be available. This can result in silent memory corruption, as
this->end() will be an invalid pointer and the program may continue executing.
Another alternative to fix would be to remove the default argument from
grow(), which would mean several changing grow() to grow(this->size()+1)
in several places.
No test case added because it would require allocating ~4GB.
Reviewers: echristo
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77601
Lawrence D'Anna [Tue, 21 Apr 2020 23:53:47 +0000 (16:53 -0700)]
get rid of PythonInteger::GetInteger()
Summary:
One small step in my long running quest to improve python exception handling in
LLDB. Replace GetInteger() which just returns an int with As<long long> and
friends, which return Expected types that can track python exceptions
Reviewers: labath, jasonmolenda, JDevlieghere, vadimcn
Reviewed By: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D78462
LLVM GN Syncbot [Tue, 21 Apr 2020 23:36:07 +0000 (23:36 +0000)]
[gn build] Port
23609331472
Amy Huang [Tue, 21 Apr 2020 21:25:32 +0000 (14:25 -0700)]
Reland "Implement some functions in NativeSession." with fixes so that
the tests pass on Linux.
Summary:
This change implements readFromExe, and calculating VA and RVA, which
are some of the functionalities that will be used for native PDB reading
for llvm symbolizer.
bug: https://bugs.llvm.org/show_bug.cgi?id=41795
Mircea Trofin [Tue, 21 Apr 2020 20:13:23 +0000 (13:13 -0700)]
[llvm][NFC][CallSite] Remove CallSite from FunctionAttrs
Reviewers: dblaikie, craig.topper
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D78584
Bruno Cardoso Lopes [Tue, 21 Apr 2020 22:30:54 +0000 (15:30 -0700)]
Reapply: Make header inclusion order from umbrella dirs deterministic
Sort the headers by name before adding the includes in
collectModuleHeaderIncludes. This makes the include order for building
umbrellas deterministic across different filesystems and also guarantees
that the ASTWriter always dump top headers in the same order.
There's currently no good way to test for this behavior.
This was first introduced in r289478 and reverted few times because of
ASANifed test failures on open source bots (both from LLVM and Swift).
Finally reproduced the problem in a Linux machine and use std::sort as a
fix, since we are not dealing with POD-like types.
rdar://problem/
28116411
Fangrui Song [Tue, 21 Apr 2020 21:44:03 +0000 (14:44 -0700)]
[ELF] Fix a null pointer dereference when relocating a Local-Exec TLS relocation for a lazy symbol
If there is no SHF_TLS section, there will be no PT_TLS and Out::tlsPhdr may be a nullptr.
If the symbol referenced by an R_TLS is lazy, we should treat the symbol as undefined.
Also reorganize tls-in-archive.s and tls-weak-undef.s . They do not test what they intended to test.
Dan Liew [Tue, 21 Apr 2020 22:13:15 +0000 (15:13 -0700)]
Disable a Darwin test under LSan.
* Changing source lines seems to cause us to hit rdar://problem/
62132428.
* Even if I workaround the above issue sometimes the source line in the dylib reported by atos is off by one.
It's simpler to just disable the test for now.
rdar://problem/
61793759