458660 Commits

Author SHA1 Message Date
Nathan Sidwell
f84ac48f1e [BOLT] Add BOLT_TARGETS_TO_BUILD
Adds BOLT_TARGETS_TO_BUILD, which defaults to the intersection of
X86;AArch64 and LLVM_TARGETS_TO_BUILD, but allows configuration to
alter that -- for instance omitting one of those two targets even if
llvm supports both.

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D148847
2023-04-21 13:07:04 -04:00
Lei Zhang
eca7698a97 [mlir][vector] NFC: Expose castAwayContractionLeadingOneDim
This commit exposes the transformation behind the pattern.
It is useful for more targeted application on a specific op
for once.

Reviewed By: kuhar

Differential Revision: https://reviews.llvm.org/D148758
2023-04-21 09:41:14 -07:00
Eric Gouriou
ca554ad7c2 [RISCV] NFC tweaks in extension descriptions, sorting
NFC changes in RISCISAInfo and RISCFeatures, and matching updates to the
MC tests.

- Drop the '.' in the parentheses section of the Zvk extension
  descriptions. This is supported by
<https://www.masterclass.com/articles/period-inside-or-outside-parentheses#>,
- Remove an extraneous space in the description of Zvt,
- Reorder the ImpliedExts.* constant literals in RISCISAInfo.cpp, as
  suggested in <https://reviews.llvm.org/D148483>.

Differential Revision: https://reviews.llvm.org/D148857
2023-04-21 17:39:44 +01:00
Nathan Sidwell
1c3653df08 [BOLT] Robustify compile-time config check
The BOLT runtime is specifically hard coded for x86_64 linux or x86_64
darwin. (Using x86_64 syscalls, hardcoding syscall numbers.)

Make it very clear this is for those specific pair of systems.

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D148825
2023-04-21 12:37:54 -04:00
Zibi Sarbinowski
ff46b84416 [SystemZ][z/OS] Make LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL available for external unwind library.
On z/OS, we need to pass the location of unwind interface header when building cxxabi. The cmake macro `LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL` is available for this purpose but it is only used with conjunction with `LIBCXXABI_USE_LLVM_UNWINDER`. For the external unwind library we need to use LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL unconditionally whenever it is set.

Reviewed By: #libc_abi, muiez, phosek, SeanP

Differential Revision: https://reviews.llvm.org/D147460
2023-04-21 11:36:30 -05:00
Aart Bik
86888e420c [mlir][sparse][gpu] generate proper memcpy in/out host and device
The host registration is a convenient way to get CUDA kernels
running, but it may be slow and does not work for all buffer
(like global constants). This revision uses the proper alloc
copy dealloc chains for buffers, using asynchronous chains
to increase overlap. The host registration mechanism is
kept under a flag for the output, just for experimentation
purposes while this project ramps up.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D148682
2023-04-21 09:30:42 -07:00
Alexey Bataev
851a12138a [SLP]Fix the cost for the extractelements, used in several nodes.
Currently the compiler calculates the compensation cost for the
extractelements, removed during vectorization. But if the extractelement
instruction is used in several nodes, we can calculate the compensation
for them several times.

Differential Revision: https://reviews.llvm.org/D148806
2023-04-21 09:05:03 -07:00
Nikita Popov
d003c01c30 [LV][IndVars] Move test to correct directory and regenerate (NFC)
For some reason, an IndVarSimplify test was in the LoopVectorize
directory.
2023-04-21 18:03:41 +02:00
LLVM GN Syncbot
e4ca96731c [gn build] Port 6c9066fe2ecc 2023-04-21 15:51:37 +00:00
Qiongsi Wu
887828d502 [CMake][AIX] Fixing AIX rpath
Recent commit 8f833f88ab modified the installation rpath and did not set `BUILD_WITH_INSTALL_RPATH` correctly on AIX, which led to installation failures on AIX. This patch sets `BUILD_WITH_INSTALL_RPATH` on AIX to fix the installation failures.

Reviewed By: buttaface, daltenty

Differential Revision: https://reviews.llvm.org/D148866
2023-04-21 11:41:27 -04:00
Florian Hahn
f10153fe91
[Matrix] Handle integer types when distributing transposes across adds.
The current code did not properly account for integer matrixes. Check
if the operands are floating point or integer matrixes and use FAdd/Add
accordingly.

This is already done for other cases, like multiplies.

Fixes #62281.
2023-04-21 16:35:11 +01:00
Adrian Prantl
737820e6d6 Make diagnostics API safer to use
I received a crash report in DiagnosticManager that was caused by a
nullptr diagnostic having been added. The API allows passing in a null
unique_ptr, but all the methods are written assuming that all pointers
a dereferencable. This patch makes it impossible to add a null
diagnostic.

rdar://107633615

Differential Revision: https://reviews.llvm.org/D148823
2023-04-21 08:21:56 -07:00
Momchil Velikov
6c9066fe2e Recommit "[AArch64] Fix incorrect isLegalAddressingMode"
This patch recommits 0827e2fa3fd15b49fd2d0fc676753f11abb60cab after
reverting it in ed7ada259f665a742561b88e9e6c078e9ea85224.  Added
workround for `Targetlowering::AddrMode` no longer being an aggregate
in C++20.

`AArch64TargetLowering::isLegalAddressingMode` has a number of
defects, including accepting an addressing mode, which consists of
only an immediate operand, or not checking the offset range for an
addressing mode in the form `1*ScaledReg + Offs`.

This patch fixes the above issues.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D143895

Change-Id: I41a520c13ce21da503ca45019979bfceb8b648fa
2023-04-21 16:21:01 +01:00
Zain Jaffal
872924fab4
[AArch64] Fix crash caused by performExtractVectorEltCombine on DUP nodes with float operands.
Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D148705
2023-04-21 16:20:03 +01:00
Alexey Bataev
403bd583a8 [SLP]Fix a crash on scalarized vectors.
Need to register in-vector for scalarized types to avoid crash in
further analysis.
2023-04-21 08:13:48 -07:00
Florian Hahn
0a0181dc20
[ConstraintElim] Fix integer overflow in ConstraintSystem::negate.
This fixes another integer overflow that was exposed by a variant of the
test case from #62226.
2023-04-21 16:09:46 +01:00
Simon Pilgrim
fed28ada47 [CostModel][X86] Add i64 MUL latency/codesize/size-latency cost estimates 2023-04-21 15:55:22 +01:00
Simon Pilgrim
ceccc59aac [CostModel][X86] Add i32 MUL latency/codesize/size-latency cost estimates 2023-04-21 15:42:41 +01:00
Simon Pilgrim
3e9d046bfc [CostModel][X86] Improve i16 and vXi16 MUL costs
Use a modified version of the D103695 script to determine more accurate throughput/latency/codesize/size-latency cost estimates
2023-04-21 15:42:40 +01:00
David Spickett
70d8c01e45 [lldb] Update QEMU git URL in setup.sh
The old name was maintained for a while but now it has been changed
to gitlab.
2023-04-21 14:31:39 +00:00
Jacek Caban
be17209052 [tests] Add missing REQUIRES: aarch64-registered-target to llvm-lib test
Fixes Buildbot failures introduced by eb56ef3edd9f1d21e625f0158dfc4edc48bd7349 and 85a2c50ec4979b87267e4f2068f2921beb0b98f2.

Reviewed By: TWeaver

Differential Revision: https://reviews.llvm.org/D148922
2023-04-21 17:27:30 +03:00
Tom Stellard
beaf46a42d [llvm-exegesis][AArch64] Only run tests on aarch64 hosts
The add-return.s test is failing on s390x.

See also e30ce634f75c01cc8784cb0c4972c42987178c1d.

Reviewed By: courbet

Differential Revision: https://reviews.llvm.org/D148807
2023-04-21 07:17:51 -07:00
Alexey Bataev
3b7d298322 [SLP][NFC]Make computeExtractCost a member of ShuffleCostEstimator, NFC.
Moved computeExtractCost to ShuffleCostEstimator class as another step
for unifying actual codegen/cost estimation for buildvectors.

Differential Revision: https://reviews.llvm.org/D148864
2023-04-21 06:52:53 -07:00
Alvin Wong
84144f488a [asan][test][win] Fix demangled_names test on MSVC target
Fix error with b5e3d131f9ed6687cacffb67de8f54214dd8d2b3 (D147444).
2023-04-21 21:49:05 +08:00
Felipe de Azevedo Piovezan
290494955c [coroutine] Salvage dbg.values in the original function as well
D97673 implemented salvaging o dbg.value inside coroutine funclets, but
left the original function untouched. Before, only dbg.addr and dbg.decl
would get salvaged.

D121324 implemented salvaging of dbg.addr and dbg.decl in the original
function as well, but not of dbg.values.

This patch unifies salvaging in the original function and related
funclets, so that all intrinsics are salvaged in all functions. This is
particularly useful for ABIs where the original function is also
rewritten to receive the frame pointer as an argument.

Differential Revision: https://reviews.llvm.org/D148745
2023-04-21 09:31:39 -04:00
Nikita Popov
4cdb91f9e7 [SCEV] Clarify inference in isAddRecNeverPoison()
The justification in isAddRecNeverPoison() no longer applies, as
it dates back to a time where LLVM had an unconditional forward
progress guarantee. However, we also no longer need it, because we
can exploit branch on poison UB instead.

For a single exit loop (without abnormal exits) we know that all
instructions dominating the exit will be executed, so if any of
them trigger UB on poison that means that addrec is not poison.

This is slightly stronger than the previous code, because a) we
don't need the exit to also be the latch and b) we don't need the
value to be used in the exit branch in particular, any UB-producing
instruction is fine.

I don't expect much practical impact from this change, this is
mainly to clarify the reasoning behind this logic.

Differential Revision: https://reviews.llvm.org/D148633
2023-04-21 15:31:00 +02:00
Doru Bercea
1a58c3d601 Avoid capping heap to stack optimization for __kmpc_alloc_shared allocations.
Review: https://reviews.llvm.org/D148849
2023-04-21 09:27:53 -04:00
Alvin Wong
b5e3d131f9 [asan][test][win] Port more tests to not use clang-cl on MinGW
Depends on D147432

Differential Revision: https://reviews.llvm.org/D147444
2023-04-21 21:25:54 +08:00
Alvin Wong
3c1aa20c63 [asan][test][win] Port trivial tests to not use clang-cl on MinGW
Use clang driver on MinGW where clang-cl is not usable. MSVC target
still uses clang-cl to minimize changes to existing test runners.

Differential Revision: https://reviews.llvm.org/D147432
2023-04-21 21:25:49 +08:00
Jay Foad
2b81ec3265 Revert "[ConstantFolding] Fix crash when folding vector llvm.is.fpclass"
This reverts commit 5fc6425fb6c77052a26cf0cf7b886449fabe1af4.

It is reported to cause other crashes that require a larger fix.
2023-04-21 14:01:06 +01:00
Jacek Caban
cea5d2870f [llvm-lib] [llvm-readobj] [llvm-cvtres] Add Support for ARM64X object files.
Similar to D125411, but for ARM64X.

ARM64X PE binaries are hybrids containing both ARM64EC and pure ARM64
variants in one file. They are usually linked by passing separate
ARM64EC and ARM64 object files to linker. Linked binaries use ARM64
machine and contain additional CHPE metadata in their load config.
CHPE metadata support is not part of this patch, I plan to send that later.

Using ARM64X as a machine type of object files themselves is somewhat
ambiguous, but such files are allowed by MSVC. It treats them as ARM64
or ARM64EC object, depending on the context. Such objects can be
produced with cvtres.exe -machine:arm64x.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D148517
2023-04-21 15:46:20 +03:00
Jacek Caban
85a2c50ec4 [llvm-nm] Print EC symbol map.
This is useful for examining ARM64EC static libraries and allows
better llvm-lib testing. Changes to Archive class will also be
useful for LLD to support ARM64EC, where it will need to use one
map or the other, depending on linking target (or both, in case of
ARM64X, but separately as they are in different namespaces).

Reviewed By: jhenderson, efriedma

Differential Revision: https://reviews.llvm.org/D146534
2023-04-21 15:46:19 +03:00
Jacek Caban
eb56ef3edd [llvm-lib] Add support for ARM64EC libraries.
ARM64EC allows having both pure ARM64 objects and ARM64EC in the
same archive. This allows using single static library for linking
pure ARM64, pure ARM64EC or mixed modules (what MS calls ARM64X:
a single module that may be used in both modes). To achieve that,
such static libraries need two separated symbol maps. The usual map
contains only pure ARM64 symbols, while a new /<ECSYMBOLS>/ section
contains EC symbols. EC symbols map has very similar format to the
usual map, except it doesn't contain object offsets and uses offsets
from regular map instead. This is true even for pure ARM64EC static
library: it will simply have 0 symbols in the symbol map.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D143541
2023-04-21 15:46:19 +03:00
Max Kazantsev
9d7785b2e9 [BasicBlockUtils][NFCI] Extract branch inverting to a separate method
The motivation is to make possible branch inverting code reuse.

Patch by Aleksandr Popov!

Differential Revision: https://reviews.llvm.org/D148708
2023-04-21 19:44:13 +07:00
Louis Dionne
1702ff3d12 [libc++] Fix likely rebase conflict that was not resolved properly 2023-04-21 08:37:47 -04:00
Nikita Popov
efd71ebea4 [LoopLoadElimination] Preserve DT and LI (NFCI)
This pass makes control-flow changes, but only via LoopSimplify
and LoopVersioning utilities, which perserve DT and LI.
2023-04-21 14:32:55 +02:00
Matt Arsenault
c55fffecce ValueTracking: Recognize >=, <= compares with 0 as is.fpclass masks
Leave DAZ handling for a future change.
2023-04-21 08:15:04 -04:00
Matt Arsenault
8e26a9029c InstCombine: Add some baseline tests for recognizing fcmp as is.fpclass
We should be able to recognize > 0, < 0 indicates the sign.
2023-04-21 08:15:03 -04:00
Ilya Biryukov
5ea158077e Revert "Reland [Modules] Remove unnecessary check when generating name lookup table in ASTWriter"
This reverts commit 67b298f6d82e0b4bb648ac0dabe895e816a77ef1.

We got linker errors with undefined symbols during a compiler release
and tracked it down to this change. I am in the process of understanding
what is happening and getting a reproducer.

Sorry for reverting this again.

I will reopen #61065 until we fix this.
2023-04-21 14:08:18 +02:00
Manuel Klimek
9e9e096ae9 [clang-format] Fix dropped 'else'.
'else' was dropped accidentally in 398cddf6acec.

Patch by Jared Grubb.

Differential revision: https://reviews.llvm.org/D146310
2023-04-21 11:59:45 +00:00
David Spickett
c9083bea16 [LLDB] Don't print register fields when asked for a specific format
Previously if a register had fields we would always print them after the
value if the register was asked for by name.
```
(lldb) register read MDCR_EL3
MDCR_EL3 = 0x00000000
         = {
             ETBAD = 0
<...>
             RLTE = 0
           }
```
This can be quite annoying if there are a whole lot of fields but you
want to see the register in a specific format.
```
(lldb) register read MDCR_EL3 -f i
MDCR_EL3 = 0x00000000   unknown     udf    #0x0
         = {
             ETBAD = 0
<...lots of fields...>
```
Since it pushes the interesting bit far up the terminal. To solve this,
don't print fields if the user passes --format. If they're doing that
then I think it's reasonable to assume they know what they want and only
want to see that output.

This also gives users a way to silence fields, but not change the format.
By doing `register read foo -f x`. In case they are not useful or perhaps
they are trying to work around a crash.

I have customised the help text for --format for register read to explain this:
```
-f <format> ( --format <format> )
     Specify a format to be used for display. If this is set, register fields will not be dispayed.
```

Reviewed By: jasonmolenda

Differential Revision: https://reviews.llvm.org/D148790
2023-04-21 11:47:05 +00:00
Jorge Pinto Sousa
7c00219235 [clang] trigger -Wcast-qual on functional casts
-Wcast-qual does not trigger on the following code in Clang, but does
in GCC.

const auto i = 42;
using T = int*;
auto p = T(&i);

The expected behavior is that a functional cast should trigger
the warning the same as the equivalent C cast because
the meaning is the same, and nothing about the functional cast
makes it easier to recognize that a const_cast is occurring.

Fixes https://github.com/llvm/llvm-project/issues/62083
Differential Revision: https://reviews.llvm.org/D148276
2023-04-21 07:45:05 -04:00
Alexis Engelke
5368c1065f [X86][FastISel] Handle CRC32 intrinsics
Some applications make heavy use of the crc32 operation (e.g., as part
of a hash function), so having a FastISel path avoids fallbacks to
SelectionDAG and improves compile times, in our case by ~1.5%.

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D148023
2023-04-21 13:40:48 +02:00
Max Kazantsev
b86b468731 [IRCE] Support non-strict range check's predicate
Patch by Aleksandr Popov!

Differential Revision: https://reviews.llvm.org/D148227
2023-04-21 18:33:30 +07:00
Nikita Popov
22a408ae51 [Pipelines] Don't explicitly require ORE
LICM does not use ORE from the pass manager, it constructs its
own instance. As such, explicitly requiring the analysis in the
pipeline is unnecessary.
2023-04-21 13:22:04 +02:00
Louis Dionne
692dd56e4b [libc++] Use $CXX instead of 'c++' in run-buildbot
We don't have `c++` anymore in the Docker image, but the script does
require $CXX to be in the environment so that should always work.

Differential Revision: https://reviews.llvm.org/D148830
2023-04-21 07:15:16 -04:00
Matt Arsenault
a7bf92a7cb ValueTracking: Add baseline tests for fma computeKnownFPClass 2023-04-21 07:02:55 -04:00
Matt Arsenault
b789ae0605 ValueTracking: Add tests for fneg/fabs computeKnownFPClass 2023-04-21 07:02:55 -04:00
Matt Arsenault
6966859059 ValueTracking: Implement computeKnownFPClass for fpext 2023-04-21 07:02:55 -04:00
Nikita Popov
384a8dd10e [Pipelines] Don't request BFI in LICM-only loop pass adaptors
LICM doesn't use BFI anymore, so requesting BFI in these loop
pass adaptors is just a waste of compile-time.
2023-04-21 12:55:12 +02:00