Raphael Isemann [Tue, 28 Jan 2020 09:21:30 +0000 (10:21 +0100)]
[lldb] Cut off unused suffix in CompletionRequest::GetRawLine
The GetRawLine currently returns the full command line used
to create the CompletionRequest. So for example for "foo b[tab] --arg"
it would return the whole string instead of "foo b". Usually
completion code makes the wrong assumption that the cursor is at
the end of the line and handing out the complete line will cause
that people implement completions that also make this assumption.
This patch makes GetRawLine() return only the string until the
cursor and hides the suffix (so that the cursor is always at the
end of this string) and adds another function GetRawLineWithUnusedSuffix
that is specifically the line with the suffix that isn't used by
the CompletionRequest for argument parsing etc.
There is only one user of this new function that actually needs the
suffix and that is the expression command which needs the suffix to
detect if it is in the raw or argument part of the command (by looking
at the "--" separator).
Sam McCall [Mon, 13 Jan 2020 18:53:52 +0000 (19:53 +0100)]
[clangd] Improve ObjC property handling in SelectionTree.
Fixes https://github.com/clangd/clangd/issues/233
Reviewers: dgoldman
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72634
Julian Gross [Mon, 27 Jan 2020 13:58:36 +0000 (14:58 +0100)]
[mlir] fixed invalid LLVM intrinsics in LLVMOPs.td and llvmir-intrinsics.mlir.
Summary:
The intrinsic operation added multiple type annotations to the llvm intrinsic operations, but only one is needed.
The related tests in llvmir-intrinsics.mlir checked the wrong number and are adjusted as well.
Reviewers: nicolasvasilache, ftynse
Reviewed By: ftynse
Subscribers: merge_guards_bot, ftynse, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73470
Julian Gross [Mon, 27 Jan 2020 13:59:49 +0000 (14:59 +0100)]
Add tanh lowering from Standard dialect to NVVM and ROCDL.
Summary:
The tanh lowering from Standard dialect to NVVM and ROCDL was not working.
The conversion pattern are inserted in the lowering files.
The test cases for the lowerings were added in the test files.
Reviewers: nicolasvasilache, ftynse, herhut
Reviewed By: ftynse, herhut
Subscribers: merge_guards_bot, ftynse, jholewinski, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, csigg, arpith-jacob, mgester, lucyrfox, herhut, liufengdb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73471
Kazushi (Jam) Marukawa [Tue, 28 Jan 2020 08:55:56 +0000 (09:55 +0100)]
[VE] call isel with stack passing
Summary:
Function calls and stack-passing of function arguments.
Custom lowering, isel patterns and tests.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D73461
Georgii Rymar [Wed, 22 Jan 2020 12:58:32 +0000 (15:58 +0300)]
[llvm-readobj][test] - Remove --symbols --dyn-syms part from Object/readobj-shared-object.test.
The intention of Object/readobj-shared-object.test was to check the
general output for shared object.
I've added a case for testing dynamic objects to ELF/symbols.test.
Also we already test dynamic symbols printing in ELF/dyn-symbols.test +
I've added a case for `--dyn-syms` alias in D73164.
Hence we can remove this piece from Object/readobj-shared-object.test.
Differential revision: https://reviews.llvm.org/D73175
Guillaume Chatelet [Tue, 28 Jan 2020 09:32:32 +0000 (10:32 +0100)]
Update tests for @llvm.memcpy.inline intrinsics
Alex Zinenko [Tue, 28 Jan 2020 09:21:12 +0000 (10:21 +0100)]
[mlir] NFC: use doxygen-style comments in AffineToStandard.cpp
Guillaume Chatelet [Tue, 28 Jan 2020 09:20:41 +0000 (10:20 +0100)]
Fix failing bot
Simon Tatham [Tue, 28 Jan 2020 09:03:31 +0000 (09:03 +0000)]
[Clang] Warn about 'z' printf modifier in old MSVC.
Summary:
The 'z' length modifier, signalling that an integer format specifier
takes a `size_t` sized integer, is only supported by the C library of
MSVC 2015 and later. Earlier versions don't recognize the 'z' at all,
and respond to `printf("%zu", x)` by just printing "zu".
So, if the MS compatibility version is set to a value earlier than
MSVC2015, it's useful to warn about 'z' modifiers in printf format
strings we check.
Reviewers: aaron.ballman, lebedev.ri, rnk, majnemer, zturner
Reviewed By: aaron.ballman
Subscribers: amccarth, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73457
Kazushi (Jam) Marukawa [Tue, 28 Jan 2020 08:52:53 +0000 (09:52 +0100)]
[VE] enable unaligned load/store isel
Summary: Enable unaligned load/store isel for iN and fp32/64 and tests.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D73448
Guillaume Chatelet [Thu, 19 Dec 2019 16:33:36 +0000 (17:33 +0100)]
[instrinsics] Add @llvm.memcpy.inline instrinsics
Summary:
This is a follow up on D61634. It adds an LLVM IR intrinsic to allow better implementation of memcpy from C++.
A follow up CL will add the intrinsics in Clang.
Reviewers: courbet, theraven, t.p.northover, jdoerfert, tejohnson
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71710
Petr Hosek [Tue, 28 Jan 2020 08:24:41 +0000 (00:24 -0800)]
Revert "[lsan] Support LeakSanitizer runtime on Fuchsia"
This reverts commit
d59e3429f3a6291416e7eb99184448dfe685b77a.
River Riddle [Tue, 28 Jan 2020 07:40:01 +0000 (23:40 -0800)]
[mlir] Replace toy::DeadFunctionEliminationPass with symbolDCEPass.
Summary:
The dead function elimination pass in toy was a temporary stopgap until we had proper dead function elimination support in MLIR. Now that this functionality is available, this pass is no longer necessary.
Differential Revision: https://reviews.llvm.org/D72483
Roland McGrath [Tue, 28 Jan 2020 07:36:24 +0000 (23:36 -0800)]
[Clang] Enable -fsanitize=leak on Fuchsia targets
This required some fixes to the generic code for two issues:
1. -fsanitize=safe-stack is default on x86_64-fuchsia and is *not* incompatible with -fsanitize=leak on Fuchisa
2. -fsanitize=leak and other static-only runtimes must not be omitted under -shared-libsan (which is the default on Fuchsia)
Patch By: mcgrathr
Differential Revision: https://reviews.llvm.org/D73397
Roland McGrath [Tue, 28 Jan 2020 07:34:15 +0000 (23:34 -0800)]
[lsan] Support LeakSanitizer runtime on Fuchsia
Support LeakSanitizer runtime on Fuchsia.
Patch By: mcgrathr
Differential Revision: https://reviews.llvm.org/D72887
River Riddle [Tue, 28 Jan 2020 07:24:48 +0000 (23:24 -0800)]
[mlir] Add a DCE pass for dead symbols.
Summary: This pass deletes all symbols that are found to be unreachable. This is done by computing the set of operations that are known to be live, propagating that liveness to other symbols, and then deleting all symbols that are not within this live set.
Differential Revision: https://reviews.llvm.org/D72482
River Riddle [Tue, 28 Jan 2020 06:57:06 +0000 (22:57 -0800)]
[mlir] Refactor the implementation of Symbol use lists.
Summary: This revision refactors the implementation of the symbol use-list functionality to be a bit cleaner, as well as easier to reason about. Aside from code cleanup, this revision updates the user contract to never recurse into operations if they define a symbol table. The current functionality, which does recurse, makes it difficult to examine the uses held by a symbol table itself. Moving forward users may provide a specific region to examine for uses instead.
Differential Revision: https://reviews.llvm.org/D73427
River Riddle [Tue, 28 Jan 2020 03:57:14 +0000 (19:57 -0800)]
[mlir][NFC] Update Operation::getResultTypes to use ArrayRef<Type> instead of iterator_range.
Summary: The new internal representation of operation results now allows for accessing the result types to be more efficient. Changing the API to ArrayRef is more efficient and removes the need to explicitly materialize vectors in several places.
Differential Revision: https://reviews.llvm.org/D73429
River Riddle [Tue, 28 Jan 2020 03:04:55 +0000 (19:04 -0800)]
[mlir] Add support for marking 'unknown' operations as dynamically legal.
Summary: This allows for providing a default "catchall" legality check that is not dependent on specific operations or dialects. For example, this can be useful to check legality based on the specific types of operation operands or results.
Differential Revision: https://reviews.llvm.org/D73379
Nico Weber [Wed, 22 Jan 2020 15:34:34 +0000 (10:34 -0500)]
Make AST reading work better with LLVM_APPEND_VC_REV=NO
With LLVM_APPEND_VC_REV=NO, Modules/merge-lifetime-extended-temporary.cpp
would fail if it ran before
a0f50d731639350c7a7 (which changed
the serialization format) and then after, for these reasons:
1. With LLVM_APPEND_VC_REV=NO, the module hash before and after the
change was the same.
2. Modules/merge-lifetime-extended-temporary.cpp is the only test
we have that uses -fmodule-cache-path=%t that
a) actually writes to the cache path
b) doesn't do `rm -rf %t` at the top of the test
So the old run would write a module file, and then the new run would
try to load it, but the serialized format changed.
Do several things to fix this:
1. Include clang::serialization::VERSION_MAJOR/VERSION_MINOR in
the module hash, so that when the AST format changes (...and
we remember to bump these), we use a different module cache dir.
2. Bump VERSION_MAJOR, since
a0f50d731639350c7a7 changed the
on-disk format in a way that a gch file written before that change
can't be read after that change.
3. Add `rm -rf %t` to all tests that pass -fmodule-cache-path=%t.
This is unnecessary from a correctness PoV after 1 and 2,
but makes it so that we don't amass many cache dirs over time.
(Arguably, it also makes it so that the test suite doesn't catch
when we change the serialization format but don't bump
clang::serialization::VERSION_MAJOR/VERSION_MINOR; oh well.)
Differential Revision: https://reviews.llvm.org/D73202
Richard Smith [Tue, 28 Jan 2020 02:08:41 +0000 (18:08 -0800)]
PR44684: Look through parens and similar constructs when determining
whether a call is to a builtin.
We already had a general mechanism to do this but for some reason
weren't using it. In passing, check for the other unary operators that
can intervene in a reasonably-direct function call (we already handled
'&' but missed '*' and '+').
Florian Hahn [Tue, 28 Jan 2020 02:00:43 +0000 (18:00 -0800)]
[Matrix] Mark remarks test as AArch64 specific.
Florian Hahn [Tue, 28 Jan 2020 01:17:17 +0000 (17:17 -0800)]
[Matrix] Add info about number of operations to remarks.
This patch updates the remark to also include a summary of the number of
vector operations generated for each matrix expression.
Reviewers: anemet, Gerolf, thegameg, hfinkel, andrew.w.kaylor, LuoYuanke
Reviewed By: anemet
Differential Revision: https://reviews.llvm.org/D72480
Shoaib Meenai [Thu, 23 Jan 2020 06:29:34 +0000 (22:29 -0800)]
[llvm] Fix file ignoring inside directories
We have some ! patterns in the .gitignore (for the projects and runtimes
directories), and those patterns end up overriding the previous file
ignores, such that e.g. a .swp file inside the runtimes directory isn't
ignored. Move the file ignores last to ensure they take effect.
Differential Revision: https://reviews.llvm.org/D73253
Shoaib Meenai [Thu, 23 Jan 2020 06:28:14 +0000 (22:28 -0800)]
[runtimes] Support install-*-stripped targets
This is needed to support including runtime targets in
LLVM_DISTRIBUTION_COMPONENTS.
Differential Revision: https://reviews.llvm.org/D73252
Shoaib Meenai [Thu, 23 Jan 2020 06:16:28 +0000 (22:16 -0800)]
[runtimes] Fix installation for LLVM_RUNTIME_DISTRIBUTION_COMPONENTS
The installation target we create should trigger the corresponding
installation target in the runtimes external project.
Differential Revision: https://reviews.llvm.org/D73251
Wei Mi [Tue, 28 Jan 2020 00:49:50 +0000 (16:49 -0800)]
[LV] Remove nondeterminacy by changing LoopVectorizationLegality::Reductions
from DenseMap to MapVector
The iteration order of LoopVectorizationLegality::Reductions matters for the
final code generation, so we better use MapVector instead of DenseMap for it
to remove the nondeterminacy. reduction-order.ll in the patch is an example
reduced from the case we saw. In the output of opt command, the order of the
select instructions in the vector.body block keeps changing from run to run
currently.
Differential Revision: https://reviews.llvm.org/D73490
Florian Hahn [Tue, 28 Jan 2020 00:22:04 +0000 (16:22 -0800)]
[Matrix] Add optimization remarks for matrix expression.
Generate remarks for matrix operations in a function. To generate remarks
for matrix expressions, the following approach is used:
1. Collect leafs of matrix expressions (done in
RemarkGenerator::getExpressionLeafs). Leafs are lowered matrix
instructions without other matrix users (like stores).
2. For each leaf, create a remark containing a linearizied version of the
matrix expression.
The following improvements will be submitted as follow-ups:
* Summarize number of vector instructions generated for each expression.
* Account for shared sub-expressions.
* Propagate matrix remarks up the inlining chain.
The information provided by the matrix remarks helps users to spot cases
where matrix expression got split up, e.g. due to inlining not
happening. The remarks allow users to address those issues, ensuring
best performance.
Reviewers: anemet, Gerolf, thegameg, hfinkel, andrew.w.kaylor, LuoYuanke
Reviewed By: anemet
Differential Revision: https://reviews.llvm.org/D72453
Nathan [Tue, 28 Jan 2020 00:28:59 +0000 (00:28 +0000)]
[clang-tidy] Fix bugprone-use-after-move when move is in noexcept operator
Summary: Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=44667 | noexcept operator misinterpreted as being evaluated ]].
Reviewers: aaron.ballman, alexfh, JonasToth, hokein, gribozavr2
Reviewed By: gribozavr2
Subscribers: merge_guards_bot, Quuxplusone, xazax.hun, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D73441
Fangrui Song [Mon, 27 Jan 2020 23:10:07 +0000 (15:10 -0800)]
Reland "[StackColoring] Remap PseudoSourceValue frame indices via MachineFunction::getPSVManager()""
Reland
7a8b0b1595e7dc878b48cf9bbaa652087a6895db, with a fix that checks
`!E.value().empty()` to avoid inserting a zero to SlotRemap.
Debugged by rnk@ in https://bugs.chromium.org/p/chromium/issues/detail?id=1045650#c33
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D73510
Nathan [Mon, 27 Jan 2020 23:50:26 +0000 (23:50 +0000)]
[clang-tidy] readability-redundant-string-init now flags redundant initialisation in Field Decls and Constructor Initialisers
Summary:
The original behaviour of this check only looked at VarDecls with strings that had an empty string initializer. This has been improved to check for FieldDecls with an in class initializer as well as constructor initializers.
Addresses [[ https://bugs.llvm.org/show_bug.cgi?id=44474 | clang-tidy "modernize-use-default-member-init"/"readability-redundant-string-init" and redundant initializer of std::string ]]
Reviewers: aaron.ballman, alexfh, hokein
Reviewed By: aaron.ballman
Subscribers: merge_guards_bot, mgorny, Eugene.Zelenko, xazax.hun, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D72448
Nathan [Mon, 27 Jan 2020 23:46:53 +0000 (23:46 +0000)]
[clang-tidy] readability-identifier-naming disregards parameters restrictions on main like functions
Summary:
Typically most main functions have the signature:
```
int main(int argc, char *argv[])
```
To stick with convention when renaming parameters we should ignore the `argc` and `argv` names even if the parameter style says they should be renamed. This patch addresses this by checking all ParmVarDecls if they form part of a function with a signature that matches main `int name(int argc, char * argv[], (optional char *env[]))`
Reviewers: aaron.ballman, JonasToth, alexfh, hokein
Reviewed By: aaron.ballman
Subscribers: Mordante, merge_guards_bot, xazax.hun, kristof.beyls, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D73098
Reid Kleckner [Mon, 27 Jan 2020 21:49:09 +0000 (13:49 -0800)]
[IR] Keep a double break between functions when printing a module
This behavior appears to have changed unintentionally in
b0e979724f2679e4e6f5b824144ea89289bd6d56.
Instead of printing the leading newline in printFunction, print it when
printing a module. This ensures that `OS << *Func` starts printing
immediately on the current line, but whole modules are printed nicely.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D73505
Reid Kleckner [Mon, 27 Jan 2020 23:24:58 +0000 (15:24 -0800)]
[WinEH] Re-run stack coloring test for i686
This would've caught https://crbug.com/1045650, which resulted in the
revert of
7a8b0b1595e7dc878b48cf9bbaa652087a6895db.
Evgenii Stepanov [Sat, 25 Jan 2020 00:36:24 +0000 (16:36 -0800)]
Support zero size types in StackSafetyAnalysis.
Reviewers: vitalybuka
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73395
Evgenii Stepanov [Sat, 25 Jan 2020 00:36:13 +0000 (16:36 -0800)]
Fix StackSafetyAnalysis crash with scalable vector types.
Summary:
Treat scalable allocas as if they have storage size of 0, and
scalable-typed memory accesses as if their range is unlimited.
This is not a proper support of scalable vector types in the analysis -
we can do better, but not today.
Reviewers: vitalybuka
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73394
Florian Hahn [Mon, 27 Jan 2020 23:11:45 +0000 (15:11 -0800)]
[AArch64] Add option to enable/disable load-store renaming.
This patch adds a new option to enable/disable register renaming in the
load-store optimizer. Defaults to disabled, as there is a potential
mis-compile caused by this.
Jonas Devlieghere [Mon, 27 Jan 2020 23:10:13 +0000 (15:10 -0800)]
[lldb/Commands] Make column available through _regexp-break
Update _regexp-break to interpret main.c:8:21 as:
breakpoint set --line 8 --column 21
Differential revision: https://reviews.llvm.org/D73314
Jonas Devlieghere [Mon, 27 Jan 2020 23:08:58 +0000 (15:08 -0800)]
[lldb/Test] Use lit.local.cfg to mark whole directory as (un)supported.
Mark the whole Python or Lua test directory as unsupported when the
corresponding language is not available.
Eric Schweitz [Mon, 27 Jan 2020 23:01:55 +0000 (15:01 -0800)]
remove a trailing space character (test commit)
Matt Arsenault [Fri, 24 Jan 2020 18:11:23 +0000 (13:11 -0500)]
AMDGPU/GlobalISel: Eliminate SelectVOP3Mods_f32
Trivial type predicates should be moved into the tablegen pattern
itself, and not checked inside complex patterns. This eliminates a
redundant complex pattern, and fixes select source modifiers for
GlobalISel.
I have further patches which fully handle select in tablegen and
remove all of the C++ selection, although it requires the ugliness to
support the entire range of legal register types.
Evgenii Stepanov [Fri, 24 Jan 2020 00:12:15 +0000 (16:12 -0800)]
[gwp-asan] Implement malloc_iterate.
Summary:
This is an Android-specific interface for iterating over all live
allocations in a memory range.
Reviewers: hctim, cferris
Subscribers: mgorny, mgrang, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D73305
Jay Foad [Sun, 26 Jan 2020 14:34:28 +0000 (14:34 +0000)]
[GlobalISel] Make use of KnownBits::computeForAddSub
Summary:
This is mostly NFC. computeForAddSub may give more precise results in
some cases, but that doesn't seem to affect any existing GlobalISel
tests.
Subscribers: rovka, hiraditya, volkan, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73431
Diego Caballero [Mon, 27 Jan 2020 21:13:20 +0000 (13:13 -0800)]
[mlir] Remove 'valuesToRemoveIfDead' from PatternRewriter API
Summary:
Remove 'valuesToRemoveIfDead' from PatternRewriter API. The removal
functionality wasn't implemented and we decided [1] not to implement it in
favor of having more powerful DCE approaches.
[1] https://github.com/tensorflow/mlir/pull/212
Reviewers: rriddle, bondhugula
Reviewed By: rriddle
Subscribers: liufengdb, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72545
Stephen Neuendorffer [Fri, 25 Oct 2019 22:49:41 +0000 (15:49 -0700)]
[examples] Fix CMakefiles for JITLink and OrcError library refactoring
The examples need explicit library dependencies when building with
BUILD_SHARED_LIBS=on
Gabor Horvath [Fri, 24 Jan 2020 20:04:37 +0000 (12:04 -0800)]
[analyzer] Add FuchsiaLockChecker and C11LockChecker
These are mostly trivial additions as both of them are reusing existing
PThreadLockChecker logic. I only needed to add the list of functions to
check and do some plumbing to make sure that we display the right
checker name in the diagnostic.
Differential Revision: https://reviews.llvm.org/D73376
Sanjay Patel [Mon, 27 Jan 2020 21:33:13 +0000 (16:33 -0500)]
[InstCombine] allow more narrowing of casted select
D47163 created a rule that we should not change the casted
type of a select when we have matching types in its compare condition.
That was intended to help vector codegen, but it also could create
situations where we miss subsequent folds as shown in PR44545:
https://bugs.llvm.org/show_bug.cgi?id=44545
By using shouldChangeType(), we can continue to get the vector folds
(because we always return false for vector types). But we also solve
the motivating bug because it's ok to narrow the scalar select in that
example.
Our canonicalization rules around select are a mess, but AFAICT, this
will not induce any infinite looping from the reverse transform (but
we'll need to watch for that possibility if committed).
Side note: there's a similar use of shouldChangeType() for phi ops
just below this diff, and the source and destination types appear to
be reversed.
Differential Revision: https://reviews.llvm.org/D72733
Kern Handa [Mon, 27 Jan 2020 21:31:12 +0000 (22:31 +0100)]
[NFC][mlir][linalg] Merge Utils/Intrinsics.h into EDSC/Intrinsics.h
Differential Revision: https://reviews.llvm.org/D73377
Alex Zinenko [Mon, 27 Jan 2020 16:14:56 +0000 (17:14 +0100)]
[mlir] add lowering from affine.min to std
Summary:
Affine minimum computation will be used in tiling transformation. The
implementation is mostly boilerplate as we already lower the minimum in the
upper bound of an affine loop.
Differential Revision: https://reviews.llvm.org/D73488
Simon Pilgrim [Mon, 27 Jan 2020 21:17:26 +0000 (21:17 +0000)]
[DAG] Enable ISD::EXTRACT_SUBVECTOR SimplifyMultipleUseDemandedBits handling
This allows SimplifyDemandedBits to call SimplifyMultipleUseDemandedBits to create a simpler ISD::EXTRACT_SUBVECTOR, which is particularly useful for cases where we're splitting into subvectors anyhow.
Differential Revision: This allows SimplifyDemandedBits to call SimplifyMultipleUseDemandedBits to create a simpler ISD::EXTRACT_SUBVECTOR, which is particularly useful for cases where we're splitting into subvectors anyhow.
Adrian Prantl [Fri, 17 Jan 2020 18:38:41 +0000 (10:38 -0800)]
Fix an assertion failure in DwarfExpression's subregister composition
This patch fixes an assertion failure in DwarfExpression that is
triggered when a complex fragment has exactly the size of a
subregister of the register the DBG_VALUE points to *and* there is no
DWARF encoding for the super-register.
I took the opportunity to replace/document some magic values with
static constructor functions to make this code less confusing to read.
rdar://problem/
58489125
Differential Revision: https://reviews.llvm.org/D72938
Roman Lebedev [Mon, 27 Jan 2020 20:30:37 +0000 (23:30 +0300)]
[NFC][LoopVectorize] Autogenerate tests affected by isHighCostExpansionHelper() cost modelling (PR44668)
Roman Lebedev [Mon, 27 Jan 2020 20:22:30 +0000 (23:22 +0300)]
[NFC][IndVarSimplify] Autogenerate tests affected by isHighCostExpansionHelper() cost modelling (PR44668)
Matt Arsenault [Tue, 14 Jan 2020 04:17:59 +0000 (23:17 -0500)]
AMDGPU/GlobalISel: Select buffer atomics
The cmpswap handling is incomplete and fails to select.
Matt Arsenault [Tue, 14 Jan 2020 03:06:01 +0000 (22:06 -0500)]
AMDGPU/GlobalISel: Select llvm.amdgcn.raw.tbuffer.store
Jon Chesterfield [Mon, 27 Jan 2020 20:04:02 +0000 (20:04 +0000)]
Revert "[nfc][libomptarget] Remove SHARED annotation from local variables"
This reverts commit
0e9374e3740f82f2d46af564f6b059e68ff307c8.
Revert D73239. It fails some local testing, cause presently unknown
Matt Arsenault [Tue, 14 Jan 2020 04:01:23 +0000 (23:01 -0500)]
AMDGPU/GlobalISel: Select llvm.amdgcn.struct.buffer.store[.format]
Matt Arsenault [Tue, 14 Jan 2020 01:39:09 +0000 (20:39 -0500)]
AMDGPU/GlobalISel: Move llvm.amdgcn.raw.buffer.store handling
Treat this the same way as loads. There's less value to the
intermediate nodes, but it's good to be consistent.
Alexey Bataev [Mon, 27 Jan 2020 19:10:17 +0000 (14:10 -0500)]
[OPENMP50]Track changes of lastprivate conditional in parallel-based
regions with reductions, lastprivates or linears clauses.
If the lastprivate conditional variable is updated in inner parallel
region with reduction, lastprivate or linear clause, the value must be
considred as a candidate for lastprivate conditional. Also, tracking in
inner parallel regions is not required.
Shoaib Meenai [Mon, 27 Jan 2020 19:48:42 +0000 (11:48 -0800)]
Revert "[clang-tidy] readability-identifier-naming disregards parameters restrictions on main like functions"
This reverts commit
27e3671ff49b72640f89c34a415412e400503442.
This was an accidental push, and the author requested a revert on IRC as
their local branch is in a bad state.
Sanjay Patel [Mon, 27 Jan 2020 19:40:43 +0000 (14:40 -0500)]
[InstCombine] convert fsub nsz with fneg operand to -(X + Y)
This was noted in D72521 - we need to match fneg specifically to
consistently handle that pattern along with (-0.0 - X).
Nikita Popov [Thu, 23 Jan 2020 20:13:57 +0000 (21:13 +0100)]
[InstCombine] Move negation handling into freelyNegateValue()
Followup to D72978. This moves existing negation handling in
InstCombine into freelyNegateValue(), which make it composable.
In particular, root negations of div/zext/sext/ashr/lshr/sub can
now always be performed through a shl/trunc as well.
Differential Revision: https://reviews.llvm.org/D73288
Nikita Popov [Thu, 23 Jan 2020 20:12:41 +0000 (21:12 +0100)]
[InstCombine] Add more negation tests; NFC
Additional test cases for pushing negations through various
instructions.
Matt Arsenault [Mon, 27 Jan 2020 18:59:25 +0000 (13:59 -0500)]
TableGen: Try to fix expensive checks failures
Matt Arsenault [Tue, 14 Jan 2020 01:06:26 +0000 (20:06 -0500)]
AMDGPU/GlobalISel: Select llvm.amdcn.struct.tbuffer.load
Jinsong Ji [Mon, 27 Jan 2020 18:40:59 +0000 (18:40 +0000)]
[clang] Fix covered default in switch
clang/lib/Format/TokenAnnotator.cpp:3162:7:
error: default label in switch which covers all enumeration values
[-Werror,-Wcovered-switch-default]
default:
^
1 error generated.
Nathan [Sun, 26 Jan 2020 00:13:18 +0000 (00:13 +0000)]
[clang-tidy] readability-identifier-naming disregards parameters restrictions on main like functions
Summary:
Typically most main functions have the signature:
```
int main(int argc, char *argv[])
```
To stick with convention when renaming parameters we should ignore the `argc` and `argv` names even if the parameter style says they should be renamed. This patch addresses this by checking all ParmVarDecls if they form part of a function with a signature that matches main `int name(int argc, char * argv[], (optional char *env[]))`
Reviewers: aaron.ballman, JonasToth, alexfh, hokein
Reviewed By: aaron.ballman
Subscribers: Mordante, merge_guards_bot, xazax.hun, kristof.beyls, cfe-commits
Tags: #clang, #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D73098
Petr Hosek [Mon, 27 Jan 2020 00:10:56 +0000 (16:10 -0800)]
[Symbolize] Handle error after the notes loop
We always have to check the error, even if we're going to ignore it.
Vedant Kumar [Sat, 25 Jan 2020 20:52:47 +0000 (12:52 -0800)]
Reland (again): [DWARF] Allow cross-CU references of subprogram definitions
This is a revert-of-revert (i.e. this reverts commit
802bec89, which
itself reverted
fa4701e1 and
79daafc9) with a fix folded in. The problem
was that call site tags weren't emitted properly when LTO was enabled
along with split-dwarf. This required a minor fix. I've added a reduced
test case in test/DebugInfo/X86/fission-call-site.ll.
Original commit message:
This allows a call site tag in CU A to reference a callee DIE in CU B
without resorting to creating an incomplete duplicate DIE for the callee
inside of CU A.
We already allow cross-CU references of subprogram declarations, so it
doesn't seem like definitions ought to be special.
This improves entry value evaluation and tail call frame synthesis in
the LTO setting. During LTO, it's common for cross-module inlining to
produce a call in some CU A where the callee resides in a different CU,
and there is no declaration subprogram for the callee anywhere. In this
case llvm would (unnecessarily, I think) emit an empty DW_TAG_subprogram
in order to fill in the call site tag. That empty 'definition' defeats
entry value evaluation etc., because the debugger can't figure out what
it means.
As a follow-up, maybe we could add a DWARF verifier check that a
DW_TAG_subprogram at least has a DW_AT_name attribute.
Update #1:
Reland with a fix to create a declaration DIE when the declaration is
missing from the CU's retainedTypes list. The declaration is left out
of the retainedTypes list in two cases:
1) Re-compiling pre-r266445 bitcode (in which declarations weren't added
to the retainedTypes list), and
2) Doing LTO function importing (which doesn't update the retainedTypes
list).
It's possible to handle (1) and (2) by modifying the retainedTypes list
(in AutoUpgrade, or in the LTO importing logic resp.), but I don't see
an advantage to doing it this way, as it would cause more DWARF to be
emitted compared to creating the declaration DIEs lazily.
Update #2:
Fold in a fix for call site tag emission in the split-dwarf + LTO case.
Tested with a stage2 ThinLTO+RelWithDebInfo build of clang, and with a
ReleaseLTO-g build of the test suite.
rdar://
46577651, rdar://
57855316, rdar://
57840415, rdar://
58888440
Differential Revision: https://reviews.llvm.org/D70350
Mikhail Gadelha [Mon, 27 Jan 2020 18:51:35 +0000 (14:51 -0400)]
[analyzer] Simplify BoolAssignmentChecker
Summary:
Instead of checking the range manually, changed the checker to use assumeInclusiveRangeDual instead.
This patch was part of D28955.
Reviewers: NoQ
Reviewed By: NoQ
Subscribers: ddcc, xazax.hun, baloghadamsoftware, szepet, a.sidorin, Szelethus, donat.nagy, dkrupp, Charusso, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73062
Matt Arsenault [Mon, 13 Jan 2020 23:18:56 +0000 (18:18 -0500)]
AMDGPU/GlobalISel: Select llvm.amdgcn.raw.tbuffer.load
aartbik [Sat, 25 Jan 2020 00:27:56 +0000 (16:27 -0800)]
[mlir] [VectorOps] Lowering of vector.extract/insert_slices to LLVM IR
Summary: Uses progressive lowering to convert vector.extract_slices and vector_insert_slices to equivalent vector operations that can be subsequently lowered into LLVM.
Reviewers: nicolasvasilache, andydavis1, rriddle
Reviewed By: nicolasvasilache, rriddle
Subscribers: merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72808
Stanislav Mekhanoshin [Fri, 24 Jan 2020 00:18:16 +0000 (16:18 -0800)]
[AMDGPU] Attempt to reschedule withou clustering
We want to have more load/store clustering but we also want
to maintain low register pressure which are oposit targets.
Allow scheduler to reschedule regions without mutations
applied if we hit a register limit.
Differential Revision: https://reviews.llvm.org/D73386
Matt Arsenault [Mon, 13 Jan 2020 22:07:41 +0000 (17:07 -0500)]
AMDGPU/GlobalISel: Select llvm.amdgcn.struct.buffer.load.format
Luke Drummond [Wed, 15 Jan 2020 14:14:01 +0000 (14:14 +0000)]
[tablegen] Emit string literals instead of char arrays
This changes the generated (Instr|Asm|Reg|Regclass)Name tables from this
form:
extern const char HexagonInstrNameData[] = {
/* 0 */ 'G', '_', 'F', 'L', 'O', 'G', '1', '0', 0,
/* 9 */ 'E', 'N', 'D', 'L', 'O', 'O', 'P', '0', 0,
/* 18 */ 'V', '6', '_', 'v', 'd', 'd', '0', 0,
/* 26 */ 'P', 'S', '_', 'v', 'd', 'd', '0', 0,
[...]
};
...to this:
extern const char HexagonInstrNameData[] = {
/* 0 */ "G_FLOG10\0"
/* 9 */ "ENDLOOP0\0"
/* 18 */ "V6_vdd0\0"
/* 26 */ "PS_vdd0\0"
[...]
};
This should make debugging and exploration a lot easier for mortals,
while providing a significant compile-time reduction for common compilers.
To avoid issues with low implementation limits, this is disabled by
default for visual studio.
To force output one way or the other, pass
`--long-string-literals=<bool>` to `tablegen`
Reviewers: mstorsjo, rnk
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D73044
A variation of this patch was originally committed in
ce23515f5ab011 and
then reverted in
e464b31c due to build failures.
Jonas Devlieghere [Mon, 27 Jan 2020 18:17:46 +0000 (10:17 -0800)]
[llvm][TextAPI/MachO] Support writing single macCatalyst platform
TAPI currently lacks a way to emit the macCatalyst platform. For TBD_V3
is does support zippered frameworks given that both macOS and
macCatalyst are part of the PlatformSet.
Differential revision: https://reviews.llvm.org/D73325
Matt Arsenault [Mon, 13 Jan 2020 21:02:14 +0000 (16:02 -0500)]
AMDGPU/GlobalISel: Select llvm.amdgcn.struct.buffer.load
Matt Arsenault [Thu, 9 Jan 2020 03:35:23 +0000 (22:35 -0500)]
AMDGPU/GlobalISel: Select llvm.amdgcn.raw.buffer.load.format
Gabor Horvath [Wed, 22 Jan 2020 01:26:11 +0000 (17:26 -0800)]
[analyzer] Fix handle leak false positive when the handle dies too early
Differential Revision: https://reviews.llvm.org/D73151
Matt Arsenault [Thu, 19 Sep 2019 04:29:20 +0000 (00:29 -0400)]
AMDGPU/GlobalISel: Select llvm.amdgcn.raw.buffer.load
Use intermediate instructions, unlike with buffer stores. This is
necessary because of the need to have an internal way to distinguish
between signed and unsigned extloads. This introduces some duplication
and near duplication with the buffer store selection path. The store
handling should maybe be moved into legalization to match and
eliminate the duplication.
Matt Arsenault [Sun, 26 Jan 2020 05:25:35 +0000 (00:25 -0500)]
AMDGPU/GlobalISel: Handle VOP3NoMods
Matt Arsenault [Sun, 26 Jan 2020 05:33:43 +0000 (00:33 -0500)]
AMDGPU/GlobalISel: Add baseline tests for fma/fmad selection
Matt Arsenault [Fri, 24 Jan 2020 16:45:33 +0000 (11:45 -0500)]
AMDGPU/GlobalISel: Minor refactor of MUBUF complex patterns
This will make it easier to support the small variants in the complex
patterns for atomics.
Matt Arsenault [Sat, 25 Jan 2020 02:51:37 +0000 (21:51 -0500)]
AMDGPU: Fix not using f16 fsin/fcos
I noticed this because this accidentally started working for
GlobalISel.
Jay Foad [Tue, 26 Nov 2019 09:46:19 +0000 (09:46 +0000)]
[AMDGPU] Simplify test and extend to gfx9 and gfx10
Summary:
This is in preparation for adding more test cases for D69661 and other
bug fixes in the same area.
Reviewers: tpr, dstuttard, critson, nhaehnle, arsenm
Subscribers: kzhuravl, jvesely, wdng, yaxunl, t-tye, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70708
Simon Pilgrim [Mon, 27 Jan 2020 16:43:59 +0000 (16:43 +0000)]
[X86][AVX] Add a more aggressive SimplifyMultipleUseDemandedBits to simplify masked store masks.
Fixes a poor codegen issue noticed in PR11210.
Matt Arsenault [Wed, 1 Jan 2020 20:51:46 +0000 (15:51 -0500)]
AMDGPU/GlobalISel: Custom legalize v2s16 G_SHUFFLE_VECTOR
Try to keep simple v2s16 cases as-is. This will more naturally map to
how the VOP3P op_sel modifiers work compared to the expansion
involving bitcasts and bitshifts.
This could maybe try harder with wider source vector types, although
that could be handled with a pre-legalize combine.
Christian Sigg [Mon, 27 Jan 2020 16:23:39 +0000 (17:23 +0100)]
Add pretty printers for llvm::PointerIntPair and llvm::PointerUnion.
Reviewers: aprantl, dblaikie, jdoerfert, nicolasvasilache
Reviewed By: dblaikie
Subscribers: jpienaar, dexonsmith, merge_guards_bot, llvm-commits
Tags: #llvm, #clang, #lldb, #openmp
Differential Revision: https://reviews.llvm.org/D72557
Nico Weber [Mon, 27 Jan 2020 15:39:49 +0000 (10:39 -0500)]
Revert "[StackColoring] Remap PseudoSourceValue frame indices via MachineFunction::getPSVManager()"
This reverts commit
7a8b0b1595e7dc878b48cf9bbaa652087a6895db.
It seems to break exception handling on 32-bit Windows, see
https://crbug.com/1045650
Matt Arsenault [Fri, 24 Jan 2020 18:41:50 +0000 (13:41 -0500)]
Revert "AMDGPU: Temporary drop s_mul_hi_i/u32 patterns"
This reverts commit
fe23ed2c681413e7baf517c79aee9be130579873.
It was never really clear this was responsible for the performance
regressions that caused this to be reverted. It's been a long time,
and we need to have scalar patterns for this to get GlobalISel
working.
David Goldman [Mon, 13 Jan 2020 22:01:10 +0000 (17:01 -0500)]
[clangd] Only re-open files if their flags changed
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72647
Teresa Johnson [Fri, 24 Jan 2020 20:24:18 +0000 (12:24 -0800)]
Restore "[LTO/WPD] Enable aggressive WPD under LTO option"
This restores
59733525d37cf9ad88b5021b33ecdbaf2e18911c (D71913), along
with bot fix
19c76989bb505c3117730c47df85fd3800ea2767.
The bot failure should be fixed by D73418, committed as
af954e441a5170a75687699d91d85e0692929d43.
I also added a fix for non-x86 bot failures by requiring x86 in new test
lld/test/ELF/lto/devirt_vcall_vis_public.ll.
Matt Arsenault [Fri, 24 Jan 2020 16:26:34 +0000 (11:26 -0500)]
AMDGPU/GlobalISel: Fix not using global atomics on gfx9+
For some reason the flat/global atomics end up in the generated
matcher table in a different order from SelectionDAG. Use
AddedComplexity to prefer checking for global atomics first.
Whitney Tsang [Thu, 23 Jan 2020 20:11:28 +0000 (20:11 +0000)]
[LoopUnroll] Remove remapInstruction().
Summary:
LoopUnroll can reuse the RemapInstruction() in ValueMapper, or
remapInstructionsInBlocks() in CloneFunction, depending on the needs.
There is no need to have its own version in LoopUnroll.
By calling RemapInstruction() without TypeMapper or Materializer and
with Flags (RF_NoModuleLevelChanges | RF_IgnoreMissingLocals), it does
the same as remapInstruction(). remapInstructionsInBlocks() calls
RemapInstruction() exactly as described.
Looking at the history, I cannot find any obvious reason to have its own
version.
Reviewer: dmgreen, jdoerfert, Meinersbur, kbarton, bmahjour, etiotto,
foad, aprantl
Reviewed By: jdoerfert
Subscribers: hiraditya, zzheng, llvm-commits, prithayan, anhtuyen
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D73277
James Henderson [Fri, 3 Jan 2020 14:35:54 +0000 (14:35 +0000)]
[test][llvm-dwarfdump] Add extra test case for invalid MD5 form
A subsequent patch will change how an invalid file name table is handled
to allow parsing to continue. This patch adds a test case that will
demonstrate a difference in behaviour with that change between invalid
file tables where the error is before the end of the stated prologue
length and where the error occurs after the stated length.
Reviewed by: dblaikie
Differential Revision: https://reviews.llvm.org/D72157
James Henderson [Fri, 3 Jan 2020 13:59:46 +0000 (13:59 +0000)]
[DebugInfo] Make incorrect debug line extended opcode length non-fatal
It is possible to try to keep parsing a debug line program even when the
length of an extended opcode does not match what is expected for that
opcode. This patch changes what was previously a fatal error to be
non-fatal. The parser now continues by assuming the the claimed length
is correct, even if it means moving the offset backwards.
Reviewed by: dblaikie
Differential Revision: https://reviews.llvm.org/D72155
Matt Arsenault [Sat, 18 Jan 2020 02:28:58 +0000 (21:28 -0500)]
AMDPGPU/GlobalISel: Select more MUBUF global addressing modes
The handling of the high bits of the resource descriptor seem weird to
me, where the 3rd dword changes based on the instruction.
Martin Probst [Fri, 24 Jan 2020 10:30:31 +0000 (11:30 +0100)]
clang-format: [JS] options for arrow functions.
Summary:
clang-format currently always wraps the body of non-empty arrow
functions:
const x = () => {
z();
};
This change implements support for the `AllowShortLambdasOnASingleLine`
style options, controlling the indent style for arrow function bodies
that have one or fewer statements. SLS_All puts all on a single line,
SLS_Inline only arrow functions used in an inline position.
const x = () => { z(); };
Multi-statement arrow functions continue to be wrapped. Function
expressions (`a = function() {}`) and function/method declarations are
unaffected as well.
Reviewers: krasimir
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73335
Alex Zinenko [Thu, 16 Jan 2020 13:32:33 +0000 (14:32 +0100)]
[mlir] Harden error propagation in LLVM import
Summary:
LLVM importer to MLIR was implemented mostly as a prototype. As such, it did
not deal handle errors in a consistent way, reporting them out stderr in some
cases and continuing the execution in the error state until eventually
crashing. This is not desirable for a user-facing tool. Make sure errors are
returned from functions, consistently checked at call sites and propagated
further. Functions returning nullable IR values return nullptr to denote the
error state. Other functions return LogicalResult. LLVM importer in
mlir-translate should no longer crash on unsupported inputs.
The errors are reported without association with the source file (and therefore
cannot be checked using -verify-diagnostics). Attaching them to the actual
input file is left for future work.
Differential Revision: https://reviews.llvm.org/D72839