Owen Anderson [Tue, 10 Jan 2023 03:48:20 +0000 (20:48 -0700)]
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
Joshua Cao [Tue, 10 Jan 2023 03:24:50 +0000 (19:24 -0800)]
[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
hezuoqiang [Tue, 10 Jan 2023 03:03:05 +0000 (19:03 -0800)]
[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
Chuanqi Xu [Tue, 10 Jan 2023 02:36:50 +0000 (10:36 +0800)]
[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.
Guozhi Wei [Tue, 10 Jan 2023 02:35:35 +0000 (02:35 +0000)]
Revert "[GVN] Improve PRE on load instructions"
This reverts commit
1f1d501843e5cf8741599035d6ef66a3eb5e1e9e.
This patch caused several sanitizer tests failed. Revert it to unblock
others.
Jojo R [Fri, 30 Dec 2022 11:09:12 +0000 (19:09 +0800)]
[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
jacquesguan [Thu, 5 Jan 2023 09:06:35 +0000 (17:06 +0800)]
[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
Kito Cheng [Tue, 10 Jan 2023 01:51:07 +0000 (09:51 +0800)]
[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
Casey Carter [Tue, 10 Jan 2023 01:18:08 +0000 (17:18 -0800)]
[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
Philip Reames [Tue, 10 Jan 2023 01:41:31 +0000 (17:41 -0800)]
[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.
KAWASHIMA Takahiro [Mon, 12 Dec 2022 05:25:32 +0000 (14:25 +0900)]
[AArch64] Add SVE int instructions to isAssociativeAndCommutative
Differential Revision: https://reviews.llvm.org/D140398
KAWASHIMA Takahiro [Mon, 12 Dec 2022 05:25:32 +0000 (14:25 +0900)]
[AArch64] Add SVE FP instructions to isAssociativeAndCommutative
Differential Revision: https://reviews.llvm.org/D140396
Philip Reames [Tue, 10 Jan 2023 01:10:31 +0000 (17:10 -0800)]
Add a space for readability [nfc]
Philip Reames [Tue, 10 Jan 2023 01:09:34 +0000 (17:09 -0800)]
[X86] Reuse STDNone for MFENCE node [nfc]
Philip Reames [Tue, 10 Jan 2023 01:07:40 +0000 (17:07 -0800)]
[VE] Use generic MEMBARRIER SDAG node [nfc]
Johannes Doerfert [Tue, 10 Jan 2023 01:04:56 +0000 (17:04 -0800)]
[OpenMP][FIX] Remove version specific check lines
Ron Lieberman [Tue, 10 Jan 2023 00:52:16 +0000 (19:52 -0500)]
fix : add missing open brace [OpenMP][FIX] Avoid using an Error object after a std::move.
Craig Topper [Tue, 10 Jan 2023 00:35:44 +0000 (16:35 -0800)]
[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.
Craig Topper [Tue, 10 Jan 2023 00:31:15 +0000 (16:31 -0800)]
[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
Craig Topper [Tue, 10 Jan 2023 00:26:42 +0000 (16:26 -0800)]
[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.
Johannes Doerfert [Wed, 21 Dec 2022 00:13:41 +0000 (16:13 -0800)]
[Attributor] Allow cfg reasoning for thread-local objects
If an object (=memory) is thread-local we do not need to worry about
threading effects.
Johannes Doerfert [Fri, 6 Jan 2023 22:15:02 +0000 (14:15 -0800)]
[Attributor][OpenMP][NFC] Cleanup tests via update script
Johannes Doerfert [Sun, 8 Jan 2023 21:08:49 +0000 (13:08 -0800)]
[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.
Jeff Niu [Mon, 9 Jan 2023 23:49:14 +0000 (15:49 -0800)]
[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
Xiang Li [Sun, 8 Jan 2023 04:31:26 +0000 (23:31 -0500)]
[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
Xiang Li [Mon, 9 Jan 2023 22:45:53 +0000 (17:45 -0500)]
[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
Johannes Doerfert [Mon, 9 Jan 2023 21:03:28 +0000 (13:03 -0800)]
[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.
Johannes Doerfert [Mon, 9 Jan 2023 22:16:22 +0000 (14:16 -0800)]
[Intrinsics][FIX] Patchpoint intrinsics are not `nocallback`
Avoid the default attributes for these two special intrinsics.
Found as part of D141190.
Johannes Doerfert [Mon, 9 Jan 2023 22:14:01 +0000 (14:14 -0800)]
[GVN][NFC] Precommit intrinsic bug test case, see D141190
Caroline Tice [Mon, 9 Jan 2023 23:38:01 +0000 (15:38 -0800)]
[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.
Benjamin Kramer [Mon, 9 Jan 2023 23:39:51 +0000 (00:39 +0100)]
[GVN] Fold variable into assert. NFC
Avoids unused variable warnings when asserts are disabled.
Jonas Devlieghere [Mon, 9 Jan 2023 23:31:24 +0000 (15:31 -0800)]
[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
Nick Desaulniers [Mon, 9 Jan 2023 23:34:21 +0000 (15:34 -0800)]
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
Stanislav Mekhanoshin [Mon, 9 Jan 2023 22:19:46 +0000 (14:19 -0800)]
[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
Nick Desaulniers [Mon, 9 Jan 2023 23:24:19 +0000 (15:24 -0800)]
[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
Philip Reames [Mon, 9 Jan 2023 22:45:45 +0000 (14:45 -0800)]
[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
Jeffrey Byrnes [Fri, 6 Jan 2023 00:38:25 +0000 (16:38 -0800)]
[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
Casey Carter [Mon, 9 Jan 2023 10:39:06 +0000 (02:39 -0800)]
[libc++][test] _VSTD => std:: in test code
No `_VSTD` allowed in test code!
Differential Revision: https://reviews.llvm.org/D141269
Guozhi Wei [Mon, 9 Jan 2023 23:04:41 +0000 (23:04 +0000)]
[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
Nathan Ridge [Sun, 8 Jan 2023 08:18:13 +0000 (03:18 -0500)]
[clangd] Include the correct header for typeid()
Fixes https://github.com/clangd/clangd/issues/1449
Differential Revision: https://reviews.llvm.org/D141218
Casey Carter [Mon, 9 Jan 2023 09:38:14 +0000 (01:38 -0800)]
[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
Adrian Prantl [Mon, 9 Jan 2023 22:47:42 +0000 (14:47 -0800)]
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
Casey Carter [Mon, 9 Jan 2023 05:58:56 +0000 (21:58 -0800)]
[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
Kazu Hirata [Mon, 9 Jan 2023 22:59:25 +0000 (14:59 -0800)]
[ProfileData] Fix a warning
This patch fixes:
llvm/lib/ProfileData/SampleProfWriter.cpp:100:10: error: unused
variable 'OriginalFunctionCount' [-Werror,-Wunused-variable]
Stanislav Mekhanoshin [Mon, 9 Jan 2023 22:53:02 +0000 (14:53 -0800)]
[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.
Alex Brachet [Mon, 9 Jan 2023 22:51:08 +0000 (22:51 +0000)]
[JumpThreading] Fix test to require asserts
bixia1 [Mon, 9 Jan 2023 16:45:18 +0000 (08:45 -0800)]
[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
Jonas Devlieghere [Mon, 9 Jan 2023 22:33:39 +0000 (14:33 -0800)]
[lldb] Trust the arange accelerator tables in dSYMs
When ingesting aranges from a dSYM, always trust the contents of the
accelerator table since it always comes from dsymutil.
According to Instruments, skipping the decoding of all CU DIEs to get at
the DW_AT_ranges attribute removes ~3.5 seconds from setting a
breakpoint by file/line when debugging clang with a dSYM. Interestingly
on the wall clock the speedup is less noticeable, but still present.
rdar://problem/
56057688
Differential Revision: https://reviews.llvm.org/D68655
Teresa Johnson [Fri, 30 Dec 2022 15:47:12 +0000 (07:47 -0800)]
[MemProf] Fix combined index handling for locals
Since the linker does not resolve local symbols, we cannot look up
whether they are prevailing. The prior check was blocking all locals
from getting memprof summaries in the combined index.
Modified the existing test case to contain a local. This necessitated
some other fixes as the order of summary entries changed.
Differential Revision: https://reviews.llvm.org/D140786
William Huang [Thu, 29 Dec 2022 00:35:06 +0000 (00:35 +0000)]
[llvm-profdata] Add option to cap profile output size
Allow user to specify `--output-size-limit=n` to cap the size of generated profile to be strictly under n. Functions with the lowest total sample count are dropped first if necessary. Due to using a heuristic, excessive functions may be dropped to satisfy the size requirement
Reviewed By: snehasish
Differential Revision: https://reviews.llvm.org/D139603
Rafael A Herrera Guaitero [Mon, 9 Jan 2023 21:54:35 +0000 (15:54 -0600)]
OpenMPOpt: Check nested parallelism in target region
Analysis that determines if a parallel region can reach another parallel region in any target region of the TU.
A new global var is emitted with the name of the kernel + "_nested_parallelism", which is either 0 or 1 depending on the result.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D141010
Sanjay Patel [Mon, 9 Jan 2023 21:29:24 +0000 (16:29 -0500)]
[InstCombine] limit zext-of-icmp folds to bit-hacks
In the changed tests, we avoid creating extra instructions,
and there are no obvious regressions in IR tests at least.
Codegen should be able to create the shift+mask form if that
is profitable.
This is a more general fix for issue #59897 than
0eedc9e56712 .
Sanjay Patel [Mon, 9 Jan 2023 21:27:44 +0000 (16:27 -0500)]
[InstCombine] simplify code and fix formatting; NFC
Sanjay Patel [Mon, 9 Jan 2023 20:59:56 +0000 (15:59 -0500)]
[InstCombine] add tests for zext-of-icmp; NFC
Philip Reames [Mon, 9 Jan 2023 21:01:26 +0000 (13:01 -0800)]
[RISCV] Add -experimental-ztso test coverage
For the moment, this is the same as the default memory model.
Lei Zhang [Mon, 9 Jan 2023 20:58:26 +0000 (12:58 -0800)]
[mlir][spirv] Fix MLIR code snippet marker in TD files
Reviewed By: kuhar
Differential Revision: https://reviews.llvm.org/D141316
Tue Ly [Mon, 9 Jan 2023 20:54:50 +0000 (15:54 -0500)]
[libc][Obvious] Re-enable log10 tests.
Siva Chandra Reddy [Mon, 9 Jan 2023 20:25:52 +0000 (20:25 +0000)]
[libc][Obvious] Address few GCC warnings.
Tue Ly [Mon, 9 Jan 2023 20:11:24 +0000 (15:11 -0500)]
[libc][Obvious] Fix typos in LLVMLibCArchitectures.cmake defining target architectures.
Fix typos in LLVMLibCArchitectures.cmake defining target architectures.
Differential Revision: https://reviews.llvm.org/D141314
Fangrui Song [Mon, 9 Jan 2023 20:43:23 +0000 (12:43 -0800)]
[sanitizer] Don't intercept LFS64 symbols on musl
LFS64 symbols in musl are for glibc-ABI-compat and not intended for linking
(correct usage will not create LFS64 references). The next release 1.2.4 will
disallow linking against LFS64 symbols[1].
For sanitizers, let's just remove LFS64 interceptors. In case of erroneous LFS64
references, asan/tsan will detect fewer problems and msan may have false
positives.
[1]: https://git.musl-libc.org/cgit/musl/commit/?id=
246f1c811448f37a44b41cd8df8d0ef9736d95f4
Reviewed By: thesamesam
Differential Revision: https://reviews.llvm.org/D141186
Alex Brachet [Mon, 9 Jan 2023 20:24:16 +0000 (20:24 +0000)]
Revert "[libc] Templatize str{,n}cmp"
This reverts commit
c6dcbed2e5327f0c11962bdbbcd02f1b5c570fea.
Broke tests on arm and aarch64
Corentin Jabot [Wed, 2 Nov 2022 11:54:46 +0000 (12:54 +0100)]
[Clang] Correctly capture bindings in dependent lambdas.
Structured bindings were not properly marked odr-used
and therefore captured in generic lambddas.
Fixes #57826
It is unclear to me if further simplification can be gained
through the allowance described in
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0588r1.html.
Either way, I think this makes support for P0588 completes,
but we probably want to add test for that in a separate PR.
(and I lack confidence I understand P0588 sufficiently to assert
the completeness of our cnformance).
Reviewed By: aaron.ballman, #clang-language-wg
Differential Revision: https://reviews.llvm.org/D137244
Alex Brachet [Mon, 9 Jan 2023 20:16:20 +0000 (20:16 +0000)]
[libc] Move b* string functions to strings.h
Traditionally these functions are exposed in string*s*.h not string.h
Differential Revision: https://reviews.llvm.org/D141237
Alex Brachet [Mon, 9 Jan 2023 20:13:02 +0000 (20:13 +0000)]
[libc] Templatize str{,n}cmp
This will be used to implement the case insensitive str{,n}casecmp
Differential Revision: https://reviews.llvm.org/D141235
spupyrev [Tue, 27 Sep 2022 18:50:42 +0000 (11:50 -0700)]
[BOLT] introducing profi params
We want to use profile inference (**profi**) in BOLT for stale profile matching.
To this end, I am making a few changes modifying the interface of the algorithm.
This is the first change for existing usages of profi (e.g., CSSPGO):
- introducing an object holding the algorithmic parameters;
- some renaming of existing options;
- dropped unused option, SampleProfileInferEntryCount, as we don't plan to change its default value;
- no changes in the output / tests.
Reviewed By: hoy
Differential Revision: https://reviews.llvm.org/D134756
Fangrui Song [Mon, 9 Jan 2023 19:49:08 +0000 (19:49 +0000)]
[msan] Use SizeClassAllocator64 for AArch64
Now that D137666 requires 48-bit VMA for AArch64, we can switch to
SizeClassAllocator64 for a slightly more efficient allocator
(asan/lsan already switched by default).
It seems that we can pick kSpaceBeg = 0xE00000000000ULL to support both Linux
("app-15") and FreeBSD ("high memory").
Reviewed By: #sanitizers, vitalybuka
Differential Revision: https://reviews.llvm.org/D140792
Yitzhak Mandelbaum [Fri, 6 Jan 2023 13:34:12 +0000 (13:34 +0000)]
Revert "Revert "[clang][dataflow] Only model struct fields that are used in the function being analyzed.""
This reverts commit
2b1a517a92bfdfa3b692a660e19a2bb22513a567. It's a fix forward
with two memory errors fixed, one of which was the cause of the build breakage
in the buildbots.
Original message:
Previously, the model for structs modeled all fields in a struct when
`createValue` was called for that type. This patch adds a prepass on the
function under analysis to discover the fields referenced in the scope and then
limits modeling to only those fields. This reduces wasted memory usage
(modeling unused fields) which can be important for programs that use large
structs.
Note: This patch obviates the need for https://reviews.llvm.org/D123032.
Philip Reames [Mon, 9 Jan 2023 19:31:28 +0000 (11:31 -0800)]
[RISCV] Minor style cleanup in advance of D141311 [nfc]
Alexander Yermolovich [Mon, 9 Jan 2023 19:29:03 +0000 (11:29 -0800)]
[LLDB] Change formatting to use llvm::formatv
In preparation for eanbling 64bit support in LLDB switching to use llvm::formatv
instead of format MACROs.
Reviewed By: labath, JDevlieghere
Differential Revision: https://reviews.llvm.org/D139955
Heejin Ahn [Thu, 5 Jan 2023 23:04:02 +0000 (15:04 -0800)]
[WebAssembly] Ensure 'end_function' in functions
Local info is supposed to be emitted in the start of every function.
When there are locals, `.local` section should be present, and we emit
local info according to the section.
If there is no locals, empty local info should be emitted. This empty
local info is emitted whenever a first instruction is emitted within a
function without encountering a `.local` section. If there is no
instruction, `end_function` pseudo instruction should be present and the
empty local info will be emitted when parsing the pseudo instruction.
The following assembly is malformed because the function `test` doesn't
have an `end_function` at the end, and the parser doesn't end up
emitting the empty local info needed. But currently we don't error out
and silently produce an invalid binary.
```
.functype test () -> ()
test:
```
This patch adds one extra state to the Wasm assembly parser,
`FunctionLabel` to detect whether a function label is parsed but not
ended properly when the next function starts or the file ends.
It is somewhat tricky to distinguish `FunctionLabel` and
`FunctionStart`, because it is not always possible to ensure the state
goes from `FunctionLabel` -> `FunctionStart`. `.functype` directive does
not seem to be mandated before a function label, in which case we don't
know if the label is a function at the time of parsing. But when we do
know the label is function, we would like to ensure it ends with an
`end_function` properly. Also we would like to error out when it does
not.
For example,
```
.functype test() -> ()
test:
```
We should error out for this because we know `test` is a function and it
doesn't end with an `end_function`. This PR fixes this.
```
test:
```
We don't error out for this because there is no info that `test` is a
function, so we don't know whether there should be an `end_function` or
not.
```
test:
.functype test() -> ()
```
We error out for this currently already, because we currently switch to
`FunctionStart` state when we first see `.functype` directive after its
label definition.
Fixes https://github.com/llvm/llvm-project/issues/57427.
Reviewed By: sbc100
Differential Revision: https://reviews.llvm.org/D141103
Matt Arsenault [Mon, 9 Jan 2023 18:48:55 +0000 (13:48 -0500)]
AMDGPU: Use DataExtractor for printf string extraction
Attempt 2 to fix big endian bot failures.
Peiming Liu [Mon, 9 Jan 2023 17:45:00 +0000 (17:45 +0000)]
[mlir][sparse] remove redundant template parameter (NFC)
The template parameter is no longer needed after MutSparseTensorDescriptor
is implemented as a subclass of SparseTensorDescriptorImpl. The only purpose
for it was to enable SFINAE.
Reviewed By: bixia
Differential Revision: https://reviews.llvm.org/D141303
Philip Reames [Mon, 9 Jan 2023 19:00:11 +0000 (11:00 -0800)]
[RISCV] Consolidate test lines in fence lowering test
These are identical for RV32 and RV64.
Thurston Dang [Tue, 3 Jan 2023 21:47:51 +0000 (21:47 +0000)]
tsan: increase app mappings for aarch64 48-bit
Currently, tsan's memory mappings include 4GB
for high app, 20GB for mid app, and 8GB for low
app. The high app and mid app mappings are
too small for large programs, especially if ASLR
entropy (mmap_rnd_bits) is set higher. The low app
region (for non-PIE) is too small for some of tcmalloc's
internal tests (this does not affect normal apps,
since tsan will replace malloc).
This CL increases the memory mappings to 4TB for
high app, 1.3TB for mid app, and 10TB for low app. Note
that tsan's 44-bit pointer compression/decompression imposes
a 16TB limit on the combined size of the app mappings, making
this set of mappings more or less maximal.
Differential Revision: https://reviews.llvm.org/D140923
Augusto Noronha [Fri, 6 Jan 2023 23:17:25 +0000 (15:17 -0800)]
[lldb] Fix symbol table use after free
The symbol file stores a raw pointer to the main object file's symbol
table. This pointer, however, can be freed, if ObjectFile::ClearSymtab
is ever called. This patch makes sure out pointer to the symbol file
is valid before using it.
Philip Reames [Mon, 9 Jan 2023 18:07:17 +0000 (10:07 -0800)]
[RISCV] Add test coverage for singlethread fences
Alexey Bataev [Mon, 9 Jan 2023 17:49:12 +0000 (09:49 -0800)]
[SLP][NFC]Move getExtractIndex function for future changes, NFC.
Kazu Hirata [Mon, 9 Jan 2023 17:51:17 +0000 (09:51 -0800)]
[mlir] Fix a warning
This patch fixes:
mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp:947:13:
error: variable 'distributedDim' set but not used
[-Werror,-Wunused-but-set-variable]
Paul Kirth [Thu, 5 Jan 2023 20:32:25 +0000 (20:32 +0000)]
[lld-macho] Prevent assertions for aliases to weak_def_can_be_hidden symbols
In https://reviews.llvm.org/D137982 we found that on Mach-O private
aliases could trigger an assert in lld when the aliasee was a
weak_def_can_be_hidden symbol.
This appears to be incorrect, and should be allowed in Mach-O.
Disallowing this behavior is also inconsistent with how ld64 handles
a private alias to weak_def_can_be_hidden symbols.
This patch removes the assert and tests that LLD handles such aliases
gracefully.
Reviewed By: #lld-macho, int3
Differential Revision: https://reviews.llvm.org/D141082
Craig Topper [Mon, 9 Jan 2023 17:45:22 +0000 (09:45 -0800)]
[LocalStackSlotAllocation] Minor simplifications. NFC
Instead of maintaining a separate valid flag for BaseReg, Use
BaseReg.isValid(). I think this is left over from an older
implementation that maintained a vector of base registers.
The other change is not do a speculative assignment to BaseOffset
that needs to be reverted. Only commit it after we do the check.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D141153
Theodore Luo Wang [Mon, 9 Jan 2023 17:33:22 +0000 (17:33 +0000)]
[mlir] Print a newline when dumping Type
Fixes https://github.com/llvm/llvm-project/issues/59673
Reviewed By: mehdi_amini, Mogball
Differential Revision: https://reviews.llvm.org/D141201
Sanjay Patel [Mon, 9 Jan 2023 17:25:02 +0000 (12:25 -0500)]
[InstCombine] bitrev (zext i1 X) --> select X, SMinC, 0
https://alive2.llvm.org/ce/z/ZXCtgi
This breaks the infinite combine loop for issue #59897,
but we may still need more changes to avoid those loops.
Sanjay Patel [Mon, 9 Jan 2023 17:20:32 +0000 (12:20 -0500)]
[InstCombine] add tests for bitreverse of i1; NFC
Nikolas Klauser [Mon, 9 Jan 2023 17:15:17 +0000 (18:15 +0100)]
[libc++] Use %{clang-query} when calling clang-query
Ivan Kosarev [Mon, 9 Jan 2023 16:45:29 +0000 (16:45 +0000)]
[AMDGPU][NFC] Rename GFX10A16 operands.
They do not seem to be GFX10-specific anymore. Also renames the
corresponding feature.
Reviewed By: dp
Differential Revision: https://reviews.llvm.org/D141069
Valentin Clement [Mon, 9 Jan 2023 16:53:16 +0000 (17:53 +0100)]
[flang] Add runtime default initialization for polymorphic intent(out) dummy
This patch adds runtime default initialization for polymorphic
dummy argument. The dynamic type might require default initialization
but not the declared type.
Reviewed By: jeanPerier, PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D141278
Valentin Clement [Mon, 9 Jan 2023 16:52:14 +0000 (17:52 +0100)]
[flang] Handle emboxing of a fir.ref<none> to an unlimited polymorphic box
When an array element is extracted from an unlimited polymorphic array, the
emboxing of this element has to retrive the type code and element size from
the initial array. This patch retrive this information through the extracted
type descriptor.
This situation can be found in code like:
```
subroutine sub1(a)
class(*) :: a(:)
select type (x=>a(1))
type is (integer)
x = 10
end select
end subroutine
```
Reviewed By: jeanPerier, PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D141274
Florian Hahn [Mon, 9 Jan 2023 16:38:19 +0000 (16:38 +0000)]
[AArch64] Add additional reassociation test.
Add a test where the reassociation candidates are split across 2 blocks.
Jakub Kuderski [Mon, 9 Jan 2023 16:35:46 +0000 (11:35 -0500)]
[mlir][spirv] Account for type conversion failures in scf-to-spirv
Fixes: https://github.com/llvm/llvm-project/issues/59136
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D141292
Joseph Huber [Mon, 9 Jan 2023 16:02:28 +0000 (10:02 -0600)]
[OpenMP] Fix some tests failing with 'libgomp' as the default library
Summary:
There's some static checks on the library, we can't do offloading with
`libgomp` for OpenMP. This patch specifies the library for the tests to
avoid this breaking tests.
Nikita Popov [Mon, 9 Jan 2023 15:51:43 +0000 (16:51 +0100)]
[ConstantRange] Test 1 bit ranges in exhaustive tests (NFC)
There have been multiple cases where range calculations were wrong
in the 1 bit case. Make sure we catch these by not specifying the
bit width explicitly, and letting the test framework pick it (which
will now always test 1 and 4 bits both).
Alex Brachet [Mon, 9 Jan 2023 15:54:11 +0000 (15:54 +0000)]
[compiler-rt] Move up undefined macro checks
Previously HWCAP_ATOMIC and others were being used before checking if
they were defined. This moves up all the ifndef checks to define these
macros if they are not yet defined.
Differential Revision: https://reviews.llvm.org/D141285
Jakub Kuderski [Mon, 9 Jan 2023 15:50:06 +0000 (10:50 -0500)]
[mlir][spirv] Clean up transform pass definitions. NFC.
- Make naming more consistent.
- Drop unnecessary custom constructors definitions.
- Move pass documentation to pass descriptions.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D141159
Matthias Springer [Mon, 9 Jan 2023 15:46:01 +0000 (16:46 +0100)]
[mlir][vector] Distribute vector.insert op
In case the distributed dim of the dest vector is also a dim of the src vector, each lane inserts a smaller part of the source vector. Otherwise, one lane inserts the entire src vector and the other lanes do nothing.
Differential Revision: https://reviews.llvm.org/D137953
Jay Foad [Mon, 9 Jan 2023 14:47:09 +0000 (14:47 +0000)]
[AMDGPU] S_MULK_I32 does not define SCC. NFCI.
Differential Revision: https://reviews.llvm.org/D141281
Matthias Springer [Mon, 9 Jan 2023 15:40:32 +0000 (16:40 +0100)]
[mlir][vector] Distribute vector.insertelement op
In case of a distribution, only one lane inserts the scalar value. In case of a broadcast, every lane inserts the scalar.
Differential Revision: https://reviews.llvm.org/D137929
Matthias Springer [Mon, 9 Jan 2023 15:35:29 +0000 (16:35 +0100)]
[mlir][vector] Support vector.extract distribution of >1D vectors
Ops such as `%1 = vector.extract %0[2] : vector<5x96xf32>`.
Distribute the source vector, then extract. In case of a 1d extract, rewrite to vector.extractelement.
Differential Revision: https://reviews.llvm.org/D137646
Nikolas Klauser [Mon, 9 Jan 2023 15:37:31 +0000 (16:37 +0100)]
[libc++] Add missing include in __format/unicode.h
Nikita Popov [Mon, 9 Jan 2023 15:29:37 +0000 (16:29 +0100)]
[ConstantRange] Fix single bit abs range (PR59887)
For a full range input, we would produce an empty range instead
of a full range. The change to the SMin.isNonNegative() branch is
an optimality fix, because we should account for the potentially
discarded SMin value in the IntMinIsPoison case.
Change TestUnaryOpExhaustive to test both 4 and 1 bits, to both
cover this specific case in unit tests, and make sure all other
unary operations deal with 1-bit inputs correctly.
Fixes https://github.com/llvm/llvm-project/issues/59887.
Joe Loser [Mon, 9 Jan 2023 15:13:38 +0000 (08:13 -0700)]
[libc++][test] Fix missing include in `bit_ceil.fail.cpp`
The test uses `size_t` but does not include a header defining it. Include
`<cstddef>` which provides `size_t`.
Differential Revision: https://reviews.llvm.org/D141284