OSDN Git Service
Matt Arsenault [Sun, 5 Jan 2020 17:22:21 +0000 (12:22 -0500)]
AMDGPU/GlobalISel: Add pre-legalize combiner pass
Just copy the AArch64 pass as-is for now, except for removing the
memcpy handling.
Aaron Ballman [Wed, 22 Jan 2020 14:53:06 +0000 (09:53 -0500)]
Unconditionally enable lvalue function designators; NFC
We previously had to guard against older MSVC and GCC versions which had rvalue
references but not support for marking functions with ref qualifiers. However,
having bumped our minimum required version to MSVC 2017 and GCC 5.1 mean we can
unconditionally enable this feature. Rather than keeping the macro around, this
replaces use of the macro with the actual ref qualifier.
Sanjay Patel [Wed, 22 Jan 2020 14:29:19 +0000 (09:29 -0500)]
[InstCombine] fneg(X + C) --> -C - X
This is 1 of the potential folds uncovered by extending D72521.
We don't seem to do this in the backend either (unless I'm not
seeing some target-specific transform).
icc and gcc (appears to be target-specific) do this transform.
Differential Revision: https://reviews.llvm.org/D73057
Kazushi (Jam) Marukawa [Wed, 22 Jan 2020 14:45:42 +0000 (15:45 +0100)]
[VE] setcc isel patterns
Summary: SETCC isel patterns and tests for i32/64 and fp32/64 comparison
Reviewers: arsenm, rengolin, craig.topper, k-ishizaka
Reviewed By: arsenm
Subscribers: merge_guards_bot, wdng, hiraditya, llvm-commits
Tags: #ve, #llvm
Differential Revision: https://reviews.llvm.org/D73171
David Green [Wed, 22 Jan 2020 13:45:16 +0000 (13:45 +0000)]
[ARM] Basic gather scatter cost model
This is a very basic MVE gather/scatter cost model, based roughly on the
code that we will currently produce. It does not handle truncating
scatters or extending gathers correctly yet, as it is difficult to tell
that they are going to be correctly extended/truncated from the limited
information in the cost function.
This can be improved as we extend support for these in the future.
Based on code originally written by David Sherwood.
Differential Revision: https://reviews.llvm.org/D73021
David Green [Wed, 22 Jan 2020 13:44:36 +0000 (13:44 +0000)]
[ARM] MVE Gather Scatter cost model tests. NFC
Sander de Smalen [Wed, 22 Jan 2020 10:42:57 +0000 (10:42 +0000)]
[AArch64][SVE] Add patterns for unpredicated load/store to frame-indices.
This patch also fixes up a number of cases in DAGCombine and
SelectionDAGBuilder where the size of a scalable vector is used in a
fixed-width context (thus triggering an assertion failure).
Reviewers: efriedma, c-rhodes, rovka, cameron.mcinally
Reviewed By: efriedma
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71215
Jay Foad [Mon, 6 Jan 2020 11:22:51 +0000 (11:22 +0000)]
[MachineScheduler] Allow clustering mem ops with complex addresses
The generic BaseMemOpClusterMutation calls into TargetInstrInfo to
analyze the address of each load/store instruction, and again to decide
whether two instructions should be clustered. Previously this had to
represent each address as a single base operand plus a constant byte
offset. This patch extends it to support any number of base operands.
The old target hook getMemOperandWithOffset is now a convenience
function for callers that are only prepared to handle a single base
operand. It calls the new more general target hook
getMemOperandsWithOffset.
The only requirements for the base operands returned by
getMemOperandsWithOffset are:
- they can be sorted by MemOpInfo::Compare, such that clusterable ops
get sorted next to each other, and
- shouldClusterMemOps knows what they mean.
One simple follow-on is to enable clustering of AMDGPU FLAT instructions
with both vaddr and saddr (base register + offset register). I've left
a FIXME in the code for this case.
Differential Revision: https://reviews.llvm.org/D71655
Matt Arsenault [Wed, 22 Jan 2020 02:35:56 +0000 (21:35 -0500)]
AMDGPU/GlobalISel: Fix RegbankSelect for llvm.amdgcn.fmul.legacy
Matt Arsenault [Sat, 18 Jan 2020 01:51:01 +0000 (20:51 -0500)]
AMDGPU/GlobalISel: Handle atomic_inc/atomic_dec
The intermediate instruction drops the extra volatile argument. We are
missing an atomic ordering on these.
Matt Arsenault [Fri, 17 Jan 2020 20:40:15 +0000 (15:40 -0500)]
AMDGPU: Fix interaction of tfe and d16
This using the wrong result register, and dropping the result entirely
for v2f16. This would fail to select on the scalar case. I believe it
was also mishandling packed/unpacked subtargets.
Jaroslav Sevcik [Wed, 22 Jan 2020 14:19:44 +0000 (15:19 +0100)]
[ASTImporter] Properly delete decls from SavedImportPaths
Summary:
We see a significant regression (~40% slower on large codebases) in expression evaluation after https://reviews.llvm.org/rL364771. A sampling profile shows the extra time is spent in SavedImportPathsTy::operator[] when called from ASTImporter::Import. I believe this is because ASTImporter::Import adds an element to the SavedImportPaths map for each decl unconditionally (see https://github.com/llvm/llvm-project/blob/
7b81c3f8793d30a4285095a9b67dcfca2117916c/clang/lib/AST/ASTImporter.cpp#L8256).
To fix this, we call SavedImportPathsTy::erase on the declaration rather than clearing its value vector. That way we do not accidentally introduce new empty elements. (With this patch the performance is restored, and we do not see SavedImportPathsTy::operator[] in the profile anymore.)
Reviewers: martong, teemperor, a.sidorin, shafik
Reviewed By: martong
Subscribers: rnkovacs, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73166
Aaron Ballman [Wed, 22 Jan 2020 14:05:38 +0000 (09:05 -0500)]
Revert "Extend misc-misplaced-const to detect using declarations as well as typedef"
This reverts commit
ecc7dae50c41bc8a129a158ecf0ae0270126505c due to breaking bots:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/22157
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/43297
Matt Arsenault [Wed, 17 Jul 2019 02:37:02 +0000 (22:37 -0400)]
AMDGPU/GlobalISel: RegBankSelect interp intrinsics
Note this assumes the future use of immediates for immarg, not the
current G_CONSTANT which will be emitted.
Matt Arsenault [Sun, 12 Jan 2020 17:34:10 +0000 (12:34 -0500)]
AMDGPU: Fix missing immarg on llvm.amdgcn.interp.mov
The first operand maps to an immediate field, so this should be
immarg.
Sanjay Patel [Mon, 20 Jan 2020 18:32:55 +0000 (13:32 -0500)]
[InstCombine] add tests for fneg+fadd; NFC
Simon Pilgrim [Wed, 22 Jan 2020 13:52:26 +0000 (13:52 +0000)]
[SelectionDAG] getShiftAmountConstant - assert the type is an integer.
Simon Pilgrim [Wed, 22 Jan 2020 13:47:58 +0000 (13:47 +0000)]
Use SelectionDAG::getShiftAmountConstant(). NFCI.
Clement Courbet [Wed, 22 Jan 2020 13:40:53 +0000 (14:40 +0100)]
[llvm-mca][NFC] Regenerate tests @HEAD.
For Zen2.
Alexander Lanin [Wed, 22 Jan 2020 13:45:20 +0000 (08:45 -0500)]
Extend misc-misplaced-const to detect using declarations as well as typedef
Denis Khalikov [Wed, 22 Jan 2020 13:05:27 +0000 (08:05 -0500)]
[mlir][spirv] Add lowering for composite std.constant.
Add lowering for constant operation with ranked tensor type to
spv.constant with spv.array type.
Differential Revision: https://reviews.llvm.org/D73022
Jacques Pienaar [Tue, 21 Jan 2020 17:40:22 +0000 (09:40 -0800)]
[mlir] Enable specifying verify on OpInterface
Summary:
Add method in ODS to specify verification for operations implementing a
OpInterface. Use this with infer type op interface to verify that the
inferred type matches the return type and remove special case in
TestPatterns.
This could also have been achieved by using OpInterfaceMethod but verify
seems pretty common and it is not an arbitrary method that just happened
to be named verifyTrait, so having it be defined in special way seems
appropriate/better documenting.
Differential Revision: https://reviews.llvm.org/D73122
Simon Pilgrim [Wed, 22 Jan 2020 12:08:41 +0000 (12:08 +0000)]
[X86][SSE] combineExtractWithShuffle - pull out repeated extract index code. NFCI.
Simon Pilgrim [Wed, 22 Jan 2020 11:07:27 +0000 (11:07 +0000)]
Remove extra ';' to fix Wpedantic. NFCI.
Pavel Labath [Tue, 21 Jan 2020 16:04:39 +0000 (17:04 +0100)]
[lldb/DWARF] Remove one more auto-dwo method
Summary:
Our DWARFUnit was automatically forwarding the requests to the split
unit when looking for a DIE by offset. llvm::DWARFUnit does not do that,
and is not likely to start doing it any time soon.
This patch deletes the this logic and updates the callers to request the
correct unit instead. While doing that, I've found a bit of duplicated
code for lookup up a function and block by address, so I've extracted
that into a helper function.
Reviewers: JDevlieghere, aprantl, clayborg, jdoerfert
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73112
Thomas Preud'homme [Fri, 10 Jan 2020 16:56:07 +0000 (16:56 +0000)]
[lld/ELF] PR44498: Support input filename in double quote
Summary:
Linker scripts allow filenames to be put in double quotes to prevent
characters in filenames that are part of the linker script syntax from
having their special meaning. Case in point the * wildcard character.
Availability of double quoting filenames also allows to fix a failure in
ELF/linkerscript/filename-spec.s when the path contain a @ which the
lexer consider as a special characters and thus break up a filename
containing it. This may happens under Jenkins which createspath such as
pipeline@2.
To avoid the need for escaping GlobPattern metacharacters in filename
in double quotes, GlobPattern::create is augmented with a new parameter
to request literal matching instead of relying on the presence of a
wildcard character in the pattern.
Reviewers: jhenderson, MaskRay, evgeny777, espindola, alexshap
Reviewed By: MaskRay
Subscribers: peter.smith, grimar, ruiu, emaste, arichardson, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72517
Kerry McLaughlin [Wed, 22 Jan 2020 10:15:40 +0000 (10:15 +0000)]
[AArch64][SVE] Add intrinsic for non-faulting loads
Summary:
This patch adds the llvm.aarch64.sve.ldnf1 intrinsic, plus
DAG combine rules for non-faulting loads and sign/zero extends
Reviewers: sdesmalen, efriedma, andwar, dancgr, mgudim, rengolin
Reviewed By: sdesmalen
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cameron.mcinally, cfe-commits, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71698
Peter Smith [Tue, 21 Jan 2020 14:05:01 +0000 (14:05 +0000)]
[LLD][ELF][ARM] Don't apply --fix-cortex-a8 to relocatable links.
The --fix-cortex-a8 is sensitive to alignment and the precise destination
of branch instructions. These are not knowable at relocatable link time. We
follow GNU ld and the --fix-cortex-a53-843419 (D72968) by not patching the
code when there is a relocatable link.
Differential Revision: https://reviews.llvm.org/D73100
Kadir Cetinkaya [Tue, 21 Jan 2020 14:15:06 +0000 (15:15 +0100)]
[clangd] Do not duplicate TemplatedDecls in findExplicitReferences
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73101
Saar Raz [Wed, 22 Jan 2020 10:16:35 +0000 (12:16 +0200)]
Revert "[Concepts] Fix bug when referencing function parameters in instantiated function template requires clause"
This temporarily reverts commit
45538b5fb280e5b2903f7924fd4fa5b07a6dd3ea which breaks a test.
Sander de Smalen [Tue, 21 Jan 2020 10:20:27 +0000 (10:20 +0000)]
Add support for (expressing) vscale.
In LLVM IR, vscale can be represented with an intrinsic. For some targets,
this is equivalent to the constexpr:
getelementptr <vscale x 1 x i8>, <vscale x 1 x i8>* null, i32 1
This can be used to propagate the value in CodeGenPrepare.
In ISel we add a node that can be legalized to one or more
instructions to materialize the runtime vector length.
This patch also adds SVE CodeGen support for VSCALE, which maps this
node to RDVL instructions (for scaled multiples of 16bytes) or CNT[HSD]
instructions (scaled multiples of 2, 4, or 8 bytes, respectively).
Reviewers: rengolin, cameron.mcinally, hfinkel, sebpop, SjoerdMeijer, efriedma, lattner
Reviewed by: efriedma
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68203
Saar Raz [Wed, 22 Jan 2020 00:03:05 +0000 (02:03 +0200)]
[Concepts] Placeholder constraints and abbreviated templates
This patch implements P1141R2 "Yet another approach for constrained declarations".
General strategy for this patch was:
- Expand AutoType to include optional type-constraint, reflecting the wording and easing the integration of constraints.
- Replace autos in parameter type specifiers with invented parameters in GetTypeSpecTypeForDeclarator, using the same logic
previously used for generic lambdas, now unified with abbreviated templates, by:
- Tracking the template parameter lists in the Declarator object
- Tracking the template parameter depth before parsing function declarators (at which point we can match template
parameters against scope specifiers to know if we have an explicit template parameter list to append invented parameters
to or not).
- When encountering an AutoType in a parameter context we check a stack of InventedTemplateParameterInfo structures that
contain the info required to create and accumulate invented template parameters (fields that were already present in
LambdaScopeInfo, which now inherits from this class and is looked up when an auto is encountered in a lambda context).
Resubmit after incorrect check in NonTypeTemplateParmDecl broke lldb.
Differential Revision: https://reviews.llvm.org/D65042
Guillaume Chatelet [Tue, 21 Jan 2020 15:13:04 +0000 (16:13 +0100)]
[Alignment][NFC] Use Align with CreateMaskedStore
Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Reviewers: courbet
Subscribers: hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D73106
Pavel Labath [Wed, 22 Jan 2020 09:58:09 +0000 (10:58 +0100)]
[lldb] s/lldb/%lldb in two tests
%lldb is the proper substitution. Using "lldb" can cause us to execute
the system lldb instead of the one we are testing. This happens at least
in standalone builds.
Clement Courbet [Wed, 22 Jan 2020 08:33:50 +0000 (09:33 +0100)]
[llvm-exegesis] Serial snippet: Restrict the set of back-to-back instructions
Summary:
Right now when picking a back-to-back instruction at random, we might select
instructions that we do not know how to handle.
Add a ExegesisTarget hook to possibly filter instructions.
Reviewers: gchatelet
Subscribers: tschuett, mstojanovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73161
Guillaume Chatelet [Wed, 22 Jan 2020 09:42:37 +0000 (10:42 +0100)]
[Doc] Update requirements for masked load/store
Georgii Rymar [Tue, 21 Jan 2020 13:06:15 +0000 (16:06 +0300)]
[llvm-readobj] - Rewrite gnuhash.test test to stop using precompiled objects.
This rewrites the test to use YAML and removes 4 precompiled object.
Differential revision: https://reviews.llvm.org/D73096
Sam Parker [Wed, 22 Jan 2020 09:26:37 +0000 (04:26 -0500)]
[ARM][MVE] Clear MaskedInsts vector
In MVETailPredication, clear the vector before running on a new loop.
Differential Revision: https://reviews.llvm.org/D73048
Saar Raz [Wed, 22 Jan 2020 09:23:26 +0000 (11:23 +0200)]
[Concepts] Fix bug when referencing function parameters in instantiated function template requires clause
Fixes bug #44613 - instantiated parameters were not being added when instantiating the requires clauses.
Alex Zinenko [Wed, 22 Jan 2020 09:12:04 +0000 (10:12 +0100)]
[mlir][orc] unbreak MLIR ExecutionEngine after ORC changes
Changes to ORC in
ce2207abaf9a925b35f15ef92aaff6b301ba6d22 changed the
APIs in IRCompileLayer, now requiring the custom compiler to be wrapped
in IRCompileLayer::IRCompiler. Even though MLIR relies on Orc
CompileUtils, the type is still visible in several places in the code.
Adapt those to the new API.
Pavel Labath [Wed, 22 Jan 2020 09:02:27 +0000 (10:02 +0100)]
[lldb] Fix an asan error from
27df2d9f556c
This error is caused by a combination of a couple of factors:
- the test accidentally creating a list with a single (empty) FileSpec
instead of an empty list
- lldb overzeleously converting empty strings into nullptrs
- asan overzeleously validating symlink(2) arguments (the real symlink
call would just fail with EFAULT)
I fix this by using FileSpec::GetPath instead of GetCString. This avoids
the nullptr and also avoids inserting the path into the global string
pool.
I also enhance the test case to test both empty paths and empty lists.
Sunil Singh [Wed, 22 Jan 2020 09:09:43 +0000 (10:09 +0100)]
Change the googlemock link
Summary:
This commit changes the googlemock link in the Testing Guide doc as googlemock is absorbed into the GoogleTest project
Reviewers: shafik, labath, JDevlieghere, mib
Reviewed By: labath
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73082
Haojian Wu [Tue, 21 Jan 2020 14:28:06 +0000 (15:28 +0100)]
[clangd] Handle the missing injectedClassNameType in targetDecl.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73102
Evgeny Leviant [Wed, 22 Jan 2020 09:09:13 +0000 (01:09 -0800)]
[llvm-as] Fix assembling of index with multiple summaries sharing single GUID
Differential revision: https://reviews.llvm.org/D73091
Haojian Wu [Tue, 21 Jan 2020 15:42:18 +0000 (16:42 +0100)]
[clang][index] Index the injected class name types.
Summary: Currently, we (clangd) are missing this kind of references.
Reviewers: kadircet
Subscribers: ilya-biryukov, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73109
Saar Raz [Wed, 22 Jan 2020 08:46:05 +0000 (10:46 +0200)]
[Concepts] Fix incorrect recovery in TryAnnotateTypeConstraint
TryAnnotateTypeConstraint would not put the scope specifier back into the token stream when faced
with a non-concept name after a scope specifier.
Kazushi (Jam) Marukawa [Wed, 22 Jan 2020 08:17:36 +0000 (09:17 +0100)]
[VE] i<N> and fp32/64 arguments, return values and constants
Summary:
Support for i<N> and fp32/64 arguments (in register), return values
and constants along with tests.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D73092
Raphael Isemann [Tue, 21 Jan 2020 11:44:11 +0000 (12:44 +0100)]
[lldb] Add a display name to ClangASTContext instances
Summary:
I often struggle to understand what exactly LLDB is doing by looking at our expression evaluation logging as our messages look like this:
```
CompleteTagDecl[2] on (ASTContext*)0x7ff31f01d240 Completing (TagDecl*)0x7ff31f01d568 named DeclName1
```
From the log messages it's unclear what this ASTContext is. Is it the scratch context, the expression context, some decl vendor context or a context from a module?
The pointer value isn't helpful for anyone unless I'm in a debugger where I could inspect the memory at the address. But even with a debugger it's not easy to
figure out what this ASTContext is without having deeper understanding about all the different ASTContext instances in LLDB (e.g., valid SourceLocation
from the file system usually means that this is the Objective-C decl vendor, a file name from multiple expressions is probably the scratch context, etc.).
This patch adds a name field to ClangASTContext instances that we can use to store a name which can be used for logging and debugging. With this
our log messages now look like this:
```
CompleteTagDecl[2] on scratch ASTContext. Completing (TagDecl*)0x7ff31f01d568 named Foo
```
We can now also just print a ClangASTContext from the debugger and see a useful name in the `m_display_name` field, e.g.
```
m_display_name = "AST for /Users/user/test/main.o";
```
Reviewers: shafik, labath, JDevlieghere, mib
Reviewed By: shafik
Subscribers: clayborg, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D72391
Amara Emerson [Wed, 22 Jan 2020 06:38:02 +0000 (22:38 -0800)]
[AArch64][GlobalISel] Fix llvm.returnaddress(0) selection when LR is clobbered.
The code was originally ported from SelectionDAG, which does CSE behind the scenes
automatically. When copying the return address from LR live into the function, we
need to make sure to use the single copy on function entry. Any later copy from LR
could be using clobbered junk.
Implement this by caching the copy in the per-MF state in the selector.
Should hopefully fix the AArch64 sanitiser buildbot failure.
Lang Hames [Wed, 22 Jan 2020 06:43:08 +0000 (22:43 -0800)]
[ORC] Fix the LLJITWithObjectCache example to address changes in
ce2207abaf9.
Jonas Devlieghere [Wed, 22 Jan 2020 06:20:48 +0000 (22:20 -0800)]
[lldb/Initializers] Move all ObjC initializers into AppleObjCRuntime
AppleObjCRuntime is the main entry point to the plugin with the same
name. This is part of a greater refactoring to auto generate the
initializers. NFC.
Differential revision: https://reviews.llvm.org/D73121
Daniil Suchkov [Mon, 20 Jan 2020 05:27:46 +0000 (12:27 +0700)]
[LICM] Don't cache AliasSetTrackers when run under legacy PM
Summary:
This is the first step towards complete removal of AST caching from
LICM. Attempts to keep LICM's AST cache up to date across passes can lead
to miscompiles like this one: https://bugs.llvm.org/show_bug.cgi?id=44320.
LICM has already switched to using MemorySSA to do sinking and hoisting
and only builds an AliasSetTracker on demand for the promoteToScalars
step, without caching it from one LICM instance to the next. Given this,
we don't have compile-time reasons to keep AST caching any more.
The only scenario where the caching would be used currently is when
using the LegacyPassManager and setting -enable-mssa-loop-dependency=false.
This switch should help us to surface any possible issues that may arise
along this way, also it turns subsequent removal of AST caching into NFC.
Reviewers: asbirlea, fhahn, efriedma, reames
Reviewed By: asbirlea
Subscribers: hiraditya, george.burgess.iv, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73081
Lang Hames [Wed, 22 Jan 2020 06:00:17 +0000 (22:00 -0800)]
Update clang-interpreter example to incorporate changes in
ce2207abaf9.
Austin Kerbow [Mon, 20 Jan 2020 15:25:20 +0000 (07:25 -0800)]
[DA][TTI][AMDGPU] Add option to select GPUDA with TTI
Summary: Enable the new diveregence analysis by default for AMDGPU.
Reviewers: rampitec, nhaehnle, arsenm
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73049
Lang Hames [Wed, 22 Jan 2020 04:35:40 +0000 (20:35 -0800)]
[ORC] Update examples to incorporate changes in
ce2207abaf9.
This should fix the builders that were failing due to broken JIT examples
after
ce2207abaf9.
LLVM GN Syncbot [Wed, 22 Jan 2020 04:19:38 +0000 (04:19 +0000)]
[gn build] Port
e53a9d96e6a
Carl Ritson [Wed, 22 Jan 2020 04:11:29 +0000 (13:11 +0900)]
[AMDGPU] SIRemoveShortExecBranches should not remove branches exiting loops
Summary:
Check that a s_cbranch_execz is not a loop exit before removing it.
As the pass is generating infinite loops.
Reviewers: cdevadas, arsenm, nhaehnle
Reviewed By: nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, tpr, t-tye, hiraditya, kerbowa, llvm-commits, dstuttard, foad
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72997
cdevadas [Wed, 22 Jan 2020 04:07:55 +0000 (13:07 +0900)]
Resubmit: [AMDGPU] Invert the handling of skip insertion.
The current implementation of skip insertion (SIInsertSkip) makes it a
mandatory pass required for correctness. Initially, the idea was to
have an optional pass. This patch inserts the s_cbranch_execz upfront
during SILowerControlFlow to skip over the sections of code when no
lanes are active. Later, SIRemoveShortExecBranches removes the skips
for short branches, unless there is a sideeffect and the skip branch is
really necessary.
This new pass will replace the handling of skip insertion in the
existing SIInsertSkip Pass.
Differential revision: https://reviews.llvm.org/D68092
Lang Hames [Wed, 22 Jan 2020 04:12:10 +0000 (20:12 -0800)]
[ORC] Fix a missing move in
ce2207abaf9.
This should fix the build failure at
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/32524
and others.
Puyan Lotfi [Wed, 22 Jan 2020 03:45:23 +0000 (22:45 -0500)]
[clang][IFS][test] Temporary work around for in-process cc1 ASAN issues.
When using in-process cc1, the Clang Interface Stubs pipeline setup
exposes an ASAN bug. I am still investigating this issue but want to
green the bots for now. I don't think this is a huge issue since the
Clang Interface Stubs Driver setup code is the only code path that sets
up such a pipeline (ie N cc1's for N c files followed by another N cc1's
for to generate stub files for the same N c files).
This issue is being discussed in https://reviews.llvm.org/D69825.
If a resolution is not found soon, a bugzilla filling will be in order.
Lang Hames [Wed, 22 Jan 2020 00:28:30 +0000 (16:28 -0800)]
[ORC] Add support for emulated TLS to ORCv2.
This commit adds a ManglingOptions struct to IRMaterializationUnit, and replaces
IRCompileLayer::CompileFunction with a new IRCompileLayer::IRCompiler class. The
ManglingOptions struct defines the emulated-TLS state (via a bool member,
EmulatedTLS, which is true if emulated-TLS is enabled and false otherwise). The
IRCompileLayer::IRCompiler class wraps an IRCompiler (the same way that the
CompileFunction typedef used to), but adds a method to return the
IRCompileLayer::ManglingOptions that the compiler will use.
These changes allow us to correctly determine the symbols that will be produced
when a thread local global variable defined at the IR level is compiled with or
without emulated TLS. This is required for ORCv2, where MaterializationUnits
must declare their interface up-front.
Most ORCv2 clients should not require any changes. Clients writing custom IR
compilers will need to wrap their compiler in an IRCompileLayer::IRCompiler,
rather than an IRCompileLayer::CompileFunction, however this should be a
straightforward change (see modifications to CompileUtils.* in this patch for an
example).
Kazuaki Ishizaki [Wed, 22 Jan 2020 03:36:10 +0000 (11:36 +0800)]
[libcxxabi] NFC: Fix trivial typos in comments
Reviewers: EricWF, mclow.lists, Jim
Reviewed By: Jim
Subscribers: mgorny, christof, ldionne, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D72151
Kazuaki Ishizaki [Wed, 22 Jan 2020 03:30:57 +0000 (11:30 +0800)]
[llvm] NFC: fix trivial typos in documents
Reviewers: hans, Jim
Reviewed By: Jim
Subscribers: jvesely, nhaehnle, mgorny, arphaman, bmahjour, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73017
Jonas Devlieghere [Wed, 22 Jan 2020 03:01:38 +0000 (19:01 -0800)]
Revert "[Concepts] Placeholder constraints and abbreviated templates"
This temporarily reverts commit
e03ead6771fc97b11cb0c94b7f023142184ad25f
because it breaks LLDB.
http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/3356
http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/12872
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/6407/
Saar Raz [Wed, 22 Jan 2020 02:06:51 +0000 (04:06 +0200)]
[Concepts] Fix circular AST->Sema dependency in ASTConcept.cpp
Remove inappropriate Sema include in ASTConcept.cpp introduced by D72552 for the finer-grained includes actually needed.
Eli Friedman [Wed, 22 Jan 2020 01:28:47 +0000 (17:28 -0800)]
[polly] XFAIL memset_null.ll.
I'm working on a patch, but not sure how long it'll take.
Fangrui Song [Wed, 22 Jan 2020 01:02:25 +0000 (17:02 -0800)]
[test] Use yaml2obj -o %t instead of > %t
To improve consistency and avoid unneeded shell feature (output
redirection).
While here, make other changes to improve consistency
--docnum 1 => --docnum=1
-docnum=x => --docnum=x
Louis Dionne [Tue, 21 Jan 2020 20:39:43 +0000 (12:39 -0800)]
[libc++] Make sure std::is_scalar returns true for block types
Summary:
The compiler already treats them as scalar types, so the library should
too. Furthermore, this allows blocks to be used in more places, for
example in std::optional, which requires an object type.
rdar://problem/
57892832
Reviewers: dexonsmith, EricWF, mclow.lists
Differential Revision: https://reviews.llvm.org/D72708
Saar Raz [Wed, 22 Jan 2020 00:50:12 +0000 (02:50 +0200)]
[Concepts] Constraint Satisfaction Caching
Add a simple cache for constraint satisfaction results. Whether or not this simple caching
would be permitted in final C++2a is currently being discussed but it is required for
acceptable performance so we use it in the meantime, with the possibility of adding some
cache invalidation mechanisms later.
Differential Revision: https://reviews.llvm.org/D72552
Vedant Kumar [Wed, 22 Jan 2020 00:51:27 +0000 (16:51 -0800)]
[clang/Darwin] Remove __llvm_profile_counter_bias from export list for profiling
Do not export __llvm_profile_counter_bias when profiling is enabled
because this symbol is hidden and cannot be exported.
Should fix this bot error:
```
URL: http://green.lab.llvm.org/green/job/clang-stage1-RA/5678/consoleFull
Problem: Command Output (stdout):
--
ld: warning: cannot export hidden symbol ___llvm_profile_counter_bias
from
/Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/lib/clang/11.0.0/lib/darwin/libclang_rt.profile_osx.a(InstrProfilingBiasVar.c.o)
ld: warning: cannot export hidden symbol ___llvm_profile_counter_bias
from
/Users/buildslave/jenkins/workspace/clang-stage1-RA/clang-build/lib/clang/11.0.0/lib/darwin/libclang_rt.profile_osx.a(InstrProfilingBiasVar.c.o)
```
Amara Emerson [Fri, 17 Jan 2020 22:34:26 +0000 (14:34 -0800)]
[AArch64] Don't generate gpr CSEL instructions in early-ifcvt if regclasses aren't compatible.
In GlobalISel we may in some unfortunate circumstances generate PHIs with
operands that are on separate banks. If-conversion doesn't currently check for
that case and ends up generating a CSEL on AArch64 with incorrect register
operands.
Differential Revision: https://reviews.llvm.org/D72961
Saar Raz [Wed, 22 Jan 2020 00:41:37 +0000 (02:41 +0200)]
[clang-tidy] Fix check for generic lambda invented template parameters
clang-tidy previously relied on there being no identifier for a TemplateTypeParmDecl for checking
whether 'decltype(x)' should be inserted, instead of checking whether or not it is implicit.
D65042 added new names for invented generic lambda template parameters, rendering that check incorrect.
Nicolas Vasilache [Wed, 22 Jan 2020 00:43:27 +0000 (19:43 -0500)]
Revert "[mlir][Linalg] Add tensor support to Linalg EDSC Builders"
This reverts commit
89e19e8eddd6dd0dc38d595b6784fb9ce65d9972.
This committed a stale version of the diff https://reviews.llvm.org/D72863 .. I apologize, reverting.
Nicolas Vasilache [Wed, 22 Jan 2020 00:37:18 +0000 (19:37 -0500)]
[mlir][Linalg] Add tensor support to Linalg EDSC Builders
Summary:
This diff extends the Linalg EDSC builders so we can easily create mixed
tensor/buffer linalg.generic ops. This is expected to be useful for
HLO -> Linalg lowering.
The `StructuredIndexed` struct is made to derive from `ValueHandle` and can
now capture a type + indexing expressions. This is used to represent return
tensors.
Pointwise unary and binary builders are extended to allow both output buffers
and return tensors. This has implications on the number of region arguments.
Reviewers: ftynse, herhut, hanchung, asaadaldien, stellaraccident
Reviewed By: asaadaldien
Subscribers: merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72863
Saar Raz [Wed, 22 Jan 2020 00:03:05 +0000 (02:03 +0200)]
[Concepts] Placeholder constraints and abbreviated templates
This patch implements P1141R2 "Yet another approach for constrained declarations".
General strategy for this patch was:
- Expand AutoType to include optional type-constraint, reflecting the wording and easing the integration of constraints.
- Replace autos in parameter type specifiers with invented parameters in GetTypeSpecTypeForDeclarator, using the same logic
previously used for generic lambdas, now unified with abbreviated templates, by:
- Tracking the template parameter lists in the Declarator object
- Tracking the template parameter depth before parsing function declarators (at which point we can match template
parameters against scope specifiers to know if we have an explicit template parameter list to append invented parameters
to or not).
- When encountering an AutoType in a parameter context we check a stack of InventedTemplateParameterInfo structures that
contain the info required to create and accumulate invented template parameters (fields that were already present in
LambdaScopeInfo, which now inherits from this class and is looked up when an auto is encountered in a lambda context).
Differential Revision: https://reviews.llvm.org/D65042
Richard Smith [Tue, 21 Jan 2020 23:52:15 +0000 (15:52 -0800)]
List implicit operator== after implicit destructors in a vtable.
Summary:
We previously listed first declared members, then implicit operator=,
then implicit operator==, then implicit destructors. Per discussion on
https://github.com/itanium-cxx-abi/cxx-abi/issues/88, put the implicit
equality comparison operators at the very end, after all special member
functions.
This reinstates
add2b7e44ada46f30715b5c48823a9e9e317e0c3, reverted in
commit
89e43f04ba87a0da6e94863db149669c7536486b, with a fix for 32-bit
targets.
Reviewers: rjmccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72897
Adrian Prantl [Tue, 21 Jan 2020 23:31:58 +0000 (15:31 -0800)]
Fix typos
Andrei Elovikov [Tue, 21 Jan 2020 22:25:55 +0000 (14:25 -0800)]
[SLP] Don't allow Div/Rem as alternate opcodes
Summary:
We don't have control/verify what will be the RHS of the division, so it might
happen to be zero, causing UB.
Reviewers: Vasilis, RKSimon, ABataev
Reviewed By: ABataev
Subscribers: vporpo, ABataev, hiraditya, llvm-commits, vdmitrie
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72740
Jonas Devlieghere [Tue, 21 Jan 2020 23:14:28 +0000 (15:14 -0800)]
[lldb/Plugin] Move DisassemblerLLVMC for consistency with plugin (NFC)
Rename the DisassemblerLLVMC directory from llvm to LLVMC to match the
plugin name.
Jonas Devlieghere [Tue, 21 Jan 2020 23:01:36 +0000 (15:01 -0800)]
[lldb/Plugin] Rename MainThreadCheckerRuntime for consistency with plugin (NFC)
Renames MainThreadCheckerRuntime to
InstrumentationRuntimeMainThreadChecker to be consistent with the
directory structure and plugin name.
Jonas Devlieghere [Tue, 21 Jan 2020 22:55:13 +0000 (14:55 -0800)]
[lldb/Plugin] Rename UBSanRuntime for consistency with plugin (NFC)
Renames UBSanRuntime to InstrumentationRuntimeUBSan to be consistent
with the directory structure and plugin name.
Jonas Devlieghere [Tue, 21 Jan 2020 22:50:36 +0000 (14:50 -0800)]
[lldb/Plugin] Rename TSanRuntime for consistency with plugin (NFC)
Renames TSanRuntime to InstrumentationRuntimeTSan to be
consistent with the directory structure and plugin name.
Jonas Devlieghere [Tue, 21 Jan 2020 22:43:46 +0000 (14:43 -0800)]
[lldb/Plugin] Rename AddressSanitizerRuntime for consistency with plugin (NFC)
Renames AddressSanitizerRuntime to InstrumentationRuntimeASan to be
consistent with the directory structure and plugin name.
Jason Molenda [Tue, 21 Jan 2020 22:45:21 +0000 (14:45 -0800)]
Fix an over-suspend bug with LaunchInNewTerminalWithAppleScript sessions
When launching an inferior in a new terminal window via AppleScript
and the darwin-debug helper program, we could often end up with the
inferior process having a too-high suspend count, and it would never
resume execution.
lldb tries to wait until darwin-debug has finished its work and has
launched the inferior (WaitForProcessToSIGSTOP) but this wasn't
working correctly - and cannot be made to work.
This patch removes WaitForProcessToSIGSTOP, adds a special tiny
segment to the darwin-debug executable so it can be identified as
that binary (ExecExtraSuspend), and adds code to debugserver to
detect this segment. When debugserver sees this segment, it notes
that the next exec will be done with a launch-suspended flag. When
the next exec happens, debugserver forces an extra task_resume when
we resume the inferior.
An alternative approach would be if lldb could detect when the
inferior has been launched by darwin-debug unambiguously; monitoring
when the unix socket between darwin-debug and lldb was closed would
have been a reasonable way to do this too.
<rdar://problem/
29760580>
Differential Revision: https://reviews.llvm.org/D72963
Florian Hahn [Tue, 21 Jan 2020 22:32:34 +0000 (14:32 -0800)]
[AArch64] Add custom store lowering for 256 bit non-temporal stores.
Currently we fail to lower non-termporal stores for 256+ bit vectors
to STNPQ, because type legalization will split them up to 128 bit stores
and because there are no single non-temporal stores, creating STPNQ
in the Load/Store optimizer would be quite tricky.
This patch adds custom lowering for 256 bit non-temporal vector stores
to improve the generated code.
Reviewers: dmgreen, samparker, t.p.northover, ab
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D72919
Matt Arsenault [Tue, 21 Jan 2020 22:12:26 +0000 (17:12 -0500)]
AMDGPU/GlobalISel: Merge trivial legalize rules
Also move constant-like rules together
Roman Lebedev [Tue, 21 Jan 2020 22:04:47 +0000 (01:04 +0300)]
[IR] Value::getPointerAlignment(): handle pointer constants
Summary:
New `@test13` in `Attributor/align.ll` is the main motivation - `null` pointer
really does not limit our alignment knowledge, in fact it is fully aligned
since it has no bits set.
Here we don't special-case `null` pointer because it is somewhat controversial
to add one more place where we enforce that `null` pointer is zero,
but instead we do the more general thing of trying to perform constant-fold
of pointer constant to an integer, and perform alignment inferrment on that.
Reviewers: jdoerfert, gchatelet, courbet, sstefan1
Reviewed By: jdoerfert
Subscribers: hiraditya, arphaman, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73131
Florian Hahn [Tue, 21 Jan 2020 22:22:33 +0000 (14:22 -0800)]
[Matrix] Hide and describe matrix-propagate-shape option.
Andrei Elovikov [Wed, 15 Jan 2020 17:24:12 +0000 (09:24 -0800)]
[SLP] Add a test showing miscompilation in AltOpcode support
Reviewers: Vasilis, RKSimon, ABataev
Reviewed By: RKSimon, ABataev
Subscribers: ABataev, inglorion, dexonsmith, llvm-commits, vdmitrie
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72739
Alexandre Ganea [Tue, 21 Jan 2020 22:03:00 +0000 (17:03 -0500)]
[PATCH] Reland [Clang] Un-break scan-build after integrated-cc1 change
The issue was reported by @xazax.hun here: https://reviews.llvm.org/D69825#
1827826
"This patch (D69825) breaks scan-build-py which parses the output of "-###" to get -cc1 command. There might be other tools with the same problems. Could we either remove (in-process) from CC1Command::Print or add a line break?
Having the last line as a valid invocation is valuable and there might be tools relying on that."
Differential Revision: https://reviews.llvm.org/D72982
Matt Arsenault [Tue, 21 Jan 2020 21:37:15 +0000 (16:37 -0500)]
AMDGPU/GlobalISel: Merge G_PTR_ADD/G_PTR_MASK rules
Tim Shen [Wed, 13 Nov 2019 02:17:04 +0000 (18:17 -0800)]
[APInt] Fix tests that had wrong assumption about sdivs with negative quotient.
Reviewers: sanjoy
Subscribers: bixia, dexonsmith, sanjoy.google, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70156
Fred Riss [Mon, 20 Jan 2020 16:39:25 +0000 (08:39 -0800)]
[lldb/DataFormatters] Fix the `$$deference$$` synthetic child
Summary:
The ValueObject code checks for a special `$$dereference$$` synthetic
child to allow formatter providers to implement a natural
dereferencing behavior in `frame variable` for objects like smart
pointers.
This support was broken when used directly throught the Python API and
not trhough `frame variable`. The reason is that
SBFrame.FindVariable() will return by default the synthetic variable
if it exists, while `frame variable` will not do this eagerly. The
code in `ValueObject::Dereference()` accounted for the latter but not
for the former. The fix is trivial. The test change includes
additional covergage for the already-working bahevior as it wasn't
covered by the testsuite before.
This commit also adds a short piece of documentatione explaining that
it is possible (even advisable) to provide this synthetic child
outstide of the range of the normal children.
Reviewers: jingham
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73053
Matt Arsenault [Tue, 21 Jan 2020 21:07:22 +0000 (16:07 -0500)]
AMDGPU/GlobalISel: Legalize G_PTR_ADD for arbitrary pointers
Pointers of unrecognized address spaces shoudl be treated as
global-like pointers. Even if loads and stores of them aren't handled,
dumb operations that just operate on the bits should work.
Jonas Devlieghere [Tue, 21 Jan 2020 21:21:34 +0000 (13:21 -0800)]
[lldb/CMake] Add check-lldb-shell and check-lldb-api targets for Xcode
The Xcode generator does not provide the auto-generated targets where
you can append a folder name to check-lldb. Instead add two custom lit
targets to run just the shell and api tests.
Vladimir Vereschaka [Tue, 21 Jan 2020 21:03:11 +0000 (13:03 -0800)]
Revert "List implicit operator== after implicit destructors in a vtable."
This reverts commit
add2b7e44ada46f30715b5c48823a9e9e317e0c3.
Failed "Clang::virtual-compare.cpp" test on the arm builders.
See
http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l/builds/3169
for details.
Alexandre Ganea [Tue, 21 Jan 2020 21:06:36 +0000 (16:06 -0500)]
Revert "[Clang] Un-break scan-build after integrated-cc1 change"
This reverts commit
a6883017ea9af529e89d7f89af2477378b6eafca.
Aaron Ballman [Tue, 21 Jan 2020 21:03:22 +0000 (16:03 -0500)]
Removing an accidentally duplicated line of test code to fix bots.
Etienne Pierre-Doray [Tue, 21 Jan 2020 20:43:17 +0000 (15:43 -0500)]
Allow arbitrary capability name in Thread Safety Analysis
Restricting the names of capabilities to only "role" or "mutex" makes
for awkward diagnostic text, such as with:
https://chromium-review.googlesource.com/c/chromium/src/+/
1948098/19/base/sequence_checker_unittest.nc#33
Jonas Devlieghere [Tue, 21 Jan 2020 20:25:45 +0000 (12:25 -0800)]
[lldb/Platform] Re-add ifdef's to guard macOS-only code.
I moved the code from the system initializer to PlatformMacOSX. The
defines are still necessary because MacOSX is initialized on other
platforms where the other platforms are not available.