Danil Stefaniuc [Mon, 6 Dec 2021 20:48:48 +0000 (12:48 -0800)]
[formatters] Add a pointer and reference tests for a list and forward_list formatters for libstdcpp and libcxx
This adds extra tests for libstdcpp and libcxx list and forward_list formatters to check whether formatter behaves correctly when applied on pointer and reference values.
Reviewed By: wallace
Differential Revision: https://reviews.llvm.org/D115137
Walter Erquinigo [Fri, 3 Dec 2021 01:46:15 +0000 (17:46 -0800)]
[formatters] Add a deque formatter for libstdcpp and fix the libcxx one
This adds the formatters for libstdcpp's deque as a python
implementation. It adds comprehensive tests for the two different
storage strategies deque uses. Besides that, this fixes a couple of bugs
in the libcxx implementation. Finally, both implementation run against
the same tests.
This is a minor improvement on top of Danil Stefaniuc's formatter.
Eugene Zhulenev [Mon, 6 Dec 2021 19:23:53 +0000 (11:23 -0800)]
[mlir] Improve async parallel for tests + fix typos
Do load and store to verify that we process each element of the iteration space once.
Reviewed By: cota
Differential Revision: https://reviews.llvm.org/D115152
David Blaikie [Mon, 6 Dec 2021 20:18:02 +0000 (12:18 -0800)]
Bazel: add new llvm-c/Deprecated.h header
Michael Kruse [Mon, 6 Dec 2021 20:08:07 +0000 (14:08 -0600)]
[OpenMPIRBuilder] Implicitly defined control blocks. NFC.
Do not explicitly store the BasicBlocks for Preheader, Body and After inside CanonicalLoopInfo, but look the up when needed using their position relative to the other loop control blocks. By definition, instructions inside these are not managed by CanonicalLoopInfo (except terminator for Preheader) hence it makes sense to think of them as connections to the CanonicalLoopInfo instead of part of the CanonicalLoopInfo itself.
In particular for Preheader, it makes using SplitBasicBlock easier since inserting control flow at an InsertPoint may otherwise require updating the CanonicalLoopInfo's Preheader because the branch that jumps to the header is moved to another BasicBlock.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D114368
Rob Suderman [Mon, 6 Dec 2021 19:54:09 +0000 (11:54 -0800)]
[mlir] Add CtPop to MathOps with lowering to LLVM
math.ctpop maths to the llvm.ctpop intrinsic.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D114998
Arnold Schwaighofer [Mon, 6 Dec 2021 19:01:13 +0000 (11:01 -0800)]
[coro async] Don't use lifetime.start based alloca localization for ABI.Async/ABI.Retcon
Infinite loops can lead to an IR representation where the lifetime.end
intrinsice is missing. The code to do lifetime based optimization then
fails to see that an address escapes (is life) accross a supspend.
Eventually, we could detect such situations and disable it under more narrow
circumstances. For now, do the correct thing.
rdar://
83635953
Differential Revision: https://reviews.llvm.org/D110949
Simon Pilgrim [Mon, 6 Dec 2021 19:45:40 +0000 (19:45 +0000)]
[X86] LowerRotate - fix assertion. NFC.
v32i16 rotation lowering is only lowered on non-BWI targets.
Balázs Kéri [Mon, 6 Dec 2021 17:16:02 +0000 (18:16 +0100)]
[clang][ASTImporter] Update lookup table correctly at deduction guides.
Declaration context of template parameters of a FunctionTemplateDecl
may be different for each one parameter if the template is a
deduction guide. This case is handled correctly after this change.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/D114418
Nick Desaulniers [Mon, 6 Dec 2021 19:11:19 +0000 (11:11 -0800)]
[clang][ARM] only check -mtp=cp15 for non-asm sources
This diagnostic is really to highlight lack of support for hard thread
pointers in post-RA instruction scheduling for non-armv6k+ targets;
something that isn't run for assembler sources.
Fixes: https://github.com/ClangBuiltLinux/linux/issues/1502
Link: https://lore.kernel.org/all/814585495.6773.1636629846970@jenkins.jenkins/
Reviewed By: ardb
Differential Revision: https://reviews.llvm.org/D114124
Nico Weber [Mon, 6 Dec 2021 19:24:01 +0000 (14:24 -0500)]
Revert "[gn build] (manually) port
4a16fe1369f3ab (debuginfod)"
This reverts commit
f0cda7155cdc3672a715eb84f03ea3461042e48f.
4a16fe1369f3ab got reverted in
f45c9c56c59f.
Noah Shutty [Mon, 6 Dec 2021 19:19:14 +0000 (19:19 +0000)]
Revert "[llvm] [Debuginfo] Debuginfod client library."
This reverts commit
4a16fe1369f3ab0e98261d4bd133034425d0523c because it
caused failures on Windows builds.
Aaron Ballman [Mon, 6 Dec 2021 19:12:54 +0000 (14:12 -0500)]
Fixing this test which failed due to different warnings
Arnold Schwaighofer [Mon, 6 Dec 2021 17:23:50 +0000 (09:23 -0800)]
[coro async] Disable lifetime.start sinking for ABI::Async and ABI::Retcon
It does not handle loops correctly i.e it moves the lifetime.start
intrinsic into a loop rendering the stack object as not alive for part
of the loop.
```
entry:
%obj = alloca i8
lifetime.start(%obj)
br loop
loop:
coro.suspend()
escape(%obj)
cond_br %cond, label %exit, label loop
br loop
exit:
lifetime.end(%obj
```
After sinking:
```
entry:
%obj = alloca i8
br loop
loop:
coro.suspend()
lifetime.start(%obj)
escape(%obj)
cond_br %cond, label %exit, label loop
br loop
exit:
lifetime.end(%obj
```
rdar://
83411917
Differential Revision: https://reviews.llvm.org/D110953
Aaron Ballman [Mon, 6 Dec 2021 18:51:26 +0000 (13:51 -0500)]
Fix a failing test case after
6c75ab5f66b403f7ca67e86aeed3a58abe10570b
The test is the same whether it's testing _BitInt or _ExtInt, so use
the type which is not deprecated.
Louis Dionne [Mon, 22 Nov 2021 21:44:50 +0000 (16:44 -0500)]
[libc++] Fix the return value of max_size()
I assume nobody ever uses std::string_view::max_size() outside of
testing. However, we should still return a value that is based on
something with a reasonable rationale. Previously, we would forget
to take into account the size of the character type stored in the
string, and this patch takes that into account.
Thanks to @mclow.lists for pointing out this issue.
Differential Revision: https://reviews.llvm.org/D114395
Alexey Bataev [Mon, 6 Dec 2021 16:32:15 +0000 (08:32 -0800)]
[SLP]Fix compiler crash when calculating extract cost for undefs.
Need to add an extra check for potential undef values in
computeExtractCost function to avoid compiler crash on casting to
instructon.
Differential Revision: https://reviews.llvm.org/D115162
Louis Dionne [Mon, 6 Dec 2021 18:44:15 +0000 (13:44 -0500)]
[libc++][NFC] Fix release note indentation
Florian Hahn [Mon, 6 Dec 2021 18:32:35 +0000 (18:32 +0000)]
[LV] Check VPValue operand instead of Cost::isUniformAfterVec (NFC).
ILV::scalarizeInstruction still uses the original IR operands to check
if an input value is uniform after vectorization.
There is no need to go back to the cost model to figure that out, as the
information is already explicit in the VPlan. Just check directly
whether the VPValue is defined outside the plan or is a uniform
VPReplicateRecipe.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D114253
Aaron Ballman [Mon, 6 Dec 2021 18:29:17 +0000 (13:29 -0500)]
Speculatively fix the LLDB build bots from
6c75ab5f66b403f7ca67e86aeed3a58abe10570b
It looks like some renames got missed.
Nico Weber [Mon, 6 Dec 2021 18:17:06 +0000 (13:17 -0500)]
[gn build] (manually) port
4a16fe1369f3ab (debuginfod)
Aaron Ballman [Mon, 6 Dec 2021 18:13:13 +0000 (13:13 -0500)]
Update the status of N2412 in C (we do not implement large parts of it)
Jonas Paulsson [Thu, 14 Oct 2021 18:10:47 +0000 (20:10 +0200)]
[SystemZ] Improve codegen for memset.
Memset with a constant length was implemented with a single store followed by
a series of MVC:s. This patch changes this so that one store of the byte is
emitted for each MVC, which avoids data dependencies between the MVCs. An
MVI/STC + MVC(len-1) is done for each block.
In addition, memset with a variable length is now also handled without a
libcall. Since the byte is first stored and then MVC is used from that
address, a length of two must now be subtracted instead of one for the loop
and EXRL. This requires an extra check for the one-byte case, which is
handled in a special block with just a single MVI/STC (like GCC).
Review: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D112004
Martin Probst [Fri, 3 Dec 2021 10:20:56 +0000 (11:20 +0100)]
clang-format: [JS] test case for numeric separators.
ES2021 allows numeric literals using `_` as a separator. This already
works, but had no test.
Differential Revision: https://reviews.llvm.org/D115147
Noah Shutty [Mon, 6 Dec 2021 17:35:48 +0000 (17:35 +0000)]
[llvm] [Debuginfo] Debuginfod client library.
This adds a Debuginfod client library which queries servers specified by the `DEBUGINFOD_URLS` environment variable for the debuginfo, executable, or a specified source file associated with a given build id.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D112758
Aaron Ballman [Mon, 6 Dec 2021 17:46:54 +0000 (12:46 -0500)]
Introduce _BitInt, deprecate _ExtInt
WG14 adopted the _ExtInt feature from Clang for C23, but renamed the
type to be _BitInt. This patch does the vast majority of the work to
rename _ExtInt to _BitInt, which accounts for most of its size. The new
type is exposed in older C modes and all C++ modes as a conforming
extension. However, there are functional changes worth calling out:
* Deprecates _ExtInt with a fix-it to help users migrate to _BitInt.
* Updates the mangling for the type.
* Updates the documentation and adds a release note to warn users what
is going on.
* Adds new diagnostics for use of _BitInt to call out when it's used as
a Clang extension or as a pre-C23 compatibility concern.
* Adds new tests for the new diagnostic behaviors.
I want to call out the ABI break specifically. We do not believe that
this break will cause a significant imposition for early adopters of
the feature, and so this is being done as a full break. If it turns out
there are critical uses where recompilation is not an option for some
reason, we can consider using ABI tags to ease the transition.
Balazs Benics [Mon, 6 Dec 2021 17:38:58 +0000 (18:38 +0100)]
[analyzer][solver] Fix assertion on (NonLoc, Op, Loc) expressions
Previously, the `SValBuilder` could not encounter expressions of the
following kind:
NonLoc OP Loc
Loc OP NonLoc
Where the `Op` is other than `BO_Add`.
As of now, due to the smarter simplification and the fixedpoint
iteration, it turns out we can.
It can happen if the `Loc` was perfectly constrained to a concrete
value (`nonloc::ConcreteInt`), thus the simplifier can do
constant-folding in these cases as well.
Unfortunately, this could cause assertion failures, since we assumed
that the operator must be `BO_Add`, causing a crash.
---
In the patch, I decided to preserve the original behavior (aka. swap the
operands (if the operator is commutative), but if the `RHS` was a
`loc::ConcreteInt` call `evalBinOpNN()`.
I think this interpretation of the arithmetic expression is closer to
reality.
I also tried naively introducing a separate handler for
`loc::ConcreteInt` RHS, before doing handling the more generic `Loc` RHS
case. However, it broke the `zoo1backwards()` test in the `nullptr.cpp`
file. This highlighted for me the importance to preserve the original
behavior for the `BO_Add` at least.
PS: Sorry for introducing yet another branch into this `evalBinOpXX`
madness. I've got a couple of ideas about refactoring these.
We'll see if I can get to it.
The test file demonstrates the issue and makes sure nothing similar
happens. The `no-crash` annotated lines show, where we crashed before
applying this patch.
Reviewed By: martong
Differential Revision: https://reviews.llvm.org/D115149
James Farrell [Mon, 6 Dec 2021 17:35:26 +0000 (17:35 +0000)]
Revert "Use VersionTuple for parsing versions in Triple, fixing issues that caused the original change to be reverted. This makes it possible to distinguish between "16" and "16.0" after parsing, which previously was not possible."
This reverts commit
50324670342d9391f62671685f4d6b4880a4ea9a.
Jonas Devlieghere [Mon, 6 Dec 2021 17:30:01 +0000 (09:30 -0800)]
Revert "[clang][DebugInfo] Allow function-local statics and types to be scoped within a lexical block"
This reverts commit
e403f4fdc88322201040f2bee7b328e8a78e2f7f because it
breaks TestSetData.py on GreenDragon:
https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/39089/
Craig Topper [Mon, 6 Dec 2021 17:06:48 +0000 (09:06 -0800)]
[RISCV] Loosen some restrictions on lowering constant BUILD_VECTORs using vid.v.
The immediate size check on StepNumerator did not take into account
that vmul.vi does not exist. It also did not account for power of 2
constants that can be done with vshl.vi.
This patch fixes this by moving the conversion from mul to shift
further up. Then we can consider the immediates separately for MUL
vs SHL. For MUL I've allowed simm12 which requires a single addi
before a vmul.vx. For SHL I've allowed any uimm5 which works with
vshl.vi. We could relax these further in the future. This is a
starting point that allows us to emit the same number of instructions
we were already using for smaller numerators.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D115081
Joseph Huber [Mon, 6 Dec 2021 16:14:54 +0000 (11:14 -0500)]
[OpenMP] Make reduction functions SPMD compatible
Reduction functions were guarded before which was wrong, these are SPMD
compatible.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D115159
Joseph Huber [Mon, 6 Dec 2021 15:58:02 +0000 (10:58 -0500)]
[OpenMP][FIX] Invalidate the SPMDCompatibilityTracker explicitly
Before SPMDzation it was sufficient to add an incompatible instruction
to the SPMDCompatibilityTracker. However, now adding instructions means
they need guarding. As calls cannot be guarded in general we need to
explicitly prevent SPMD mode.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D115158
Evgeny Mandrikov [Mon, 6 Dec 2021 17:06:51 +0000 (18:06 +0100)]
Fix compilation of Google Test in C++20 mode
Without this patch when using CMAKE_CXX_STANDARD=20
and MSVC 19.30.30705.0 compilation of unit tests
fails with
llvm\utils\unittest\googlemock\include\gmock/gmock-actions.h(828): error C2039: 'result_of': is not a member of 'std'
Patch is taken from Google Test:
https://github.com/google/googletest/commit/
61f010d703b32de9bfb20ab90ece38ab2f25977f
Do not use std::result_of as it was removed in C++20.
Differential Revision: https://reviews.llvm.org/D115163
LLVM GN Syncbot [Mon, 6 Dec 2021 17:02:44 +0000 (17:02 +0000)]
[gn build] Port
c68f71eb37c2
spupyrev [Mon, 8 Nov 2021 15:02:33 +0000 (07:02 -0800)]
ext-tsp basic block layout
A new basic block ordering improving existing MachineBlockPlacement.
The algorithm tries to find a layout of nodes (basic blocks) of a given CFG
optimizing jump locality and thus processor I-cache utilization. This is
achieved via increasing the number of fall-through jumps and co-locating
frequently executed nodes together. The name follows the underlying
optimization problem, Extended-TSP, which is a generalization of classical
(maximum) Traveling Salesmen Problem.
The algorithm is a greedy heuristic that works with chains (ordered lists)
of basic blocks. Initially all chains are isolated basic blocks. On every
iteration, we pick a pair of chains whose merging yields the biggest increase
in the ExtTSP value, which models how i-cache "friendly" a specific chain is.
A pair of chains giving the maximum gain is merged into a new chain. The
procedure stops when there is only one chain left, or when merging does not
increase ExtTSP. In the latter case, the remaining chains are sorted by
density in decreasing order.
An important aspect is the way two chains are merged. Unlike earlier
algorithms (e.g., based on the approach of Pettis-Hansen), two
chains, X and Y, are first split into three, X1, X2, and Y. Then we
consider all possible ways of gluing the three chains (e.g., X1YX2, X1X2Y,
X2X1Y, X2YX1, YX1X2, YX2X1) and choose the one producing the largest score.
This improves the quality of the final result (the search space is larger)
while keeping the implementation sufficiently fast.
Differential Revision: https://reviews.llvm.org/D113424
Jon Chesterfield [Mon, 6 Dec 2021 16:56:13 +0000 (16:56 +0000)]
[openmp] Default to new rtl for amdgpu
Reverts D114965 as the compiler backend appears to be working again
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D115157
Peter Waller [Mon, 6 Dec 2021 15:11:45 +0000 (15:11 +0000)]
[AArch64][SVE] Fix ICE extracting fixedvec from scalable load
f526c600c043 had a concern raised because of an invalid typesize request
on a scalable vector, which this patch addresses.
Prevent shouldReduceLoadWidth from attempting to query the bit size, and
add a regression test in sve-extract-fixed-vector.ll.
Differential Revision: https://reviews.llvm.org/D115156
Kazu Hirata [Mon, 6 Dec 2021 16:49:10 +0000 (08:49 -0800)]
[CodeGen] Use range-based for loops (NFC)
Jon Chesterfield [Mon, 6 Dec 2021 16:42:25 +0000 (16:42 +0000)]
[libomptarget] Add cmake variables to disable building the amdgpu or cuda plugins
Analogous to the controls on building device runtimes
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D115148
Jon Chesterfield [Mon, 6 Dec 2021 16:41:22 +0000 (16:41 +0000)]
[openmp] Run tests on both runtimes, independent of the default
Minor fix to the lit.cfg. Currently, nvptx runs the tests twice on the new runtime.
Soon, amdgpu will run them on the new runtime as well as the old.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D115150
Bardia Mahjour [Mon, 6 Dec 2021 16:22:25 +0000 (11:22 -0500)]
[VP] getVPMemoryOpCost interface
Added TTI queries for the cost of a VP Memory operation, and added Opcode,
DataType and Alignment to the hasActiveVectorLength() interface.
Reviewed By: Roland Froese
Differential Revision: https://reviews.llvm.org/D109416
Arthur O'Dwyer [Sun, 5 Dec 2021 15:08:05 +0000 (10:08 -0500)]
[libc++] Work around a Clang bug in transform_view, and regression-test.
Clang trunk rejects the new test case, but this is a Clang bug
(PR47414, 47509, 50864, 44833).
```
In module 'std' imported from /Users/aodwyer/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp:17:
/Users/aodwyer/llvm-project/build2/include/c++/v1/__ranges/transform_view.h:85:44: error: constraints not satisfied for alias template 'range_reference_t' [with _Rp = const NonConstView]
regular_invocable<const _Fn&, range_reference_t<const _View>>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/aodwyer/llvm-project/build2/include/c++/v1/__ranges/transform_view.h:416:25: note: in instantiation of template class 'std::ranges::transform_view<NonConstView, (lambda at /Users/aodwyer/llvm-project/libcxx/test/std/ranges/range.adaptors/range.transform/general.pass.cpp:73:71)>' requested here
-> decltype( transform_view(_VSTD::forward<_Range>(__range), _VSTD::forward<_Fn>(__f)))
^
```
We can work around this by adding a layer of indirection: put the
problematic constraint into a named concept and Clang becomes more
amenable to SFINAE'ing instead of hard-erroring.
Drive-by simplify `range.transform/general.pass.cpp` to make it clearer
what it's actually testing in this area.
Differential Revision: https://reviews.llvm.org/D115116
Simon Moll [Mon, 6 Dec 2021 15:44:36 +0000 (16:44 +0100)]
Revert "[Clang] Ignore CLANG_DEFAULT_LINKER for custom-linker toolchains"
Reverted until all Toolchains are fixed for the new behavior.
This reverts commit
34a43f2115af79f896c889433c57f3b400e9f2c6.
Jon Chesterfield [Mon, 6 Dec 2021 15:26:17 +0000 (15:26 +0000)]
[openmp] Enable tests on new devicertl on amdgpu
Reviewed By: pdhaliwal
Differential Revision: https://reviews.llvm.org/D114891
Ties Stuij [Mon, 6 Dec 2021 15:03:14 +0000 (15:03 +0000)]
[ARM][clang] Add back branch protection tests
When committing the PACBTI-M frontend support
patch (https://reviews.llvm.org/D112421), the tests in
arm-invalid-branch-protection.c were failing on certain test setups, so it was
removed to make the llvm test suite pass. The fix is to require
arm-registered-target.
This patch is part of a series that adds support for the PACBTI-M extension of
the Armv8.1-M architecture, as detailed here:
https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/armv8-1-m-pointer-authentication-and-branch-target-identification-extension
The PACBTI-M specification can be found in the Armv8-M Architecture Reference
Manual:
https://developer.arm.com/documentation/ddi0553/latest
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D115141
Nikita Popov [Mon, 6 Dec 2021 14:59:28 +0000 (15:59 +0100)]
[llvm-c] Avoid use of deprecated APIs in unit tests
As pointed out in https://reviews.llvm.org/D114936#3173327,
unit tests were still using deprecated C APIs.
James Farrell [Wed, 1 Dec 2021 16:54:32 +0000 (16:54 +0000)]
Use VersionTuple for parsing versions in Triple, fixing issues that caused the original change to be reverted. This makes it possible to distinguish between "16" and "16.0" after parsing, which previously was not possible.
This reverts commit
40d5eeac6cd89a2360c3ba997cbaa816abca828c.
Differential Revision: https://reviews.llvm.org/D114885
Chuanqi Xu [Mon, 6 Dec 2021 14:52:51 +0000 (22:52 +0800)]
[Coroutines] Handle CallBrInst in SalvageDebugInfo
Reviewed by: StephenTozer
Differential Revision: https://reviews.llvm.org/D115139
Valentin Clement [Mon, 6 Dec 2021 14:51:45 +0000 (15:51 +0100)]
[fir] Add fircg.ext_array_coor conversion
This patch adds the conversion pattern for the fircg.ext_array_coor
operation. It applies the address arithmetic on a dynamically shaped, shifted
and/or sliced array.
This patch is part of the upstreaming effort from fir-dev branch.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D113968
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
Jake Egan [Mon, 6 Dec 2021 14:26:04 +0000 (09:26 -0500)]
[MC] Add emitXCOFFSymbolLinkageWithVisibility to MCNullStreamer
This patch adds `emitXCOFFSymbolLinkageWithVisibility` to MCNullStreamer to fix llvm_unreachable getting reached when using option `-filetype=null` on AIX.
Reviewed By: DiggerLin
Differential Revision: https://reviews.llvm.org/D114876
Pavel Labath [Fri, 26 Nov 2021 08:00:35 +0000 (09:00 +0100)]
[lldb/qemu] Add support for pty redirection
Lldb uses a pty to read/write to the standard input and output of the
debugged process. For host processes this would be automatically set up
by Target::FinalizeFileActions. The Qemu platform is in a unique
position of not really being a host platform, but not being remote
either. It reports IsHost() = false, but it is sufficiently host-like
that we can use the usual pty mechanism.
This patch adds the necessary glue code to enable pty redirection. It
includes a small refactor of Target::FinalizeFileActions and
ProcessLaunchInfo::SetUpPtyRedirection to reduce the amount of
boilerplate that would need to be copied.
I will note that qemu is not able to separate output from the emulated
program from the output of the emulator itself, so the two will arrive
intertwined. Normally this should not be a problem since qemu should not
produce any output during regular operation, but some output can slip
through in case of errors. This situation should be pretty obvious (to a
human), and it is the best we can do anyway.
For testing purposes, and inspired by lldb-server tests, I have extended
the mock emulator with the ability "program" the behavior of the
"emulated" program via command-line arguments.
Differential Revision: https://reviews.llvm.org/D114796
Pavel Labath [Mon, 6 Dec 2021 13:58:39 +0000 (14:58 +0100)]
[lldb/lua] Add a file that should have been a part of
a52af6d3
Pavel Labath [Mon, 6 Dec 2021 13:56:40 +0000 (14:56 +0100)]
[lldb] Remove extern "C" from lldb-swig-lua interface
This is the lua equivalent of
9a14adeae0.
Michał Górny [Thu, 2 Dec 2021 17:34:28 +0000 (18:34 +0100)]
[lldb] [Process/elf-core] Disable for FreeBSD vmcores
Recognize FreeBSD vmcores (kernel core dumps) through OS ABI = 0xFF
+ ELF version = 0, and do not process them via the elf-core plugin.
While these files use ELF as a container format, they contain raw memory
dump rather than proper VM segments and therefore are not usable
to the elf-core plugin.
Differential Revision: https://reviews.llvm.org/D114967
Jon Chesterfield [Mon, 6 Dec 2021 13:25:22 +0000 (13:25 +0000)]
[openmp][amdgpu] Disable tests requiring USM on amdgcn
These tests tend to hang or crash on hardware that doesn't
support USM. Disabling them helps diagnose other issues. To safely
enable we require a means of testing whether USM is expected to work.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D115144
Florian Hahn [Mon, 6 Dec 2021 13:06:11 +0000 (13:06 +0000)]
[DSE] Add additional memset_chk tests.
Alex Zinenko [Fri, 3 Dec 2021 12:13:43 +0000 (13:13 +0100)]
[mlir] Avoid needlessly converting LLVM named structs with compatible elements
Conversion of LLVM named structs leads to them being renamed since we cannot
modify the body of the struct type once it is set. Previously, this applied to
all named struct types, even if their element types were not affected by the
conversion. Make this behvaior only applicable when element types are changed.
This requires making the LLVM dialect type-compatibility check recursively look
at the element types (arguably, it should have been doing than since the moment
the LLVM dialect type system stopped being closed). In addition, have a more
lax check for outer types only to avoid repeated check when necessary (e.g.,
parser, verifiers that are going to also look at the inner type).
Reviewed By: wsmoses
Differential Revision: https://reviews.llvm.org/D115037
Simon Moll [Mon, 6 Dec 2021 10:00:38 +0000 (11:00 +0100)]
[Clang] Ignore CLANG_DEFAULT_LINKER for custom-linker toolchains
Before, the CLANG_DEFAULT_LINKER cmake option was a global override for
the linker that shall be used on all toolchains. The linker binary
specified that way may not be available on toolchains with custom
linkers. Eg, the only linker for VE is named 'nld' - any other linker
invalidates the toolchain.
This patch removes the hard override and instead lets the generic
toolchain implementation default to CLANG_DEFAULT_LINKER. Toolchains
can now deviate with a custom linker name or deliberatly default to
CLANG_DEFAULT_LINKER.
Reviewed By: MaskRay, phosek
Differential Revision: https://reviews.llvm.org/D115045
Dmitry Vyukov [Mon, 6 Dec 2021 11:24:10 +0000 (12:24 +0100)]
tsan: disable dlopen_static_tls.cpp test on powerpc64
Reviewed By: melver
Differential Revision: https://reviews.llvm.org/D115142
Sander de Smalen [Mon, 6 Dec 2021 11:14:27 +0000 (11:14 +0000)]
[LV] Pass compare predicate to getCmpSelInstrCost.
If the condition of a select is a compare, pass its predicate to
TTI::getCmpSelInstrCost to get a more accurate cost value instead
of passing BAD_ICMP_PREDICATE.
I noticed that the commit message from D90070 had a comment about the
vectorized select predicate possibly being composed of other compares with
different predicate values, but I wasn't able to construct an example
where this was an actual issue. If this is an issue, I guess we could
add another check that the block isn't predicated for any reason.
Reviewed By: dmgreen, fhahn
Differential Revision: https://reviews.llvm.org/D114646
Dmitri Gribenko [Fri, 19 Nov 2021 10:54:50 +0000 (11:54 +0100)]
[clang][docs][dataflow] Added an introduction to dataflow analysis
This documentation supports the dataflow analysis framework (see "[RFC]
A dataflow analysis framework for Clang AST" on cfe-dev).
Since the implementation of the framework has not been committed yet,
right now the doc describes dataflow analysis in general.
Since this is the first markdown document in clang/docs, I added support
for Markdown to clang/docs/conf.py in the same way as it is done in
llvm/docs.
Reviewed By: xazax.hun
Differential Revision: https://reviews.llvm.org/D114231
Kazushi (Jam) Marukawa [Sun, 5 Dec 2021 18:52:26 +0000 (03:52 +0900)]
[VE] Support VE specific data directives in MC
Support VE specific data directives, .word/.long/.llong, in MC layer.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D115120
Ties Stuij [Mon, 6 Dec 2021 11:00:10 +0000 (11:00 +0000)]
[ARM] Implement setjmp BTI placement for PACBTI-M
This patch intends to guard indirect branches performed by longjmp
by inserting BTI instructions after calls to setjmp.
Calls with 'returns-twice' are lowered to a new pseudo-instruction
named t2CALL_BTI that is later expanded to a bundle of {tBL,t2BTI}.
This patch is part of a series that adds support for the PACBTI-M extension of
the Armv8.1-M architecture, as detailed here:
https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/armv8-1-m-pointer-authentication-and-branch-target-identification-extension
The PACBTI-M specification can be found in the Armv8-M Architecture Reference
Manual:
https://developer.arm.com/documentation/ddi0553/latest
The following people contributed to this patch:
- Alexandros Lamprineas
- Ties Stuij
Reviewed By: labrinea
Differential Revision: https://reviews.llvm.org/D112427
Kazushi (Jam) Marukawa [Sun, 28 Nov 2021 16:10:45 +0000 (01:10 +0900)]
[VE] Change to use R_VE_SREL32
Change to use R_VE_SREL32 for relative branch instructions instead of
R_VE_PC_LO32 in order to check ranges of relative branch isntructions
at link time correctly.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D115097
David Green [Mon, 6 Dec 2021 11:06:25 +0000 (11:06 +0000)]
[ARM] Add a vrinta.f16.f16 alias
The v8.1-m ARMARM uses the vrinta.f16.f16 names, as opposed to
vrinta.f16. This adds an alias for it in the same way that we have for
f32 and f64.
Differential Revision: https://reviews.llvm.org/D68127
Djordje Todorovic [Mon, 6 Dec 2021 10:58:50 +0000 (02:58 -0800)]
[NFC][LICM] Update the comment in the scalar-promote.ll
The comment was stale after the https://reviews.llvm.org/D113289
was committed.
Kazushi (Jam) Marukawa [Fri, 19 Nov 2021 11:43:19 +0000 (20:43 +0900)]
[VE] Support multiple architectures installation
Change C++ header files placement to support multiple LLVM_RUNTIME_TARGETS
build. Also modifies regression test for it.
Reviewed By: simoll
Differential Revision: https://reviews.llvm.org/D114527
Kristina Bessonova [Mon, 6 Dec 2021 10:19:09 +0000 (12:19 +0200)]
[clang][DebugInfo] Allow function-local statics and types to be scoped within a lexical block
This is almost a reincarnation of https://reviews.llvm.org/D15977 originally
implemented by Amjad Aboud. It was discussed on llvm-dev [0], committed
with its backend counterpart [1], but finally reverted [2].
This patch makes clang to emit debug info for function-local static variables,
records (classes, structs and unions) and typdefs correctly scoped if
those function-local entites defined within a lexical (bracketed) block.
Before this patch, clang emits all those entities directly scoped in
DISubprogram no matter where they were really defined, causing
debug info loss (reported several times in [3], [4], [5]).
[0] https://lists.llvm.org/pipermail/llvm-dev/2015-November/092551.html
[1] https://reviews.llvm.org/rG30e7a8f694a19553f64b3a3a5de81ce317b9ec2f
[2] https://reviews.llvm.org/rGdc4531e552af6c880a69d226d3666756198fbdc8
[3] https://bugs.llvm.org/show_bug.cgi?id=19238
[4] https://bugs.llvm.org/show_bug.cgi?id=23164
[5] https://bugs.llvm.org/show_bug.cgi?id=44695
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D113743
Matthias Springer [Mon, 6 Dec 2021 09:06:41 +0000 (18:06 +0900)]
[mlir][linalg][bufferize][NFC] Utilize isWritable for FuncOps
This is a cleanup of ModuleBufferization. Instead of storing information about writable function arguments in BufferizationAliasInfo, we can use isWritable and make the decision there, based on dialect-specifc bufferization state.
Differential Revision: https://reviews.llvm.org/D114930
Balazs Benics [Mon, 6 Dec 2021 09:20:17 +0000 (10:20 +0100)]
[analyzer] Ignore flex generated files
Some projects [1,2,3] have flex-generated files besides bison-generated
ones.
Unfortunately, the comment `"/* A lexical scanner generated by flex */"`
generated by the tools is not necessarily at the beginning of the file,
thus we need to quickly skim through the file for this needle string.
Luckily, StringRef can do this operation in an efficient way.
That being said, now the bison comment is not required to be at the very
beginning of the file. This allows us to detect a couple more cases
[4,5,6].
Alternatively, we could say that we only allow whitespace characters
before matching the bison/flex header comment. That would prevent the
(probably) unnecessary string search in the buffer. However, I could not
verify that these tools would actually respect this assumption.
Additionally to this, e.g. the Twin project [1] has other non-whitespace
characters (some preprocessor directives) before the flex-generated
header comment. So the heuristic in the previous paragraph won't work
with that.
Thus, I would advocate the current implementation.
According to my measurement, this patch won't introduce measurable
performance degradation, even though we will do 2 linear scans.
I introduce the ignore-bison-generated-files and
ignore-flex-generated-files to disable skipping these files.
Both of these options are true by default.
[1]: https://github.com/cosmos72/twin/blob/master/server/rcparse_lex.cpp#L7
[2]: https://github.com/marcauresoar/make-examples/blob/
22362cdcf9dd7c597b5049ce7f176621e2e9ac7a/sandbox/count-words/lexer.c#L6
[3]: https://github.com/vladcmanea/2nd-faculty-year-Formal-Languages---Automata-assignments/blob/
11abdf64629d9eb741438ba69f04636769d5a374/lab1/lex.yy.c#L6
[4]: https://github.com/KritikaChoudhary/System-Software-Lab/blob/
47f5b2cfe2a2738fd54eae9f8439817f6a22034e/B_yacc/1/y1.tab.h#L2
[5]: https://github.com/VirtualMonitor/VirtualMonitor/blob/
71d1bf9b1e7b392a7bd0c73dc217138dc5865651/src/VBox/Additions/x11/x11include/xorg-server-1.8.0/parser.h#L2
[6]: https://github.com/bspaulding/DrawTest/blob/
3f773ceb13de14275429036b9cbc5aa19e29bab9/Framework/OpenEars.framework/Versions/A/Headers/jsgf_parser.h#L2
Reviewed By: xazax.hun
Differential Revision: https://reviews.llvm.org/D114510
Matthias Springer [Mon, 6 Dec 2021 08:40:08 +0000 (17:40 +0900)]
[mlir][linalg][bufferize] Remove buffer equivalence from bufferize
Remove all function calls related to buffer equivalence from bufferize implementations.
Add a new PostAnalysisStep for scf.for that ensures that yielded values are equivalent to the corresponding BBArgs. (This was previously checked in `bufferize`.) This will be relaxed in a subsequent commit.
Note: This commit changes two test cases. These were broken by design
and should not have passed. With the new scf.for PostAnalysisStep, this
bug was fixed.
Differential Revision: https://reviews.llvm.org/D114927
Paulo Matos [Sun, 5 Dec 2021 12:50:47 +0000 (13:50 +0100)]
[WebAssembly] Implementation of intrinsic for ref.null and HeapType removal
This patch implements the intrinsic for ref.null.
In the process of implementing int_wasm_ref_null_func() and
int_wasm_ref_null_extern() intrinsics, it removes the redundant
HeapType.
This also causes the textual assembler syntax for ref.null to
change. Instead of receiving an argument: `func` or `extern`, the
instruction mnemonic is either ref.null_func or ref.null_extern,
without the need for a further operand.
Reviewed By: tlively
Differential Revision: https://reviews.llvm.org/D114979
MaheshRavishankar [Mon, 6 Dec 2021 08:35:47 +0000 (08:35 +0000)]
[mlir] Add default implementations for methods in `TilingInterface`.
Adding the default implementation of `getLoopIteratorTypes` and
`getLoopBounds` allows ExternalModels to override these methods.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D115101
Matthias Springer [Mon, 6 Dec 2021 08:25:13 +0000 (17:25 +0900)]
[mlir][linalg][bufferize][NFC] Collect equivalent FuncOp BBArgs in PostAnalysisStep
Collect equivalent BBArgs right after the equivalence analysis of the FuncOp and before bufferizing. This is in preparation of decoupling bufferization from aliasInfo.
Also gather equivalence info for CallOps, which was missing in the
previous commit.
Differential Revision: https://reviews.llvm.org/D114847
Nikita Popov [Sun, 4 Jul 2021 16:14:09 +0000 (18:14 +0200)]
[llvm-c] Add header deprecations
This adds support for header deprecation using
LLVM_ATTRIBUTE_C_DEPRECATED (note that we can't use
LLVM_ATTRIBUTE_DEPRECATED, which is C++ specific). This will not
help people using the FFI interface, but may help people using the
C headers.
Differential Revision: https://reviews.llvm.org/D114936
Michal Terepeta [Mon, 6 Dec 2021 07:59:49 +0000 (07:59 +0000)]
[mlir][Vector] Support 0-D vectors in `ConstantMaskOp`
To support creating both a mask with just a single `true` and `false` values,
I had to relax the restriction in the verifier that the rank is always equal to
the length of the attribute array, in other words, we now allow:
- `vector.constant_mask [0] : vector<i1>` which gets lowered to
`arith.constant dense<false> : vector<i1>`
- `vector.constant_mask [1] : vector<i1>` which gets lowered to
`arith.constant dense<true> : vector<i1>`
(the attribute list for the 0-D case must be a singleton containing
either `0` or `1`)
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D115023
gysit [Mon, 6 Dec 2021 07:25:24 +0000 (07:25 +0000)]
[mlir][linalg] Pad independent of application order (NFC).
This revision makes the padding pattern independent of the application order. It addresses the concern that we cannot rely on the execution order of the greedy rewriter (https://reviews.llvm.org/D114689). Instead, the pattern is updated to apply repeatedly till all operations are padded.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D114851
Tan S. B [Mon, 6 Dec 2021 06:32:48 +0000 (22:32 -0800)]
[clang-format] Adjust braced list detection
This avoids mishandling nested compound statements that are followed by another compound statement.
Fixes https://llvm.org/PR38314 and https://llvm.org/PR48305.
Differential Revision: https://reviews.llvm.org/D114583
Zi Xuan Wu [Mon, 6 Dec 2021 05:36:20 +0000 (13:36 +0800)]
[CSKY] Add compressed instruction mapping between 32-bit and 16-bit instruction
Add all CompressPat to map instructions between 16-bit and 32-bit with using the CompressInstEmitter infra.
Although it's only used in asm printer, also enable it in asm parser to debug mapping when -enable-csky-asm-compressed-inst is on.
Differential Revision: https://reviews.llvm.org/D115026
Noah Shutty [Mon, 6 Dec 2021 05:39:05 +0000 (05:39 +0000)]
Revert "[llvm] [Debuginfo] Debuginfod client library."
This reverts commit
af69947e7028274573cfc927aabead8326b63367 because it
caused buildbot failures.
Noah Shutty [Mon, 6 Dec 2021 04:27:53 +0000 (04:27 +0000)]
[llvm] [Debuginfo] Debuginfod client library.
This adds a Debuginfod library containing the `fetchDebuginfo` function which queries servers specified by the `DEBUGINFOD_URLS` environment variable for the debuginfo, executable, or a specified source file associated with a given build id.
This diff was split out from D111252.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D112758
Shivam Gupta [Mon, 6 Dec 2021 03:57:08 +0000 (09:27 +0530)]
[Docs] Fix a link
current link is pointing to https://llvm.org/docs/CodeGenerator.html#segmented-stacks while it point to https://llvm.org/docs/CodeGenerator.html#tail-call-optimization or id81.
Differential Revision: https://reviews.llvm.org/D115119
Qiu Chaofan [Mon, 6 Dec 2021 02:15:05 +0000 (10:15 +0800)]
[PowerPC] Implement general back2back fusion
Implement 'back-to-back' FX fusion according to Power10 User Manual
'19.1.5.4 Fusion', not enabled by default.
Reviewed By: nemanjai
Differential Revision: https://reviews.llvm.org/D114345
Nikolas Klauser [Thu, 2 Dec 2021 20:09:38 +0000 (21:09 +0100)]
[libc++][NFC] Disable clang-tidy checks
Disable clang-tidy checks as discussed in D114915
Reviewed By: ldionne, #libc
Spies: cjdb, aheejin, libcxx-commits
Differential Revision: https://reviews.llvm.org/D114985
Arthur O'Dwyer [Sun, 5 Dec 2021 23:56:58 +0000 (18:56 -0500)]
[libc++] Remove space-alignment of trailing braces in module.modulemap. NFC.
As discussed on the Discord, 2021-12-01 through 2021-12-05.
Our new consistent style for this is "don't align the right-braces"
(but still align the left-braces, as shown).
Jack Andersen [Sun, 5 Dec 2021 19:55:20 +0000 (14:55 -0500)]
[GlobalISel] Allow DBG_VALUE to use undefined vregs before LiveDebugValues.
Expanding on D109750.
Since `DBG_VALUE` instructions have final register validity determined in
`LDVImpl::handleDebugValue`, there is no apparent reason to immediately prune
unused register operands as their defs are erased. Consequently, this renders
`MachineInstr::eraseFromParentAndMarkDBGValuesForRemoval` moot; gaining a
substantial performance improvement.
The only necessary changes involve making relevant passes consider invalid
DBG_VALUE vregs uses as valid.
Reviewed By: MatzeB
Differential Revision: https://reviews.llvm.org/D112852
Jez Ng [Sat, 4 Dec 2021 02:26:32 +0000 (21:26 -0500)]
[lld-macho] Unreferenced weak dylib symbols shouldn't fetch archive symbols
We were fetching archive symbols too eagerly, bloating binary size as well as
just screwing up binaries that expected to look up certain symbols only at
runtime.
Reviewed By: #lld-macho, oontvoo
Differential Revision: https://reviews.llvm.org/D115092
Jack Andersen [Sun, 5 Dec 2021 19:45:33 +0000 (14:45 -0500)]
[CMake] Installable find modules for terminfo and libffi
Improves cross-distro portability of LLVM cmake package by resolving paths for
terminfo and libffi via import targets.
When LLVMExports.cmake is generated for installation, it contains absolute
library paths which are likely to be a common cause of portability issues. To
mitigate this, the discovery logic for these dependencies is refactored into
find modules which get installed alongside LLVMConfig.cmake. The result is
cleaner, cmake-friendly management of these dependencies that respect the
environment of the LLVM package importer.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D114327
Jack Andersen [Sun, 5 Dec 2021 19:35:33 +0000 (14:35 -0500)]
Test commit to check access.
Mehdi Amini [Sun, 5 Dec 2021 19:16:54 +0000 (19:16 +0000)]
Fix TOSA verifier to emit verbose errors
Also as a test for invalid ops which was missing.
Michael Liao [Sun, 5 Dec 2021 18:39:48 +0000 (13:39 -0500)]
Fix `-Wunused-variable` warning. NFC.
Arthur O'Dwyer [Sun, 5 Dec 2021 18:21:01 +0000 (13:21 -0500)]
[libc++] Adjust space-alignment in module.modulemap. NFC.
Arthur O'Dwyer [Sun, 5 Dec 2021 18:08:36 +0000 (13:08 -0500)]
[libc++] Add missing `#pragma GCC system_header` in a few headers. NFCI.
Arthur O'Dwyer [Sun, 5 Dec 2021 18:05:21 +0000 (13:05 -0500)]
[libc++] Fix an include-guard comment. NFC.
Nico Weber [Sun, 5 Dec 2021 18:15:56 +0000 (13:15 -0500)]
[gn build] port
a8025e06fc0f more
src/ryu/*.cpp includes files relative to src, so src/ needs
to be passes as -I flag now.
Mark de Wever [Sun, 5 Dec 2021 16:44:24 +0000 (17:44 +0100)]
[libc++][doc] Update format implementation status.
Kazu Hirata [Sun, 5 Dec 2021 16:33:02 +0000 (08:33 -0800)]
[llvm] Use range-based for loops (NFC)
Sanjay Patel [Sun, 5 Dec 2021 14:47:17 +0000 (09:47 -0500)]
[InstSimplify] fix logic fold of 'or' for vectors
Reduce code duplication for commutative pattern matching
and fix a miscompile.
We can't safely propagate an undef element in this transform:
https://alive2.llvm.org/ce/z/s5xy55
Sanjay Patel [Sun, 5 Dec 2021 14:28:11 +0000 (09:28 -0500)]
[InstSimplify] add/adjust tests for 'or' logic fold; NFC
The last test shows a miscompile:
https://alive2.llvm.org/ce/z/s5xy55
Sanjay Patel [Fri, 3 Dec 2021 14:14:41 +0000 (09:14 -0500)]
[InstCombine] add tests for icmp with mul op with known bits; NFC
D114962