Hanhan Wang [Fri, 21 Apr 2023 20:25:33 +0000 (13:25 -0700)]
[mlir][linalg] Expose lowerPack and lowerUnPack utils.
Reviewed By: qcolombet
Differential Revision: https://reviews.llvm.org/D148867
Arthur Eubanks [Fri, 21 Apr 2023 21:52:37 +0000 (14:52 -0700)]
[Lint] Remove legacy pass
Louis Dionne [Mon, 6 Mar 2023 21:43:34 +0000 (16:43 -0500)]
[libc++] Make std::allocator_arg and friends conforming in C++17
This patch makes global tag variables like std::allocator_arg
conform to C++17 by defining them as inline constexpr variables.
This is possible without creating an ODR violation now that we don't
define strong definitions of those variables in the shared library
anymore.
Differential Revision: https://reviews.llvm.org/D145589
Arthur Eubanks [Fri, 21 Apr 2023 20:34:11 +0000 (13:34 -0700)]
[Inliner] Remove -update-return-attrs flag
This is by default on and I don't see any reason to turn it off. There's also no testing of it.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D148956
Teresa Johnson [Fri, 21 Apr 2023 21:37:42 +0000 (14:37 -0700)]
Revert "[MemProf] Context disambiguation cloning pass [patch 2/3]"
This reverts commit
d0649a6ad8be778abf7569f502148d577f8bc6f1.
Reverting due to a number of bot failures that need investigation.
Teresa Johnson [Wed, 4 Jan 2023 04:19:57 +0000 (20:19 -0800)]
[MemProf] Context disambiguation cloning pass [patch 2/3]
Performs cloning on the CallsiteContextGraph (not on the IR or summary
index), in order to uniquely identify the allocation behavior of an
allocation call given its context. In order to do this, the graph is
recursively traversed starting from the allocation nodes, until we
identify a point where the allocation behavior is unambiguous (the edges
have a single allocation type). Nodes are then cloned as we unwind the
recursion. We try to perform the minimal amount of cloning required to
disambiguate the contexts.
The follow-on patch will contain the support for applying the cloning to
the IR.
Depends on D140908 and D145836.
Differential Revision: https://reviews.llvm.org/D140949
Jim Ingham [Fri, 21 Apr 2023 20:49:01 +0000 (13:49 -0700)]
Make sure SelectMostRelevantFrame happens only when returning to the user.
This is a user facing action, it is meant to focus the user's attention on
something other than the 0th frame when you stop somewhere where that's
helpful. For instance, stopping in pthread_kill after an assert will select
the assert frame.
This is not something you want to have happen internally in lldb, both
because internally you really don't want the selected frame changing out
from under you, and because the recognizers can do arbitrary work, and that
can cause deadlocks or other unexpected behavior.
However, it's not something that the current code does
explicitly after a stop has been delivered, it's expected to happen implicitly
as part of stopping. I changing this to call SMRF explicitly after a user
stop, but that got pretty ugly quickly.
So I added a bool to control whether to run this and audited all the current
uses to determine whether we're returning to the user or not.
Differential Revision: https://reviews.llvm.org/D148863
Fangrui Song [Fri, 21 Apr 2023 20:46:20 +0000 (13:46 -0700)]
[ELF][test] Test .glink code sequence and DT_PPC64_GLINK
Valentin Clement [Fri, 21 Apr 2023 20:22:28 +0000 (13:22 -0700)]
[flang][openacc] Fix the value of lower bound, upper bound and extent
Update the lowering to match the intent of the newly added operation
as described here D148860.
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D148932
Jason Molenda [Fri, 21 Apr 2023 20:16:50 +0000 (13:16 -0700)]
TestSTL was marked as skipped unconditionally in 2018, undo
It was avoiding a crash at the time on macOS, apparently, and
it skipped the test on all platforms. This test passes for me
now on macOS, let's remove the skip and see how the bots go.
Craig Topper [Fri, 21 Apr 2023 19:40:58 +0000 (12:40 -0700)]
[RISCV][Docs] Tweak the note about zicsr and zifencei since we now support version 2.1 of the base I specification.
Differential Revision: https://reviews.llvm.org/D148948
Diego Caballero [Fri, 21 Apr 2023 18:36:47 +0000 (18:36 +0000)]
[MLIR][Vector] Enable masked vectorizaton of contraction ops
This patch enables the vectorization of contraction ops using vector
masking. Support for vectorizing contractions is already there so this
is just adding contraction ops to the list of supported ops in
`vectorizeDynamicLinalgOpPrecondition` and adding a test.
Reviewed By: hanchung, awarzynski
Differential Revision: https://reviews.llvm.org/D148865
Sam McCall [Fri, 21 Apr 2023 19:07:17 +0000 (21:07 +0200)]
[dataflow] Don't crash in Environment::dump when decls have weird names
Joseph Huber [Fri, 21 Apr 2023 18:26:13 +0000 (13:26 -0500)]
[libc] Ignore unknown CUDA versions for `libc` targeting NVPTX
Summary:
We generally need a CUDA toolchain to build the tests for the GPU `libc`
targeting NVPTX. However, clang will commonly emit warnings on versions
that are too new. We can ignore these in `libc` since we are manually
specifying the `+ptx` version to use whenever we compile. So we do not
need to worry about unexpected changes and we do not depend on any newer
features. So this should not be problematic.
Joseph Huber [Fri, 21 Apr 2023 18:24:27 +0000 (13:24 -0500)]
[libc] Bump up sm_60's CUDA feature to +ptx63
Summary:
The sm_60 GPU is the oldest model that's supported for using the RPC
features of the `libc` GPU runtime. This also requires at least `+ptx63`
to enable use of the active mask. So, this patch sets that as the
minimum.
Shilei Tian [Fri, 21 Apr 2023 18:12:57 +0000 (14:12 -0400)]
[OpenMP] Enable the IDE support for the device runtime
Currently the device runtime is built as a custom target, which will not be included
in the compile commands. Those language servers using compile commands cannot
handle device runtime correctly.
In this patch, when `CMAKE_EXPORT_COMPILE_COMMANDS` is turned on, dummy
targets that will be excluded from all will be added. Those targets will not be
built or installed if we just simply do `make` or `make install`, but their
compilation will be included in the compile commands.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D148870
Nico Weber [Fri, 21 Apr 2023 18:07:17 +0000 (14:07 -0400)]
[gn] Port
f84ac48f1e83 (BOLT_TARGETS_TO_BUILD)
Alex Duran [Thu, 9 Mar 2023 23:46:24 +0000 (17:46 -0600)]
Fix an issue with th_task_state_memo_stack and proxy/helper tasks
When proxy or helper tasks were used in inactive parallel regions, no
memo of the th_task_state was stored in the stack, so th_task_state
became invalid. This change inserts an item in the memo stack to track
these th_task_states.
Patch by Alex Duran.
Differential Revision: https://reviews.llvm.org/D145736
Jan Svoboda [Fri, 21 Apr 2023 17:43:07 +0000 (10:43 -0700)]
[clang][deps] NFC: Refactor and comment ModuleDeps sorting
I once again stumbled across `IndexedModuleID` and was confused by the mutable `InputIndex` field.
This patch adds comments around that piece of code and unifies/simplifies related functions.
Reviewed By: Bigcheese
Differential Revision: https://reviews.llvm.org/D145197
Craig Topper [Fri, 21 Apr 2023 17:54:24 +0000 (10:54 -0700)]
[RISCV] Add Tag_RISCV_arch attribute by default when using clang as an assembler.
Can be disabled with -mno-default-build-attributes just like ARM.
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D148817
Nathan Sidwell [Thu, 20 Apr 2023 22:11:54 +0000 (18:11 -0400)]
[BOLT] Remove unneeded dyncasts
These checks are unnecessary -- we've already bailed if the format was wrong.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D148848
Jan Svoboda [Fri, 21 Apr 2023 15:58:36 +0000 (08:58 -0700)]
[clang] NFCI: Optimize storage and lookup of analyzer options
This patch moves `llvm::sort()` from `AnalyzerOptions` constructor to initialization of local static variable in `isUnknownAnalyzerConfig()`.
This avoids unnecessary work, which can speed up Clang tools that initialize lots of `CompilerInvocation`s (and therefore `AnalyzerOptions`).
Reviewed By: steakhal
Differential Revision: https://reviews.llvm.org/D137258
David Green [Fri, 21 Apr 2023 17:35:58 +0000 (18:35 +0100)]
[DAG][AArch64] Limit preferIncOfAddToSubOfNot until after legalization if the node has wrap flags
If the add node has wrap flags then they will be destroyed by converting to
sub/not. The flags can be useful in converting to rhadd, for example, but that
may be required late if the node types need to be legalized. This limits the
preferIncOfAddToSubOfNot fold until after legalize DAG if the node have flags
to allow more folding.
Differential Revision: https://reviews.llvm.org/D148809
Aaron Ballman [Fri, 21 Apr 2023 17:33:39 +0000 (13:33 -0400)]
Revert "[clang] trigger -Wcast-qual on functional casts"
This reverts commit
7c0021923503a9a5fe1ba1f0b778b5b83c42aa43.
It broke post-commit buildbots:
https://lab.llvm.org/buildbot/#/builders/37/builds/21631
Jonas Devlieghere [Fri, 21 Apr 2023 17:06:12 +0000 (10:06 -0700)]
[lldb] Let Mangled decide whether a name is mangled or not
We have a handful of places in LLDB where we try to outsmart the logic
in Mangled to determine whether a string is mangled or not. There's at
least one place (*) where we are getting this wrong and causes a subtle
bug. The `cstring_is_mangled` is cheap enough that we should always rely
on it to determine whether a string is mangled or not.
(*) `ObjectFileMachO` assumes that a symbol that starts with a double
underscore (such as `__pthread_kill`) is mangled. That's mostly
harmless, until you use `function.name-without-args` in the frame
format. The formatter calls `Symbol::GetNameNoArguments()` which is a
wrapper around `Mangled::GetName(ePreferDemangledWithoutArguments)`. The
latter will first try using the appropriate language plugin to get the
demangled name without arguments, and if that fails, falls back to
returning the demangled name. Because we forced Mangled to treat the
symbol as a mangled name (even though it's not) there's no demangled
name. The result is that frames don't show any symbol at all.
Differential revision: https://reviews.llvm.org/D148846
Razvan Lupusoru [Thu, 20 Apr 2023 22:48:57 +0000 (15:48 -0700)]
[mlir][openacc] Add descriptions for new acc data operations
The acc.bounds operation now clarifies that it is meant to be
zero-based. I added example for both C++ and Fortran to
show the normalized representation.
I also added description for each operand in the data entry
and data exit operations.
Reviewed By: clementval
Differential Revision: https://reviews.llvm.org/D148860
Momchil Velikov [Fri, 21 Apr 2023 16:34:54 +0000 (17:34 +0100)]
[NFC][CodeGenPrepare] Match against the correct instruction when checking profitability of folding an address
The "nested" `AddressingModeMatcher`s in
`AddressingModeMatcher::isProfitableToFoldIntoAddressingMode` are constructed
using the original memory instruction, even though they check whether the
address operand of a differrent memory instructon is foldable. The memory
instruction is used only for a dominance check (when not checking for
profitability), and using the wrong memory instruction does not change the
outcome of the test - if an address is foldable, the dominance test afects which
of the two possible ways to fold is chosen, but this result is discarded.
As an example, in
target triple = "x86_64-linux"
declare i1 @check(i64, i64)
define i32 @f(i1 %cc, ptr %p, ptr %q, i64 %n) {
entry:
br label %loop
loop:
%iv = phi i64 [ %i, %C ], [ 0, %entry ]
%offs = mul i64 %iv, 4
%c.0 = icmp ult i64 %iv, %n
br i1 %c.0, label %A, label %fail
A:
br i1 %cc, label %B, label %C
C:
%u = phi i32 [0, %A], [%w, %B]
%i = add i64 %iv, 1
%a.0 = getelementptr i8, ptr %p, i64 %offs
%a.1 = getelementptr i8, ptr %a.0, i64 4
%v = load i32, ptr %a.1
%c.1 = icmp eq i32 %v, %u
br i1 %c.1, label %exit, label %loop
B:
%a.2 = getelementptr i8, ptr %p, i64 %offs
%a.3 = getelementptr i8, ptr %a.2, i64 4
%w = load i32, ptr %a.3
br label %C
exit:
ret i32 -1
fail:
ret i32 0
}
the dominance test is perfomed between `%i = ...` and `%v = ...` at the moment
we're checking whether `%a3 = ...` is foldable
Using the memory instruction, which uses the interesting address is "more
correct" and this change is needed by a future patch.
Reviewed By: mkazantsev
Differential Revision: https://reviews.llvm.org/D143896
Nathan Sidwell [Thu, 20 Apr 2023 19:22:18 +0000 (15:22 -0400)]
[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
Lei Zhang [Fri, 21 Apr 2023 16:41:01 +0000 (09:41 -0700)]
[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
Eric Gouriou [Fri, 21 Apr 2023 16:37:46 +0000 (17:37 +0100)]
[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
Nathan Sidwell [Wed, 19 Apr 2023 20:07:25 +0000 (16:07 -0400)]
[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
Zibi Sarbinowski [Fri, 21 Apr 2023 16:29:36 +0000 (11:29 -0500)]
[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
Aart Bik [Wed, 19 Apr 2023 03:56:41 +0000 (20:56 -0700)]
[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
Alexey Bataev [Thu, 20 Apr 2023 14:11:48 +0000 (07:11 -0700)]
[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
Nikita Popov [Fri, 21 Apr 2023 16:02:29 +0000 (18:02 +0200)]
[LV][IndVars] Move test to correct directory and regenerate (NFC)
For some reason, an IndVarSimplify test was in the LoopVectorize
directory.
LLVM GN Syncbot [Fri, 21 Apr 2023 15:51:37 +0000 (15:51 +0000)]
[gn build] Port
6c9066fe2ecc
Qiongsi Wu [Fri, 21 Apr 2023 15:31:46 +0000 (11:31 -0400)]
[CMake][AIX] Fixing AIX rpath
Recent commit https://github.com/llvm/llvm-project/commit/
8f833f88ab78265a8e0ebb0d1522771d67c708a9 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
Florian Hahn [Fri, 21 Apr 2023 15:35:11 +0000 (16:35 +0100)]
[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.
Adrian Prantl [Fri, 21 Apr 2023 15:20:39 +0000 (08:20 -0700)]
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
Momchil Velikov [Fri, 21 Apr 2023 14:27:36 +0000 (15:27 +0100)]
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
Zain Jaffal [Fri, 21 Apr 2023 15:20:03 +0000 (16:20 +0100)]
[AArch64] Fix crash caused by performExtractVectorEltCombine on DUP nodes with float operands.
Reviewed By: dmgreen
Differential Revision: https://reviews.llvm.org/D148705
Alexey Bataev [Fri, 21 Apr 2023 14:44:36 +0000 (07:44 -0700)]
[SLP]Fix a crash on scalarized vectors.
Need to register in-vector for scalarized types to avoid crash in
further analysis.
Florian Hahn [Fri, 21 Apr 2023 15:09:46 +0000 (16:09 +0100)]
[ConstraintElim] Fix integer overflow in ConstraintSystem::negate.
This fixes another integer overflow that was exposed by a variant of the
test case from #62226.
Simon Pilgrim [Fri, 21 Apr 2023 14:55:22 +0000 (15:55 +0100)]
[CostModel][X86] Add i64 MUL latency/codesize/size-latency cost estimates
Simon Pilgrim [Fri, 21 Apr 2023 12:28:07 +0000 (13:28 +0100)]
[CostModel][X86] Add i32 MUL latency/codesize/size-latency cost estimates
Simon Pilgrim [Fri, 21 Apr 2023 09:31:24 +0000 (10:31 +0100)]
[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
David Spickett [Fri, 21 Apr 2023 14:30:51 +0000 (14:30 +0000)]
[lldb] Update QEMU git URL in setup.sh
The old name was maintained for a while but now it has been changed
to gitlab.
Jacek Caban [Fri, 21 Apr 2023 14:27:05 +0000 (17:27 +0300)]
[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
Tom Stellard [Fri, 21 Apr 2023 14:17:49 +0000 (07:17 -0700)]
[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
Alexey Bataev [Thu, 20 Apr 2023 18:48:44 +0000 (11:48 -0700)]
[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
Alvin Wong [Fri, 21 Apr 2023 13:46:58 +0000 (21:46 +0800)]
[asan][test][win] Fix demangled_names test on MSVC target
Fix error with
b5e3d131f9ed6687cacffb67de8f54214dd8d2b3 (D147444).
Felipe de Azevedo Piovezan [Wed, 19 Apr 2023 13:04:54 +0000 (09:04 -0400)]
[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
Nikita Popov [Tue, 18 Apr 2023 10:33:58 +0000 (12:33 +0200)]
[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
Doru Bercea [Thu, 20 Apr 2023 20:54:46 +0000 (16:54 -0400)]
Avoid capping heap to stack optimization for __kmpc_alloc_shared allocations.
Review: https://reviews.llvm.org/D148849
Alvin Wong [Mon, 3 Apr 2023 14:50:14 +0000 (22:50 +0800)]
[asan][test][win] Port more tests to not use clang-cl on MinGW
Depends on D147432
Differential Revision: https://reviews.llvm.org/D147444
Alvin Wong [Mon, 3 Apr 2023 08:37:31 +0000 (16:37 +0800)]
[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
Jay Foad [Fri, 21 Apr 2023 12:59:13 +0000 (13:59 +0100)]
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.
Jacek Caban [Fri, 21 Apr 2023 12:32:07 +0000 (15:32 +0300)]
[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
Jacek Caban [Fri, 21 Apr 2023 12:31:54 +0000 (15:31 +0300)]
[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
Jacek Caban [Fri, 21 Apr 2023 12:31:21 +0000 (15:31 +0300)]
[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
Max Kazantsev [Fri, 21 Apr 2023 12:06:06 +0000 (19:06 +0700)]
[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
Louis Dionne [Fri, 21 Apr 2023 12:37:35 +0000 (08:37 -0400)]
[libc++] Fix likely rebase conflict that was not resolved properly
Nikita Popov [Fri, 21 Apr 2023 12:31:59 +0000 (14:31 +0200)]
[LoopLoadElimination] Preserve DT and LI (NFCI)
This pass makes control-flow changes, but only via LoopSimplify
and LoopVersioning utilities, which perserve DT and LI.
Matt Arsenault [Wed, 19 Apr 2023 22:51:11 +0000 (18:51 -0400)]
ValueTracking: Recognize >=, <= compares with 0 as is.fpclass masks
Leave DAZ handling for a future change.
Matt Arsenault [Wed, 19 Apr 2023 23:08:29 +0000 (19:08 -0400)]
InstCombine: Add some baseline tests for recognizing fcmp as is.fpclass
We should be able to recognize > 0, < 0 indicates the sign.
Ilya Biryukov [Fri, 21 Apr 2023 11:49:27 +0000 (13:49 +0200)]
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.
Manuel Klimek [Fri, 21 Apr 2023 11:56:37 +0000 (11:56 +0000)]
[clang-format] Fix dropped 'else'.
'else' was dropped accidentally in
398cddf6acec.
Patch by Jared Grubb.
Differential revision: https://reviews.llvm.org/D146310
David Spickett [Thu, 20 Apr 2023 10:07:21 +0000 (10:07 +0000)]
[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
Jorge Pinto Sousa [Fri, 21 Apr 2023 11:45:05 +0000 (07:45 -0400)]
[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
Alexis Engelke [Fri, 10 Mar 2023 11:26:10 +0000 (12:26 +0100)]
[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
Max Kazantsev [Fri, 21 Apr 2023 10:58:16 +0000 (17:58 +0700)]
[IRCE] Support non-strict range check's predicate
Patch by Aleksandr Popov!
Differential Revision: https://reviews.llvm.org/D148227
Nikita Popov [Fri, 21 Apr 2023 11:15:15 +0000 (13:15 +0200)]
[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.
Louis Dionne [Thu, 20 Apr 2023 19:06:41 +0000 (15:06 -0400)]
[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
Matt Arsenault [Mon, 17 Apr 2023 18:48:50 +0000 (14:48 -0400)]
ValueTracking: Add baseline tests for fma computeKnownFPClass
Matt Arsenault [Wed, 19 Apr 2023 13:25:00 +0000 (09:25 -0400)]
ValueTracking: Add tests for fneg/fabs computeKnownFPClass
Matt Arsenault [Mon, 10 Apr 2023 02:18:03 +0000 (22:18 -0400)]
ValueTracking: Implement computeKnownFPClass for fpext
Nikita Popov [Fri, 21 Apr 2023 10:55:12 +0000 (12:55 +0200)]
[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.
Nikita Popov [Fri, 21 Apr 2023 10:42:22 +0000 (12:42 +0200)]
[NewGVN] Convert tests to opaque pointers (NFC)
Nikita Popov [Fri, 21 Apr 2023 10:40:36 +0000 (12:40 +0200)]
[NewGVN] Regenerate test checks (NFC)
Max Kazantsev [Fri, 21 Apr 2023 10:16:59 +0000 (17:16 +0700)]
[IRCE][NFCI] Refactor parseRangeCheckICmp
Simplify parseRangeCheckICmp:
- If RHS is loop-variant, swap LHS/RHS and swap predicate
- all checks are either IV >(=) const or IV <(=) RHS (maybe not const)
Patch by Aleksandr Popov!
Differential Revision: https://reviews.llvm.org/D148720
Igor Kirillov [Mon, 3 Apr 2023 16:22:01 +0000 (16:22 +0000)]
[CodeGen] Enable AArch64 SVE FCMLA/FCADD instruction generation in ComplexDeinterleaving
This commit adds support for scalable vector types in theComplexDeinterleaving
pass, allowing it to recognize and handle `llvm.vector.interleave2` and
`llvm.vector.deinterleave2` intrinsics for both fixed and scalable vectors
Differential Revision: https://reviews.llvm.org/D147451
Max Kazantsev [Fri, 21 Apr 2023 09:49:18 +0000 (16:49 +0700)]
[FlattenCFG] Replace branch condition with a created one correctly
Fix case when FlattenCFGOpt combines the conditions but doesn't update
branch with a new combined condition. It happens when one of the
combinable condition is inverted and has more then 1 user
Patch by Aleksandr Popov!
Differential Revision: https://reviews.llvm.org/D148707
Max Kazantsev [Fri, 21 Apr 2023 09:41:51 +0000 (16:41 +0700)]
[FlattenCFG] Add a test to demonstrate bug
FlattenCFGOpt combines the conditions but doesn't update branch with a
new combined condition. It happens when one of the combinable condition
is inverted and has more then 1 user.
Patch by Aleksandr Popov!
Differential Revision: https://reviews.llvm.org/D148706
Akshay Khadse [Fri, 21 Apr 2023 09:42:04 +0000 (17:42 +0800)]
[Coverity] Fix uninitialized scalar members in TableGen
This change fixes static code analysis warnings
Reviewed By: skan
Differential Revision: https://reviews.llvm.org/D148815
Nikolas Klauser [Fri, 13 Jan 2023 17:48:17 +0000 (18:48 +0100)]
[libc++][PSTL] Copy the headers into libc++
We decided to integrate the PSTL into our own headers and only share the backend impletementations. This is a first step in that direction, specifically it copies the PSTL headers into the libc++ structure.
Reviewed By: ldionne, #libc
Spies: rodgert, mikhail.ramalho, jplehr, bcain, h-vetinari, Mordante, rarutyun, var-const, sstefan1, pcwang-thead, libcxx-commits, arichardson, mgrang, miyuki
Differential Revision: https://reviews.llvm.org/D141779
Shengchen Kan [Fri, 21 Apr 2023 09:20:00 +0000 (17:20 +0800)]
[X86][tablgen] Fix typo in comments, NFC
Max Kazantsev [Fri, 21 Apr 2023 08:54:19 +0000 (15:54 +0700)]
[Test] Regenerate checks using update_test_checks.py
Carlos Alberto Enciso [Fri, 21 Apr 2023 08:11:40 +0000 (09:11 +0100)]
Revert "Reapply D146987 "[Assignment Tracking] Enable by default""
This reverts commit
b74aeaccbae876ca348aa87a3db05d444052ae65.
Note: The author (Orlando) asked to revert this commit.
Nikita Popov [Thu, 20 Apr 2023 12:59:27 +0000 (14:59 +0200)]
[OpenMP] Replace libomp_check_linker_flag with llvm_check_compiler_linker_flag
Replace the custom libomp_check_linker_flag() implementation with
llvm_check_compiler_linker_flag() from the common cmake utils. Due
to the way the custom implementation is implemented (capturing
output from an entire nested cmake invocation) it can easily end
up incorrectly detecting flags as unavailable, e.g. because "error",
"unknown" or similar occurs inside compiler flags, the directory
name, etc.
Fixes https://github.com/llvm/llvm-project/issues/62240.
Differential Revision: https://reviews.llvm.org/D148798
Andrzej Warzynski [Wed, 12 Apr 2023 19:44:13 +0000 (12:44 -0700)]
[mlir][linalg] Refine `tensor.extract` vectorisation
This patch updates the vectorisation of the extract Op so that the
permutation map for the transfer_read Op is defined explicitly by the
vectoriser (as opposed to being constructed implicitly by the
transfer_read builder).
This change is needed for cases where the rank of the source tensor is
lower than the rank of the output vector generated by the vectoriser:
```mlir
%17 = vector.transfer_read %arg1[%14, %16], %cst_4 {in_bounds = [true, true]} : tensor<257x24xf32>, vector<1x1x4xf32>
```
In cases like this, the vectorize will create the following permutation map:
```
(d0, d1) -> (0, d0, d1)
```
In other cases the behaviour remains unchanged.
Fixes https://github.com/openxla/iree/issues/13036. That's also where
the test case was extracted from.
Differential Revision: https://reviews.llvm.org/D148537
Jay Foad [Fri, 21 Apr 2023 07:28:05 +0000 (08:28 +0100)]
[AMDGPU] Avoid using tuple where pair does suffice
Fixes the following building errors, happening with official Android prebuilt clang 14 shipped with Android 13:
external/llvm-project/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:5491:13: error: no viable constructor or deduction guide for deduction of template arguments of 'tuple'
? std::tuple(HSAMD::V3::AssemblerDirectiveBegin,
^
...
external/llvm-project/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp:5493:13: error: no viable constructor or deduction guide for deduction of template arguments of 'tuple'
: std::tuple(HSAMD::AssemblerDirectiveBegin,
^
Fixes: 6443c0e ("[AMDGPU] Stop using make_pair and make_tuple. NFC.")
Patch by Mauro Rossi!
Differential Revision: https://reviews.llvm.org/D142839
Dominik Adamski [Fri, 14 Apr 2023 19:04:35 +0000 (14:04 -0500)]
[OpenMP][AMDGPU] Refactor setting uniform work group size attribute
Work group size attribute was set in Clang specific class. That's why
we cannot reuse this code in Flang.
If we move setting of this attribute to OpenMPIRBuilder, then we can reuse this
code in Flang and Clang. Function createOffloadEntry from OpenMPIRBuilder is
already used by Clang (via OpenMPIRBuilder::createOffloadEntriesAndInfoMetadata
function).
Differential Revision: https://reviews.llvm.org/D148525
Reviewed By: jdoerfert
Mehdi Amini [Fri, 21 Apr 2023 06:13:55 +0000 (00:13 -0600)]
Revert "Fix handling of special and large vals in expand pattern for `round`" and "Add pattern that expands `math.roundeven` into `math.round` + arith"
This reverts commit
8d2bae9abdc30e104bab00a4dd0f9d39f5bdda6e and
commit
ab2fc9521ec606603412645d4a4b3cf456acd153.
Tests are broken on Mac M2
Serguei Katkov [Fri, 14 Apr 2023 07:05:03 +0000 (14:05 +0700)]
[BreakFalseDeps] Respect dead blocks.
The pass uses ReachingDefAnalysis which has no information about
instructions in dead blocks.
So do not process them.
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D148329
Lang Hames [Fri, 21 Apr 2023 04:47:49 +0000 (21:47 -0700)]
[RuntimeDyld] Disable some ppc64 tests on 32-bit architectures.
These tests have been failing on 32-bit machines.
https://github.com/llvm/llvm-project/issues/62184.
Lang Hames [Fri, 21 Apr 2023 01:50:02 +0000 (18:50 -0700)]
[ORC-RT] Fix typo in include-guard comment.
Akshay Khadse [Fri, 21 Apr 2023 04:22:28 +0000 (12:22 +0800)]
Fix uninitialized scalar members in CodeGen
This change fixes some static code analysis warnings.
Reviewed By: LuoYuanke
Differential Revision: https://reviews.llvm.org/D148811
Shilei Tian [Fri, 21 Apr 2023 04:08:24 +0000 (00:08 -0400)]
[Attributor] Set up a dedicated simplification call back map for `GlobalVariable`
Currently we don't check call backs for global variable simplification.
What's more, the only way that we can register a simplification call back for
global variable is through its initializer (essentially a `Constant *`). It might
not correspond to the right global variable. In this patch, we set up a dedicated
simplification map for `GlobalVariable`.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D144749
Jie Fu [Fri, 21 Apr 2023 03:59:38 +0000 (11:59 +0800)]
[lldb] Fix -Wctad-maybe-unsupported in PathMappingList.cpp (NFC)
/home/jiefu/llvm-project/lldb/source/Target/PathMappingList.cpp:51:5: error: 'scoped_lock' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
std::scoped_lock locks(m_mutex, rhs.m_mutex);
^
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/mutex:692:11: note: add a deduction guide to suppress this warning
class scoped_lock
^
/home/jiefu/llvm-project/lldb/source/Target/PathMappingList.cpp:72:3: error: 'scoped_lock' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
std::scoped_lock locks(m_mutex, rhs.m_mutex);
^
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/mutex:692:11: note: add a deduction guide to suppress this warning
class scoped_lock
^
2 errors generated.
Akshay Khadse [Fri, 21 Apr 2023 03:41:42 +0000 (11:41 +0800)]
[Coverity] Fix uninitialized scalar members
This change fixes static code analysis errors
Reviewed By: LuoYuanke
Differential Revision: https://reviews.llvm.org/D148813