Jan Korous [Thu, 4 Jun 2020 04:39:55 +0000 (21:39 -0700)]
Relands "[YAMLVFSWriter][Test][NFC] Add couple tests" vol. 2
This reverts commit
e4e3e41905d182c0f3d5b0b9406e3cbf2aabb30f.
Fixed dangling StringRef in test.
Gongyu Deng [Thu, 4 Jun 2020 07:53:05 +0000 (09:53 +0200)]
[lldb] tab completion for `command script delete'
Summary: Added the tab completion for `command script delete`.
Reviewers: teemperor, JDevlieghere
Reviewed By: teemperor
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D80775
Jan Korous [Thu, 4 Jun 2020 08:10:49 +0000 (01:10 -0700)]
[Support][NFC] Tests for root_name(), root_directory() and root_path()
It's literally just doc comments converted to unittests.
Yevgeny Rouban [Thu, 4 Jun 2020 07:30:58 +0000 (14:30 +0700)]
[Instruction] Remove setProfWeight()
Remove the function Instruction::setProfWeight() and make
use of Instruction::copyMetadata(.., {LLVMContext::MD_prof}).
This is correct for all use cases of setProfWeight() as it
is applied to CallBase instructions only.
This change results in prof metadata copied intact even if
the source has "VP". The old pair of calls
extractProfTotalWeight() + setProfWeight() resulted in
setting branch_weights if the source had "VP" data.
Reviewers: yamauchi, davidxl
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80987
Mikael Holmen [Thu, 4 Jun 2020 07:38:56 +0000 (09:38 +0200)]
[WebAssembly] Fix gcc warning [NFC]
gcc 7.4 complained with
../lib/Target/WebAssembly/WebAssemblyFixBrTableDefaults.cpp:125:23: warning: extra ';' [-Wpedantic]
false);
^
Sam Parker [Tue, 2 Jun 2020 11:29:42 +0000 (12:29 +0100)]
[NFCI][CostModel][AMDGPU] Simplify getUserCost
Casts and intrinsics are now handled by the default implementation
of getUserCost, so remove them from the backends switch statement.
https://reviews.llvm.org/D80994
Jean Perier [Thu, 4 Jun 2020 07:41:28 +0000 (09:41 +0200)]
[flang] Fix IsConstantExpr for division expressions
Summary:
Fortran::evaluate::IsConstantExpr did not check that the numerator
was a constant expression. This patch fixes the issue.
Reviewers: DavidTruby, klausler, schweitz, PeteSteinfeld, jdoerfert, sscalpone
Reviewed By: klausler, PeteSteinfeld, sscalpone
Subscribers: llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D81096
Kazu Hirata [Thu, 4 Jun 2020 07:40:17 +0000 (00:40 -0700)]
[Inlining] Introduce -enable-npm-pgo-inline-deferral
Summary:
Experiments show that inline deferral past pre-inlining slightly
pessimizes the performance.
This patch introduces an option to control inline deferral during PGO.
The option defaults to true for now (that is, NFC).
Reviewers: davidxl
Reviewed By: davidxl
Subscribers: eraman, hiraditya, haicheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80776
Craig Topper [Thu, 4 Jun 2020 06:19:03 +0000 (23:19 -0700)]
[X86] Remove (V)MOVHPDrm patterns that involve bitcast+scalar_to_vec+loadi64.
I think these are left over from when we used to type legalize
v2f32 loads using bitcast+scalar_to_vec+loadi64 on 64-bit targets.
These days we use loadf64. If this becomes a problem a better
solution would be a DAG combine to turn it into scalar_to_vec+loadf64.
Kazushi (Jam) Marukawa [Thu, 4 Jun 2020 07:05:19 +0000 (09:05 +0200)]
[VE] Change to use EXTRACT_SUBREG instead of COPY_TO_REGCLASS
Summary:
Change to use EXTRACT_SUBREG instead of COPY_TO_REGCLASS in order to
remove unnecessary copy instructions.
Differential Revision: https://reviews.llvm.org/D81129
David Sherwood [Tue, 2 Jun 2020 13:44:24 +0000 (14:44 +0100)]
[SVE] Fix ubsan issues in DecodeIITType
In an earlier patch I removed the need for
IITDescriptor::ScalableVecArgument, which involved changing
DecodeIITType to pull out the last IIT_Info from the list. However,
it turns out this is unsafe and causes ubsan failures. I've tried to
fix this a different way by simply passing the last IIT_Info as an
additional argument to DecodeIITType.
Differential Revision: https://reviews.llvm.org/D81057
Martin Boehme [Fri, 29 May 2020 08:36:19 +0000 (10:36 +0200)]
[clang] Always allow including builtin headers in [no_undeclared_headers] modules.
Previously, this would fail if the builtin headers had been "claimed" by
a different module that wraps these builtin headers. libc++ does this,
for example.
This change adds a test demonstrating this situation; the test fails
without the fix.
Madhur Amilkanthwar [Thu, 4 Jun 2020 04:21:18 +0000 (09:51 +0530)]
Utility to dump .dot representation of SelectionDAG without firing viewer
Summary:
This patch adds support for dumping .dot
representation of SelectionDAG. It is inspired from the fact that,
a developer may want to just dump the graph at
a predictable path with a simple name to compare.
The exisitng utility (i.e. viewGraph) are overkill
for this motive hence this patch adds the requires support
while using the core routines from GraphWriter.
Example usage: DAG.dumpDotGraph("/tmp/graph.dot", "MyGraph")
will create /tmp/graph.dot file when DAG is an
object of SelectionDAG class.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D80711
Siva Chandra Reddy [Thu, 4 Jun 2020 05:39:34 +0000 (22:39 -0700)]
[libc][NFC] Add ceil[f], floor[f] and trunc[f] to the spec and config files.
Fangrui Song [Thu, 4 Jun 2020 05:05:15 +0000 (22:05 -0700)]
[gcov] Don't error 'unexpected end of memory buffe'
Fangrui Song [Thu, 4 Jun 2020 04:14:54 +0000 (21:14 -0700)]
[gcov] Make `Creating 'filename'` compatible with gcov
And clean up llvm-cov.test a bit
Philip Reames [Thu, 4 Jun 2020 03:31:17 +0000 (20:31 -0700)]
[Statepoint] Remove last of old ImmutableStatepoint code
To do so, I had to sink the old school inline operand handling into GCStatepointInst which is non ideal. This code should be removed shortly and I was able to at least clean it up a bunch.
Philip Reames [Thu, 4 Jun 2020 03:05:19 +0000 (20:05 -0700)]
[Statepoint] Delete more dead code from old wrappers
The verify() routine duplicates IR/Verifier.cpp checks, so while not technically dead it doesn't add any value either.
Philip Reames [Thu, 4 Jun 2020 02:49:25 +0000 (19:49 -0700)]
[Statepoint] Start the process of removing old interfaces
We introduced the GCStatepointInst class and have migrated almost all users of Statepoint/ImmutableStatepoint to the new API. Given downstream consumers have had a week to migrate, remove code which is now dead.
Eric Christopher [Thu, 4 Jun 2020 02:59:26 +0000 (19:59 -0700)]
Replace integer usage with enumeration.
Fangrui Song [Thu, 4 Jun 2020 02:58:28 +0000 (19:58 -0700)]
[gcov] Delete XFAIL: host-byteorder-big-endian
Add two to function-numbering.ll and exit-block.ll
Fangrui Song [Thu, 4 Jun 2020 02:29:21 +0000 (19:29 -0700)]
[gcov] Improve .gcno compatibility with gcov and use DataExtractor
llvm-cov.test and many Inputs/test* files contain wrong tests.
This patch rewrites a large portion of these files.
The pre-canned .gcno & .gcda are replaced by binaries produced by
clang --coverage (compatible with gcov 4.8~7)
(after some GCDAProfiling.c bugs were fixed by my previous commits).
Also make llvm-cov gcov on a little-endian host capable to parse big-endian .gcno and .gcda,
and make llvm-cov gcov on big-endian host capable to parse little-endian .gcno and .gcda
Yaxun (Sam) Liu [Fri, 1 May 2020 15:30:24 +0000 (11:30 -0400)]
[CUDA][HIP] Fix constexpr variables for C++17
constexpr variables are compile time constants and implicitly const, therefore
they are safe to emit on both device and host side. Besides, in many cases
they are intended for both device and host, therefore it makes sense
to emit them on both device and host sides if necessary.
In most cases constexpr variables are used as rvalue and the variables
themselves do not need to be emitted. However if their address is taken,
then they need to be emitted.
For C++14, clang is able to handle that since clang emits them with
available_externally linkage together with the initializer.
However for C++17, the constexpr static data member of a class or template class
become inline variables implicitly. Therefore they become definitions with
linkonce_odr or weak_odr linkages. As such, they can not have available_externally
linkage.
This patch fixes that by adding implicit constant attribute to
file scope constexpr variables and constexpr static data members
in device compilation.
Differential Revision: https://reviews.llvm.org/D79237
Xing GUO [Thu, 4 Jun 2020 01:25:26 +0000 (09:25 +0800)]
[ObjectYAML][ELF] Let the endianness of DWARF sections be inferred from FileHeader.
This patch helps infer the endianness of DWARF sections from `FileHeader`.
Reviewed By: jhenderson, grimar
Differential Revision: https://reviews.llvm.org/D81051
Xing GUO [Thu, 4 Jun 2020 00:53:40 +0000 (08:53 +0800)]
[ObjectYAML][DWARF] Support emitting the .debug_aranges section in ELFYAML.
This patch enables yaml2obj to emit the .debug_aranges section in ELFYAML.
Known issues:
- The current implementation of `debug_aranges` doesn't support emitting `segment` in the `(segment, address, length)` tuple. I will fix it in a follow-up patch.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D80972
Julian Lettner [Thu, 21 May 2020 18:14:55 +0000 (11:14 -0700)]
[Darwin] Add tests for OS version checking
Extract ParseVersion helper function for testing.
Reviewed By: delcypher
Differential Revision: https://reviews.llvm.org/D80761
Matt Arsenault [Sun, 31 May 2020 15:58:56 +0000 (11:58 -0400)]
GlobalISel: Start defining strict FP instructions
The AMDGPU lowering for unconstrained G_FDIV sometimes needs to
introduce a mode switch in the middle, so it's helpful to have
constrained instructions available to legalize this. Right now nothing
is preventing reordering of the mode switch with the other
instructions in the expansion.
Quentin Colombet [Wed, 3 Jun 2020 23:15:23 +0000 (16:15 -0700)]
[RegisterCoalescer] Update empty subranges when rematerializing
When we rematerialize a value as part of the coalescing, we may
widen the register class of the destination register.
When this happens, updateRegDefUses may create additional subranges
to account for the wider register class.
The created subranges are empty and if they are not defined by
the rematerialized instruction we clean them up.
However, if they are defined by the rematerialized instruction but
unused, we failed to flag them as dead definition and would leave
them as empty live-range.
This is wrong because empty live-ranges don't interfere with anything,
thus if we don't fix them, we would fail to account that the
rematerialized instruction clobbers some lanes.
E.g., let us consider the following pseudo code:
def.lane_low64:reg128 = ldimm
newdef:reg32 = COPY def.lane_low64_low32
When rematerialization happens for newdef, we end up with:
newdef.lane_low64:reg128 = ldimm
= use newdef.lane_low64_low32
Let's look at the live interval of newdef.
Before rematerialization, we would get:
newdef [defIdx, useIdx:0) 0@defIdx
Right after updateRegDefUses, newdef register class is widen to reg128
and the subrange definitions will be augmented to fill the subreg that
is used at the definition point, here lane_low64.
The resulting live interval would be:
newdef [newDefIdx, useIdx:0) 0@newDefIdx
* lane_low64_high32 EMPTY
* lane_low64_low32 [newDefIdx, useIdx:0)
Before this patch this would be the final status of the live interval.
Therefore we miss that lane_low64_high32 is actually live on the
definition point of newdef.
With this patch, after rematerializing, we check all the added subranges
and for the ones that are defined but empty, we flag them as dead def.
Thus, in that case, newdef would look like this:
newdef [newDefIdx, useIdx:0) 0@newDefIdx
* lane_low64_high32 [newDefIdx, newDefIdxDead) ; <-- instead of EMPTY
* lane_low64_low32 [newDefIdx, useIdx:0)
This fixes https://www.llvm.org/PR46154
Julian Lettner [Wed, 3 Jun 2020 23:59:59 +0000 (16:59 -0700)]
Eric Christopher [Wed, 3 Jun 2020 23:59:36 +0000 (16:59 -0700)]
consitfy and auto -> auto * a few places to clean up uses.
Matt Arsenault [Sun, 31 May 2020 20:18:52 +0000 (16:18 -0400)]
AArch64/GlobalISel: Fix assert on call returning 0 sized type
I don't know why this is considered valid IR, but it probably should
not be.
Matt Arsenault [Sat, 30 May 2020 15:04:15 +0000 (11:04 -0400)]
AMDGPU/GlobalISel: Handle uniform G_DYN_STACKALLOC
Matt Arsenault [Sat, 30 May 2020 14:54:43 +0000 (10:54 -0400)]
GlobalISel: Fail expansion of G_DYN_STACKALLOC for StackGrowsUp
Saleem Abdulrasool [Wed, 3 Jun 2020 19:20:35 +0000 (19:20 +0000)]
lld: add basic static library search
This is a very basic static library search addition. This is the pre-Xcode4
behaviour of searching all paths for the shared version before searching for
the static version of the library. This behaviour is supposed to be inverted
with `-search_paths_first` being the default. This adds the library search
with the intention of providing the setup to merge the paths into one path
and making it controllable by `OPT_search_paths_first`.
Vitaly Buka [Wed, 3 Jun 2020 23:12:08 +0000 (16:12 -0700)]
[StackSafety,NFC] Add statistic counters
Vitaly Buka [Wed, 3 Jun 2020 22:30:03 +0000 (15:30 -0700)]
Fix "Statistics are disabled"
There is no -DLLVM_ENABLE_STATS, only
-DLLVM_FORCE_ENABLE_STATS.
It was renamed by
6cf299cf01e4a83844126f7faf17cbeb78e88da9
Eric Christopher [Wed, 3 Jun 2020 21:20:46 +0000 (14:20 -0700)]
Fix typo in filename comment.
Philip Reames [Wed, 3 Jun 2020 22:21:11 +0000 (15:21 -0700)]
[Statepoints][CGP] Minor parameter type cleanup
Jessica Paquette [Wed, 3 Jun 2020 22:48:22 +0000 (15:48 -0700)]
[AArch64][NFC] Regenerate arm64-rev.ll
Test had some GISel stuff in it which was changed by
969d2d1ea94.
Thomas Lively [Wed, 3 Jun 2020 22:36:44 +0000 (15:36 -0700)]
[WebAssembly] Fix ISel crash in SIGN_EXTEND_INREG lowering
Summary:
The code previously assumed that the index of a vector extract was
constant, but this was not always true. This patch fixes the problem
by bailing out of the lowering if the index is nonconstant and also
replaces `static_cast`s in the lowering function with `cast`s because
the latter contain type-checking asserts that would make similar
issues easier to find and debug.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81025
Jessica Paquette [Tue, 2 Jun 2020 18:13:56 +0000 (11:13 -0700)]
[AArch64][GlobalISel] Add selection support for rev16, rev32, and rev64
This does three things:
1) Adds G_REV16, G_REV32, and G_REV64. These are equivalent to AArch64rev16,
AArch64rev32, and AArch64rev64 respectively.
2) Adds support for producing G_REV64 in the postlegalizer combiner.
We don't legalize any of the shuffles which could give us a G_REV32 or
G_REV16 yet. Since the function for detecting the rev mask is lifted from
AArch64ISelLowering, it should work for G_REV32 and G_REV16 when we get
there.
3) Adds a selection test for a good portion of the patterns imported for the rev
family. The only ones which are not tested are the ones with bitconvert.
This also does a little cleanup, and adds a struct for shuffle vector pseudo
matchdata. This lets us still use `applyShuffleVectorPseudo` rather than adding
a new function.
It should also make it a bit easier to port some of the other masks from
AArch64ISelLowering. (e.g. `isZIP_v_undef_Mask` and friends)
Differential Revision: https://reviews.llvm.org/D81112
Julian Lettner [Wed, 3 Jun 2020 22:24:53 +0000 (15:24 -0700)]
Fix bug in newly added VersionBase::operator>=
Fixup for
ba6b1b4353e33a7a36bcbad1d1c1157826197fd2.
Philip Reames [Wed, 3 Jun 2020 22:09:03 +0000 (15:09 -0700)]
[Statepoint] Fix signed vs unsigned in index handling
As noted in a comment on D80937, all of these are specified as unsigned values, but the verifier code was using signed. Given the practical values involved, the different in range didn't matter, but we might as well clean it up.
Jessica Paquette [Tue, 2 Jun 2020 16:30:04 +0000 (09:30 -0700)]
[AArch64][GlobalISel] Select uzp1 and uzp2
Porting the mask stuff for uzp1 and uzp2 from AArch64ISelLowering.
Add two custom opcodes: G_UZP1 and G_UZP2.
Produce them in the post-legalizer combiner when the mask checks out.
Tests:
- postlegalizer-combiner-uzp.mir verifies that we create G_UZP1 and G_UZP2.
The testcases that check that we create them come from neon-perm.ll.
- select-uzp.mir verifies that we can select G_UZP1 and G_UZP2.
Differential Revision: https://reviews.llvm.org/D81049
Hanhan Wang [Wed, 3 Jun 2020 22:00:33 +0000 (15:00 -0700)]
[mlir][StandardToSPIRV] Handle i1 case for lowering std.zexti to SPIR-V.
Differential Revision: https://reviews.llvm.org/D80965
Philip Reames [Wed, 3 Jun 2020 21:56:24 +0000 (14:56 -0700)]
Introduce a "gc-live" bundle for the gc arguments of a statepoint
Currently, gc.relocates are defined in terms of indices into the statepoint's operand list. Given the gc args are at the end of a variable length list of operands, this makes interpreting their indices by hand a tad challenging. We can simplify the statepoint sequence and improve readability quite a bit by pulling these new operands into their own named operand bundle.
This patch defines a new operand bundle tag "gc-live". The semantics of the bundle are the same as the existing gc arguments of a statepoint. This patch simply introduces the definition and codegen for the bundle, future patches will migrate RS4GC to emitting the new form.
Interestingly, with this done and the recent migration to using deopt and gc-transition bundles, we really don't have much left in the statepoint itself. It really looks like the existing ID and flags fields are redundant; we have (existing!) attributes for all of them. I think we'll be able to reduce the gc.statepoint signature to simply a wrapped call (e.g. actual target and actual arguments).
Differential Revision: https://reviews.llvm.org/D80937
Hanhan Wang [Wed, 3 Jun 2020 21:55:10 +0000 (14:55 -0700)]
[mlir][Linalg] Add support for fusion between indexed_generic ops and tensor_reshape ops
Summary:
The fusion for tensor_reshape is embedding the information to indexing maps,
thus the exising pattenr also works for indexed_generic ops.
Depends On D80347
Differential Revision: https://reviews.llvm.org/D80348
Hanhan Wang [Wed, 3 Jun 2020 21:58:19 +0000 (14:58 -0700)]
[mlir][Linalg] Add support for fusion between indexed_generic ops and generic ops on tensors.
Summary:
Different from the fusion between generic ops, indices are involved. In this
context, we need to re-map the indices for producer since the fused op is built
on consumer's perspective. This patch supports all combination of the fusion
between indexed_generic ops and generic ops, which includes tests case:
1) generic op as producer and indexed_generic op as consumer.
2) indexed_generic op as producer and generic op as consumer.
3) indexed_generic op as producer and indexed_generic op as consumer.
Differential Revision: https://reviews.llvm.org/D80347
Kadir Cetinkaya [Wed, 3 Jun 2020 21:50:26 +0000 (23:50 +0200)]
[clangd] Fix forgotten propagation of AsnycPreamble flag
aartbik [Wed, 3 Jun 2020 21:13:22 +0000 (14:13 -0700)]
[mlir] [VectorOps] Use 'vector.flat_transpose' for 2-D 'vector.tranpose'
Summary:
Progressive lowering of vector.transpose into an operation that
is closer to an intrinsic, and thus the hardware ISA. Currently
under the common vector transform testing flag, as we prepare
deploying this transformation in the LLVM lowering pipeline.
Reviewers: nicolasvasilache, reidtatge, andydavis1, ftynse
Reviewed By: nicolasvasilache, ftynse
Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, llvm-commits
Tags: #llvm, #mlir
Differential Revision: https://reviews.llvm.org/D80772
Jonas Devlieghere [Wed, 3 Jun 2020 21:53:30 +0000 (14:53 -0700)]
[lldb/Test] Python <3.5 requires **kwargs to come last
Thanks Martin Böhme for pointing this out.
Jonas Devlieghere [Wed, 3 Jun 2020 20:14:08 +0000 (13:14 -0700)]
[lldb/Test] Remove un(used|needed|maintained) files from lldbsuite.
Jim Ingham [Wed, 3 Jun 2020 21:29:22 +0000 (14:29 -0700)]
Add a test for preserving state on the non-expr thread across expression evaluation.
There may be another test that tests this but I couldn't find one.
LLVM GN Syncbot [Wed, 3 Jun 2020 21:16:03 +0000 (21:16 +0000)]
[gn build] Port
e636e6b79ac
LLVM GN Syncbot [Wed, 3 Jun 2020 21:16:02 +0000 (21:16 +0000)]
[gn build] Port
7f50c15be5c
Craig Topper [Wed, 3 Jun 2020 18:57:03 +0000 (11:57 -0700)]
[X86] Separate X86_CPU_TYPE_COMPAT_WITH_ALIAS from X86_CPU_TYPE_COMPAT. NFC
Add a separate X86_CPU_TYPE_COMPAT_ALIAS that carries alias string
and the enum from X86_CPU_TYPE_COMPAT.
Nico Weber [Wed, 3 Jun 2020 21:05:34 +0000 (17:05 -0400)]
[gn build] Fix link with ld.bfd and gold.
lld's symbol resolution algorithm makes it not depend on
the order of object files and libraries, but ld.bfd and
gold require listing dependencies later on the link line.
Put {{libs}} after {{inputs}} so that e.g. -lpthreads
appears after the object files, not before it.
Differential Revision: https://reviews.llvm.org/D81035
Thomas Lively [Wed, 3 Jun 2020 21:04:59 +0000 (14:04 -0700)]
Reland "[WebAssembly] Eliminate range checks on br_tables"
This reverts commit
755a89591528b692315ad0325347e2fd4637271b.
Although I was not able to reproduce any test failures locally,
aheejin was able to reproduce them and found a fix, applied here.
Dan Gohman [Tue, 21 Apr 2020 17:35:10 +0000 (10:35 -0700)]
[WebAssembly] Add support for -mexec-model=reactor
This adds a -mexec-model= command-line flag. The default value is "command"
which is no change from the current behavior. The other option is "reactor"
which enables the WASI Reactor ABI:
https://github.com/WebAssembly/WASI/blob/master/design/application-abi.md
Differential Revision: https://reviews.llvm.org/D62922
Christopher Tetreault [Wed, 3 Jun 2020 20:35:41 +0000 (13:35 -0700)]
[SVE] Eliminate calls to default-false VectorType::get() from IR
Reviewers: efriedma, kmclaughlin, sdesmalen, dexonsmith, dblaikie
Reviewed By: efriedma
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80261
Konrad Kleine [Wed, 3 Jun 2020 20:53:43 +0000 (16:53 -0400)]
[clang-tidy]: Added modernize-replace-disallow-copy-and-assign-macro
Summary:
This check finds macro expansions of `DISALLOW_COPY_AND_ASSIGN(Type)` and
replaces them with a deleted copy constructor and a deleted assignment operator.
Before the `delete` keyword was introduced in C++11 it was common practice to
declare a copy constructor and an assignment operator as a private members. This
effectively makes them unusable to the public API of a class.
With the advent of the `delete` keyword in C++11 we can abandon the
`private` access of the copy constructor and the assignment operator and
delete the methods entirely.
Migration example:
```
lang=dif
class Foo {
private:
- DISALLOW_COPY_AND_ASSIGN(Foo);
+ Foo(const Foo &) = delete;
+ const Foo &operator=(const Foo &) = delete;
};
```
Reviewers: alexfh, hokein, aaron.ballman, njames93
Reviewed By: njames93
Subscribers: Eugene.Zelenko, mgorny, xazax.hun, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D80531
Matt Arsenault [Tue, 19 Mar 2019 17:50:22 +0000 (13:50 -0400)]
RegAllocFast: Record internal state based on register units
Record internal state based on register units. This is often more
efficient as there are typically fewer register units to update
compared to iterating over all the aliases of a register.
Original patch by Matthias Braun, but I've been rebasing and fixing it
for almost 2 years and fixed a few bugs causing intermediate failures
to make this patch independent of the changes in
https://reviews.llvm.org/D52010.
Matt Arsenault [Wed, 3 Jun 2020 20:09:06 +0000 (16:09 -0400)]
X86: Switch fastregalloc test to use generated checks
Julian Lettner [Thu, 14 May 2020 21:52:35 +0000 (14:52 -0700)]
[Darwin] Improve runtime OS version checks
Use a struct to represent numerical versions instead of encoding release
names in an enumeration. This avoids the need to extend the enumeration
every time there is a new release.
Rename `GetMacosVersion() -> GetMacosAlignedVersion()` to better reflect
how this is used on non-MacOS platforms.
Reviewed By: delcypher
Differential Revision: https://reviews.llvm.org/D79970
Lukas Sommer [Wed, 3 Jun 2020 20:32:49 +0000 (16:32 -0400)]
Replace separator in OpenMP variant name mangling.
Summary:
Nvidia PTX does not allow `.` to appear in identifiers, so OpenMP variant mangling now uses `$` to separate segments of the mangled name for variants of functions declared via `declare variant`.
Reviewers: jdoerfert, Hahnfeld
Reviewed By: jdoerfert
Subscribers: yaxunl, guansong, sstefan1, cfe-commits
Tags: #openmp, #clang
Differential Revision: https://reviews.llvm.org/D80439
Davide Italiano [Wed, 3 Jun 2020 19:21:35 +0000 (12:21 -0700)]
[IRInterpreter] Unused. Drive-by cleanup. NFCI.
Jacques Pienaar [Wed, 3 Jun 2020 20:09:07 +0000 (13:09 -0700)]
[mlir] Remove unneeded inference trait/fns
Therse are all handled with the simple return type inference in ODS.
Also update some summaries to match what is recommended in ODS doc.
mydeveloperday [Wed, 3 Jun 2020 19:44:08 +0000 (20:44 +0100)]
[clang-format] [PR46157] Wrong spacing of negative literals with use of operator
Summary:
see https://bugs.llvm.org/show_bug.cgi?id=46157
Reviewed By: curdeius
Differential Revision: https://reviews.llvm.org/D80933
mydeveloperday [Wed, 3 Jun 2020 19:42:09 +0000 (20:42 +0100)]
[clang-format] [PR46159] Linux kernel 'C' code uses 'try' as a variable name, allow clang-format to handle such cases
Reviewed By: curdeius
Differential Revision: https://reviews.llvm.org/D80940
Vyacheslav Zakharin [Wed, 27 May 2020 19:27:53 +0000 (12:27 -0700)]
Define __SPIR__ macro for spir/spir64 targets.
Differential Revision: https://reviews.llvm.org/D80655
Raphael Isemann [Wed, 3 Jun 2020 19:30:07 +0000 (21:30 +0200)]
[lldb][NFC] Fix documentation formatting in ASTResultSynthesizer
This comment apparently didn't survive the great LLDB reformatting unharmed.
Vedant Kumar [Wed, 3 Jun 2020 18:52:29 +0000 (11:52 -0700)]
[lldb/StringPrinter] Support strings with invalid utf8 sub-sequences
Support printing strings which contain invalid utf8 sub-sequences, e.g.
strings like "hello world \xfe", instead of bailing out with "Summary
Unavailable".
I took the opportunity here to delete some hand-rolled utf8 -> utf32
conversion code and replace it with calls into llvm's Support library.
rdar://
61554346
Vedant Kumar [Wed, 3 Jun 2020 18:51:22 +0000 (11:51 -0700)]
[lldb/StringPrinter] Convert DecodedCharBuffer to a class, NFC
The m_size and m_data members of DecodedCharBuffer are meant to be
private.
Florian Hahn [Wed, 3 Jun 2020 19:11:52 +0000 (20:11 +0100)]
[AArch64] Fix stp-opt-with-renaming-ld3.mir with expensive checks.
Unconditionally use -verify-machineinstrs and XFAIL the test until
fixed.
Saleem Abdulrasool [Wed, 3 Jun 2020 18:13:05 +0000 (18:13 +0000)]
lld: use `std::make_unique` (NFC)
The LLVM code base already uses C++14, use std::make_unique
to avoid the explicit constructor invocation via new and to avoid
spelling out the type twice.
Arnold Schwaighofer [Tue, 2 Jun 2020 14:19:22 +0000 (07:19 -0700)]
CoroSplit: Fix coroutine splitting for retcon and retcon.once
Summary:
For retcon and retcon.once coroutines we assume that all uses of spills
can be sunk past coro.begin. This simplifies handling of instructions
that escape the address of an alloca.
The current implementation would have issues if the address of the
alloca is escaped before coro.begin. (It also has issues with casts before and
uses of those casts after the coro.begin instruction)
%alloca_addr = alloca ...
%escape = ptrtoint %alloca_addr
coro.begin
store %escape to %alloca_addr
rdar://
60272809
Subscribers: hiraditya, modocache, mgrang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81023
Simon Pilgrim [Wed, 3 Jun 2020 18:41:56 +0000 (19:41 +0100)]
[VectorCombine] Add multi-use shl test for D80885
Florian Hahn [Wed, 3 Jun 2020 16:12:45 +0000 (17:12 +0100)]
[AArch64] Add ld3 test case for renaming in ldst-opt (NFC).
The test case highlights a mis-compile reported in PR46105, where
a consecutive register list is renamed, which invalidates some other
used registers.
Florian Hahn [Wed, 3 Jun 2020 11:24:56 +0000 (12:24 +0100)]
[NewGVN] Add test to ensure metadata is preserved for ssa_copy (NFC)
Add a new test that checks that metadata is preserved when ssa_copy
calls introduced by PredicateInfo are replaced by their original
values.
Lang Hames [Wed, 3 Jun 2020 04:31:26 +0000 (21:31 -0700)]
[JITLink] Skip debug sections in MachO objects.
Debug sections will not be linked into the final executable and may contain
ambiguous relocations*. Skipping them avoids both some unnecessary processing
cost and the hassle of dealing with the problematic relocations.
* E.g. __debug_ranges contains non-extern relocations to the end of functions
hat begin with named symbols. Under the usual rules for interpreting non-extern
relocations these will be incorrectly associated with the following block, or
no block at all (if there is a gap between one block and the next).
Simon Pilgrim [Wed, 3 Jun 2020 17:53:35 +0000 (18:53 +0100)]
[VectorCombine] Add multi-use multiply test for D80885
Richard Smith [Wed, 3 Jun 2020 17:52:55 +0000 (10:52 -0700)]
[doc] Fix use of ` where `` was intended in attribute docs.
`...` is rST syntax for hyperlinks etc. ``...`` should be used for code snippets.
Steven Wan [Wed, 3 Jun 2020 17:49:47 +0000 (13:49 -0400)]
[AIX] Change the default target CPU to power4 for AIX on Power
Summary: This patch changes the AIX default target CPU to power4 since this is the the lowest arch for the lowest OS level supported.
Reviewers: hubert.reinterpretcast, cebowleratibm, daltenty
Reviewed By: hubert.reinterpretcast
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80835
Dorit Nuzman [Wed, 3 Jun 2020 17:11:54 +0000 (13:11 -0400)]
[InstSimplify] fix bug in matching or-with-not op (PR46083)
jasonliu [Wed, 3 Jun 2020 16:23:12 +0000 (16:23 +0000)]
[XCOFF][AIX] Use 'L..' instead of 'L' for PrivateGlobalPrefix
Without this change, names start with 'L' will get created as
temporary symbol in MCContext::createSymbol.
Some other potential prefix considered:
.L, does not work for AIX, as a function start with L will end
up with .L as prefix for its function entry point.
..L could work, but it does not play well with the convention
on AIX that anything start with '.' are considered as entry point.
L. could work, but not sure if it's safe enough, as it's possible
to have suffixes like .something append to a plain L, giving L.something
which is not necessarily a temporary.
That's why we picked L.. for now.
Differential Revision: https://reviews.llvm.org/D80831
Hiroshi Yamauchi [Tue, 2 Jun 2020 22:10:02 +0000 (15:10 -0700)]
[profile] Sync InstrProfData.inc with llvm.
Reviewers: davidxl
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D81038
Louis Dionne [Wed, 3 Jun 2020 16:58:50 +0000 (12:58 -0400)]
[libc++] Fix test broken in C++03 due to requiring C++11 features from vector
Richard Smith [Wed, 3 Jun 2020 16:56:38 +0000 (09:56 -0700)]
[doc] Fix typo.
The absence of a space here caused this codeblock to be missing from the rendered output.
Jonas Devlieghere [Wed, 3 Jun 2020 16:31:15 +0000 (09:31 -0700)]
[lldb/Test] Don't print 'command invoked'
The different tools constructing dotest invocations (lit and
lldb-dotest) already print the command invocation so there's no need to
print it again in the dotest output.
My motivation for removing it is that it doesn't include the Python
interpreter and every time I accidentally copy it, the command fails
with an `ImportError`.
Differential revision: https://reviews.llvm.org/D81032
Frederik Gossen [Wed, 3 Jun 2020 16:14:42 +0000 (16:14 +0000)]
[MLIR] Shape to standard dialect lowering
Add a new pass to lower operations from the `shape` to the `std` dialect.
The conversion applies only to the `size_to_index` and `index_to_size`
operations and affected types.
Other patterns will be added as needed.
Differential Revision: https://reviews.llvm.org/D81091
Louis Dionne [Wed, 3 Jun 2020 15:51:59 +0000 (11:51 -0400)]
[libc++] Support move construction and assignment in <thread> in C++03
Libc++ provides support for <thread> in C++03 as an extension. Furthermore,
it does not support any compiler that doesn't have rvalue references. It
is hence possible to provide the move constructor and move assignment
operator in C++03.
Paul Pelzl [Wed, 3 Jun 2020 09:50:45 +0000 (12:50 +0300)]
[analyzer] ObjCAutoreleaseWriteChecker: Support explicit autoreleasepools.
The checker currently supports only a whitelist of block-enumeration
methods which are known to internally clear an autorelease pool.
Extend this checker to detect writes within the scope of explicit
@autoreleasepool statements.
rdar://
25301111
Differential Revision: https://reviews.llvm.org/D81072
Paul Pelzl [Wed, 3 Jun 2020 08:39:12 +0000 (11:39 +0300)]
[analyzer] Add support for ObjCIndirectCopyRestoreExpr.
Idiomatic objc using ARC will generate this expression regularly due to
NSError out-param passing. Providing an implementation for this
expression allows the analyzer to explore many more codepaths in ARC
projects.
The current implementation is not perfect but the differences are hopefully
subtle enough to not cause much problems.
rdar://
63918914
Differential Revision: https://reviews.llvm.org/D81071
Victor Huang [Wed, 3 Jun 2020 15:37:07 +0000 (10:37 -0500)]
[CodeGen] Enable tail call position check for speculatable functions
In the function "Analysis.cpp:isInTailCallPosition", it only checks whether
a call is in a tail call position if the call has side effects, access memory
or it is not safe to speculative execute. Therefore, a speculatable function
will not go through tail call position check and improperly tail called when
it is not in a tail-call position. This patch enables tail call position check
for speculatable functions.
Differential Revision: https://reviews.llvm.org/D80661
Saleem Abdulrasool [Tue, 2 Jun 2020 23:05:09 +0000 (23:05 +0000)]
lld: ignore the `-search_paths_first` option on MachO
ld64 provides the `-search_path_firsts` which will search each path in
the library search path order for both `lib[name].dylib`, `lib[name].a`
before moving on (searching all paths for the dylib and then falling
back to the static library if a shared library was not found).
This option has been the default for a long time, but the command line
flag still exists. Ignore it for compatibility.
David Zarzycki [Wed, 3 Jun 2020 15:23:27 +0000 (11:23 -0400)]
[libcxx testing] Fix bot failure in my last commit
Kang Zhang [Wed, 3 Jun 2020 15:25:30 +0000 (15:25 +0000)]
[LiveVariables] Don't set undef reg PHI used as live for FromMBB
Summary:
In the patch D73152, it adds a new function LiveVariables::addNewBlock.
This new function will add the reg which PHI used to the MBB which reg
is from.
But the new function may cause LiveVariable Verification failed when the
Src reg in PHI is undef.
Reviewed By: bjope
Differential Revision: https://reviews.llvm.org/D80077
Henry Kao [Wed, 3 Jun 2020 15:12:25 +0000 (11:12 -0400)]
[CodeGen][SVE] Replace deprecated calls in getCopyFromPartsVector()
Summary: Replaced getVectorNumElements() with getVectorElementCount(). Added operator overloads for class ElementCount. Fixes warning in several AArch64 unit tests.
Reviewers: sdesmalen, kmclaughlin, dancgr, efriedma, each, andwar, rengolin
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80826
Yonghong Song [Tue, 2 Jun 2020 07:47:18 +0000 (00:47 -0700)]
[BPF] Remove unnecessary MOV_32_64 instructions
Commit
13f6c81c5d9a ("[BPF] simplify zero extension
with MOV_32_64") tried to use MOV_32_64 instructions
instead of lshift/rshift instructions for zero extension.
This has the benefit to remove the number of instructions
and may help verifier too.
But the same commit also removed the old MOV_32_64
pruning as it deems unsafe as MOV_32_64 does have the
side effect, zeroing out the top 32bit in the register.
This caused the following failure in kernel selftest
test_cls_redirect.o. In linux kernel, we have
struct __sk_buff {
__u32 data;
__u32 data_end;
};
The compiler will generate 32bit load for __sk_buff->data
and __sk_buff->data_end. But kernel verifier will actually
loads an address (64bit address on 64bit kernel) to the
result register. In this particular example, the explicit zext
was not optimized away and destroyed top 32bit
address and the verifier rejected the program :
w2 = *(u32 *)(r1 + 76)
...
r2 = w2 /* MOV_32_64: this will clear top 32bit */
Currently, if the load and the zext are next to each other, the
instruction pattern match can actually capture this to
avoid MOV_32_64, e.g., in BPFInstrInfo.td, we have
def : Pat<(i64 (zextloadi32 ADDRri:$src)),
(SUBREG_TO_REG (i64 0), (LDW32 ADDRri:$src), sub_32)>;
However, if they are not next to each other, LDW32 and
MOV_32_64 are generated, which may cause the above mentioned
problem.
BPF Backend already tried to optimize away pattern
mov_32_64 + lshift + rshift
Commit
13f6c81c5d9a may generate mov_32_64 not followed by shifts.
This patch added optimization for only mov_32_64 too.
Differential Revision: https://reviews.llvm.org/D81048
Simon Pilgrim [Wed, 3 Jun 2020 15:05:31 +0000 (16:05 +0100)]
Fix gcc -Wdocumentation warning. NFC.
gcc doesn't recognise @llvm.experimental.guard as a code snippet