Mark de Wever [Tue, 1 Mar 2022 17:02:10 +0000 (18:02 +0100)]
[libc++] Removes base member from tests.
Change the tests to use the base friend function instead of members.
Also changed some types to have a base friends instead of members.
Reviewed By: #libc, ldionne, Quuxplusone
Differential Revision: https://reviews.llvm.org/D120742
Matt Arsenault [Thu, 3 Mar 2022 18:23:41 +0000 (13:23 -0500)]
Revert "Inliner: Correctly merge amdgpu-unsafe-fp-atomics attribute"
This reverts commit
169ebf03ab2a6f16bfa32a36305929c7bc8e4784.
This was effectively rendering the attribute useless in the real
world, although this is still broken.
Sanjay Patel [Thu, 3 Mar 2022 17:50:48 +0000 (12:50 -0500)]
[x86] add tests for vector rotate; NFC
Sanjay Patel [Thu, 3 Mar 2022 16:01:12 +0000 (11:01 -0500)]
[AArch64][x86] add tests for rotate/funnel combines; NFC
Jim Ingham [Thu, 3 Mar 2022 20:10:54 +0000 (12:10 -0800)]
Fix the order of modules-loaded event and the resultant breakpoint-changed event.
The order used to be breakpoint-changed first, which didn't make much sense.
Differential Revision: https://reviews.llvm.org/D120919
Jim Ingham [Thu, 3 Mar 2022 17:56:50 +0000 (09:56 -0800)]
Fix up the "lldb log break" channel output.
1) Make the BreakpointEventData::Dump actually do something useful.
2) Make the Breakpoint events print when the break log channel is on
without having to turn on the events channel.
Differential Revision: https://reviews.llvm.org/D120917
Erich Keane [Thu, 3 Mar 2022 19:45:44 +0000 (11:45 -0800)]
[NFC] move CheckInstantiatedFunctionTemplateConstraints to SemaConcepts.cpp
This is a Sema function that now no longer depends on any of the
functionality in SemaTemplateInstantiateDecl.cpp (as the static function
was moved to Sema in a previous NFC). Moving it to SemaConcept means
that it and CheckFunctionConstraints can be changed to share more.
Philip Reames [Thu, 3 Mar 2022 19:36:21 +0000 (11:36 -0800)]
[DSE] Cache liveOnEntry as clobbering access
This builds on @fhahn's D112313, and caches the liveOnEntry node as a optimized access. D112313 tied to only cache a known clobber. This change adds caching the fact that no clobber exists. It still does not cache may-clobber results.
Differential Revision: https://reviews.llvm.org/D120842
Philip Reames [Thu, 3 Mar 2022 19:24:32 +0000 (11:24 -0800)]
Revert "Reapply "[SLP] Schedule only sub-graph of vectorizable instructions"""
This reverts commit
738042711bc08cde9135873200b1d088e6cf11c3. A second, apparently separate, issue has been reported on the original review.
Vasileios Porpodas [Tue, 1 Mar 2022 06:34:45 +0000 (22:34 -0800)]
[RegAlloc] Add a complexity limit in growRegion() to cap compilation time.
growRegion() does not scale in code with BBs with a very large number of edges.
In such code growRegion() becomes a compile-time bottleneck, consuming 60% of
the total compilation time.
This patch adds a limit to the complexity of growRegion() by incrementing a counter
in each iteration. We bail out once the limit is reached.
Differential Revision: https://reviews.llvm.org/D120752
Jonas Devlieghere [Thu, 3 Mar 2022 19:20:25 +0000 (11:20 -0800)]
[lldb] Remove reproducer verifier and corresponding command
This removes the reproducer verifier and the corresponding `reproducer
verify` subcommand.
Stanislav Mekhanoshin [Thu, 3 Mar 2022 19:17:50 +0000 (11:17 -0800)]
[AMDGPU] Added hsa-gfx90a-v3.s test. NFC.
Arthur Eubanks [Thu, 3 Mar 2022 18:57:10 +0000 (10:57 -0800)]
Revert "[GlobalOpt] Don't replace alias with aliasee if either alias/aliasee may be preemptible"
This reverts commit
30e8f83c84c5a302a559722fc0d2973dc3f425ee.
Causes huge compile time regressions on certain large files. Will followup offline with author.
Jonas Devlieghere [Thu, 3 Mar 2022 18:30:43 +0000 (10:30 -0800)]
[lldb] Remove FileSystem::Initialize from VFS mapping
This patch removes the ability to instantiate the LLDB FileSystem class
based on a VFS overlay. This also removes the "hack" where we cast the
VFS to a RedirectingFileSystem to obtain the external path. You can
still instantiate a FileSystem with a VFS, but with the caveat that
operations that rely on the external path won't work.
Differential revision: https://reviews.llvm.org/D120923
Stanislav Mekhanoshin [Thu, 3 Mar 2022 18:57:28 +0000 (10:57 -0800)]
[AMDGPU] Add test for instructions unsupported on gfx940. NFC.
Snehasish Kumar [Wed, 23 Feb 2022 20:37:42 +0000 (12:37 -0800)]
[memprof] Symbolize and cache stack frames.
Currently, symbolization of stack frames occurs on demand when the instrprof writer
iterates over all the records in the raw memprof reader. With this
change we symbolize and cache the frames immediately after reading the
raw profiles. For a large internal binary this results in a runtime
reduction of ~50% (2m -> 48s) when merging a memprof raw profile with a
raw instr profile to generate an indexed profile. This change also makes
it simpler in the future to generate additional calling context
metadata to attach to each memprof record.
Differential Revision: https://reviews.llvm.org/D120430
Nikolas Klauser [Thu, 3 Mar 2022 13:32:41 +0000 (14:32 +0100)]
[libc++] Remove _LIBCXX_MODULES_BUILD and ext/ headers from header tests
Reviewed By: ldionne, Quuxplusone, #libc
Spies: libcxx-commits, arichardson
Differential Revision: https://reviews.llvm.org/D120896
Shivam [Thu, 3 Mar 2022 15:32:34 +0000 (21:02 +0530)]
[analyzer] Done some changes to detect Uninitialized read by the char array manipulation functions
Few weeks back I was experimenting with reading the uninitialized values from src , which is actually a bug but the CSA seems to give up at that point . I was curious about that and I pinged @steakhal on the discord and according to him this seems to be a genuine issue and needs to be fix. So I goes with fixing this bug and thanks to @steakhal who help me creating this patch. This feature seems to break some tests but this was the genuine problem and the broken tests also needs to fix in certain manner. I add a test but yeah we need more tests,I'll try to add more tests.Thanks
Reviewed By: steakhal, NoQ
Differential Revision: https://reviews.llvm.org/D120489
Shafik Yaghmour [Thu, 3 Mar 2022 18:39:06 +0000 (10:39 -0800)]
[LLDB] Remove cases of using namespace llvm:: from header file
We have using namespace llvm::dwarf in dwarf.h header globally. Replacing that
with a using namespace within lldb_private::dwarf and moving to a
using namespace lldb_private::dwarf in .cpp files and fully qualified names
in the few header files.
Differential Revision: https://reviews.llvm.org/D120836
Louis Dionne [Thu, 3 Mar 2022 18:14:31 +0000 (13:14 -0500)]
[libc++] Move several defines to ADDITIONAL_COMPILE_FLAGS in the test suite
This avoids -Wmacro-redefined when turning warnings on with GCC.
Louis Dionne [Thu, 3 Mar 2022 18:07:42 +0000 (13:07 -0500)]
[libc++] Move .fail.cpp test to .verify.cpp
Arthur Eubanks [Thu, 3 Mar 2022 18:02:29 +0000 (10:02 -0800)]
[CostModel] Change printer pass wording to work with update_analyze_test_checks.py
update_analyze_test_checks.py looks for very specific wording, update
the printer pass to match the legacy `-analyze -cost-model` wording.
Shivam [Thu, 3 Mar 2022 15:32:34 +0000 (21:02 +0530)]
[analyzer] Done some changes to detect Uninitialized read by the char array manipulation functions
Few weeks back I was experimenting with reading the uninitialized values from src , which is actually a bug but the CSA seems to give up at that point . I was curious about that and I pinged @steakhal on the discord and according to him this seems to be a genuine issue and needs to be fix. So I goes with fixing this bug and thanks to @steakhal who help me creating this patch. This feature seems to break some tests but this was the genuine problem and the broken tests also needs to fix in certain manner. I add a test but yeah we need more tests,I'll try to add more tests.Thanks
Reviewed By: steakhal, NoQ
Differential Revision: https://reviews.llvm.org/D120489
Craig Topper [Thu, 3 Mar 2022 17:16:20 +0000 (09:16 -0800)]
[InstCombine][Analysis] Move getFCmpCode and getPredForFCmpCode to CmpInstAnalysis. NFC
The similar getICmpCode and getPredForICmpCode are already there.
This moves FP for consistency.
I think InstCombine is currently the only user of both.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D120754
David Spickett [Thu, 3 Mar 2022 17:20:31 +0000 (17:20 +0000)]
Revert "[lldb] Correct case in description of breakpoint --on-catch/throw"
This reverts commit
6b3b3ef344504334f43afe76c805d2e6e7b587e9.
Jim Ingham informed me that the upper case is a hint to the option
name, like you might see in a menu to show you what the shortcut is.
Erich Keane [Thu, 3 Mar 2022 16:56:46 +0000 (08:56 -0800)]
[NFC] Change TemplateInstantiator to refer to the base using a typedef
A few places were inconsistent here, which makes a refactor to support
delayed concepts significantly more difficult.
Andrzej Warzynski [Thu, 3 Mar 2022 17:04:32 +0000 (17:04 +0000)]
[flang][nfc] Fix GCC 11 build
After merging https://reviews.llvm.org/D120801, Flang no longer builds
with GCC 11:
```
../llvm-project/flang/lib/Semantics/runtime-type-info.cpp:385:22: error: variable ‘lenParam’ set but not used [-Werror=unused-but-set-variable]
385 | for (SymbolRef lenParam : *lenParameters) {
| ^~~~~~~~
```
I'm sending this without a review as a quick fix.
Akira Hatanaka [Thu, 3 Mar 2022 16:54:46 +0000 (08:54 -0800)]
[NFC][Clang][OpaquePtr] Remove calls to Address::deprecated in
CGBlocks.cpp
Differential Revision: https://reviews.llvm.org/D120856
Emre Kultursay [Thu, 3 Mar 2022 16:47:26 +0000 (08:47 -0800)]
[lldb] Fix DataExtractor symbol conflict
There are two DataExtractors in scope: one from the llvm namespace and
one from the lldb_private namespace. Some Microsoft Visual C++ compilers
(I tested with MSVC 14.23 specifically) cannot handle this situation,
and generate ambiguous symbol errors. This change fixes this compile
error.
Differential revision: https://reviews.llvm.org/D120718
Florian Hahn [Thu, 3 Mar 2022 16:41:26 +0000 (16:41 +0000)]
[IVDescriptor] Find original 'Previous' for first-order recurrences.
This patch extends first-order recurrence handling to support cases
where we already sunk an instruction for a different recurrence, but
LastPrev comes before Previous.
To handle those cases correctly, we need to find the earliest entry for
the sink-after chain, because this is references the Previous from the
original recurrence. This is needed to ensure we use the correct
instruction as sink point.
Depends on D118558.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D118642
Andrzej Warzynski [Thu, 3 Mar 2022 16:33:54 +0000 (16:33 +0000)]
[flang][nfc] Add missing build dependency
Two buildbots have started failing recently:
* https://lab.llvm.org/buildbot/#/builders/181/builds/3894
* https://lab.llvm.org/buildbot/#/builders/191/builds/3908
Build error:
```
In file included from /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/flang/examples/FlangOmpReport/FlangOmpReport.cpp:21:
In file included from /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/flang/include/flang/Frontend/FrontendActions.h:15:
In file included from /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/llvm/../mlir/include/mlir/IR/BuiltinOps.h:16:
In file included from /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/llvm/../mlir/include/mlir/IR/FunctionInterfaces.h:17:
In file included from /home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/llvm/../mlir/include/mlir/IR/BuiltinTypes.h:12:
/home/tcwg-buildbot/worker/flang-aarch64-rel-assert/llvm-project/llvm/../mlir/include/mlir/IR/BuiltinAttributeInterfaces.h:279:10: fatal error: 'mlir/IR/BuiltinAttributeInterfaces.h.inc' file not found
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```
I have not been able to reproduce locally, but from this log it is clear
that the rule for `flangFrontend` is missing the
`MLIRBuiltinAttributeInterfacesIncGen` dependency from MLIR. I couldn't
identify a breaking commit. I suspect that until now we have simply been
"lucky" and that dependency just happened to be built before
`flangFrontend`.
I am sending this without a review - the change is rather
straightforward and the only way to verify it is to make the buildbots
test it.
Paul Robinson [Wed, 2 Mar 2022 15:56:32 +0000 (10:56 -0500)]
[PS4] isPS4 and isPS4CPU are not meaningfully different
Siva Chandra Reddy [Thu, 3 Mar 2022 10:46:01 +0000 (10:46 +0000)]
[libc][Obvious] Add a few missing deps listings.
Sebastian Neubauer [Mon, 14 Feb 2022 11:07:34 +0000 (12:07 +0100)]
[UpdateTestChecks] Don't skip first line with --filter
body_start was never used, resulting in the first filtered line to be
skipped.
Fixes the --filter option introduced in D117694.
Differential Revision: https://reviews.llvm.org/D119704
Ruslan Arutyunyan [Thu, 3 Mar 2022 14:04:59 +0000 (17:04 +0300)]
[libcxx][test][NFC] Add tests for constructors of unordered [multi]map since C++14
Add tests for C++14 constructors in unordered_map and unordered_multimap
unordered_[multi]map(size_type sz, const allocator_type& alloc);
unordered_[multi]map(size_type sz, const hasher& hash, const allocator_type& alloc);
template <class InputIt>
unordered_[multi]map(InputIt first, InputIt last, size_type sz, const allocator_type& alloc);
template <class InputIt>
unordered_[multi]map(InputIt first, InputIt last, size_type sz, const hasher& hash, const allocator_type& alloc);
unordered_[multi]map(initializer_list<value_type> init, size_type sz, const allocator_type& alloc);
unordered_[multi]map(initializer_list<value_type> init, size_type sz, const hasher& hash, const allocator_type& alloc);
Reviewed By: ldionne, rarutyun, #libc
Differential Revision: https://reviews.llvm.org/D119236
Nikita Popov [Thu, 3 Mar 2022 15:59:17 +0000 (16:59 +0100)]
[Attributor] Regenerate test checks (NFC)
Michael Kruse [Thu, 3 Mar 2022 14:57:22 +0000 (08:57 -0600)]
[mlir] Fix gcc -std=c++17 compilation.
Ensure that `Handler` within the class is interpreted as the as the current template instantiation (instead the class template itself).
Fixes #53447
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D120852
Corentin Jabot [Thu, 3 Mar 2022 10:27:45 +0000 (11:27 +0100)]
[Clang] Diagnose invalid member variable with template parameters
Fixes https://github.com/llvm/llvm-project/issues/54151
Reviewed By: erichkeane, aaron.ballman
Differential Revision: https://reviews.llvm.org/D120881
Lei Zhang [Thu, 3 Mar 2022 14:44:40 +0000 (09:44 -0500)]
[mlir][linalg] NFC: minor cleanups after moving pad to tensor dialect
Reviewed By: mravishankar
Differential Revision: https://reviews.llvm.org/D120627
Roy Jacobson [Thu, 3 Mar 2022 14:17:07 +0000 (06:17 -0800)]
[Concepts] Check constraints for explicit template instantiations
The standard requires[0] member function constraints to be checked when
explicitly instantiating classes. This patch adds this constraints
check.
This issue is tracked as #46029 [1].
Note that there's an related open CWG issue (2421[2]) about what to do when
multiple candidates have satisfied constraints. This is particularly an
issue because mangling doesn't contain function constraints, and so the
following code still ICEs with definition with same mangled name
'_ZN1BIiE1fEv' as another definition:
template<class T>
struct B {
int f() requires std::same_as<T, int> {
return 0;
}
int f() requires (std::same_as<T, int> &&
!std::same_as<T, char>) {
return 1;
}
};
template struct B<int>;
Also note that the constraints checking while instantiating *functions*
is still not implemented. I started looking at it but It's a bit more
complicated. I believe in such a case we have to consider the partial
constraints order and potentially choose the best candidate out of the
set of multiple valid ones.
[0]: https://eel.is/c++draft/temp.explicit#10
[1]: https://github.com/llvm/llvm-project/issues/46029
[2]: https://cplusplus.github.io/CWG/issues/2421.html
Differential Revision: https://reviews.llvm.org/D120255
Jake Egan [Thu, 3 Mar 2022 14:28:23 +0000 (09:28 -0500)]
[libc++] Fix initialization of __fill_
`basic_ios` delays initialization of `__fill_` to `widen(' ')` until `fill()` is called. But, `fill(char_type)` is missing this logic, so the fill character does not get initialized to whitespace if `fill(char_type)` is called first. This patch adds this logic to `fill(char_type)`.
Reviewed By: #libc, ldionne, Quuxplusone
Differential Revision: https://reviews.llvm.org/D120751
Sanjay Patel [Thu, 3 Mar 2022 13:48:25 +0000 (08:48 -0500)]
[SDAG] try harder to remove a rotate from X == 0
https://alive2.llvm.org/ce/z/mJP7XP
This can be viewed as expanding the compare into and/or-of-compares:
https://alive2.llvm.org/ce/z/bkZYWE
followed by reduction of each compare.
This could be extended in several ways:
1. There's a (X & Y) == -1 sibling.
2. We can recurse through more than 1 'or'.
3. The fold could be generalized beyond rotates - any operation that
only changes the order of bits (bswap, bitreverse).
This is a transform noted in D111530.
Sanjay Patel [Wed, 2 Mar 2022 21:58:02 +0000 (16:58 -0500)]
[x86] add tests for setcc of rotate; NFC
Nikita Popov [Thu, 3 Mar 2022 14:18:15 +0000 (15:18 +0100)]
[FuncSpec] Remove unnecessary function pointer type check
We will check a bit later that the constant is in fact a function,
so the separate check for a function pointer type is largely
redunant. Also simplify the cast stripping with
stripPointerCasts().
Florian Hahn [Thu, 3 Mar 2022 13:32:08 +0000 (13:32 +0000)]
[AArch64] Use first op of FADDPv* instead of implicit def.
This patch updates the FADDPv* patterns that only use the lower half of
the result register. For those patterns, the second operand does not
matter because its results won't be used.
Instead of introducing new implicit defs for those operands, just use
the first operand. The problem with using new implicit defs is that
register allocation can introduce unnecessary dependencies by using a
different register than the first operand.
For motivating cases, see the changes in the fadd_reduction_*_in_loop
cases. Without this change, the first faddp in the loop has an
unnecessary additional dependency through v0, which is also used for
a cross-iteration reduction.
This can noticeable impact performance. For slightly bigger loops,
this change can improve performance by 15%.
Reviewed By: sdesmalen, t.p.northover
Differential Revision: https://reviews.llvm.org/D120706
Haojian Wu [Thu, 3 Mar 2022 13:21:31 +0000 (14:21 +0100)]
[pseudo] Fix an out-of-bound access for LRTable::Actions.
Without this patch, when End == Start, we access Actions[Actions.end()]
though we return an empty result.
This fixes an assertion failure in MSVC STL debug build.
Matthias Springer [Thu, 3 Mar 2022 12:52:11 +0000 (21:52 +0900)]
[mlir][bufferize] Always bufferize top-to-bottom
This ensures that we generate memref types with matching layout maps. (Especially when using partial bufferization passes.)
Differential Revision: https://reviews.llvm.org/D120893
Alexandros Lamprineas [Thu, 3 Mar 2022 11:53:01 +0000 (11:53 +0000)]
[FuncSpec][NFC] Refactor internal structures.
`ArgInfo` is reduced to only contain a pair of {formal,actual} values.
The specialized function `Fn` and the `Partial` flag are redundant in
this structure. The `Gain` is moved to a new struct `SpecializationInfo`.
The value mappings created by cloneCandidateFunction() are being used
by rewriteCallSites() for matching the formal arguments of recursive
functions.
The list of specializations is passed by reference to calculateGains()
instead of being returned by value.
The `IsPartial` flag is removed from isArgumentInteresting() and
getPossibleConstants() as it's no longer used anywhere in the code.
Differential Revision: https://reviews.llvm.org/D120753
owenca [Thu, 3 Mar 2022 07:36:34 +0000 (23:36 -0800)]
[clang-format] Handle wrapped else for RemoveBracesLLVM
Removes the newline before the right brace that's followed by an
else on the next line.
Differential Revision: https://reviews.llvm.org/D120873
Alex Tsao [Wed, 2 Mar 2022 18:03:48 +0000 (02:03 +0800)]
[RISCV] Add cost modelling for masked memory op
The patch adds very basic cost model for masked memory op on scalable vector.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D117884
LLVM GN Syncbot [Thu, 3 Mar 2022 12:36:38 +0000 (12:36 +0000)]
[gn build] Port
8de8731591fe
Simon Moll [Thu, 3 Mar 2022 12:34:20 +0000 (13:34 +0100)]
Revert "[VP] Introducing VectorBuilder, the VP intrinsic builder"
This reverts commit
8bcbfb50e8ea24998f9adf2f50b1f63b499299ed.
Taking this patch offline to fix breakage: https://lab.llvm.org/buildbot/#/builders/110/builds/10912
Nikolas Klauser [Thu, 3 Mar 2022 11:10:30 +0000 (12:10 +0100)]
[libc++] Use -I instead of -isystem to include headers in the test suite
Using -isystem marks the headers as system headers, which means that we
don't actually get all the warnings that we'd normally get if we included
the headers as user headers.
The goal of the test suite is normally to mirror as closely as possible
how users would use the library. Technically, this change goes against
that philosophy, since users should be using `-isystem` (if they ever
need to specify the libc++ path explicitly, which should be a rare
occurence). However, I believe fishing out additional warnings from
the headers provides more value, hence this change. Ideally, we'd be
able to still use `-isystem`, but instruct Clang to still emit warnings
from the libc++ headers (e.g. we could tell Clang to emit warnings in
any file inside `<...>/usr/include/c++/v1`).
Reviewed By: #libc, ldionne, #libc_abi
Spies: Mordante, EricWF, mstorsjo, mgorny, aheejin, arichardson, philnik, jloser, libcxx-commits
Differential Revision: https://reviews.llvm.org/D118616
Ruslan Arutyunyan [Thu, 3 Mar 2022 11:48:54 +0000 (14:48 +0300)]
[libcxx][test][NFC] Add tests for C++14 constructors of unordered sets
Add tests for C++14 constructors in unordered_set and unordered_multiset:
unordered_[multi]set(size_type sz, const allocator_type& alloc);
unordered_[multi]set(size_type sz, const hasher& hash, const allocator_type& alloc);
template <class InputIt>
unordered_[multi]set(InputIt first, InputIt last, size_type sz, const allocator_type& alloc);
template <class InputIt>
unordered_[multi]set(InputIt first, InputIt last, size_type sz, const hasher& hash, const allocator_type& alloc);
unordered_[multi]set(initializer_list<value_type> init, size_type sz, const allocator_type& alloc);
unordered_[multi]set(initializer_list<value_type> init, size_type sz, const hasher& hash, const allocator_type& alloc);
Reviewed By: ldionne, Quuxplusone, rarutyun, #libc
Differential Revision: https://reviews.llvm.org/D119243
Simon Pilgrim [Thu, 3 Mar 2022 12:07:48 +0000 (12:07 +0000)]
[X86][XOP] Tidyup VPHADD/VPHSUB unary horizontal ops default schedule class
Based off Agner and AMD SoG tables, the XOP VPHADD/VPHSUB unary horizontal ops are as fast as basic arithmetic ops, not the slower SSSE3 binary horizontal add/sub ops. This also matches what the bdver2 model already lists.
Noticed while investigating reduction add optimizations.
Sam Parker [Thu, 3 Mar 2022 11:47:02 +0000 (11:47 +0000)]
[NFC] TypePromotion test
Martin Storsjö [Sat, 26 Feb 2022 22:16:24 +0000 (00:16 +0200)]
Reapply [lit] Read command stdout/stderr as text on Windows
This takes care of normalizing newlines back to single LF instead
of CRLF.
Fix up a couple tests that accidentally pass binary data to stdout.
Differential Revision: https://reviews.llvm.org/D120623
Martin Storsjö [Tue, 22 Feb 2022 11:23:53 +0000 (13:23 +0200)]
[libcxx] [test] Fix get/put long_double_ru_RU on Glibc, FreeBSD and Windows
Note, reducing ios.width() in put_long_double instead of using variable
padding, when using a variable width symbol. Some of those tests didn't
actually trigger any padding in the existing form, with a longer
currency symbol; reduce the width so there's no actual padding with the
slightly shorter currency symbol either.
The tests for the international currency symbol use the same amount of
padding on all platforms, so they still exercise the padding properly.
Differential Revision: https://reviews.llvm.org/D120317
David Green [Thu, 3 Mar 2022 11:17:24 +0000 (11:17 +0000)]
[AArch64] Update costs for some fp16 converts
This updates the costs for FP16 converts, as some of them were pretty
high.
Differential Revision: https://reviews.llvm.org/D120771
Matthias Springer [Thu, 3 Mar 2022 10:50:32 +0000 (19:50 +0900)]
[mlir][linalg][bufferize] Migrate --linalg-bufferize to BufferizableOpInterface-based bufferization
This commit deletes the old dialect conversion-based bufferization patterns, which are now obsolete.
Differential Revision: https://reviews.llvm.org/D120883
David Green [Thu, 3 Mar 2022 10:42:57 +0000 (10:42 +0000)]
[AArch64] Vector shifts cost 1
The costs of vector shifts was 2 as opposed to 1, as the nodes are
marked custom. Fix this like the others and mark the nodes as cheap.
Differential Revision: https://reviews.llvm.org/D120773
LLVM GN Syncbot [Thu, 3 Mar 2022 10:33:40 +0000 (10:33 +0000)]
[gn build] Port
8bcbfb50e8ea
Simon Moll [Thu, 3 Mar 2022 10:31:42 +0000 (11:31 +0100)]
[VP] Introducing VectorBuilder, the VP intrinsic builder
VectorBuilder wraps around an IRBuilder and
VectorBuilder::createVectorInstructions emits VP intrinsics as if they
were regular instructions.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D105283
Andrzej Warzynski [Thu, 3 Mar 2022 10:24:35 +0000 (10:24 +0000)]
Revert "[mlir] Add extensible dialects"
This reverts commit
dbe9f0914fcfd8444fd9656821af0f1a34a27e7a.
The flang-x86_64-windows buildbot has been failing since this has been merged:
* https://lab.llvm.org/buildbot/#/builders/172/builds/9124
Similar failure was reported by the pre-commit CI.
Kristóf Umann [Fri, 4 Feb 2022 14:40:26 +0000 (15:40 +0100)]
[analyzer] Improve NoOwnershipChangeVisitor's understanding of deallocators
The problem with leak bug reports is that the most interesting event in the code
is likely the one that did not happen -- lack of ownership change and lack of
deallocation, which is often present within the same function that the analyzer
inlined anyway, but not on the path of execution on which the bug occured. We
struggle to understand that a function was responsible for freeing the memory,
but failed.
D105819 added a new visitor to improve memory leak bug reports. In addition to
inspecting the ExplodedNodes of the bug pat, the visitor tries to guess whether
the function was supposed to free memory, but failed to. Initially (in D108753),
this was done by checking whether a CXXDeleteExpr is present in the function. If
so, we assume that the function was at least party responsible, and prevent the
analyzer from pruning bug report notes in it. This patch improves this heuristic
by recognizing all deallocator functions that MallocChecker itself recognizes,
by reusing MallocChecker::isFreeingCall.
Differential Revision: https://reviews.llvm.org/D118880
Nikita Popov [Thu, 3 Mar 2022 10:05:31 +0000 (11:05 +0100)]
[InstCombine] Support opaque pointers in callee bitcast fold
To make this actually trigger, we also need to check whether the
function types differ, which is a hidden cast under opaque pointers.
The transform is somewhat less relevant there because it is
primarily about pointer bitcasts, but it can also happen with other
bit- or pointer-castable types.
Byval handling is easier with opaque pointers because there is no
need to adjust the byval type, we only need to make sure that it's
still a pointer.
David Spickett [Thu, 3 Mar 2022 10:04:07 +0000 (10:04 +0000)]
[lldb] Correct case in description of breakpoint --on-catch/throw
Somehow we ended up with catcH/throW.
Nikita Popov [Thu, 3 Mar 2022 09:49:00 +0000 (10:49 +0100)]
[InstCombine] Remove unnecessary byval check in callee cast fold
The logic for handling this was fixed in
8d7f118ab2b9e51d6cf2811291e319b4d977eb8c, but the check for byval
on the callee was retained. This resulted in a weird situation
where the transform would work depending on whether the byval
was only on the call or on both the call and the function.
Nikita Popov [Thu, 3 Mar 2022 09:47:19 +0000 (10:47 +0100)]
[InstCombine] Add callee bitcast test with byval on callee (NFC)
Same as the existing test, but the callee also has a byval
attribute.
Cullen Rhodes [Thu, 3 Mar 2022 09:20:22 +0000 (09:20 +0000)]
[AArch64] Allow copying of SVE registers in Streaming SVE
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D118562
Cullen Rhodes [Thu, 3 Mar 2022 09:20:13 +0000 (09:20 +0000)]
[AArch64] Add legal types for Streaming SVE
The compiler currently crashes for scalable types when compiling with
+sme, e.g.
define <vscale x 4 x i32> @foo(<vscale x 4 x i32> %a) {
ret <vscale x 4 x i32> %a
}
since it doesn't know how to legalize the types. SME implies a subset of
SVE (+streaming-sve), the hasSVE predication in the backend needs
extending to consider types/operations that are legal in Streaming SVE.
This is the first patch adding legal types <-> register classes. Before
making the change +sve(2) was temporarily replaced with +sme in all the
intrinsics tests to see what failed, and again after making the change.
For all the tests that passed after adding the legal types another RUN
line has been added for +streaming-sve. More patches to follow.
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D118561
Haojian Wu [Mon, 28 Feb 2022 09:25:59 +0000 (10:25 +0100)]
[AST] Use RecoveryExpr to model a DeclRefExpr which refers to an invalid Decl.
Previously, we didin't build a DeclRefExpr which refers to an invalid declaration.
In this patch, we handle this case by building an empty RecoveryExpr,
which will preserve more broken code (AST parent nodes that contain the
RecoveryExpr is preserved in the AST).
Differential Revision: https://reviews.llvm.org/D120812
Nikita Popov [Thu, 3 Mar 2022 09:28:09 +0000 (10:28 +0100)]
[Scalarizer] Avoid pointer element type accesses
Pass through the load/store type to the Scatterer instead.
serge-sans-paille [Thu, 3 Mar 2022 09:19:10 +0000 (10:19 +0100)]
Add missing include under -DEXPENSIVE_CHECKS
This is a follow-up to
59630917d6cc7c4a273f617f92bf6190ee2992e1
Jean Perier [Thu, 3 Mar 2022 09:14:08 +0000 (10:14 +0100)]
[flang] Generate PDT runtime type info in the type definition scope
This patches modifies PDT runtime type info generation so that it is
easier to handle derived type descriptor in lowering. It changes three
aspects:
1. The symbol name suffix of runtime type info for PDT instantiation is
changed from a serial number unrelated to the types to an encoding of
the instantiated KIND parameters.
2. New runtime type info is not created for each instantiation of PDT without
KIND parameters (only length parameters). Instead, the runtime type
info of the type definition is always used. It is updated to contain
the component descriptions.
3. Runtime type info of PDT instantiation is now always generated in the
scope where the type is defined. If several PDT type instantiation
are made in different scope with the same kind parameters, they will
use the same runtime type info.
Rational of the change:
In lowering, derived type descriptors are not mapped when instantiating derived
type objects. They are mapped later when symbol knowledge is not available anymore.
This mapping is based on the FIR representation of derived types. For
PDT, the FIR type information does not allow deducing the instantiation
scope, it only allows retrieving the type name, the type _definition_
scope, and the kind parameter values. Therefore, in order to be able to
retrieve the derived type descriptor from a FIR type, the derived type
descriptor must be generated in the definition scope and must reflect
the kind parameters. This justifies the need for changes 1. and 3.
above (suffix and scope change). Changes 2. comes from the fact that
all runtime type info of type without kind parameters can be generated
from the type definition, and that because of the suffix change, the
symbol name for type definition and type instantiation are the same.
Although this change is first motivated by how lowering handles derived
types, I believe it is also an improvement from a functional point of
view since this change will allow reducing the number of generated
runtime type info for PDTs, since redundant information (different
instantiations with same kind parameters) will only be generated once.
Differential Revision: https://reviews.llvm.org/D120801
Jean Perier [Thu, 3 Mar 2022 09:11:19 +0000 (10:11 +0100)]
[flang] Handle optional TARGET associate in ASSOCIATED runtime
The TARGET argument of ASSOCIATED may be dynamically optional, in which
case ASSOCIATED(POINTER, TARGET) is equal to ASSOCIATED(TARGET).
Make the runtime argument a pointer so that it can detect and handle
arguments that are dynamically optional.
Also fix the runtime to check if TARGET base address is not null and if
its element size is not null to match the requirement of ASSOCIATED
regarding TARGET:
- if TARGET is an object: true iff [..] TARGET is not a zerosized storage sequence
- if TARGET is a POINTER: true iff [..] POINTER and TARGET are associated
Not that ASSOCIATED will also returns false if TARGET is an unallocated allocatable.
This is not described in the standard, but is a unanimous behaviour of
existing compilers.
Differential Revision: https://reviews.llvm.org/D120835
Jean Perier [Thu, 3 Mar 2022 09:07:34 +0000 (10:07 +0100)]
[flang] Support PDT type descriptors in codegen
This change updates the mapping of derived types and type descriptor
object names to support kind parametrized derived types (PDT).
It moves the custom name mapping to the internal name utility.
To improve robustness and error reporting, type descriptors are also now
required to be generated in all compilation unit that manipulates
derived types. The previous codegen relied on the fact that descriptors
not defined in the current FIR module were available externally. Errors
with missing type descriptors were only caught at link time.
This patch makes derived type definition mandatory, except if the
derived types are expected to not have derived type descriptors (builtin
types), or if the newly added debug switch `--ignore-missing-type-desc`
is set. In those cases, a null pointer is used as type descriptor
pointer. The debug switch intends to help testing FIR to LLVM passes
without having to bother providing type descriptor data structures that
are normally built by the front-end.
Differential Revision: https://reviews.llvm.org/D120804
Nikita Popov [Thu, 3 Mar 2022 08:59:06 +0000 (09:59 +0100)]
[llvm-stress] Support opaque pointers
With opaque pointers, generate the load/store type independently
of the pointer type.
Nikita Popov [Thu, 3 Mar 2022 08:40:28 +0000 (09:40 +0100)]
[DSE] Drop redundant WalkerStepLimit adjustment
There is a general WalkerStepLimit adjustment higher up in the
loop, and I don't see any reason why this particular case would
need additional adjustment. Furthermore, this could underflow.
jacquesguan [Mon, 21 Feb 2022 08:13:44 +0000 (16:13 +0800)]
[RISCV] Fold store of vmv.f.s to a vse with VL=1.
This patch support the FP part of D109482.
Differential Revision: https://reviews.llvm.org/D120235
Martin Storsjö [Wed, 19 Jan 2022 10:38:15 +0000 (10:38 +0000)]
[libcxx] [test] Fix the collate compare test for Glibc, Windows and FreeBSD
The old expected behaviour was specific to Apple platforms,
while Glibc, Windows and FreeBSD collate differently (ignoring
case). Make the old tested behaviour a special case for Apple
platforms, and make the default case the one used by the other
three.
In clang-cl/DLL configurations, the test is hit by
https://llvm.org/PR41018 (making the test fail to link).
Differential Revision: https://reviews.llvm.org/D120797
Martin Storsjö [Wed, 2 Mar 2022 10:33:31 +0000 (12:33 +0200)]
[LLD] [COFF] Order .debug_* sections at the end, to avoid leaving gaps if stripped
So far, we sort all discardable sections at the end, with only some
extra logic to make sure that the .reloc section is at the start
of that group of sections. But if there are other discardable
sections, other than .reloc, they must also be ordered before
.debug_* sections, to avoid leaving gaps if the executable is
stripped.
(Stripping executables doesn't remove all discardable sections,
only the ones named .debug_*).
Rust binaries seem to include a .rmeta section, which is marked
discardable. This fixes stripping such binaries if built with
dwarf debug info included.
This fixes issues observed in MSYS2 in
https://github.com/msys2/MINGW-packages/pull/10555.
Differential Revision: https://reviews.llvm.org/D120805
Peixin-Qiao [Thu, 3 Mar 2022 07:21:44 +0000 (15:21 +0800)]
[MLIR] Fix afterIP for dynamic worksharing-loop after collaping loops
The loopInfos gets invalidated after collapsing nested loops. Use the
saved afterIP since the returned afterIP by applyDynamicWorkshareLoop
may be not valid.
Reviewed By: shraiysh
Differential Revision: https://reviews.llvm.org/D120294
serge-sans-paille [Wed, 2 Mar 2022 15:38:19 +0000 (16:38 +0100)]
Cleanup includes: Transform/Scalar
Estimated impact on preprocessor output line:
before:
1062981579
after:
1062494547
Discourse thread: https://discourse.llvm.org/t/include-what-you-use-include-cleanup
Differential Revision: https://reviews.llvm.org/D120817
serge-sans-paille [Tue, 1 Mar 2022 20:01:59 +0000 (21:01 +0100)]
Revert "Add missing include under EXPENSIVE_CHECK"
This reverts commit
eeaca53df7a030862bd1160950a6264aeb605cc6.
It's a duplicate of
https://reviews.llvm.org/rG50874a188b94a25827963956887b878d3701509a
Jonas Devlieghere [Thu, 3 Mar 2022 06:40:04 +0000 (22:40 -0800)]
[lldb] Update the CI docs
Remove the reproducer bot and the fedora bot.
Jonas Devlieghere [Thu, 3 Mar 2022 06:33:38 +0000 (22:33 -0800)]
[lldb] Update TestBasicEntryValues.py for `image lookup` output
Update TestBasicEntryValues.py for
15983c28aa81 which changes the output
for `image lookup -v`. This should fix the debian and macos build bots.
Danila Malyutin [Thu, 10 Feb 2022 14:31:03 +0000 (17:31 +0300)]
[Support][AArch64] Detect a few more host CPU features on AArch64
Add detecton for lse, sve and sve2 on linux
Differential Revision: https://reviews.llvm.org/D119435
Dominic Chen [Wed, 2 Mar 2022 06:54:59 +0000 (22:54 -0800)]
[lldb] Fix python errors in gdbremote.py
Fix exceptions encountered while debugging gdb protocol
Differential Revision: https://reviews.llvm.org/D120792
Kai Luo [Thu, 3 Mar 2022 02:08:22 +0000 (10:08 +0800)]
[PowerPC][atomics] Precommit test cases for i128 cmpxchg. NFC.
David Blaikie [Thu, 3 Mar 2022 02:05:11 +0000 (02:05 +0000)]
More bazel fixes.
Jonas Devlieghere [Thu, 3 Mar 2022 00:41:46 +0000 (16:41 -0800)]
[lldb] Skip check for the lldb prompt in TestIOHandlerProcessSTDIO
The check for the prompt isn't essential for this test. The check fail
on the lldb-arm-ubuntu because of what appears to be a missing space
after the prompt. Rather than disabling the test, let's see if we can
get it to pass without it.
David Blaikie [Thu, 3 Mar 2022 00:18:54 +0000 (00:18 +0000)]
More attempts at bazel fix
Peter Klausler [Thu, 24 Feb 2022 00:36:39 +0000 (16:36 -0800)]
[flang] Remove bogus messages for actual/dummy procedure argument compatibility
Add new IsCompatibleWith() member functions to many classes in evaluate::characteristics
that apply more nuanced compatibility checking for function results, dummy
arguments, and procedure interfaces than the previous tests for complete
equivalence. Use IsCompatibleWith() in semantics for call checking.
Differential Revision: https://reviews.llvm.org/D120844
Jonas Devlieghere [Wed, 2 Mar 2022 23:56:43 +0000 (15:56 -0800)]
[lldb] Update error messages in TestMemoryHistory.py
Update TestMemoryHistory.py for
daba82362228b4aa460c26079c028ebf832066fd
which changes the CommandObject & Disassemble error messages .
Jonas Devlieghere [Wed, 2 Mar 2022 23:38:02 +0000 (15:38 -0800)]
[lldb] Devirtualize IOHandler::{IsActive,SetIsDone,GetIsDone} (NFC)
There are no implementations overriding these methods.
Differential revision: https://reviews.llvm.org/D120766
Jonas Devlieghere [Wed, 2 Mar 2022 19:59:55 +0000 (11:59 -0800)]
[lldb] Avoid data race in IOHandlerProcessSTDIO
This patch fixes a data race in IOHandlerProcessSTDIO. The race is
happens between the main thread and the event handling thread. The main
thread is running the IOHandler (IOHandlerProcessSTDIO::Run()) when an
event comes in that makes us pop the process IO handler which involves
cancelling the IOHandler (IOHandlerProcessSTDIO::Cancel). The latter
calls SetIsDone(true) which modifies m_is_done. At the same time, we
have the main thread reading the variable through GetIsDone().
This patch avoids the race by using a mutex to synchronize the two
threads. On the event thread, in IOHandlerProcessSTDIO ::Cancel method,
we obtain the lock before changing the value of m_is_done. On the main
thread, in IOHandlerProcessSTDIO::Run(), we obtain the lock before
reading the value of m_is_done. Additionally, we delay calling SetIsDone
until after the loop exists, to avoid a potential race between the two
writes.
Write of size 1 at 0x00010b66bb68 by thread T7 (mutexes: write M2862, write M718324145051843688):
#0 lldb_private::IOHandler::SetIsDone(bool) IOHandler.h:90 (liblldb.15.0.0git.dylib:arm64+0x971d84)
#1 IOHandlerProcessSTDIO::Cancel() Process.cpp:4382 (liblldb.15.0.0git.dylib:arm64+0x5ddfec)
#2 lldb_private::Debugger::PopIOHandler(std::__1::shared_ptr<lldb_private::IOHandler> const&) Debugger.cpp:1156 (liblldb.15.0.0git.dylib:arm64+0x3cb2a8)
#3 lldb_private::Debugger::RemoveIOHandler(std::__1::shared_ptr<lldb_private::IOHandler> const&) Debugger.cpp:1063 (liblldb.15.0.0git.dylib:arm64+0x3cbd2c)
#4 lldb_private::Process::PopProcessIOHandler() Process.cpp:4487 (liblldb.15.0.0git.dylib:arm64+0x5c583c)
#5 lldb_private::Debugger::HandleProcessEvent(std::__1::shared_ptr<lldb_private::Event> const&) Debugger.cpp:1549 (liblldb.15.0.0git.dylib:arm64+0x3ceabc)
#6 lldb_private::Debugger::DefaultEventHandler() Debugger.cpp:1622 (liblldb.15.0.0git.dylib:arm64+0x3cf2c0)
#7 std::__1::__function::__func<lldb_private::Debugger::StartEventHandlerThread()::$_2, std::__1::allocator<lldb_private::Debugger::StartEventHandlerThread()::$_2>, void* ()>::operator()() function.h:352 (liblldb.15.0.0git.dylib:arm64+0x3d1bd8)
#8 lldb_private::HostNativeThreadBase::ThreadCreateTrampoline(void*) HostNativeThreadBase.cpp:62 (liblldb.15.0.0git.dylib:arm64+0x4c71ac)
#9 lldb_private::HostThreadMacOSX::ThreadCreateTrampoline(void*) HostThreadMacOSX.mm:18 (liblldb.15.0.0git.dylib:arm64+0x29ef544)
Previous read of size 1 at 0x00010b66bb68 by main thread:
#0 lldb_private::IOHandler::GetIsDone() IOHandler.h:92 (liblldb.15.0.0git.dylib:arm64+0x971db8)
#1 IOHandlerProcessSTDIO::Run() Process.cpp:4339 (liblldb.15.0.0git.dylib:arm64+0x5ddc7c)
#2 lldb_private::Debugger::RunIOHandlers() Debugger.cpp:982 (liblldb.15.0.0git.dylib:arm64+0x3cb48c)
#3 lldb_private::CommandInterpreter::RunCommandInterpreter(lldb_private::CommandInterpreterRunOptions&) CommandInterpreter.cpp:3298 (liblldb.15.0.0git.dylib:arm64+0x506478)
#4 lldb::SBDebugger::RunCommandInterpreter(bool, bool) SBDebugger.cpp:1166 (liblldb.15.0.0git.dylib:arm64+0x53604)
#5 Driver::MainLoop() Driver.cpp:634 (lldb:arm64+0x100006294)
#6 main Driver.cpp:853 (lldb:arm64+0x100007344)
Differential revision: https://reviews.llvm.org/D120762
Stanislav Mekhanoshin [Wed, 2 Mar 2022 23:35:08 +0000 (15:35 -0800)]
[AMDGPU] Removed XFAIL from hsa-gfx940-v3.s. NFC.
Handling of big endian was fixed in D88858.
Aakanksha [Wed, 2 Mar 2022 23:23:40 +0000 (23:23 +0000)]
[AMDGPU] Add gfx1036 target
Differential Revision: https://reviews.llvm.org/D120846
Peter Klausler [Fri, 18 Feb 2022 18:17:04 +0000 (10:17 -0800)]
[flang] Extend ProvenanceRange::Suffix() to handle crash case
Suffix() can be called from AllSources::IntersectionWithSourceFiles()
when a contiguous range of source provenance overlaps a macro expansion.
It skips over the macro expansion and recurses on the remainder of
the range, which might end with a bit that does overlap with a
source file. However, in the case where the original range is
entirely within the expanded macro, Suffix() crashes when called
with a skip offset greater than the size of the range.
Rather than add logic around this and other calls to Suffix() to
avoid passing an out-of-range skip, it's better to accommodate it
in Suffix() and return an empty result.
Differential Revision: https://reviews.llvm.org/D120843