Ben Shi [Tue, 26 Oct 2021 08:39:51 +0000 (08:39 +0000)]
[CUDA][NFC] Fix inexact warning message about lambdas
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D112521
Nico Weber [Wed, 27 Oct 2021 01:05:48 +0000 (21:05 -0400)]
Unbreak code_signature_lc.test on macOS after
911be05743eb606
Daniel Rodríguez Troitiño [Wed, 27 Oct 2021 00:03:08 +0000 (17:03 -0700)]
[test][objcopy] Replace GNU sed extension with BSD compatible syntax.
GNU sed offers the `,+4d` to delete the line a next four lines, but BSD
sed doesn't seem to support it (at least in macOS 10.15, but seems to do
in my 11.6 version).
Replace the usage of the extension with the equivalent syntax that works
both in BSD and GNU sed. I don't have a macOS 10.15 to check, but this
works in both my macOS 11.6 and Linux machines.
Differential Revision: https://reviews.llvm.org/D112583
Jacques Pienaar [Wed, 27 Oct 2021 00:35:16 +0000 (17:35 -0700)]
[mlir] Fix missing prefix for region accessor on OpAdaptor
Also flip op-decl-and-defs test to _Prefixed to test more.
Brad Smith [Wed, 27 Oct 2021 00:05:12 +0000 (20:05 -0400)]
[mlir] Avoid including <alloca.h> on OpenBSD
Luís Ferreira [Tue, 26 Oct 2021 23:23:27 +0000 (16:23 -0700)]
[Demangle] Add prepend functionality to OutputString
Implement the functionallity of prepend, required by D demangler.
Please read discussion https://reviews.llvm.org/D111414 for context.
See also https://reviews.llvm.org/D111947 .
Reviewed By: dblaikie, Geod24
Differential Revision: https://reviews.llvm.org/D111948
David Blaikie [Tue, 26 Oct 2021 23:19:38 +0000 (16:19 -0700)]
Add cross-project-test for simplified template name rebuilding
LLVM GN Syncbot [Tue, 26 Oct 2021 23:05:31 +0000 (23:05 +0000)]
[gn build] Port
566bfbb740bb
Jacques Pienaar [Tue, 26 Oct 2021 23:04:15 +0000 (16:04 -0700)]
[mlir][ods] Fix incorrect accessing of segment_sizes
The previous change resulted in prefixing a query that uses the raw
attribute as if function invocation. Fixing quickly, with updated test
to follow.
Jez Ng [Tue, 26 Oct 2021 22:40:20 +0000 (18:40 -0400)]
[lld-macho] Fix compact-unwind-bad-reloc.s test
Broken by
a9353dbe517c522ac63818de2cde645acdc46834.
Now that the functions point to the compact unwind entries, instead of
the other way around, we need to perform the "invalid reference" check
in a different place.
This change was originally part of the stacked diff D109946, but should
have been included as part of D109945.
David Blaikie [Tue, 26 Oct 2021 22:48:20 +0000 (15:48 -0700)]
llvm-dwarfdump --verify: Exit non-zero on simplified template name rebuilding failures
Nico Weber [Tue, 26 Oct 2021 22:40:07 +0000 (18:40 -0400)]
Reland "[gn build] (manually) port
6fe2beba7d2a (ExceptionTests)"
This reverts commit
e2a2e5475cbd370044474e132a1b5c58e6a3d458.
6fe2beba7d2a relanded (again) in
c24a58081b527fa8.
Rob Suderman [Tue, 26 Oct 2021 22:08:05 +0000 (15:08 -0700)]
[tosa][mlir] Add bailout to TosaMakeBroadcastable for unranked case
Dyn-cast should be checked and bailed out if the dyn_cast failed.
Reviewed By: sjarus, NatashaKnk
Differential Revision: https://reviews.llvm.org/D112574
Austin Kerbow [Sat, 23 Oct 2021 05:06:41 +0000 (22:06 -0700)]
[AMDGPU] Use max waves for scheduler's initial occupancy target
The scheduler should set critical/excess register usage thresholds that
are guided by the maximum possible occupancy for the function. This
change is focused on setting proper lower bounds on register usage which
we would typically only see when a specific number of maximum waves is
requested with the "waves-per-eu" attribute, or by setting
"amdgpu-num-vgpr|sgpr" directly. This was broken previously. I have a
follow-on patch that will address issues with the scheduler not
targeting correct upper bounds on register usage which is typical with
launch bounds and min "waves-per-eu".
Changes by this patch:
Set the initial critical register usage thresholds to minimum values
that are determined by the maximum possible occupancy for the function,
or the number of allocatable registers, whichever is lower.
Avoid unisgned overflow if register limits are lower than the register
tracking "ErrorMargin", I.e. when using stress-regalloc=2.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D112373
Yuanfang Chen [Tue, 26 Oct 2021 20:58:43 +0000 (13:58 -0700)]
[DebugInfo] Skip ODRUniquing for mismatched tags
Otherwise, ODRUniquing would map some member method/variable MDNodes
to have enum type DIScope, resulting in invalid debug info and bad
DWARF.
- Add a Verifier check that when a 'scope:' operand is an ODR type that is not an enum.
- Makes ODRUniquing apply to only ODR types with the same tag so that the debuginfo/DWARF is well-formed.
Reviewed By: probinson, aprantl
Differential Revision: https://reviews.llvm.org/D111770
Greg Clayton [Tue, 26 Oct 2021 01:03:06 +0000 (18:03 -0700)]
Add new key/value pairs to the module statistics for "statistics dump".
The new key/value pairs that are added to each module's stats are:
"debugInfoByteSize": The size in bytes of debug info for each module.
"debugInfoIndexTime": The time in seconds that it took to index the debug info.
"debugInfoParseTime": The time in seconds that debug info had to be parsed.
At the top level we add up all of the debug info size, parse time and index time with the following keys:
"totalDebugInfoByteSize": The size in bytes of all debug info in all modules.
"totalDebugInfoIndexTime": The time in seconds that it took to index all debug info if it was indexed for all modules.
"totalDebugInfoParseTime": The time in seconds that debug info was parsed for all modules.
Differential Revision: https://reviews.llvm.org/D112501
Nuri Amari [Tue, 26 Oct 2021 21:25:34 +0000 (14:25 -0700)]
Regenerate LC_CODE_SIGNATURE during llvm-objcopy operations
**Context:**
This is a second attempt at introducing signature regeneration to llvm-objcopy. In this diff: https://reviews.llvm.org/D109840, a script was introduced to test
the validity of a code signature. In this diff: https://reviews.llvm.org/D109803 (now reverted), an effort was made to extract the signature generation behavior out of LLD into a common location for use in llvm-objcopy. In this diff: https://reviews.llvm.org/D109972 it was decided that there was no appropriate common location and that a small amount of duplication to bring signature generation to llvm-objcopy would be better. This diff introduces this duplication.
**Summary**
Prior to this change, if a LC_CODE_SIGNATURE load command
was included in the binary passed to llvm-objcopy, the command and
associated section were simply copied and included verbatim in the
new binary. If rest of the binary was modified at all, this results
in an invalid Mach-O file. This change regenerates the signature
rather than copying it.
The code_signature_lc.test test was modified to include the yaml
representation of a small signed MachO executable in order to
effectively test the signature generation.
Reviewed By: alexander-shaposhnikov, #lld-macho
Differential Revision: https://reviews.llvm.org/D111164
Danil Stefaniuc [Tue, 26 Oct 2021 21:24:46 +0000 (14:24 -0700)]
[formatters] Add a libstdcpp formatter for bitset and unify tests across stdlibs
This diff adds a data formatter for libstdcpp's bitset. Besides, it unifies the tests for bitset for libcxx and libstdcpp for maintainability.
Reviewed By: wallace
Differential Revision: https://reviews.llvm.org/D112180
Sanjay Patel [Tue, 26 Oct 2021 21:41:19 +0000 (17:41 -0400)]
[InstCombine] try to canonicalize icmp with trunc op into mask and cmp
The motivating test is based on:
https://llvm.org/PR52260
We have better analysis for X == 0, so try harder to form that.
Sanjay Patel [Tue, 26 Oct 2021 21:09:10 +0000 (17:09 -0400)]
[InstCombine] add tests for icmp with trunc op; NFC
Aart Bik [Tue, 26 Oct 2021 21:16:05 +0000 (14:16 -0700)]
[mlir][sparse] refine trait of sparse_tensor.convert
Rationale:
The currently used trait was demanding that all types are the same
which is not true (since the sparse part may change and the dim sizes
may be relaxed). This revision uses the correct trait and makes the
rank match test explicit in the verify method.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D112576
William Muir [Tue, 26 Oct 2021 21:23:11 +0000 (14:23 -0700)]
[Bazel] link backtrace library when building llvm/lib/Support under FreeBSD
Links the backtrace library which is required under FreeBSD when building llvm/lib/Support. This library is similarly linked by CMake on BSD builds at [llvm/lib/Support/CMakeLists.txt](https://github.com/llvm/llvm-project/blob/
e158b5634aa67ea3039a62c3d8bda79b77b3b21c/llvm/lib/Support/CMakeLists.txt#L39-L46)
Reviewed By: GMNGeoffrey
Differential Revision: https://reviews.llvm.org/D110533
Alexey Bataev [Tue, 26 Oct 2021 21:04:05 +0000 (14:04 -0700)]
[SLP][NFC]Add a test for poison-free or reduction.
Aart Bik [Tue, 26 Oct 2021 03:10:42 +0000 (20:10 -0700)]
[mlir][sparse] refactor loop sequence codegen
This refactoring adds a few "event" functions (start/end loop-seq/loop) for
readability of the core function of codegen. This also prepares sparse tensor
output codegen, where these "event" functions will provide convenient
placeholders to start or stop insertion bookkeeping.
This revision also includes a few various minor changes that kept on
pending in my local workspace.
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D112506
Jon Chesterfield [Tue, 26 Oct 2021 20:18:19 +0000 (21:18 +0100)]
[libomptarget][nfc]Generalise DeviceRTL cmake to allow building for amdgpu
Essentially moves the foreach over sm integers into a macro and instantiates it for nvptx.
NFC in that the macro is not presently instantiated for amdgpu as the corresponding code doesn't compile yet.
Reviewed By: Meinersbur
Differential Revision: https://reviews.llvm.org/D111987
Jez Ng [Tue, 26 Oct 2021 20:04:06 +0000 (16:04 -0400)]
[lld-macho] Simplify the handling of "no unwind info" functions
This diff does away with `addEntriesForFunctionsWithoutUnwindInfo()`,
because `addSymbol()` can now determine which functions need those
entries.
While overhauling UnwindInfoSection, I also parallelized the relocation
of the contents of the CUEs. This somewhat offsets the time regression
from creating one InputSection per CUE (which was done in D109944).
Reviewed By: #lld-macho, oontvoo
Differential Revision: https://reviews.llvm.org/D109945
Jez Ng [Tue, 26 Oct 2021 20:04:04 +0000 (16:04 -0400)]
[lld-macho] Associate compact unwind entries with function symbols
Compact unwind entries (CUEs) contain pointers to their respective
function symbols. However, during the link process, it's far more useful
to have pointers from the function symbol to the CUE than vice versa.
This diff adds that pointer in the form of `Defined::compactUnwind`.
In particular, when doing dead-stripping, we want to mark CUEs live when
their function symbol is live; and when doing ICF, we want to dedup
sections iff the symbols in that section have identical CUEs. In both
cases, we want to be able to locate the symbols within a given section,
as well as locate the CUEs belonging to those symbols. So this diff also
adds `InputSection::symbols`.
The ultimate goal of this refactor is to have ICF support dedup'ing
functions with unwind info, but that will be handled in subsequent
diffs. This diff focuses on simplifying `-dead_strip` --
`findFunctionsWithUnwindInfo` is no longer necessary, and
`Defined::isLive()` is now a lot simpler. Moreover, UnwindInfoSection no
longer has to check for dead CUEs -- we simply avoid adding them in the
first place.
Additionally, we now support stripping of dead LSDAs, which follows
quite naturally since `markLive()` can now reach them via the CUEs.
Reviewed By: #lld-macho, gkm
Differential Revision: https://reviews.llvm.org/D109944
Stanislav Mekhanoshin [Tue, 26 Oct 2021 19:57:17 +0000 (12:57 -0700)]
[InstCombine] Precommit new and-xor-or.ll tests. NFC.
Valentin Clement [Tue, 26 Oct 2021 19:42:26 +0000 (21:42 +0200)]
[fir] Avoid slice with substr in fir.array_load, fir.array_coor and fir.array_merge_store
Substring information on slice operation has been added in D112441.
The operations fir.array_load, fir.array_coor and fir.array_merge_store can take
a slice but not with a substring. This patch add this check in their verifier.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D112568
Alexander Belyaev [Tue, 26 Oct 2021 19:35:49 +0000 (21:35 +0200)]
[mlir] Use float literals to make Windows build happy.
Vassil Vassilev [Mon, 25 Oct 2021 17:52:20 +0000 (17:52 +0000)]
Reinstate "[clang-repl] Re-implement clang-interpreter as a test case."
Original commit message: "
Original commit message: "
Original commit message: "
Original commit message:"
The current infrastructure in lib/Interpreter has a tool, clang-repl, very
similar to clang-interpreter which also allows incremental compilation.
This patch moves clang-interpreter as a test case and drops it as conditionally
built example as we already have clang-repl in place.
"
This patch also ignores ppc due to missing weak symbol for __gxx_personality_v0
which may be a feature request for the jit infrastructure. Also, adds a missing
build system dependency to the orc jit.
"
Additionally, this patch defines a custom exception type and thus avoids the
requirement to include header <exception>, making it easier to deploy across
systems without standard location of the c++ headers.
"
This patch also works around PR49692 and finds a way to use llvm::consumeError
in rtti mode.
"
This patch also checks if stl is built with rtti.
Differential revision: https://reviews.llvm.org/D107049
Florian Hahn [Tue, 26 Oct 2021 19:19:36 +0000 (20:19 +0100)]
[Matrix] Replace some err kinds with err_builtin_invalid_arg_type. (NFC)
Replace some custom matrix diagnostic kinds with the more generic
err_builtin_invalid_arg_type introduced in D111985.
Reviewed By: aaron.ballman, erichkeane
Differential Revision: https://reviews.llvm.org/D112532
Alexander Belyaev [Tue, 26 Oct 2021 19:27:20 +0000 (21:27 +0200)]
[mlir] Update Erf approximation.
Valentin Clement [Tue, 26 Oct 2021 19:12:36 +0000 (21:12 +0200)]
[fir][NFC] Move RewritePatterns.td to CanonicalizationPatterns.td in Dialect
RewritePatterns.td/RewritePatterns.inc is used only by the
FIROps.cpp file. This patch move this file logically in the Dialect
folder together with FIRDialet, FIROps, FIRTypes ...
It also rename it to CanonicalizationPatterns.td.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: schweitz
Differential Revision: https://reviews.llvm.org/D112522
Michał Górny [Tue, 26 Oct 2021 19:08:03 +0000 (21:08 +0200)]
[lldb] [unittests] Fix TcpListen() call in RNBSocketTest
Julian Lettner [Tue, 26 Oct 2021 18:43:04 +0000 (11:43 -0700)]
[TSan] Ensure test uses tagged pointer
This is a test-only failure. The test wrongly assumes that this gets us
a tagged pointer:
```
NSObject* num1 = @7;
assert(isTaggedPtr(num1));
```
However, on newer deployment targets that have “const data support” we
get a “normal” pointer to constant object.
Radar-Id: rdar://problem/
83217293
Alexander Belyaev [Tue, 26 Oct 2021 18:39:25 +0000 (20:39 +0200)]
[mlir] Allow polynomial approximations for N-d vectors.
Polynomial approximation can be extented to support N-d vectors.
N-dimensional vectors are useful when vectorizing operations on N-dimensional
tiles. Before lowering to LLVM these vectors are usually unrolled or flattened
to 1-dimensional vectors.
Differential Revision: https://reviews.llvm.org/D112566
Stella Laurenzo [Tue, 26 Oct 2021 17:14:50 +0000 (17:14 +0000)]
[mlir][python] Segment MLIR Python test dialect to avoid testonly dependency.
With https://reviews.llvm.org/rG14c9207063bb00823a5126131e50c93f6e288bd3, the build is broken with -DMLIR_INCLUDE_TESTS=OFF. This patch fixes the build and we may want to do a better fix to the layering in a followup.
Differential Revision: https://reviews.llvm.org/D112560
Fangrui Song [Tue, 26 Oct 2021 18:44:18 +0000 (11:44 -0700)]
[ARC] Fix `undefined symbol: llvm::MachineFunction::dump() const`
Luke Petre [Tue, 26 Oct 2021 18:02:08 +0000 (14:02 -0400)]
[AST] Fix the EndLoc calculation for ObjCObjectPointer
There is an issue where the AST code does not compute the correct SourceRange
for a ObjCObjectPointer.
From Richard Smith (ie @zygoloid) in discord:
I think the problem is that we set an invalid location for the * (because there
isn't one): https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaType.cpp#L1121
And then we use the default getLocalSourceRangeImpl for a PointerLikeTypeLoc
that just assumes the * location is the type's end location:
https://github.com/llvm/llvm-project/blob/main/clang/include/clang/AST/TypeLoc.h#L1293
Possibly we should be special-casing that here:
https://github.com/llvm/llvm-project/blob/main/clang/lib/AST/TypeLoc.cpp#L228
My change:
introduces a AST dump test to show the issue in the first commit
special cases ObjCObjectPointerType in the second commit to correctly compute
the end location
Zahira Ammarguellat [Tue, 26 Oct 2021 16:18:28 +0000 (12:18 -0400)]
Fix indentation and pragma name.
zhijian [Tue, 26 Oct 2021 17:56:52 +0000 (13:56 -0400)]
address an test error on window os , exclude the test llvm/test/tools/llvm-readobj/XCOFF/xcoff-auxiliary-header.test from
windows OS.
http://45.33.8.238/win/47662/step_11.txt
for
https://reviews.llvm.org/D82549
Dmitry Vyukov [Tue, 26 Oct 2021 17:47:34 +0000 (19:47 +0200)]
Revert "tsan: turn off COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED"
This reverts commit
5ec832269eedeeddcf00d34efd7272a107e2c7c1.
It broke a number of bots, e.g.:
https://lab.llvm.org/buildbot/#/builders/52/builds/11811
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112563
Joe Loser [Tue, 26 Oct 2021 17:45:52 +0000 (13:45 -0400)]
[libc++][NFC] Mark LWG2731 as complete
Mark LWG2731 as complete. The type alias `mutex_type` is only provided if
`scoped_lock` is given one mutex type and it has been implemented that
way since the beginning of Clang 5 it seems. There already are tests for
verifying existence (and lack thereof) for `mutex_type` type alias
depending on the number of mutex types, so there is nothing to
do for this LWG issue.
Reviewed By: Quuxplusone, Mordante, #libc
Differential Revision: https://reviews.llvm.org/D112462
Chia-hung Duan [Tue, 26 Oct 2021 17:35:15 +0000 (17:35 +0000)]
[mlir] Placeholder used in predicate should be the base type
Added a notification in the placeholder section. While writing things
like preciate of an attribute, we may embed certain placeholder in the C
expression. Note that the type of the placeholder is only guaranteed to
be the base type like mlir::Type, it's better not to use the derived
type which is based on the implementation.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D112396
Usman Nadeem [Tue, 26 Oct 2021 17:22:17 +0000 (10:22 -0700)]
[NFC][Instcombine] Pre-commit some tests for negative fabs
Change-Id: Idcce321c825ecc6b3a111a683e24dc10015f6872
Alexey Bataev [Tue, 26 Oct 2021 17:11:26 +0000 (10:11 -0700)]
[SLP][NFC]Add a test for logical reduction with extra op.
Stanislav Mekhanoshin [Tue, 26 Oct 2021 17:09:21 +0000 (10:09 -0700)]
[InstCombine] Precommit new and-xor-or.ll tests. NFC.
Louis Dionne [Mon, 25 Oct 2021 19:05:27 +0000 (15:05 -0400)]
[libc++] Implement shared_ptr methods inline in the class
This patch refactors the shared_ptr methods from being defined out-of-line
to being defined inline in the class, like what we do for all new code in
the library. The benefits of doing that are that code is not as scattered
around and is hence easier to understand, and it avoids a ton of duplication
due to SFINAE checks. Defining the method where it is declared also removes
the possibility for mismatched attributes.
As a fly-by change, this also:
- Adds a few _LIBCPP_HIDE_FROM_ABI attributes
- Uses __enable_if_t instead of enable_if as a function argument, to match
the style that we use everywhere else.
Differential Revision: https://reviews.llvm.org/D112478
Usman Nadeem [Tue, 26 Oct 2021 17:07:08 +0000 (10:07 -0700)]
[NFC][Instcombine] Cleanup some obsolete matches in visitSelectInstr
These are now redundant after https://reviews.llvm.org/D106872
Change-Id: I82edfedf1d45cac4e3368d77ce3a48c78e342c19
Rosie Sumpter [Tue, 26 Oct 2021 10:24:28 +0000 (11:24 +0100)]
[LoopVectorize] Clean up VPReductionRecipe::execute. NFC
Use RdxDesc->getOpcode instead of getUnderlingInstr()->getOpcode.
Move the code which finds Kind and IsOrdered to be outside the for loop
since neither of these change with the vector part.
Differential Revision: https://reviews.llvm.org/D112547
Balazs Benics [Tue, 26 Oct 2021 16:15:00 +0000 (18:15 +0200)]
[analyzer] Fix StringChecker for Unknown params
It seems like protobuf crashed the `std::string` checker.
Somehow it acquired `UnknownVal` as the sole `std::string` constructor
parameter, causing a crash in the `castAs<Loc>()`.
This patch addresses this.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/D112551
Amy Zhuang [Tue, 26 Oct 2021 15:42:22 +0000 (08:42 -0700)]
[mlir] Fix getVectorReductionOp
1.Combining kind min/max of Vector reduction op has been changed to
minf/maxf, minsi/maxsi, and minui/maxui. Modify getVectorReductionOp
accordingly.
2.Add min/max to supported reductions.
Reviewed By: dcaballe, nicolasvasilache
Differential Revision: https://reviews.llvm.org/D112246
Kazu Hirata [Tue, 26 Oct 2021 16:01:29 +0000 (09:01 -0700)]
[CodeGen, Hexagon] Use MachineBasicBlock::phis (NFC)
Florian Hahn [Tue, 26 Oct 2021 14:38:32 +0000 (15:38 +0100)]
[Clang] Add elementwise min/max builtins.
This patch implements __builtin_elementwise_max and
__builtin_elementwise_min, as specified in D111529.
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D111985
Sanjay Patel [Tue, 26 Oct 2021 14:44:19 +0000 (10:44 -0400)]
[x86] add test/run for mayLoadFold with alignment; NFC
Jez Ng [Tue, 26 Oct 2021 15:36:09 +0000 (11:36 -0400)]
[lld-macho] Put GOT into `__DATA` segment where appropriate
We were previously always emitting the GOT into `__DATA_CONST`, even for
target platforms where it should end up in `__DATA`.
I stumbled onto this while trying to use the `class-dump` tool -- with
the wrong segment names, it fails to locate the ObjC runtime info and
therefore fails to dump any classes.
Reviewed By: #lld-macho, oontvoo
Differential Revision: https://reviews.llvm.org/D112500
Adam Czachorowski [Tue, 26 Oct 2021 13:04:03 +0000 (15:04 +0200)]
[clangd] AddUsing: Fix support for template specializations.
Before this change, we would add "using std::vector<int>" instead of
just "using std::vector;", which would not even compile.
Fixes https://github.com/clangd/clangd/issues/904
Differential Revision: https://reviews.llvm.org/D112530
Adam Czachorowski [Tue, 26 Oct 2021 11:34:10 +0000 (13:34 +0200)]
[clangd] Fix a hover crash on templated spaceship operator.
We make assumption that:
getDeclForComment(getDeclForComment(X)) == getDeclForComment(X)
but this is not true if you have a template
instantionation of a template instantiation, which is the case when, for
example, you have a <=> operator in a templated class.
This fix makes getDeclForComment() call itself recursively to ensure
this property is always true.
Fixes https://github.com/clangd/clangd/issues/901
Differential Revision: https://reviews.llvm.org/D112527
Kirill Bobyrev [Tue, 26 Oct 2021 15:10:51 +0000 (17:10 +0200)]
[clang] Do not traverse EnumDecl's type in RecursiveASTVisitor
This is inconsistent with the code and comments in
RecursiveASTVisitor.h and is not a correct behavior:
https://github.com/llvm/llvm-project/blob/main/clang/include/clang/AST/RecursiveASTVisitor.h#L1879-L1880
> We shouldn't traverse D->getTypeForDecl(); it's a result of
> declaring the type, not something that was written in the source.
Fixes the failures in
1c2e249f938c50e1b331a1f7adc83c0a381f3897
Matt Morehouse [Tue, 26 Oct 2021 15:08:23 +0000 (08:08 -0700)]
[libFuzzer] Improve corpus replacement unit test.
Verify that SecondII is not replaced.
Jonas Paulsson [Tue, 19 Oct 2021 10:47:15 +0000 (12:47 +0200)]
[SystemZ] Improvement of emitMemMemWrapper()
It was discovered that an extra register COPY remained when expanding a
(variable length) memory operation with a loop and there was another use of
the involved address register(s) afterwards.
A simple fix for this is to COPY the address registers before the loop and
use that new vreg instead.
Review: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D112065
Alexey Bataev [Mon, 25 Oct 2021 16:40:59 +0000 (09:40 -0700)]
[SLP]Do not reorder reduction nodes.
The final reduction nodes should not be reordered, the order does not
matter for reductions. Also, it might be profitable to vectorize smaller
reduction trees, reduction cost may compensate small tree cost.
Part of D111574
Differential Revision: https://reviews.llvm.org/D112467
zhijian [Tue, 26 Oct 2021 14:40:25 +0000 (10:40 -0400)]
[AIX][XCOFF] parsing xcoff object file auxiliary header
Summary:
The patch supports parsing the xcoff object file auxiliary header with llvm-readobj with option "auxiliary-headers"
the format of auxiliary header as
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/filesreference/XCOFF.html#XCOFF__fyovh386shar
Reviewers: James Henderson, Jason Liu, Hubert Tong, Esme yi, Sean Fertile.
Differential Revision: https://reviews.llvm.org/D82549
Florian Hahn [Mon, 25 Oct 2021 08:55:21 +0000 (09:55 +0100)]
Specify Clang vector builtins.
This patch specifies a set of vector builtins for Clang, as discussed on
cfe-dev:
https://lists.llvm.org/pipermail/cfe-dev/2021-September/068999.html
https://lists.llvm.org/pipermail/cfe-dev/2021-October/069070.html
Reviewed By: scanon
Differential Revision: https://reviews.llvm.org/D111529
Louis Dionne [Mon, 25 Oct 2021 14:59:59 +0000 (10:59 -0400)]
[libc++] Include nasty_macros.h when running tests with from-scratch configs
This was forgotten when setting up the from-scratch configs.
Differential Revision: https://reviews.llvm.org/D112460
Dmitry Vyukov [Mon, 25 Oct 2021 12:58:43 +0000 (14:58 +0200)]
tsan: turn off COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED
All tsan interceptors check for initialization and/or initialize things
as necessary lazily, so we can pretend everything is initialized in the
COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED check to avoid double-checking
for initialization (this is only necessary for sanitizers that don't
handle initialization on common grounds).
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112446
Dmitry Vyukov [Tue, 26 Oct 2021 13:01:09 +0000 (15:01 +0200)]
sanitizer_common: fix deadlock detector output
Print PC of the previous lock, not the current one.
The current one will be printed during unwind.
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D112533
Kirill Bobyrev [Tue, 26 Oct 2021 14:08:54 +0000 (16:08 +0200)]
[clangd] IncludeCleaner: don't stop the traversal
I was under the impression that `return false;` in the
RecursiveASTVisitor stops the traversal for the subtree but it appears
that it stops the whole tree traversal, so this change introduces a bug
where `ReferencedLocationCrawler` will not collect any symbols past an
enum.
This is a follow-up on D112209.
Neubauer, Sebastian [Tue, 26 Oct 2021 13:45:10 +0000 (15:45 +0200)]
[AMDGPU] Remove unused CSR defs
CSR_AMDGPU_VGPRs_24_255 and CSR_AMDGPU_VGPRs_32_255 are not used
anywhere, so remove them.
Differential Revision: https://reviews.llvm.org/D112535
Ron Lieberman [Tue, 26 Oct 2021 01:53:15 +0000 (01:53 +0000)]
[openmp][lit] Add support to OpenMP lit.cfg for ROCR_VISIBLE_DEVICES env-var
add support for ROCR_VISIBLE_DEVICES similar to name and purpose
as CUDA_VISIBLE_DEVICES
Differential Revision: https://reviews.llvm.org/D112503
Nico Weber [Thu, 21 Oct 2021 10:53:12 +0000 (06:53 -0400)]
[clang] Implement CFG construction for @try and @catch
@finally is still not implemented.
With this, clang can emit -Wreturn-type warnings for functions containing
@try/@catch (but not yet @finally), and -Wunreachable-code also works for those
functions.
The implementation is similar to D36914.
Part of PR46693.
Differential Revision: https://reviews.llvm.org/D112287
Nico Weber [Tue, 26 Oct 2021 13:35:20 +0000 (09:35 -0400)]
[clang] Make loop in CFGBuilder::VisitCXXTryStmt() more canonical
No behavior change.
Nico Weber [Tue, 26 Oct 2021 13:29:41 +0000 (09:29 -0400)]
[clang] Simplify CFG block printing code a bit
No behavior change.
Nico Weber [Tue, 26 Oct 2021 13:23:16 +0000 (09:23 -0400)]
[clang] Use consistent punctuation at end of Block NULL comment
No behavior change.
Abinav Puthan Purayil [Wed, 22 Sep 2021 10:32:52 +0000 (16:02 +0530)]
[AMDGPU] Add constrained shift pattern matches.
The motivation for this is due to clang's conformance to
https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_C.html#operators-shift
which makes clang emit (<shift> a, (and b, <width> - 1)) for `a <shift> b`
in OpenCL where a is an int of bit width <width>.
Differential revision: https://reviews.llvm.org/D110231
Louis Dionne [Tue, 12 Oct 2021 18:10:02 +0000 (14:10 -0400)]
[libunwind] Take 2: Use the from-scratch testing configuration by default
Summary:
This commit switches libunwind from using the complicated logic in
libc++'s testing configuration to a from-scratch configuration.
I tried to make sure that all cases that were handled in the old
config were handled by this one too, so hopefully this shouldn't
break anyone. However, if you encounter issues with this change,
please let me know and feel free to revert if I don't reply quickly.
This change was engineered to be easily revertable.
This commit is a re-application of
5a8ad80b6fa5, which was reverted in
070a2ddcb665 because it broke the Bootstrapping build. This has now been
addressed by tweaking the from-scratch config.
Differential Revision: https://reviews.llvm.org/D112082
Chen Zheng [Tue, 26 Oct 2021 01:33:27 +0000 (01:33 +0000)]
[PowerPC] use right extend type for SCEV
Fix an issue caused by D108750
Reviewed By: nemanjai
Differential Revision: https://reviews.llvm.org/D112502
Abinav Puthan Purayil [Sat, 23 Oct 2021 15:35:32 +0000 (21:05 +0530)]
[AMDGPU] Enable 48-bit mul in AMDGPUCodeGenPrepare.
We were bailing out of creating 24-bit muls for results wider than 32
bits in AMDGPUCodeGenPrepare. With the 24-bit mulhi intrinsic, this
change teaches AMDGPUCodeGenPrepare to generate the 48-bit mul
correctly.
Differential Revision: https://reviews.llvm.org/D112395
Abinav Puthan Purayil [Sat, 23 Oct 2021 07:15:32 +0000 (12:45 +0530)]
[AMDGPU] Implement llvm.amdgcn.mulhi.[i,u]24 intrinsics.
These intrinsics maps to the 24-bit v_mul_hi instructions.
This change also fixes an incorrect assumption on the associativity of
24-bit mulhi in its SDNode record in tblgen.
Differential Revision: https://reviews.llvm.org/D112394
Valentin Clement [Tue, 26 Oct 2021 12:55:47 +0000 (14:55 +0200)]
[fir][NFC] Fix indentation for fir.alloca builders
Sanjay Patel [Tue, 26 Oct 2021 12:10:34 +0000 (08:10 -0400)]
[x86] use cast instead of dyn_cast for unchecked usage; NFC
This was noted as an independent clean-up in D112464.
Sanjay Patel [Mon, 25 Oct 2021 19:45:08 +0000 (15:45 -0400)]
[x86] add test for vector increment; NFC
Sam McCall [Tue, 26 Oct 2021 12:19:05 +0000 (14:19 +0200)]
[clangd] Remove tricky integration test that flakes/fails on some platforms.
This functionality is covered by unittests, will add a better
integration test soon.
Michał Górny [Sat, 23 Oct 2021 09:15:00 +0000 (11:15 +0200)]
[lldb] [Host] Move port predicate-related logic to gdb-remote
Remove the port predicate from Socket and ConnectionFileDescriptor,
and move it to gdb-remote. It is specifically relevant to the threading
used inside gdb-remote and with the new port callback API, we can
reliably move it there. While at it, switch from the custom Predicate
to std::promise/std::future.
Differential Revision: https://reviews.llvm.org/D112357
Neubauer, Sebastian [Mon, 25 Oct 2021 08:58:01 +0000 (10:58 +0200)]
[AMDGPU] Fix setcc combine for i128
The combine asserted if constants could not be represented as uint64_t.
Use APInts to fix this.
Differential Revision: https://reviews.llvm.org/D112416
Jay Foad [Tue, 4 May 2021 10:14:42 +0000 (11:14 +0100)]
[AMDGPU] Use standard MachineBasicBlock::getFallThrough method. NFCI.
Differential Revision: https://reviews.llvm.org/D101825
Michał Górny [Fri, 22 Oct 2021 15:42:23 +0000 (17:42 +0200)]
[lldb] [lldb-gdbserver] Unify listen/connect code to use ConnectionFileDescriptor
Unify the listen and connect code inside lldb-server to use
ConnectionFileDescriptor uniformly rather than a mix of it and Acceptor.
This involves:
- adding a function to map legacy values of host:port parameter
(including legacy server URLs) into CFD-style URLs
- adding a callback to return "local socket id" (i.e. UNIX socket path
or TCP port number) between listen() and accept() calls in CFD
- adding a "unix-abstract-accept" scheme to CFD
As an additional advantage, this permits lldb-server to accept any URL
known to CFD including the new serial:// scheme. Effectively,
lldb-server can now listen on the serial port. Tests for connecting
over a pty are added to test that.
Differential Revision: https://reviews.llvm.org/D111964
Pavel Labath [Tue, 26 Oct 2021 11:03:09 +0000 (13:03 +0200)]
[lldb] Fix PlatformAppleSimulator for
a458ef4f
Kirill Bobyrev [Tue, 26 Oct 2021 09:53:34 +0000 (11:53 +0200)]
[clangd] Add a way to enable IncludeCleaner through config
This is useful for dogfooding the feature and spotting bugs.
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D111870
Uday Bondhugula [Mon, 11 Oct 2021 10:18:06 +0000 (15:48 +0530)]
[MLIR] Fix AffineExpr getLargestKnownDivisor for ceildiv and floordiv
Fix AffineExpr `getLargestKnownDivisor` for ceil/floor div cases.
In these cases, nothing can be inferred on the divisor of the
result.
Add test case for `mod` as well.
Differential Revision: https://reviews.llvm.org/D112523
Michał Górny [Wed, 20 Oct 2021 19:28:25 +0000 (21:28 +0200)]
[lldb] [Communication] Add a WriteAll() method that resumes writing
Add a Communication::WriteAll() that resumes Write() if the initial call
did not write all data. Use it in GDBRemoteCommunication when sending
packets in order to fix handling partial writes (i.e. just resume/retry
them rather than erring out). This fixes LLDB failures when writing
large packets to a pty.
Differential Revision: https://reviews.llvm.org/D112169
Jonas Paulsson [Mon, 25 Oct 2021 14:02:20 +0000 (16:02 +0200)]
[SystemZ] Provide size values for PATCHPOINT, STACKMAP and FENTRY_CALL.
All instructions must have a correct size value close to emission when
SystemZLongBranch runs, or a necessary branch relaxation may be missed.
This patch also adds an assert for instruction sizes in SystemZLongBranch.
Review: Ulrich Weigand
Fraser Cormack [Fri, 22 Oct 2021 14:19:25 +0000 (15:19 +0100)]
[LangRef] Document that DataLayout defaults to little-endian
Little-endian has apparently been the default since 2014.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D112316
David Green [Tue, 26 Oct 2021 09:35:12 +0000 (10:35 +0100)]
[AArch64] Add a costmodel test for overflowing arithmatic. NFC
Pavel Labath [Mon, 25 Oct 2021 14:44:12 +0000 (16:44 +0200)]
Modernize and simplify HostInfo::GetOSKernelDescription
Replace bool+by-ref argument with llvm::Optional, and move the common
implementation into HostInfoPOSIX. Based on my (simple) experiment,
the uname and the sysctl approach return the same value on MacOS, so
there's no need for a mac-specific implementation of this functionality.
Differential Revision: https://reviews.llvm.org/D112457
Nikita Popov [Tue, 26 Oct 2021 09:08:58 +0000 (11:08 +0200)]
[SCEV] Use reverse() (NFC)
Kirill Bobyrev [Tue, 26 Oct 2021 08:37:05 +0000 (10:37 +0200)]
[clangd] IncludeCleaner: Don't consider the definition as usage for function forward declarations
Reviewed By: kadircet
Differential Revision: https://reviews.llvm.org/D111711
Valentin Clement [Tue, 26 Oct 2021 08:32:48 +0000 (10:32 +0200)]
[fir] Add substring to fir.slice operation
This patch adds the substriing information to the fir.slice
operation. This will be used by character operations in later
upstreaming patches.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D112441
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Pavel Labath [Thu, 21 Oct 2021 19:00:33 +0000 (21:00 +0200)]
[lldb] Remove ConstString from Platform plugin names