447894 Commits

Author SHA1 Message Date
Owen Anderson
ef9aa34f02 Revert "Remove the ThreadLocal template from LLVM."
This reverts commit 54d78b639b9c18b42abd4fac5c6e76105f06b3ef.
2023-01-09 21:21:38 -07:00
Owen Anderson
9a6e84fd21 Revert "Fix warning when building with GCC."
This reverts commit 971786254cc4093eb1c56625b8da0fd3544f6512.
2023-01-09 21:21:29 -07:00
Owen Anderson
971786254c Fix warning when building with GCC. 2023-01-09 21:19:17 -07:00
Owen Anderson
54d78b639b Remove the ThreadLocal template from LLVM.
This has been obsoleted by C++ thread_local for a long time.
As far as I know, Xcode was the last supported toolchain to add
support for C++ thread_local in 2016.

As a precaution, use LLVM_THREAD_LOCAL which provides even greater
backwards compatibility, allowing this to function even pre-C++11
versions of GCC.

Reviewed By: majnemer

Differential Revision: https://reviews.llvm.org/D141347
2023-01-09 21:12:27 -07:00
Joshua Cao
8d92a8226e [SCEV] Add llvm.experimental.guard conditions to applyLoopGuards()
Conditions for dominating branches and llvm.assumes are already
collected. This also adds conditions from guards.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D141243
2023-01-09 19:35:16 -08:00
hezuoqiang
e3b47d31ae [BOLT] Modify the print option to a meaningful value
Using the option `-print-sorted-by=.` cause to core dump, so change to a legal value.

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D140847
2023-01-09 19:05:21 -08:00
Chuanqi Xu
9cb1298dcc [NFC] Fix a test faliing in AIX
See https://reviews.llvm.org/D140867.

The signature of the constructor/destrucor of the global variables is
different in different targets. And the CHECKs in the test is
unavailable in other targets (e.g., AIX). So the patch tries to avoid
the test failure by requiring the target type.
2023-01-10 10:41:21 +08:00
Guozhi Wei
9852941f01 Revert "[GVN] Improve PRE on load instructions"
This reverts commit 1f1d501843e5cf8741599035d6ef66a3eb5e1e9e.

This patch caused several sanitizer tests failed. Revert it to unblock
others.
2023-01-10 02:35:35 +00:00
Jojo R
7546c96be3 [RISCV] Add codegen support for RISCV XTHeadVdot Extension
This patch adds codegen support for XTHeadVdot extension,
which is documented here, it's based on standard vector extension v1.0:
  https://github.com/T-head-Semi/thead-extension-spec

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D140771
2023-01-10 18:12:43 +08:00
jacquesguan
93f081c896 [mlir] Avoid crash of UnsignedWhenEquivalent for no integer type.
Fixes https://github.com/llvm/llvm-project/issues/59617.

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D141038
2023-01-10 10:05:02 +08:00
Kito Cheng
f4c887c3a8 [RISCV] Add H extension
`h` was the prefix of multi-letter extension name, but it become a
extension name in later RISC-V isa spec.

Fortunately we don't have any extension really defined is prefixed
with `h`, so we can just change that.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D136817
2023-01-10 09:52:03 +08:00
Casey Carter
915f2f16fb [libc++][test] Avoid MSVC constexpr bug
C++ constexpr allows a non-constant-expresssion lvalue to be used in a constant expression if it's not subject to lvalue-to-rvalue conversion. Subtly, this means you can make a constant-expression copy of a non-constant-expression object of empty type since the copy constructor doesn't perform lvalue-to-rvalue conversion. MSVC has had bugs with this usage forever, which will hopefully finally be mashed implementing C++23's relaxation on the use of pointers and references in constant expressions.

There's no need for this particular test to use this particular constexpr feature, we can simply make the predicates constant expressions.

Differential Revision: https://reviews.llvm.org/D141336
2023-01-09 17:48:04 -08:00
Philip Reames
a8d22190e2 [XCore] Use the newly introduced generic MEMBARRIER node [not quite nfc]
The target node being removed did not have side effects; the generic one does.  Nothing in the code indicates the lack was intentional, so this is probably fixing a bug.
2023-01-09 17:43:44 -08:00
KAWASHIMA Takahiro
6d0c3eb49d [AArch64] Add SVE int instructions to isAssociativeAndCommutative
Differential Revision: https://reviews.llvm.org/D140398
2023-01-10 10:39:49 +09:00
KAWASHIMA Takahiro
1088ef5cb0 [AArch64] Add SVE FP instructions to isAssociativeAndCommutative
Differential Revision: https://reviews.llvm.org/D140396
2023-01-10 10:39:48 +09:00
Philip Reames
aee3a6bcaf Add a space for readability [nfc] 2023-01-09 17:20:51 -08:00
Philip Reames
0dd3f30fe3 [X86] Reuse STDNone for MFENCE node [nfc] 2023-01-09 17:20:51 -08:00
Philip Reames
f412171f71 [VE] Use generic MEMBARRIER SDAG node [nfc] 2023-01-09 17:20:50 -08:00
Johannes Doerfert
900e80737e [OpenMP][FIX] Remove version specific check lines 2023-01-09 17:04:56 -08:00
Ron Lieberman
d179dfe8ce fix : add missing open brace [OpenMP][FIX] Avoid using an Error object after a std::move. 2023-01-09 19:52:16 -05:00
Craig Topper
64fae4d3b7 [RISCV] Add isel patterns to form tail undisturbed vwadd(u).wv from vwadd(u)_vl+vp_merge.
We use a special TIED instructions for vwadd(u).wv to avoid an
earlyclobber constraint preventing the first source and the destination
from being the same register.

This prevents our normal post process for forming TU instructions.
Add manual isel pattern instead. This matches what we do for FMA
for example.
2023-01-09 16:44:11 -08:00
Craig Topper
3f191770fa [RISCV] Update combineBinOp_VLToVWBinOp_VL to check the number users after we know what combine we're going to do.
If we're forming vwadd(u).wv we don't care if the already wide
source operand has additional users. It's not affected by the
transform.

Fixes #59345
2023-01-09 16:44:10 -08:00
Craig Topper
47cc1b9d29 [RISCV] Add test cases for PR59345. NFC
These tests show failure to form vwadd(u).wv instructions.

One of the operands of the add is already wide and has an
additional user. We are unnecessary enforcing that operand to
have a single use.
2023-01-09 16:44:10 -08:00
Johannes Doerfert
1b9ba5856a [Attributor] Allow cfg reasoning for thread-local objects
If an object (=memory) is thread-local we do not need to worry about
threading effects.
2023-01-09 16:40:20 -08:00
Johannes Doerfert
56be9123ca [Attributor][OpenMP][NFC] Cleanup tests via update script 2023-01-09 16:40:20 -08:00
Johannes Doerfert
afeeab1ff3 [OpenMP][NFC] Rerun the update_cc_test_checks on most OpenMP tests
The script changes over time and unrelated changes to the test check
lines should not pollute future revisions.
2023-01-09 16:40:20 -08:00
Jeff Niu
7ed242eecb [mlir][llvm] Don't mark CallIntrinsicOp as Pure
This is a function call to intrinsics with unknown side effects.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D141332
2023-01-09 16:21:15 -08:00
Xiang Li
78a73dda60 [DirectX backend] PartSize not include PartHeader
PartSize for a part in dx container is only the size of the content of the part, not include size of the PartHeader.

Differential Revision: https://reviews.llvm.org/D141207
2023-01-09 19:10:21 -05:00
Xiang Li
e3becfacfd [DirectX backend] Remove unused bitcode block for dxil
DXIL doesn't need uselist strtab and symtab blocks which are not supported  by llvm3.7 bitcode.

Differential Revision: https://reviews.llvm.org/D141328
2023-01-09 19:06:33 -05:00
Johannes Doerfert
bdcbf6c85d [OpenMP][FIX] Avoid using an Error object after a std::move.
The error was always a success even if the error case happened as the
std::move reseted the error object.
2023-01-09 16:03:52 -08:00
Johannes Doerfert
3071bdc327 [Intrinsics][FIX] Patchpoint intrinsics are not nocallback
Avoid the default attributes for these two special intrinsics.
Found as part of D141190.
2023-01-09 16:03:52 -08:00
Johannes Doerfert
c586d97310 [GVN][NFC] Precommit intrinsic bug test case, see D141190 2023-01-09 16:03:51 -08:00
Caroline Tice
2700d0d13a [AAUnderlyingObjects] Initialize an uninitialized boolean.
Recent commit introducing AA for getting underluying objects of a
pointer created an uninitialized boolean, which causes tests to fail
when built unter asan/ubsan. This initialized that variable.
2023-01-09 15:46:15 -08:00
Benjamin Kramer
38c481ddcb [GVN] Fold variable into assert. NFC
Avoids unused variable warnings when asserts are disabled.
2023-01-10 00:39:51 +01:00
Jonas Devlieghere
9b737f148d
[lldb] Limit trusting aranges to dSYMs only.
Limit trusting the arange accelerator tables (8b259fe573e1) to dSYMs
only, and not any debug info object file.

Differential revision: https://reviews.llvm.org/D141330
2023-01-09 15:38:05 -08:00
Nick Desaulniers
c20954dbab update_any_test_checks.py: run from any dir
Allow running llvm/utils/update_any_test_checks.py from working
directories other llvm/utils/.

Fixes:
$ ./llvm/utils/update_any_test_checks.py path/to/foo.ll
utils/update_llc_test_checks.py: not found (used in path/to/foo.ll)

Reviewed By: arichardson

Differential Revision: https://reviews.llvm.org/D140586
2023-01-09 15:36:15 -08:00
Stanislav Mekhanoshin
c8ed36281a [AMDGPU] Cast sub-dword elements to i32 in concat_vectors
This produces better code by avoiding repacking in some cases.

Fixes: SWDEV-373436

Differential Revision: https://reviews.llvm.org/D141329
2023-01-09 15:35:49 -08:00
Nick Desaulniers
b50327eea6 [llvm][PPCISelDAGToDAG] rename ppc-codegen to ppc-isel
Every other subclass of SelectionDAGISel calls this pass "<arch>-isel".
No existing tests refer to ppc-codegen so this is purely a cosmetic
change to bring the pass name in line with other architecture's
SelectionDAGISel subclasses.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D140497
2023-01-09 15:24:25 -08:00
Philip Reames
037636e695 [SDAG] Introduce a common MEMBARRIER node [nfc]
We have multiple targets which have defined custom instructions and sdag nodes to represent a compiler memory barrier. This patch consolidates the sdag node definition into common code.

This is a companion to D92842, but a bit different in focus. This change consolidates the existing sdag node definitions; that patch skipped defining a sdag node by instead going straight to a target node. That patch is also not NFC - as being so is quite hard for commoning up the instruction definitions.

I started with two backends to ensure the new common code was reusable while not having a massive diff. Once this lands, I'll submit a series of NFCs for backends where the changes are obvious, or reviews if more discussion is needed.

Differential Revision: https://reviews.llvm.org/D141317
2023-01-09 15:20:08 -08:00
Jeffrey Byrnes
596c558155 [AMDGPU] More selectively attach implicit operands to agpr spills
Implicit def operands are needed when we spill partially undef super registers by each individual subregister. The implicit-def operands will allow us to lower spills without the verifier complaining. Currently, we are overzeously attaching implicit operands, when we really only need them on the first sub reg spill op. By more selectively attached the implicit ops, we will free up some unneeded dependencies for the post-ra scheduler.

Moreover, this enables a previously incorrect optimization / resolves a correctness issue in indirectCopyToAGPR. When lowering AGPR copies on GFX908, we can improve CodeGen by reusing accvgpr_writes. However, we could not reliably determine which agprs accvgpr_writes actually define due to implicit-defs.

Differential Revision: https://reviews.llvm.org/D141101
2023-01-09 15:10:06 -08:00
Casey Carter
275ff33abf [libc++][test] _VSTD => std:: in test code
No `_VSTD` allowed in test code!

Differential Revision: https://reviews.llvm.org/D141269
2023-01-09 15:09:20 -08:00
Guozhi Wei
1f1d501843 [GVN] Improve PRE on load instructions
This patch implements the enhancement proposed by
https://github.com/llvm/llvm-project/issues/59312.

Suppose we have following code

   v0 = load %addr
   br %LoadBB

 LoadBB:
   v1 = load %addr
   ...

 PredBB:
   ...
   br %cond, label %LoadBB, label %SuccBB

 SuccBB:
   v2 = load %addr
   ...

Instruction v1 in LoadBB is partially redundant, edge (PredBB, LoadBB) is a
critical edge. SuccBB is another successor of PredBB, it contains another load
v2 which is identical to v1. Current GVN splits the critical edge
(PredBB, LoadBB) and inserts a new load in it. A better method is move the load
of v2 into PredBB, then v1 can be changed to a PHI instruction.

If there are two or more similar predecessors, like the test case in the bug
entry, current GVN simply gives up because otherwise it needs to split multiple
critical edges. But we can move all loads in successor blocks into predecessors.

Differential Revision: https://reviews.llvm.org/D139582
2023-01-09 23:08:41 +00:00
Nathan Ridge
056d4dca77 [clangd] Include the correct header for typeid()
Fixes https://github.com/clangd/clangd/issues/1449

Differential Revision: https://reviews.llvm.org/D141218
2023-01-09 18:07:07 -05:00
Casey Carter
96f1cd2427 [libc++][test] Silence MSVC warning
Our static analyzer likes to warn when loop bodies are never executed, which is true for `make_string<T>("")`. Build the result with `basic_string`'s iterator-pair constructor instead, which is simpler (one liner), faster (single pass), and doesn't trigger the warning.

Differential Revision: https://reviews.llvm.org/D141263
2023-01-09 15:05:31 -08:00
Adrian Prantl
f8d7ab8cf8 Return a shared_ptr from ScratchTypeSystemClang::GetForTarget()
The current interface theoretically could lead to a use-after-free
when a client holds on to the returned pointer. Fix this by returning
a shared_ptr to the scratch typesystem.

rdar://103619233

Differential Revision: https://reviews.llvm.org/D141100
2023-01-09 15:04:53 -08:00
Casey Carter
6b90f6745a [libc++][test] Make some string tests MSVC-friendly
* Using one-or-two letter names for globals is asking for shadowing warnings.
* MSVCSTL's container proxy allocations strike again
* MSVCSTL's `<string>` doesn't define `std::out_of_range`
* `basic_string::substr` takes two arguments of type `size_type`. Let's use that type instead of `size_t` and `ptrdiff_t` to avoid narrowing warnings.

Differential Revision: https://reviews.llvm.org/D141253
2023-01-09 15:00:07 -08:00
Kazu Hirata
9f4a9d3f44 [ProfileData] Fix a warning
This patch fixes:

  llvm/lib/ProfileData/SampleProfWriter.cpp💯10: error: unused
  variable 'OriginalFunctionCount' [-Werror,-Wunused-variable]
2023-01-09 14:59:25 -08:00
Stanislav Mekhanoshin
d562d30fb5 [AMDGPU] More tests for vector_shuffle.packed.ll. NFC.
Pre-commit tests before the next patch. Subtest shuffle_v16f16_concat
exposes the problem with suboptimal lowering.
2023-01-09 14:57:45 -08:00
Alex Brachet
230dba0ad3 [JumpThreading] Fix test to require asserts 2023-01-09 22:51:08 +00:00
bixia1
f3fd739d39 [mlir][sparse] Improve the rewriting for NewOp with dimension ordering.
Previously, we use a temporary tensor with identity ordering. We now use a
temporary tensor with the destination dimension ordering, to enable the use of
sort_coo for sorting the tensor.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D141295
2023-01-09 14:40:33 -08:00