Haojian Wu [Fri, 15 Jul 2022 11:25:02 +0000 (13:25 +0200)]
Remove an unsued-variable warning, NFC.
Adhemerval Zanella [Fri, 15 Jul 2022 11:38:51 +0000 (08:38 -0300)]
[libcxx] Temporarily skip Arm configs
The machine hosting these agents will be down for maintenance July 15th.
Differential Revision: https://reviews.llvm.org/D129847
Simon Pilgrim [Fri, 15 Jul 2022 11:16:22 +0000 (12:16 +0100)]
[DAG] Move "xor (X logical_shift ShiftC), XorC --> (not X) logical_shift ShiftC" fold into SimplifyDemandedBits
SimplifyDemandedBits is called slightly later which allows the not(sext(x)) -> sext(not(x)) fold to occur via foldLogicOfShifts
As mentioned on D127115, we should be able to further generalise this based off the demanded bits.
Piotr Sobczak [Fri, 15 Jul 2022 11:29:22 +0000 (13:29 +0200)]
[InstCombine] Precommit test
Michał Górny [Fri, 15 Jul 2022 11:43:34 +0000 (13:43 +0200)]
Revert "[lldb] [llgs] Fix multi-resume bugs with nonstop mode"
This reverts commit
f8605da8758fbae16410e4ed5493a39429fd73ec.
This is causing buildbot failures and now I see that I have not updated
the tests to use "stop" instead of "trap".
Edd Barrett [Fri, 15 Jul 2022 11:00:14 +0000 (12:00 +0100)]
[stackmaps] Legalise patchpoint arguments.
This is similar to D125680, but for llvm.experimental.patchpoint
(instead of llvm.experimental.stackmap).
Differential review: https://reviews.llvm.org/D129268
Michał Górny [Tue, 28 Jun 2022 04:00:46 +0000 (06:00 +0200)]
[lldb] [llgs] Fix multi-resume bugs with nonstop mode
Improve handling of multiple successive continue packets in non-stop
mode. More specifically:
1. Explicitly send error response (instead of crashing on assertion)
if the user attempts to resume the same process twice. Since we
do not support thread-level non-stop mode, one needs to always stop
the process explicitly before resuming another thread set.
2. Actually stop the process if "vCont;t" is delivered to a running
process. Similarly, we only support stopping all the running threads
simultaneously (via -1) and return an error in any other case.
With this patch, running multiple processes simultaneously is still
unsupported. The patch also employs a hack to avoid enabling stdio
forwarding on "vCont;t" packet. Both of these issues are addressed
by followup patches.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.llvm.org/D128710
Andy Yankovsky [Fri, 15 Jul 2022 10:43:48 +0000 (10:43 +0000)]
Reland "[lldb] Add support for using integral const static data members in the expression evaluator"
Reland
486787210d which broke tests on Arm and Windows.
* Windows -- on Windows const static data members with no out-of-class
definition do have valid addresses, in constract to other platforms
(Linux, macos) where they don't. Adjusted the test to expect success
on Windows and failure on other platforms.
* Arm -- `int128` is not available on 32-bit ARM, so disable the test
for this architecture.
Simon Pilgrim [Fri, 15 Jul 2022 10:28:33 +0000 (11:28 +0100)]
[ARM] Regenerate hoist-and-by-const-from-shl-in-eqcmp-zero.ll
cleanup some common prefixes
Dmitry Preobrazhensky [Fri, 15 Jul 2022 10:17:36 +0000 (13:17 +0300)]
[AMDGPU][MC][NFC] Remove unnecessary code
Differential Revision: https://reviews.llvm.org/D129766
Dmitry Preobrazhensky [Fri, 15 Jul 2022 10:11:59 +0000 (13:11 +0300)]
[AMDGPU][MC][GFX11] Correct disassembly of *_e64_dpp opcodes which support op_sel
These opcodes cannot be disassembled because op_sel operand is missing - it must be added manually.
See https://github.com/llvm/llvm-project/issues/56512 for detailed issue analysis.
Differential Revision: https://reviews.llvm.org/D129637
Haojian Wu [Fri, 15 Jul 2022 09:51:13 +0000 (11:51 +0200)]
[syntax] Add virtual destructor in TokenManager.
Fix `-Wnon-virtual-dtor` warning.
Krasimir Georgiev [Fri, 15 Jul 2022 09:36:08 +0000 (11:36 +0200)]
[clang-format] distinguish multiplication after brace-init from pointer
After https://github.com/llvm/llvm-project/commit/
b646f0955574c6ad4c156c9db522e46f597cfda9,
the added regression test started being formatted as-if the
multiplication `*` was a pointer. This adapts the heuristic to
distinguish between these two cases.
Reviewed By: jackhong12, curdeius, HazardyKnusperkeks, owenpan
Differential Revision: https://reviews.llvm.org/D129771
Nikita Popov [Fri, 15 Jul 2022 08:59:33 +0000 (10:59 +0200)]
[InstCombine] Ensure constant folding in binop of select fold
When folding a binop into a select, we need to ensure that one
of the select arms actually does constant fold, otherwise we'll
create two binop instructions and perform the reverse transform.
Ensure this by performing an explicit constant folding attempt,
and failing the transform if neither side simplifies.
A simple alternative here would have been to limit the fold to
ImmConstants, but given the current representation of scalable
vector splats, this wouldn't be ideal.
Mel Chen [Fri, 15 Jul 2022 08:45:22 +0000 (01:45 -0700)]
[LV][NFC] Fix the condition for printing debug messages
Reviewed By: fhahn
Differential Revision: https://reviews.llvm.org/D128523
LLVM GN Syncbot [Fri, 15 Jul 2022 08:36:57 +0000 (08:36 +0000)]
[gn build] Port
263dcf452fa0
Haojian Wu [Thu, 7 Jul 2022 12:44:27 +0000 (14:44 +0200)]
[syntax] Introduce a TokenManager interface.
TokenManager defines Token interfaces for the clang syntax-tree. This is the level
of abstraction that the syntax-tree should use to operate on Tokens.
It decouples the syntax-tree from a particular token implementation (TokenBuffer
previously). This enables us to use a different underlying token implementation
for the syntax Leaf node -- in clang pseudoparser, we want to produce a
syntax-tree with its own pseudo::Token rather than syntax::Token.
Differential Revision: https://reviews.llvm.org/D128411
Fangrui Song [Fri, 15 Jul 2022 08:29:58 +0000 (01:29 -0700)]
[ELF] Reword --no-allow-shlib-undefined diagnostic
Use a format more similar to unresolved references from regular object
files. It's probably easier to read for people who are less familiar
with the linker diagnostics.
Reviewed By: ikudrin
Differential Revision: https://reviews.llvm.org/D129790
Mel Chen [Fri, 15 Jul 2022 07:20:20 +0000 (00:20 -0700)]
[LV] Pre-commit test case for D128523, NFC
Fangrui Song [Fri, 15 Jul 2022 08:20:38 +0000 (01:20 -0700)]
Modernize Optional::{getValueOr,hasValue}
Nikita Popov [Thu, 7 Jul 2022 10:27:43 +0000 (12:27 +0200)]
[IR] Don't use blockaddresses as callbr arguments
Following some recent discussions, this changes the representation
of callbrs in IR. The current blockaddress arguments are replaced
with `!` label constraints that refer directly to callbr indirect
destinations:
; Before:
%res = callbr i8* asm "", "=r,r,i"(i8* %x, i8* blockaddress(@test8, %foo))
to label %asm.fallthrough [label %foo]
; After:
%res = callbr i8* asm "", "=r,r,!i"(i8* %x)
to label %asm.fallthrough [label %foo]
The benefit of this is that we can easily update the successors of
a callbr, without having to worry about also updating blockaddress
references. This should allow us to remove some limitations:
* Allow unrolling/peeling/rotation of callbr, or any other
clone-based optimizations
(https://github.com/llvm/llvm-project/issues/41834)
* Allow duplicate successors
(https://github.com/llvm/llvm-project/issues/45248)
This is just the IR representation change though, I will follow up
with patches to remove limtations in various transformation passes
that are no longer needed.
Differential Revision: https://reviews.llvm.org/D129288
Petr Hosek [Fri, 15 Jul 2022 08:10:52 +0000 (08:10 +0000)]
[compiler-rt][CMake] Set unwinder for MSan unittests
This addresses an issue introduced by
6699f554880087106a02be1675395bf2cc6f46c8.
Chuanqi Xu [Fri, 15 Jul 2022 07:54:45 +0000 (15:54 +0800)]
[C++20] [Modules] Handle reachability for enum class
In previous reachability patch, we missed the case for enum class.
Trying to handle it in this patch and add the corresponding tests.
Nikita Popov [Thu, 14 Jul 2022 13:20:13 +0000 (15:20 +0200)]
[LSR] Create SCEVExpander earlier, use member isSafeToExpand() (NFC)
This is a followup to D129630, which switches LSR to the member
isSafeToExpand() variant, and removes the freestanding function.
This is done by creating the SCEVExpander early (already during the
analysis phase). Because the SCEVExpander is now available for the
whole lifetime of LSRInstance, I've also made it into a member
variable, rather than passing it around in even more places.
Differential Revision: https://reviews.llvm.org/D129769
owenca [Fri, 15 Jul 2022 07:25:01 +0000 (00:25 -0700)]
[llvm] A macro of if should be wrapped in do ... while (false)
Petr Hosek [Mon, 11 Jul 2022 08:08:37 +0000 (08:08 +0000)]
[compiler-rt][CMake] Set --unwindlib=none when using LLVM libunwind
We already link libunwind explicitly so avoid trying to link toolchain's
default libunwind which may be missing. This matches what we already do
for libcxx and libcxxabi.
Differential Revision: https://reviews.llvm.org/D129472
Ingo Müller [Thu, 14 Jul 2022 08:04:21 +0000 (08:04 +0000)]
[mlir][benchmark] Fix import in sparse benchmark.
The benchmark currently fails to run because it cannot find the `func`
symbol when using a `FuncOp`. I suppose that the breakage was introduced
by the extraction of the func dialect from the builtin dialect that
wasn't reflected in the benchmark yet.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D129738
Lian Wang [Wed, 29 Jun 2022 06:28:26 +0000 (06:28 +0000)]
[RISCV] Add cost model for vector.reverse mask operation
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D128784
Rainer Orth [Fri, 15 Jul 2022 06:20:57 +0000 (08:20 +0200)]
[Orc] Honor hasJIT in JITTargetMachineBuilder::createTargetMachine
Even with D129349 <https://reviews.llvm.org/D129349>, various SPARC JIT
tests still `FAIL`. They are guarded by `host-supports-jit`. This is set
from `clang-repl --host-supports-jit` which still returns `true`. It turns
out the `JITTargetMachineBuilder` doesn't consider `hasJIT` at all.
This patch corrects this, turning the affected tests `UNSUPPORTED`.
Tested on `sparcv9-sun-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D129350
Rainer Orth [Fri, 15 Jul 2022 06:18:40 +0000 (08:18 +0200)]
[Sparc] Don't claim JIT support on SPARC for now
Until D118450 <https://reviews.llvm.org/D118450> lands, there's no JIT
support on SPARC, but the backend claims otherwise, leading to various
testsuite failures.
This patch corrects this.
Tested on `sparcv9-sun-solaris2.11`.
Differential Revision: https://reviews.llvm.org/D129349
LLVM GN Syncbot [Fri, 15 Jul 2022 04:37:28 +0000 (04:37 +0000)]
[gn build] Port
7ced9fff9547
Jonas Devlieghere [Fri, 15 Jul 2022 03:23:07 +0000 (20:23 -0700)]
[lldb] Print the enum values and their description in the help output
Print the enum values and their description in the help output for
argument values. Until now, there was no way to get these values and
their description.
Example output:
(lldb) help <description-verbosity>
<description-verbosity> -- How verbose the output of 'po' should be.
compact : Only show the description string
full : Show the full output, including persistent variable's
name and type
Differential revision: https://reviews.llvm.org/D129707
Jonas Devlieghere [Thu, 14 Jul 2022 03:11:37 +0000 (20:11 -0700)]
[lldb] Refactor command option enum values (NFC)
Refactor the command option enum values and the command argument table
to connect the two. This has two benefits:
- We guarantee that two options that use the same argument type have
the same accepted values.
- We can print the enum values and their description in the help
output. (D129707)
Differential revision: https://reviews.llvm.org/D129703
Jonas Devlieghere [Fri, 15 Jul 2022 04:13:57 +0000 (21:13 -0700)]
Revert "[clang] Implement ElaboratedType sugaring for types written bare"
This reverts commit
7c51f02effdbd0d5e12bfd26f9c3b2ab5687c93f because it
stills breaks the LLDB tests. This was re-landed without addressing the
issue or even agreement on how to address the issue. More details and
discussion in https://reviews.llvm.org/D112374.
Kostya Serebryany [Thu, 14 Jul 2022 20:22:59 +0000 (13:22 -0700)]
[SanitizerCoverage] add weak definitions for the load/store callbacks.
Add weak definitions for the load/store callbacks.
This matches the weak definitions for all other SanitizerCoverage
callbacks.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D129801
Matheus Izvekov [Mon, 11 Oct 2021 16:15:36 +0000 (18:15 +0200)]
[clang] Implement ElaboratedType sugaring for types written bare
Without this patch, clang will not wrap in an ElaboratedType node types written
without a keyword and nested name qualifier, which goes against the intent that
we should produce an AST which retains enough details to recover how things are
written.
The lack of this sugar is incompatible with the intent of the type printer
default policy, which is to print types as written, but to fall back and print
them fully qualified when they are desugared.
An ElaboratedTypeLoc without keyword / NNS uses no storage by itself, but still
requires pointer alignment due to pre-existing bug in the TypeLoc buffer
handling.
---
Troubleshooting list to deal with any breakage seen with this patch:
1) The most likely effect one would see by this patch is a change in how
a type is printed. The type printer will, by design and default,
print types as written. There are customization options there, but
not that many, and they mainly apply to how to print a type that we
somehow failed to track how it was written. This patch fixes a
problem where we failed to distinguish between a type
that was written without any elaborated-type qualifiers,
such as a 'struct'/'class' tags and name spacifiers such as 'std::',
and one that has been stripped of any 'metadata' that identifies such,
the so called canonical types.
Example:
```
namespace foo {
struct A {};
A a;
};
```
If one were to print the type of `foo::a`, prior to this patch, this
would result in `foo::A`. This is how the type printer would have,
by default, printed the canonical type of A as well.
As soon as you add any name qualifiers to A, the type printer would
suddenly start accurately printing the type as written. This patch
will make it print it accurately even when written without
qualifiers, so we will just print `A` for the initial example, as
the user did not really write that `foo::` namespace qualifier.
2) This patch could expose a bug in some AST matcher. Matching types
is harder to get right when there is sugar involved. For example,
if you want to match a type against being a pointer to some type A,
then you have to account for getting a type that is sugar for a
pointer to A, or being a pointer to sugar to A, or both! Usually
you would get the second part wrong, and this would work for a
very simple test where you don't use any name qualifiers, but
you would discover is broken when you do. The usual fix is to
either use the matcher which strips sugar, which is annoying
to use as for example if you match an N level pointer, you have
to put N+1 such matchers in there, beginning to end and between
all those levels. But in a lot of cases, if the property you want
to match is present in the canonical type, it's easier and faster
to just match on that... This goes with what is said in 1), if
you want to match against the name of a type, and you want
the name string to be something stable, perhaps matching on
the name of the canonical type is the better choice.
3) This patch could exposed a bug in how you get the source range of some
TypeLoc. For some reason, a lot of code is using getLocalSourceRange(),
which only looks at the given TypeLoc node. This patch introduces a new,
and more common TypeLoc node which contains no source locations on itself.
This is not an inovation here, and some other, more rare TypeLoc nodes could
also have this property, but if you use getLocalSourceRange on them, it's not
going to return any valid locations, because it doesn't have any. The right fix
here is to always use getSourceRange() or getBeginLoc/getEndLoc which will dive
into the inner TypeLoc to get the source range if it doesn't find it on the
top level one. You can use getLocalSourceRange if you are really into
micro-optimizations and you have some outside knowledge that the TypeLocs you are
dealing with will always include some source location.
4) Exposed a bug somewhere in the use of the normal clang type class API, where you
have some type, you want to see if that type is some particular kind, you try a
`dyn_cast` such as `dyn_cast<TypedefType>` and that fails because now you have an
ElaboratedType which has a TypeDefType inside of it, which is what you wanted to match.
Again, like 2), this would usually have been tested poorly with some simple tests with
no qualifications, and would have been broken had there been any other kind of type sugar,
be it an ElaboratedType or a TemplateSpecializationType or a SubstTemplateParmType.
The usual fix here is to use `getAs` instead of `dyn_cast`, which will look deeper
into the type. Or use `getAsAdjusted` when dealing with TypeLocs.
For some reason the API is inconsistent there and on TypeLocs getAs behaves like a dyn_cast.
5) It could be a bug in this patch perhaps.
Let me know if you need any help!
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D112374
Phoebe Wang [Fri, 15 Jul 2022 01:31:56 +0000 (09:31 +0800)]
[X86] Use generic tuning for "x86-64" if "tune-cpu" is not specified
This is an alternative to D129154. See discussions on https://discourse.llvm.org/t/fast-scalar-fsqrt-tuning-in-x86/63605
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D129647
Fangrui Song [Fri, 15 Jul 2022 01:47:48 +0000 (18:47 -0700)]
[llvm-dwp][test] Add nocompress.test testing LLVM_ENABLE_ZLIB==0
Rewrite a prebuilt file removed by D129728.
Craig Topper [Fri, 15 Jul 2022 00:50:18 +0000 (17:50 -0700)]
[RISCV] Refine the heuristics for our custom (mul (and X, C2), C1) isel.
Prefer to use SLLI instead of zext.w/zext.h in more cases. SLLI
might be better for compression.
Huan Nguyen [Fri, 15 Jul 2022 01:04:58 +0000 (18:04 -0700)]
[BOLT] Support split landing pad
We previously support split jump table, where some jump table entries
target different fragments of same function. In this fix, we provide
support for another type of intra-indirect transfer: landing pad.
When C++ exception handling is used, compiler emits .gcc_except_table
that describes the location of catch block (landing pad) for specific
range that potentially invokes a throw(). Normally landing pads reside
in the function, but with -fsplit-machine-functions, landing pads can
be moved to another fragment. The intuition is, landing pads are rarely
executed, so compiler can move them to .cold section.
This update will mark all fragments that have landing pad to another
fragment as non-simple, and later propagate non-simple to all related
fragments.
This update also includes one manual test case: split-landing-pad.s
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D128561
Fangrui Song [Fri, 15 Jul 2022 00:20:40 +0000 (17:20 -0700)]
[test] Remove llvm-dwp/X86/nocompress.test
It requires !zlib and isn't so useful.
Craig Topper [Thu, 14 Jul 2022 23:41:40 +0000 (16:41 -0700)]
[RISCV] Fix mistake in RISCVTTIImpl::getIntImmCostInst.
zext.w requires Zba not Zbb. The test was also wrong, but had the
correct comment.
Alexander Timofeev [Thu, 14 Jul 2022 23:35:05 +0000 (01:35 +0200)]
[AMDGPU] Fix for the test failure caused by the
2e29b0138ca243c7d288622524a004c84acbbb9e
Fixing the idiv-licm.ll test failure
Differential Revision: https://reviews.llvm.org/D129819
Arjun P [Thu, 14 Jul 2022 23:18:17 +0000 (00:18 +0100)]
[MLIR][Presburger] MPInt: use /// for top-level comment, not // (NFC)
Fangrui Song [Thu, 14 Jul 2022 23:28:57 +0000 (16:28 -0700)]
[test] Remove zlib-gnu tests
jeff [Wed, 13 Jul 2022 17:28:41 +0000 (17:28 +0000)]
[AMDGPU] Update the mechanism used to check for cycles and add eges in power-sched mutation
Fangrui Song [Thu, 14 Jul 2022 23:19:32 +0000 (16:19 -0700)]
[llvm-dwp] Add SHF_COMPRESSED support and remove .zdebug support
clang 14 removed -gz=zlib-gnu and ld.lld/llvm-objcopy removed .zdebug support
recently. llvm-dwp currently doesn't support SHF_COMPRESSED. Add support and
remove .zdebug support.
Simplify llvm::object::Decompressor which has no .zdebug user now.
While here, add tests for ELF32LE, ELF32BE, and ELF64BE.
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D129728
Craig Topper [Thu, 14 Jul 2022 23:07:03 +0000 (16:07 -0700)]
[SelectionDAG][RISCV][AMDGPU][ARM] Improve SimplifyDemandedBits for SHL with variable shift amount.
If we have a variable shift amount and the demanded mask has leading
zeros, we can propagate those leading zeros to not demand those bits
from operand 0. This can allow zero_extend/sign_extend to become
any_extend. This pattern can occur due to C integer promotion rules.
This transform is already done by InstCombineSimplifyDemanded.cpp where
sign_extend can be turned into zero_extend for example.
Reviewed By: spatel, foad
Differential Revision: https://reviews.llvm.org/D121833
Craig Topper [Mon, 11 Jul 2022 22:06:00 +0000 (15:06 -0700)]
[RISCV] Add additional tests for D121833. NFC
Shafik Yaghmour [Thu, 14 Jul 2022 21:54:48 +0000 (14:54 -0700)]
[Clang] Modify CXXMethodDecl::isMoveAssignmentOperator() to look through type sugar
AcceptedPublic
Currently CXXMethodDecl::isMoveAssignmentOperator() does not look though type
sugar and so if the parameter is a type alias it will not be able to detect
that the method is a move assignment operator. This PR fixes that and adds a set
of tests that covers that we correctly detect special member functions when
defaulting or deleting them.
This fixes: https://github.com/llvm/llvm-project/issues/56456
Differential Revision: https://reviews.llvm.org/D129591
Craig Topper [Thu, 14 Jul 2022 22:13:02 +0000 (15:13 -0700)]
[RISCV] Make TuneSiFive7 depend on TuneNoDefaultUnroll instead of listing it for every SiFive7 CPU
David Blaikie [Thu, 14 Jul 2022 22:55:24 +0000 (22:55 +0000)]
Remove testing for zlib-gnu llvm-mc support in the absence of zlib
Manish Gupta [Thu, 14 Jul 2022 22:40:53 +0000 (22:40 +0000)]
[mlir][NVGPU] Verifier for nvgpu.ldmatrix
* Adds verifiers for `nvgpu.ldmatrix` op
* Adds tests to `mlir/test/Dialect/NVGPU/invalid.mlir`
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D129669
David Blaikie [Thu, 14 Jul 2022 22:38:17 +0000 (22:38 +0000)]
Remove zlibgnu support in llvm-mc
The feature's been removed from most other tools in LLVM at this point.
owenca [Thu, 14 Jul 2022 08:05:45 +0000 (01:05 -0700)]
[clang-format] Fix invalid-code-generation by RemoveBracesLLVM
When removing an r_brace that is the first token of an annotated line, if the
line above ends with a line comment, clang-format generates invalid code by
merging the tokens after the r_brace into the line comment.
Fixes #56488.
Differential Revision: https://reviews.llvm.org/D129742
Nikolas Klauser [Thu, 14 Jul 2022 22:16:18 +0000 (00:16 +0200)]
[libc++] Update RangesAlgorithms.csv
Aart Bik [Thu, 14 Jul 2022 21:55:43 +0000 (14:55 -0700)]
[mlir][sparse][bufferization] fix a few memory leaks
Fixed some new memory leaks after migration to new
bufferization. One is expected, the other may need
some more careful analysis.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D129805
Alexander Timofeev [Tue, 21 Jun 2022 08:57:58 +0000 (10:57 +0200)]
[AMDGPU] Lowering VGPR to SGPR copies to v_readfirstlane_b32 if profitable.
Since the divergence-driven instruction selection has been enabled for AMDGPU,
all the uniform instructions are expected to be selected to SALU form, except those not having one.
VGPR to SGPR copies appear in MIR to connect values producers and consumers. This change implements an algorithm
that evolves a reasonable tradeoff between the profit achieved from keeping the uniform instructions in SALU form
and overhead introduced by the data transfer between the VGPRs and SGPRs.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D128252
Tom Stellard [Thu, 14 Jul 2022 21:51:44 +0000 (14:51 -0700)]
Tom Stellard [Wed, 22 Jun 2022 05:22:11 +0000 (22:22 -0700)]
[gold] Ignore bitcode from sections inside object files
-fembed-bitcode will put bitcode into special sections within object
files, but this is not meant to be used by LTO, so the gold plugin
should ignore it.
https://github.com/llvm/llvm-project/issues/47216
Reviewed By: tejohnson, MaskRay
Differential Revision: https://reviews.llvm.org/D116995
Katherine Rasmussen [Thu, 14 Jul 2022 21:44:34 +0000 (14:44 -0700)]
Revert "[flang] Add co_sum to the list of intrinsics and update test"
This reverts commit
d2460d90080f2ff8564ceed745998f821544ec98.
Reverting this commit because after pushing to main it caused
unexpected test failures.
Siva Chandra [Thu, 14 Jul 2022 21:37:24 +0000 (14:37 -0700)]
[libc] Enable a few stdlib and time functions on aarch64.
isuckatcs [Thu, 16 Jun 2022 14:46:01 +0000 (16:46 +0200)]
[analyzer] Evaluate construction of non-POD type arrays
Introducing the support for evaluating the constructor
of every element in an array. The idea is to record the
index of the current array member being constructed and
create a loop during the analysis. We looping over the
same CXXConstructExpr as many times as many elements
the array has.
Differential Revision: https://reviews.llvm.org/D127973
Petr Hosek [Mon, 11 Jul 2022 08:18:28 +0000 (08:18 +0000)]
[compiler-rt][CMake] Use linker semantics for unwinder and C++ library
Try the shared library first, and if it doesn't exist fallback onto
the static one. When the static library is requested, skip the shared
library.
Differential Revision: https://reviews.llvm.org/D129470
Alexandre Ganea [Thu, 14 Jul 2022 20:56:23 +0000 (16:56 -0400)]
[LLD][COFF] On Windows, fix the date formatting in the 'incremental' test.
On my system the date formatting is a bit different from what the test used to
support. I'm using:
Windows 11 version 21H2, build 22000.795 using the English(Canada) region.
ls from BusyBox 1.36
VS 2022 17.2.5
WinSDK 10.0.22000
Aart Bik [Thu, 14 Jul 2022 20:18:17 +0000 (13:18 -0700)]
[mlir][sparse][bufferization] initialize reduction variable
After recent bufferization improvement, this test
started failing due to missed zero initialization.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D129800
Jez Ng [Thu, 14 Jul 2022 20:46:15 +0000 (16:46 -0400)]
[clang] Document -femit-compact-unwind option in the User’s Manual
Reviewed By: #lld-macho, thakis
Differential Revision: https://reviews.llvm.org/D129772
Katherine Rasmussen [Thu, 26 May 2022 22:14:31 +0000 (15:14 -0700)]
[flang] Add co_sum to the list of intrinsics and update test
Add the collective subroutine, co_sum, to the list of intrinsics.
In accordance with 16.9.50 and 16.9.137, add a check for and an
error if coindexed objects are being passed to certain arguments
in co_sum and in move_alloc. Add a semantics test to check that
this error is successfully caught in calls to move_alloc. Remove
the XFAIL directive, update the ERROR directives and add both
standard-conforming and non-standard conforming calls to the
semantics test for co_sum.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D114134
Fangrui Song [Thu, 14 Jul 2022 20:46:38 +0000 (13:46 -0700)]
[ELF][test] Fix a typo in aarch64-ifunc-bti.s to actually test what was intended
Thanks to Alex Brachet for spotting it in D110217.
Krzysztof Drewniak [Fri, 8 Jul 2022 19:11:03 +0000 (19:11 +0000)]
[mlir][AMDGPU] Add lds_barrier op
The lds_barrier op allows workgroups to wait at a barrier for
operations to/from their local data store (LDS) to complete without
incurring the performance penalties of a full memory fence.
Reviewed By: nirvedhmeshram
Differential Revision: https://reviews.llvm.org/D129522
Siva Chandra [Thu, 14 Jul 2022 20:40:32 +0000 (13:40 -0700)]
[libc] Enable few stdio functions on aarch64.
Jeff Niu [Thu, 14 Jul 2022 20:31:47 +0000 (13:31 -0700)]
[mlir] (NFC) run clang-format on all files
Siva Chandra [Thu, 14 Jul 2022 20:20:43 +0000 (13:20 -0700)]
[libc] Enable few pthread and threads functions on aarch64.
Siva Chandra Reddy [Tue, 12 Jul 2022 21:50:03 +0000 (21:50 +0000)]
[libc] Add implementations of pthread_equal and pthread_self.
Reviewed By: michaelrj, lntue
Differential Revision: https://reviews.llvm.org/D129729
Fabian Parzefall [Thu, 14 Jul 2022 19:55:20 +0000 (12:55 -0700)]
[BOLT] Replace uses of layout with basic block list
As we are moving towards support for multiple fragments, loops that
iterate over all basic blocks of a function, but do not depend on the
order of basic blocks in the final layout, should iterate over binary
functions directly, rather than the layout.
Eventually, all loops using the layout list should either iterate over
the function, or be aware of multiple layouts. This patch replaces
references to binary function's block layout with the binary function
itself where only little code changes are necessary.
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D129585
Hui Xie [Wed, 13 Jul 2022 16:20:22 +0000 (17:20 +0100)]
[libc++][ranges] implement `std::ranges::set_union`
[libc++][ranges] implement `std::ranges::set_union`
Differential Revision: https://reviews.llvm.org/D129657
Philip Reames [Thu, 14 Jul 2022 19:57:32 +0000 (12:57 -0700)]
[CVP] Add coverage for missing mul/shl nowrap variants
LLVM GN Syncbot [Thu, 14 Jul 2022 19:46:00 +0000 (19:46 +0000)]
[gn build] Port
a83004f4ff9e
Vitaly Buka [Thu, 14 Jul 2022 19:33:16 +0000 (12:33 -0700)]
[test] Fix D129789 for 32bit platforms
David Tenty [Mon, 11 Jul 2022 15:05:42 +0000 (11:05 -0400)]
[libcxx][AIX][z/OS] Remove headers included via `_IBMCPP__`
D127650 removed support for non-clang-based XL compilers, but left some
of the headers used only by this compiler and included under the
__IBMCPP__ macro. This change cleans this up by deleting these headers.
Reviewed By: hubert.reinterpretcast, fanbo-meng
Differential Revision: https://reviews.llvm.org/D129491
Louis Dionne [Thu, 14 Jul 2022 19:08:15 +0000 (15:08 -0400)]
[libc++] Add missing UNSUPPORTED annotations to experimental tests that use RTTI
Petr Hosek [Mon, 11 Jul 2022 07:53:47 +0000 (07:53 +0000)]
[libcxxabi][CMake] Set --unwindlib=none when using LLVM libunwind
We already link libunwind explicitly so avoid trying to link toolchain's
default libunwind which may be missing. This matches what we already do
for libcxx.
Differential Revision: https://reviews.llvm.org/D129469
Ellis Hoag [Thu, 14 Jul 2022 18:40:53 +0000 (11:40 -0700)]
[InstrProf] Add options to profile function groups
Add two options, `-fprofile-function-groups=N` and `-fprofile-selected-function-group=i` used to partition functions into `N` groups and only instrument the functions in group `i`. Similar options were added to xray in https://reviews.llvm.org/D87953 and the goal is the same; to reduce instrumented size overhead by spreading the overhead across multiple builds. Raw profiles from different groups can be added like normal using the `llvm-profdata merge` command.
Reviewed By: ianlevesque
Differential Revision: https://reviews.llvm.org/D129594
Nick Desaulniers [Thu, 14 Jul 2022 18:25:21 +0000 (11:25 -0700)]
[clang][CodeGen] add fn_ret_thunk_extern to synthetic fns
Follow up fix to
commit
2240d72f15f3 ("[X86] initial -mfunction-return=thunk-extern
support")
https://reviews.llvm.org/D129572
@nathanchance reported that -mfunction-return=thunk-extern was failing
to annotate the asan and tsan contructors.
https://lore.kernel.org/llvm/Ys7pLq+tQk5xEa%2FB@dev-arch.thelio-3990X/
I then noticed the same occurring for gcov synthetic functions.
Similar to
commit 2786e67 ("[IR][sanitizer] Add module flag "frame-pointer" and set
it for cc1 -mframe-pointer={non-leaf,all}")
define a new module level MetaData, "fn_ret_thunk_extern", then when set
adds the fn_ret_thunk_extern IR Fn Attr to synthetically created
Functions.
Fixes https://github.com/llvm/llvm-project/issues/56514
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D129709
Sanjay Patel [Wed, 13 Jul 2022 14:41:41 +0000 (10:41 -0400)]
[PhaseOrdering][SystemZ] add test for combining/unrolling; NFC
As discussed in D128123, this test is based on an example
that ends up with codegen regressions if sub is converted
to xor.
Sanjay Patel [Wed, 13 Jul 2022 12:55:32 +0000 (08:55 -0400)]
[InstCombine] add/edit tests for masked sub from constant; NFC
Vitaly Buka [Thu, 14 Jul 2022 17:57:07 +0000 (10:57 -0700)]
[test][CodeGen] Don't miss lifetime markers in lifetime tests
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D129789
Amara Emerson [Thu, 14 Jul 2022 07:53:59 +0000 (00:53 -0700)]
[GlobalISel] Change widenScalar of G_FCONSTANT to mutate into G_CONSTANT.
Widening a G_FCONSTANT by extending and then generating G_FPTRUNC doesn't produce
the same result all the time. Instead, we can just transform it to a G_CONSTANT
of the same bit pattern and truncate using a plain G_TRUNC instead.
Fixes https://github.com/llvm/llvm-project/issues/56454
Differential Revision: https://reviews.llvm.org/D129743
Nikolas Klauser [Tue, 12 Jul 2022 13:29:07 +0000 (15:29 +0200)]
[libc++] Use __unwrap_iter_impl for both unwrapping and rewrapping
Reviewed By: ldionne, #libc
Spies: arichardson, sstefan1, libcxx-commits
Differential Revision: https://reviews.llvm.org/D129039
Mitch Phillips [Thu, 14 Jul 2022 17:52:43 +0000 (10:52 -0700)]
Revert "Rewording "static_assert" diagnostics"
This reverts commit
b7e77ff25fb2412f6ab6d6cc756666b0e2f97bd3.
Reason: Broke sanitizer builds bots + libcxx. 'static assertion
expression is not an integral constant expression'. More details
available in the Phabricator review: https://reviews.llvm.org/D129048
Philip Reames [Thu, 14 Jul 2022 17:42:17 +0000 (10:42 -0700)]
[RISCV][LSR] Add coverage for ICmpZero with scaled vscale values
Follow up to
3bc09c7da5 - remove a fixme I forgot to remove, and add test cases showing remaining work.
Note that scaled vscales show up in vectorized code from a couple of sources:
* Element types smaller than vector block size (i.e. everything under i64)
* Unrolling
* LMUL > 1
The largest scaling we can currently have is 256 (e8 in every possible vector register). More practically useful scales are in the 2-16 range.
Stella Stamenova [Thu, 14 Jul 2022 17:47:01 +0000 (10:47 -0700)]
Revert "[lldb] Add support for using integral const static data members in the expression evaluator"
This reverts commit
486787210df5ce5eabadc90a7de353ae81101feb.
This broke the windows lldb bot: https://lab.llvm.org/buildbot/#/builders/83/builds/21186
Nikolas Klauser [Mon, 4 Jul 2022 01:07:26 +0000 (03:07 +0200)]
[libc++] Error if someone tries to use MSVC and tell them to contact the libc++ developers
Nobody knows if there are users of libc++ with MSVC. Let's try to find that out and encourage them to upstream their changes to make that configuration work.
Reviewed By: ldionne, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D129055
LLVM GN Syncbot [Thu, 14 Jul 2022 17:28:37 +0000 (17:28 +0000)]
[gn build] Port
1a8468ba6114
Vitaly Buka [Thu, 14 Jul 2022 17:26:45 +0000 (10:26 -0700)]
[NFC] Clang-format D129645
Michał Górny [Thu, 30 Jun 2022 05:32:27 +0000 (07:32 +0200)]
[lldb] [llgs] Remove not-really-used m_inferior_prev_state
Remove m_inferior_prev_state that's not suitable for multiprocess
debugging and that does not seem to be really used at all.
The only use of the variable right now is to "prevent" sending the stop
reason after attach/launch. However, this code is never actually run
since none of the process plugins actually use eStateLaunching or
eStateAttaching. Through adding an assert, I've confirmed that it's
never hit in any of the LLDB tests or while attaching/launching debugged
process via lldb-server and via lldb CLI.
Differential Revision: https://reviews.llvm.org/D128878
Sponsored by: The FreeBSD Foundation
Hans Wennborg [Thu, 14 Jul 2022 17:21:10 +0000 (19:21 +0200)]
Pass -DLIBXML2_INCLUDE_DIRS in the Windows release package script
As pointed out on https://reviews.llvm.org/D129571 this seems to
be the preferred variable to set.
Craig Topper [Thu, 14 Jul 2022 17:10:58 +0000 (10:10 -0700)]
[RISCV] Add a RISCV specific CodeGenPrepare pass.
Initial optimization is to convert (i64 (zext (i32 X))) to
(i64 (sext (i32 X))) if the dominating condition for the basic block
guaranteed the sign bit of X is zero.
This frequently occurs in loop preheaders where a signed induction
variable that can never be negative has been widened. There will be
a dominating check that the 32-bit trip count isn't negative or zero.
The check here is not restricted to that specific case though.
A i32->i64 sext is cheaper than zext on RV64 without the Zba
extension. Later optimizations can often remove the sext from the
preheader basic block because the dominating block also needs a sext to
evaluate the greater than 0 check.
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D129732
Tue Ly [Thu, 14 Jul 2022 14:43:32 +0000 (10:43 -0400)]
[libc] Add nearest integer instructions to fputil.
Add round to nearest integer instructions to fputil. This will be
used in sinf implementation https://reviews.llvm.org/D123154
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D129776
Fangrui Song [Thu, 14 Jul 2022 17:12:48 +0000 (10:12 -0700)]
[lldb] Remove ELF .zdebug support
clang 14 removed -gz=zlib-gnu support and ld.lld/llvm-objcopy removed zlib-gnu
support recently. Remove lldb support by migrating away from
llvm::object::Decompressor::isCompressedELFSection.
The API has another user llvm-dwp, so it is not removed in this patch.
Reviewed By: labath
Differential Revision: https://reviews.llvm.org/D129724