Shilei Tian [Wed, 28 Dec 2022 00:07:24 +0000 (19:07 -0500)]
[OpenMP] Introduce basic JIT support to OpenMP target offloading
This patch adds the basic JIT support for OpenMP. Currently it only works on Nvidia GPUs.
The support for AMDGPU can be extended easily by just implementing three interface functions. However, the infrastructure requires a small extra extension (add a pre process hook) to support portability for AMDGPU because the AMDGPU backend reads target features of functions. https://github.com/shiltian/llvm-project/commit/
02bc7effccc6ff2f5ab3fe5218336094c0485766#diff-321c2038035972ad4994ff9d85b29950ba72c08a79891db5048b8f5d46915314R432 shows how it roughly works.
As for the test, even though I added the corresponding code in CMake files, the test still cannot be triggered because some code is missing in the new plugin CMake file, which has nothing to do with this patch. It will be fixed later.
In order to enable JIT mode, when compiling, `-foffload-lto` is needed, and when linking, `-foffload-lto -Wl,--embed-bitcode` is needed. That implies that, LTO is required to enable JIT mode.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D139287
Dave Marchevsky [Tue, 27 Dec 2022 23:56:47 +0000 (15:56 -0800)]
MC: Add .data. and .rodata. prefixes to MCContext section classification
Commit
463da422f019 ("MC: make section classification a bit more
thorough") changed MCContext::getELFSection section classification logic
to default to SectionKind::getText (previously default was
SectionKind::getReadOnly) and added some matching based on section name
to determine internal section classification.
The BPF runtime implements global variables using 'BPF map'
datastructures, specifically the arraymap BPF map type. Global variables
in a section are placed in a single arraymap value at predictable byte
offsets. Variables in different sections are placed in separate
arraymaps, so in this example:
#define SEC(name) __attribute__((section(name)))
SEC(".data.A") u32 one;
SEC(".data.A") u32 two;
SEC(".data.B") u32 three;
SEC(".data.B") u32 four;
variables one and two would correspond to some byte offsets (probably 0
and 4) in one arraymap, while three and four would be in a separate
arraymap. Variables of a bpf_spin_lock type are considered to protect
next-generation BPF datastructure types in the same arraymap value and
there can only be a single bpf_spin_lock variable per arraymap value -
and thus per section.
As a result it's necessary to keep bpf_spin_locks and the datastructures
they guard in separate data sections. Before the aforementioned commit,
a section whose name starts with ".data." - like ".data.A" - would be
classified as SectionKind::getReadOnly, whereas after it is
SectionKind::getText. If 4-byte padding is required in such a section due to
alignment of some symbol within it, classification of the section as
SectionKind::getText will result in compilation of those variables to
BPF backend failing with an error like "unable to write nop sequence of
4 bytes". This is due to nop instruction emitted in
BPFAsmBackend::writeNopData being 8 bytes, so the function fails since
it cannot emit a 4-byte nop instruction.
Let's follow the pattern of matching section names starting with ".bss."
and ".tbss." prefixes resulting in proper classification of the section
as data by adding similar matches for ".data." and ".rodata." prefixes.
This will bring padding behavior for these sections back to what it was
before that commit and fix the crash.
Differential Revision: https://reviews.llvm.org/D138477
Weverything [Tue, 27 Dec 2022 23:23:28 +0000 (15:23 -0800)]
[libc++] Remove self-include from header file NFC
Florian Hahn [Tue, 27 Dec 2022 23:24:21 +0000 (23:24 +0000)]
[IVUsers] Precommit test for zext SCEV invalidation issue.
Test case for issue reported by @uabelho and #59721
Florian Hahn [Tue, 27 Dec 2022 23:01:40 +0000 (23:01 +0000)]
[LV] Convert a few tests to use opaque pointers (NFC).
Pavel Iliin [Wed, 21 Dec 2022 11:29:53 +0000 (11:29 +0000)]
Reland "[AArch64] FMV support and necessary target features dependencies."
This relands commits
e43924a75145d2f9e722f74b673145c3e62bfd07,
a43f36142c501e2d3f4797ef938db4e0c5e0eeec,
bf94eac6a3f7c5cd8941956d44c15524fa3751bd with MSan buildbot
https://lab.llvm.org/buildbot/#/builders/5/builds/30139
use-of-uninitialized-value errors fixed.
Differential Revision: https://reviews.llvm.org/D127812
Peiming Liu [Tue, 27 Dec 2022 18:23:21 +0000 (18:23 +0000)]
[mlir][sparse] refactoring loop emitter into its own files.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D140701
Aart Bik [Fri, 23 Dec 2022 01:20:52 +0000 (17:20 -0800)]
[sparse][mlir][vectorization] add support for shift-by-invariant
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D140596
Florian Hahn [Tue, 27 Dec 2022 18:08:31 +0000 (18:08 +0000)]
[LV] Sink scalar operands and merge regions repeatedly.
Merging regions can enable new sinking opportunities (e.g. if users of a
scalar value are moved from different VPBBs into the same VPBB). Sinking
in turn can also enable new merging opportunities (e.g. if a recipe
between to merge-able regions is moved.
To enable more sinking opportunities, repeat sinking & merging if
regions could be merged.
Also fix mergeReplicateRegions to return the correct Changed status.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D139788
Craig Topper [Tue, 27 Dec 2022 17:41:29 +0000 (09:41 -0800)]
[RISCV] Use SmallVector::append to replace some for loops in intrinsic creation. NFC
Reviewed By: eopXD
Differential Revision: https://reviews.llvm.org/D140678
zhongyunde [Tue, 27 Dec 2022 17:17:55 +0000 (01:17 +0800)]
[AArch64][MachineScheduler] Set no side effect for movprfx
The movprfx is a vector copy, so it doesn't access memory. Set the
value of hasSideEffects 0 to avoid return true for the hasUnmodeledSideEffects(),
which will block the machine scheduler which load/store instructions.
Reviewed By: paulwalker-arm
Differential Revision: https://reviews.llvm.org/D140680
Schuyler Eldridge [Thu, 22 Dec 2022 22:34:27 +0000 (17:34 -0500)]
[mlir] Fix missing OpInterface docs newline
Fix incorrect markdown generated by mlir-tblgen for an InterfaceMethod
that includes a body. Previously, this would cause the next method to
show up on the same line and produce incorrect markdown. Newlines would
only be added if the method did _not_ provide a body. E.g., previously
this was generating markdown like:
some function comment#### `next method`
This change makes this generate as:
some function comment
#### `next method`
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D140590
Nikita Popov [Tue, 27 Dec 2022 16:00:24 +0000 (17:00 +0100)]
[InstCombine] Remove redundant evaluateGEPOffsetExpression() fold (NFCI)
If we go through the generic EmitGEPOffset code, the resulting
expression can be (and is) reduced in the same way this code did
manually. There are no changes in lit tests or llvm-test-suite.
This fold predates the time where we started adding nsw to the adds
created by EmitGEPOffset, so it was likely needed back then.
This might not actually be NFC due to worklist order changes etc.
Nikita Popov [Tue, 27 Dec 2022 15:34:04 +0000 (16:34 +0100)]
[InstCombine] Convert test to opaque pointers (NFC)
Slightly adjust the test so it uses non-zero GEP indices, otherwise
these would get folded away with opaque pointers.
Nikita Popov [Tue, 27 Dec 2022 15:22:10 +0000 (16:22 +0100)]
[InstCombine] Convert some tests to opaque pointers (NFC)
Check lines for these were regenerated, but without any
significant changes (mostly different GEP source element types).
Nikita Popov [Tue, 27 Dec 2022 15:21:31 +0000 (16:21 +0100)]
[InstCombine] Regenerate test checks (NFC)
Nikita Popov [Tue, 27 Dec 2022 15:19:13 +0000 (16:19 +0100)]
Revert "[InstCombine] Convert some tests to opaque pointers (NFC)"
This reverts commit
66cea84681e16f3d4ebdc69031824b114a0d5681.
I did not intend to commit all the changes in here, but only the
ones with no significant differences.
Nikita Popov [Tue, 27 Dec 2022 14:49:19 +0000 (15:49 +0100)]
[InstCombine] Convert some tests to opaque pointers (NFC)
Nicolas Vasilache [Tue, 27 Dec 2022 14:14:58 +0000 (06:14 -0800)]
[mlir][Linalg] Properly propagate transform result in ScalarizeOp
Denis Antrushin [Tue, 29 Nov 2022 11:47:35 +0000 (18:47 +0700)]
[RS4GC] Rematerialize derived pointers before uses.
Introduce an option to rematerialize derived pointers immediately
before their uses instead of after every statepoint. This can be
beneficial when pointer is live across many statepoints but has
few uses.
Initial implementation is simple and rematerializes derived pointer
before every use, even if there are several uses in the same block
or rematerialization instructions can be hoisted etc.
Transformation is considered profitable if we would insert less
instructions than we would insert after every live statepoint.
Depends on D138910, D138911
Reviewed By: anna, skatkov
Differential Revision: https://reviews.llvm.org/D138912
Alexey Bataev [Tue, 27 Dec 2022 13:12:16 +0000 (05:12 -0800)]
[SLP]Fix PR59693: Do not crash trying to set insert point for buildvector
of extractvalues.
No need to get the last instruction only for vectorized extractvalues,
for gathered(buildvector sequence) still need to get the insertion
point.
Nicolas Vasilache [Tue, 27 Dec 2022 13:47:02 +0000 (05:47 -0800)]
[mlir] NFC - Expose scf::canonicalizeMinMaxOp
Nikita Popov [Tue, 27 Dec 2022 11:20:05 +0000 (12:20 +0100)]
Reapply [MergedLoadStoreMotion] Convert tests to opaque pointers (NFC)
Reapply after reapplying dependent revision.
Nikita Popov [Tue, 27 Dec 2022 12:09:25 +0000 (13:09 +0100)]
[LoadStoreVectorizer] Convert tests to opaque pointers (NFC)
Nikita Popov [Tue, 27 Dec 2022 11:57:52 +0000 (12:57 +0100)]
[LoadStoreVectorize] Regenerate test checks (NFC)
Nikita Popov [Tue, 27 Dec 2022 11:53:30 +0000 (12:53 +0100)]
[LoadStoreVectorizer] Convert some tests to opaque pointers (NFC)
Nikita Popov [Tue, 27 Dec 2022 11:52:22 +0000 (12:52 +0100)]
[LoopBoundSplit] Convert tests to opaque pointers (NFC)
Nikita Popov [Tue, 27 Dec 2022 11:17:58 +0000 (12:17 +0100)]
Reapply [MergeLoadStoreMotion] Don't require GEP for sinking
Reapply with a fix for a failing debuginfo assignment tracking test.
-----
Allow sinking stores where both operands are the same, don't require
them to have an identical GEP in each block.
This came up when migrating tests to opaque pointers, where
zero-index GEPs are omitted.
Nikita Popov [Tue, 27 Dec 2022 11:44:17 +0000 (12:44 +0100)]
[GVNHoist] Make test more robust (NFC)
Make sure these stores cannot be sunk, which might defeat the
intent of the test.
Nikita Popov [Tue, 27 Dec 2022 11:37:49 +0000 (12:37 +0100)]
Revert "[MergeLoadStoreMotion] Don't require GEP for sinking"
I missed a test failure in the DebugInfo directory.
This reverts commit
2c15b9d9e1a898cfd849db81b36d278eac3ef24e.
This reverts commit
fb435e1cb5842e1437436e9e7378dfc4106fdad8.
Nikita Popov [Tue, 27 Dec 2022 11:20:05 +0000 (12:20 +0100)]
[MergedLoadStoreMotion] Convert tests to opaque pointers (NFC)
Nikita Popov [Tue, 27 Dec 2022 11:17:58 +0000 (12:17 +0100)]
[MergeLoadStoreMotion] Don't require GEP for sinking
Allow sinking stores where both operands are the same, don't require
them to have an identical GEP in each block.
This came up when migrating tests to opaque pointers, where
zero-index GEPs are omitted.
Nikita Popov [Tue, 27 Dec 2022 11:03:59 +0000 (12:03 +0100)]
[MergedLoadStoreMotion] Add tests for store without GEPs (NFC)
MergedLoadStoreMotion currently only handles the case where each
store has it's own GEP. It fails to handle the case where the
store argument is exactly the same.
Nikita Popov [Tue, 27 Dec 2022 10:52:33 +0000 (11:52 +0100)]
[Tests] Rename InstMerge -> MergedLoadStoreMotion (NFC)
These are tests for the MergeLoadStoreMotion pass, so name them
accordingly.
Guillaume Chatelet [Tue, 27 Dec 2022 08:25:32 +0000 (08:25 +0000)]
[reland][libc][NFC] Add -fno-lax-vector-conversions compilation flag
Now that
a3d2c344773cc4fc95136fd67245880b34d8e335 has been submitted.
Guillaume Chatelet [Tue, 27 Dec 2022 10:16:23 +0000 (10:16 +0000)]
[libc][NFC] Fix lax vector conversion for aarch64
Nikita Popov [Tue, 27 Dec 2022 09:57:34 +0000 (10:57 +0100)]
[InterleavedAccess] Convert tests to opaque pointers (NFC)
Nikita Popov [Tue, 27 Dec 2022 09:56:49 +0000 (10:56 +0100)]
[LCSSA] Convert tests to opaque pointers (NFC)
Nikita Popov [Tue, 27 Dec 2022 09:54:35 +0000 (10:54 +0100)]
[Internalize] Convert tests to opaque pointers (NFC)
Nikita Popov [Tue, 27 Dec 2022 09:53:42 +0000 (10:53 +0100)]
[InferFunctionAttrs] Convert tests to opaque pointers (NFC)
serge-sans-paille [Mon, 26 Dec 2022 08:19:09 +0000 (09:19 +0100)]
[clang] Use a StringRef instead of a raw char pointer to store builtin and call information
This avoids recomputing string length that is already known at compile time.
It has a slight impact on preprocessing / compile time, see
https://llvm-compile-time-tracker.com/compare.php?from=
3f36d2d579d8b0e8824d9dd99bfa79f456858f88&to=
e49640c507ddc6615b5e503144301c8e41f8f434&stat=instructions:u
This a recommit of
e953ae5bbc313fd0cc980ce021d487e5b5199ea4 and the subsequent fixes
caa713559bd38f337d7d35de35686775e8fb5175 and
06b90e2e9c991e211fecc97948e533320a825470.
The above patchset caused some version of GCC to take eons to compile clang/lib/Basic/Targets/AArch64.cpp, as spotted in
aa171833ab0017d9732e82b8682c9848ab25ff9e.
The fix is to make BuiltinInfo tables a compilation unit static variable, instead of a private static variable.
Differential Revision: https://reviews.llvm.org/D139881
Guillaume Chatelet [Tue, 27 Dec 2022 08:30:19 +0000 (08:30 +0000)]
Revert "[libc][NFC] Add -fno-lax-vector-conversions compilation flag"
This breaks aarch64 build.
This reverts commit
32f4c3f1033e32b7d2b7ba310c46c8c0d4013eb0.
Guillaume Chatelet [Tue, 27 Dec 2022 08:25:32 +0000 (08:25 +0000)]
[libc][NFC] Add -fno-lax-vector-conversions compilation flag
eopXD [Thu, 22 Dec 2022 09:20:09 +0000 (01:20 -0800)]
[NFC][Clang][RISCV] Rename data member 'DefaultPolicy' to 'PolicyAttrs'
The naming here is strange since the value may still be updated.
Reviewed By: kito-cheng, khchen
Differential Revision: https://reviews.llvm.org/D140389
Shilei Tian [Tue, 27 Dec 2022 02:39:33 +0000 (21:39 -0500)]
[RFC][OpenMP] Update to Python3 for lit test
I think it's reasonable to upgrade to Python 3 for LIT test requirement because `lit` itself (`llvm/utils/lit/lit.py`) already switched to Python 3. In addition, LLVM already requires Python 3.6 to be the minimum version (https://llvm.org/docs/GettingStarted.html#software).
Reviewed By: jdoerfert, jhuber6
Differential Revision: https://reviews.llvm.org/D139855
Max Kazantsev [Tue, 27 Dec 2022 01:58:12 +0000 (08:58 +0700)]
[Test] Add tests with logical AND/OR
Fangrui Song [Tue, 27 Dec 2022 01:37:03 +0000 (17:37 -0800)]
[mlir] Include type_traits to support latest libc++
for std::make_unsigned_t
Nikolas Klauser [Tue, 20 Dec 2022 20:13:12 +0000 (21:13 +0100)]
[libc++] Granularize <type_traits> includes in <iterator>
Reviewed By: Mordante, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D140621
Kai Sasaki [Tue, 27 Dec 2022 00:30:00 +0000 (09:30 +0900)]
[mlir] Typos in affine dialect
Florian Hahn [Mon, 26 Dec 2022 22:46:24 +0000 (22:46 +0000)]
[VPlan] Remove redundant blocks by merging them into predecessors.
Add and run VPlan transform to fold blocks with a single predecessor
into the predecessor. This remove redundant blocks and addresses a TODO
to replace special handling for the vector latch VPBB.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D139927
Roman Lebedev [Mon, 26 Dec 2022 20:45:37 +0000 (23:45 +0300)]
[DAGCombine] `combineShuffleToZeroExtendVectorInReg()`: widen shuffle elements before trying to match
We might have sunk a bitcast into shuffle, and now it might be operating
on more fine-grained elements than what we'd match, so we must not be
dependent on whatever the granularity the shuffle happened to be in,
but transform it into the one canonical for us - with widest elements.
Roman Lebedev [Mon, 26 Dec 2022 21:41:59 +0000 (00:41 +0300)]
[NFC][X86] Add some tests that can be matched as ZERO_EXTEND_VECTOR_INREG
Roman Lebedev [Mon, 26 Dec 2022 19:49:01 +0000 (22:49 +0300)]
[DAG] `combineShuffleToZeroExtendVectorInReg()`: try to match w/ commuted operands
We don't have any reason to expect that the operand we will match
is on any particular hand of the shuffle, so we should try both.
Roman Lebedev [Mon, 26 Dec 2022 18:46:20 +0000 (21:46 +0300)]
[AArch64] Custom lower `ISD::ZERO_EXTEND_VECTOR_INREG`
The baseline legalization for `ISD::ZERO_EXTEND_VECTOR_INREG`
(`VectorLegalizer::ExpandZERO_EXTEND_VECTOR_INREG`),
blends-in the zeros, but as mentioned e.g.
in
b4bd0a404fe26071dab0854dfd9767974909c7c4,
there is no such thing for AArch64.
So some of the shuffles that would be nicely lowered
by `LowerVECTOR_SHUFFLE()`, e.g. into `ZIP1`,
would now be unrecognizable after round-tripping
through `ISD::ZERO_EXTEND_VECTOR_INREG` recognition & legalization.
The most obvious solution is to just custom-lower
`ISD::ZERO_EXTEND_VECTOR_INREG` as the `ZIP1`-with-zeros,
like it would have been originally in that test case.
Roman Lebedev [Sun, 25 Dec 2022 19:16:30 +0000 (22:16 +0300)]
[DAGCombiner] Add a most basic `combineShuffleToZeroExtendVectorInReg()`
Sometimes we end up with a shuffles in DAG that would be
better represented as a `ISD::ZERO_EXTEND_VECTOR_INREG`,
and a failure to do so causes suboptimal codegen in a number of cases,
especially when we will then cast vector to scalar.
I acknowledge, the test changes here are rather underwhelming,
but as with all of codegen, it's always a yak shawing,
and this is the most stripped down version of the patch
that shows *some* effect without having insurmountable amount
of fallout to deal with. The next change resolves this regression.
The transformation will be extended in follow-ups.
Roman Lebedev [Mon, 26 Dec 2022 18:06:20 +0000 (21:06 +0300)]
[NFC][AArch64] Add a few vector shuffle tests that should be `zip1`
At least, they are equivalent to the `@vzipNoBlend`, which is lowered into zip1.
tlattner [Mon, 26 Dec 2022 19:29:44 +0000 (11:29 -0800)]
Commit changes to the Code of Conduct that make it more clear regarding behavior outside of LLVM spaces that impact the safety of our community members. Discussion may be found here: https://discourse.llvm.org/t/code-of-conduct-changes-related-to-llvm-project-policy-changes/64197
Sanjay Patel [Mon, 26 Dec 2022 18:12:44 +0000 (13:12 -0500)]
[InstCombine] do not add "nuw" to 1<<X if the "1" has undefined elements
This was noted as a potential miscompile in the post-commit feedback
for the patch that added this fold:
d4493dd1ed58ac3f1eab0
Sanjay Patel [Mon, 26 Dec 2022 17:34:47 +0000 (12:34 -0500)]
[InstCombine] replace undef in vector tests with poison; NFC
I left a few of the existing undef tests in place for extra
coverage and because one of those was noted as a miscompile in
the post-commit feedback for
d4493dd1ed58ac3f1eab0, but we are
transitioning to poison, so it is more valuable to test the
expected IR going forward.
Michał Górny [Mon, 26 Dec 2022 13:30:35 +0000 (14:30 +0100)]
[lldb] [utils] Fix linking lit-cpuid to LLVM dylib
Use `LINK_COMPONENTS` instead of manual `target_link_libraries` to link
lit-cpuid to LLVM components. This ensures that dylib is used along
with `LLVM_LINK_LLVM_DYLIB` rather than linking to component libraries
that may not be installed.
This fixes build failure on Gentoo after a dep on TargetParser component
was added in
f09cf34d00625e57dea5317a3ac0412c07292148.
Differential Revision: https://reviews.llvm.org/D140671
Florian Hahn [Mon, 26 Dec 2022 16:02:59 +0000 (16:02 +0000)]
Revert "[IPSCCP] Enable specialization of functions."
This reverts commit
2656572d485127cc30b8fe9752024d2a0f1c50db.
It looks like CINT2017rate/502.gcc_r gets mis-compiled with LTO + PGO on
AArch64 with function specialization.
Danila Malyutin [Fri, 23 Dec 2022 16:47:31 +0000 (19:47 +0300)]
[TwoAddressInstruction] Constrain RegClass when processing a statepoint
This transformation could've triggered a verifier assert if RegA and RegB
were of different reg classes. Fix this by constraining as the comment
for replaceRegWith suggests.
Differential Revision: https://reviews.llvm.org/D140672
Andrei Safronov [Mon, 26 Dec 2022 11:00:00 +0000 (12:00 +0100)]
[Xtensa 10/10] Add relaxations and fixups. Add rest part of Xtensa Core Instructions
Add branch/jump/call/l32r instructions and fixups support. Add R_XTENSA_32/R_XTENSA_SLOT0_OP
relocations in object files generation. Modify tests to support new instructions.
Add tests for relocations and fixups.
Differential Revision: https://reviews.llvm.org/D64836
Andrei Safronov [Mon, 26 Dec 2022 10:58:36 +0000 (11:58 +0100)]
[Xtensa 9/10] Add basic support of Xtensa disassembler
Differential Revision: https://reviews.llvm.org/D64835
Andrei Safronov [Mon, 26 Dec 2022 10:56:06 +0000 (11:56 +0100)]
[Xtensa 8/10] Add support of the Xtensa shift/load/store/move and processor control instructions
Add new subset of Core Instructions (not full yet). Add appropriate operands description,
modify asm parser, printer and code emitter. Modify tests to support new instructions.
Differential Revision: https://reviews.llvm.org/D64834
Andrei Safronov [Mon, 26 Dec 2022 10:55:06 +0000 (11:55 +0100)]
[Xtensa 7/10] Add Xtensa instruction printer
Add printer for current instructions and operands subsets.
Also add basic tests of the Xtensa instructions.
Differential Revision: https://reviews.llvm.org/D64833
Andrei Safronov [Mon, 26 Dec 2022 10:53:44 +0000 (11:53 +0100)]
[Xtensa 6/10] Add Xtensa basic assembler parser
Currently parse just described in *.td files Xtensa instructions and operands subsets.
Differential Revision: https://reviews.llvm.org/D64832
Andrei Safronov [Mon, 26 Dec 2022 10:52:38 +0000 (11:52 +0100)]
[Xtensa 5/10] Add Xtensa MCTargetDescr initial functionality
Differential Revision: https://reviews.llvm.org/D64831
Andrei Safronov [Mon, 26 Dec 2022 10:49:11 +0000 (11:49 +0100)]
[Xtensa 4/10] Add basic *td files with Xtensa architecture description
Add initial Xtensa.td file with target machine description. Add XtensaInstrInfo.td,
currently describe just susbet of Core Instructions like ALU, Processor control,
memory barrier and some move instructions. Add descriptions of the instructions
formats(XtensaInstrInfo.td) and some immediate instruction operands(XtensaOperands.td).
Add General Registers and Special Registers classes.
Differential Revision: https://reviews.llvm.org/D64830
Andrei Safronov [Mon, 26 Dec 2022 10:45:59 +0000 (11:45 +0100)]
[Xtensa 3/10] Add initial version of the Xtensa backend
Add Xtensa MCTargetDesc stub. Add XtensaTargetMachine and XtensaTargetInfo.
Modify llib/Target/LLVMBuild.txt. Now Xtensa target could be builded as EXPERIMENTAL.
Differential Revision: https://reviews.llvm.org/D64829
Andrei Safronov [Mon, 26 Dec 2022 10:39:46 +0000 (11:39 +0100)]
[Xtensa 2/10] Add Xtensa ELF definitions
Add file with Xtensa ELF relocations. Add Xtensa support to ELF.h,
ELFObject.h and ELFYAML.cpp. Add simple test of Xtensa ELF representation in YAML.
Differential Revision: https://reviews.llvm.org/D64827
Andrei Safronov [Mon, 26 Dec 2022 10:37:28 +0000 (11:37 +0100)]
[Xtensa 1/10] Recognize Xtensa in triple parsing code
I'm sharing initial set of patches that adds LLVM backend for Xtensa architecture.
It is based on this LLVM fork https://github.com/espressif/llvm-xtensa.
I prepared patches by similar way like it was already successfully done for RISCV, i.e. incrementally add an initial MC layer for Xtensa by small chunks which could be reviewable.
Differential Revision: https://reviews.llvm.org/D64826
WANG Xuerui [Mon, 26 Dec 2022 12:15:55 +0000 (20:15 +0800)]
[LoongArch][test] Regenerate checks for the ghc-cc.ll test case
Seems the codegen was stale (the extra `ret` after the tail call should
not be there, and indeed it is not emitted by the current code), plus
the whitespaces are different from the update_llc_test_checks.py style.
Simply regenerate it to fix the test failure.
Differential Revision: https://reviews.llvm.org/D140670
Lin Runze [Mon, 26 Dec 2022 10:37:09 +0000 (18:37 +0800)]
[LoongArch] Add GHC Calling Convention
This is modeled after [[ https://reviews.llvm.org/D89788 | the RISCV GHC calling convention]]
and matches [[ https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9292 | the corresponding GHC change ]].
Reviewed By: xen0n, wangleiat
Differential Revision: https://reviews.llvm.org/D137495
Michał Górny [Mon, 26 Dec 2022 09:21:44 +0000 (10:21 +0100)]
[clang] [OpenMP] Test amdgcn_openmp_device_math_c.c test on 32-bit platforms
Explicitly pass triple to the test compiler to prevent failure when
the host triple is 32-bit. This is the same solution
as
f74e3d2f81d2aae47d6032fc1d23114460d48a37, thanks to Joseph Huber
for it.
Max Kazantsev [Mon, 26 Dec 2022 08:58:18 +0000 (15:58 +0700)]
[Test] Update inverse test for turn-to-invariant to what they meant to be
They were supposed to test inverted branches with OR condition, not AND.
Fixed this now.
Max Kazantsev [Mon, 26 Dec 2022 08:00:27 +0000 (15:00 +0700)]
[IndVars][NFC] Factor out condition creation in optimizeLoopExitWithUnknownExitCount
This is a preparation step to support optimization of conditions that are not immediately ICmp.
Max Kazantsev [Mon, 26 Dec 2022 07:37:49 +0000 (14:37 +0700)]
[Test] Add test showing potential conflict b/w AND elimination and IV widening
Vitaly Buka [Mon, 26 Dec 2022 06:54:27 +0000 (22:54 -0800)]
Revert "[clang] Use a StringRef instead of a raw char pointer to store builtin and call information"
Revert "Fix lldb option handling since
e953ae5bbc313fd0cc980ce021d487e5b5199ea4 (part 2)"
Revert "Fix lldb option handling since
e953ae5bbc313fd0cc980ce021d487e5b5199ea4"
GCC build hangs on this bot https://lab.llvm.org/buildbot/#/builders/37/builds/19104
compiling CMakeFiles/obj.clangBasic.dir/Targets/AArch64.cpp.d
The bot uses GNU 11.3.0, but I can reproduce locally with gcc (Debian 12.2.0-3) 12.2.0.
This reverts commit
caa713559bd38f337d7d35de35686775e8fb5175.
This reverts commit
06b90e2e9c991e211fecc97948e533320a825470.
This reverts commit
e953ae5bbc313fd0cc980ce021d487e5b5199ea4.
eopXD [Sun, 25 Dec 2022 15:38:01 +0000 (07:38 -0800)]
[NFC][Clang][RISCV] Reduce for-loop with SmallVector utility
As topic, this commit reduces the for-loops with utilities of SmallVector.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D140661
Joseph Huber [Tue, 20 Dec 2022 22:02:07 +0000 (16:02 -0600)]
[Clang] Add `nvptx-arch` tool to query installed NVIDIA GPUs
We already have a tool called `amdgpu-arch` which returns the GPUs on
the system. This is used to determine the default architecture when
doing offloading. This patch introduces a similar tool `nvptx-arch`.
Right now we use the detected GPU at compile time. This is unhelpful
when building on a login node and moving execution to a compute node for
example. This will allow us to better choose a default architecture when
targeting NVPTX. Also we can probably use this with CMake's `native`
setting for CUDA now.
CUDA since 11.6 provides `__nvcc_device_query` which has a similar
function but it is probably better to define this locally if we want to
depend on it in clang.
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D140433
Jojo R [Wed, 9 Nov 2022 08:17:20 +0000 (16:17 +0800)]
[RISCV] Implement assembler support for XTHeadVdot
This patch implements the T-Head vendor extensions (XTHeadVdot),
which is documented here, it's based on standard vector extension v1.0:
https://github.com/T-head-Semi/thead-extension-spec
Owen Anderson [Sat, 24 Dec 2022 05:03:23 +0000 (22:03 -0700)]
[NFC] Elminate some needless nested-map complexity.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D140648
Owen Anderson [Sun, 25 Dec 2022 04:46:05 +0000 (21:46 -0700)]
Remove workaround for libstdc++ 4.8.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D140656
Chen Zheng [Thu, 22 Dec 2022 10:57:11 +0000 (05:57 -0500)]
[DebugInfo] make DW_LANG_C11 respect -gstrict-dwarf
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D140544
Youling Tang [Mon, 26 Dec 2022 01:33:54 +0000 (09:33 +0800)]
[compiler-rt] Fix build errors when using gcc on LoongArch
- GCC does not recognize $fcsr0, uses $r0 instead.
- GCC does not implement __builtin_thread_pointer, which can be
obtained directly through $tp.
Reviewed By: SixWeining
Differential Revision: https://reviews.llvm.org/D140545
Roman Lebedev [Mon, 26 Dec 2022 00:56:58 +0000 (03:56 +0300)]
[NFC][DAGCombiner] `canCombineShuffleToAnyExtendVectorInreg()`: take matcher as callback
Roman Lebedev [Sun, 25 Dec 2022 22:43:49 +0000 (01:43 +0300)]
[NFC][DAG] `canCombineShuffleToAnyExtendVectorInreg()`: check for legal op before matching
Likewise as with legal types check, might as well not match if won't use.
Roman Lebedev [Sun, 25 Dec 2022 21:41:12 +0000 (00:41 +0300)]
[NFC][Analysis] Implement `getShuffleMaskWithWidestElts()` wrapper (+tests)
It will be needed in an upcoming patch to implement some shuffle combining.
Roman Lebedev [Sun, 25 Dec 2022 21:03:45 +0000 (00:03 +0300)]
[NFC][DAGCombiner] Extract `canCombineShuffleToAnyVectorExtendInReg()` helper
Adding zero-ext support isn't as straight-forward, and it's easier
to to so in a new function, but this helper is useful there.
This does not change any existing behaviour.
Roman Lebedev [Sun, 25 Dec 2022 18:20:43 +0000 (21:20 +0300)]
[NFC][DAG] `combineShuffleToVectorExtend()`: check that the type is legal first
There is no point in doing any of the potentially-costly matching
if we will inevitably give up anyway.
Ilia Diachkov [Sun, 25 Dec 2022 21:16:14 +0000 (00:16 +0300)]
[SPIRV] support __spirv_Load/Store builtin functions
The patch adds support for the builtin functions __spirv_Load and
__spirv_Store. One test is added to demonstrate the improvement.
Differential Revision: https://reviews.llvm.org/D140490
Florian Hahn [Sun, 25 Dec 2022 21:34:58 +0000 (21:34 +0000)]
[VPlan] Use VPBB in sinkScalarOperands directly. (NFC)
Suggested by @Ayal in D139790.
Stephen Tozer [Tue, 20 Dec 2022 10:01:56 +0000 (10:01 +0000)]
[DebugInfo] Fix: Variables that have no non-empty values being emitted when they have a DBG_VALUE_LIST
This patch fixes a simple bug where `DbgValueHistoryMap::hasNonEmptyLocation` was incorrectly handling DBG_VALUE_LIST instructions, treating empty values as non-empty, causing empty variables to be emitted into DWARF.
Reviewed By: Orlando
Differential Revision: https://reviews.llvm.org/D133925
LLVM GN Syncbot [Sun, 25 Dec 2022 21:05:12 +0000 (21:05 +0000)]
[gn build] Port
f0756e086010
Vitaly Buka [Sun, 25 Dec 2022 20:49:35 +0000 (12:49 -0800)]
Revert "[clang-format] Add an option to format integer literal separators"
Revert "[clang-format] Disable FixRanges in IntegerLiteralSeparatorTest"
Breaks buildbots, details in https://reviews.llvm.org/D140543
This reverts commit
879bd9146a2c9ea395abd7c1ebd0f76f414a4967.
This reverts commit
46c94e5067b5f396c24bb950505c79bc819bd4b8.
Craig Topper [Sun, 25 Dec 2022 20:40:53 +0000 (12:40 -0800)]
Revert "[RISCV] Enable the LocalStackSlotAllocation pass support."
This reverts commit
180397cdded67a8fdf56f92a0b70d32f0dac8af6.
This seems to cause llvm-testsuite failures.
Nikolas Klauser [Sun, 18 Dec 2022 23:02:44 +0000 (00:02 +0100)]
[libc++] Implement constexpr {isfinite, isinf, isnan, isnormal}
This starts implementing P0533
Reviewed By: Mordante, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D140277
Joseph Huber [Sun, 25 Dec 2022 15:47:04 +0000 (09:47 -0600)]
[OpenMP] Fix test on 32-bit platforms
Summary:
This test didn't specify the triple so it defaulted to the user's, if
this was 32-bit then it failed due to a diagnostic message.
Alexey Lapshin [Sun, 25 Dec 2022 14:25:18 +0000 (15:25 +0100)]
[NFC][ADT] Rename StringMapEntry *Create() into StringMapEntry *create.