Commit Graph

474028 Commits

Author SHA1 Message Date
Pavel Iliin
e5fe3d27fc
[AArch64] Fix FMV crash on unspecified number of parameters function (#65671)
Fix Function Multi Versioning crash reported in
https://github.com/llvm/llvm-project/issues/65669
2023-09-08 16:26:39 +01:00
David Stuttard
8c03239934
[AMDGPU] New intrinsic void llvm.amdgcn.s.nop(i16) (#65757)
This allows front ends to insert s_nops - this is most often when a
delay less
than s_sleep 1 is required.
2023-09-08 16:24:10 +01:00
Antonio Frighetto
ffb8434f6a [clang] Prevent unnecessary copies in SymbolGraphSerializer (NFC) 2023-09-08 17:19:06 +02:00
Jay Foad
8669a9f93a
[AMDGPU] Cope with SelectionDAG::UpdateNodeOperands returning a different SDNode (#65765)
SITargetLowering::adjustWritemask calls SelectionDAG::UpdateNodeOperands
to update an EXTRACT_SUBREG node in-place to refer to a new IMAGE_LOAD
instruction, before we delete the old IMAGE_LOAD instruction. But in
UpdateNodeOperands can do CSE on the fly and return a different
EXTRACT_SUBREG node, so the original EXTRACT_SUBREG node would still
exist and would refer to the old deleted IMAGE_LOAD instruction. This
caused errors like:

t31: v3i32,ch = <<Deleted Node!>> # D:1
This target-independent node should have been selected!
UNREACHABLE executed at lib/CodeGen/SelectionDAG/InstrEmitter.cpp:1209!

Fix it by detecting the CSE case and replacing all uses of the original
EXTRACT_SUBREG node with the CSE'd one.

Recommit with a fix for a use-after-free bug in the first version of
this patch (#65340) which was caught by asan.
2023-09-08 16:16:02 +01:00
Benjamin Maxwell
6f95737ed4
[mlir][TOSA] Fix interpretation of --tosa-validate='profile=undefined' (#65738)
Due to a copy-paste error in 32b7c1ff this was incorrectly mapped to
`TosaProfileEnum::MainTraining` rather than `TosaProfileEnum::Undefined`.
2023-09-08 16:11:19 +01:00
Jonas Devlieghere
0f50d0108c
Revert RTSanitizerCommonSymbolizerInternal changes
This reverts the following commits:

 - 5d7b75e2a5
  [NFC][memprof] Temporarly remove RTSanitizerCommonSymbolizerInternal

 - edb211cb78
   [NFC][memprof] Temporarly remove RTSanitizerCommonSymbolizerInternal

 - 4d14b4a872
   [sanitizer] Add CMake flag to build with internal symbolizer

They break macOS nodes because CMake can't evaluate generator expressions:

  Error evaluating generator expression:

    $<TARGET_OBJECTS:RTSanitizerCommonSymbolizerInternal.osx>
    $<TARGET_OBJECTS:RTSanitizerCommonSymbolizerInternal.ios>
    $<TARGET_OBJECTS:RTSanitizerCommonSymbolizerInternal.iossim>
2023-09-08 08:03:34 -07:00
yronglin
4bb9024398
[NFC][Clang][RISCV] Remove trailing whitespaces in riscv_vector.td (#65762)
This whitespaces breaking `Format` CI.
```
$ trap 'kill -- $$' INT TERM QUIT; clang/utils/ci/run-buildbot check-format
+ set -o pipefail
+ unset LANG
+ unset LC_ALL
+ unset LC_COLLATE
++ basename clang/utils/ci/run-buildbot
+ PROGNAME=run-buildbot
+ [[ 1 == 0 ]]
+ [[ 1 -gt 0 ]]
+ case ${1} in
+ BUILDER=check-format
+ shift
+ [[ 0 -gt 0 ]]
++ git rev-parse --show-toplevel
+ MONOREPO_ROOT=/var/lib/buildkite-agent/builds/linux-56-fdf668759-vtv88-1/llvm-project/clang-ci
+ BUILD_DIR=/var/lib/buildkite-agent/builds/linux-56-fdf668759-vtv88-1/llvm-project/clang-ci/build/check-format
+ INSTALL_DIR=/var/lib/buildkite-agent/builds/linux-56-fdf668759-vtv88-1/llvm-project/clang-ci/build/check-format/install
+ cmake --version
cmake version 3.23.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
+ ninja --version
1.10.1
+ case "${BUILDER}" in
+ grep -rnI '[[:blank:]]$' clang/lib clang/include clang/docs
clang/include/clang/Basic/riscv_vector.td:580:        let Name = op # eew # "_v", IRName = op, MaskedIRName = op # "_mask",
clang/include/clang/Basic/riscv_vector.td:1786:    let RequiredFeatures = ["ZvfhminOrZvfh"] in
```

Signed-off-by: yronglin <yronglin777@gmail.com>
2023-09-08 22:59:45 +08:00
David Spickett
254847fb14 [llvm][Docs] Fix missing ' in GitHub documentation 2023-09-08 14:51:53 +00:00
Phoebe Wang
24194090e1 [X86][RFC] Add new option -m[no-]evex512 to disable ZMM and 64-bit mask instructions for AVX512 features
This is an alternative of D157485 and a pre-feature to support AVX10.

AVX10 Architecture Specification: https://cdrdv2.intel.com/v1/dl/getContent/784267
AVX10 Technical Paper: https://cdrdv2.intel.com/v1/dl/getContent/784343
RFC: https://discourse.llvm.org/t/rfc-design-for-avx10-feature-support/72661

Based on the feedbacks from LLVM and GCC community, we have agreed to
start from supporting `-m[no-]evex512` on existing AVX512 features.
The option `-mno-evex512` can be used with `-mavx512xxx` to build
binaries that can run on both legacy AVX512 targets and AVX10-256.

There're still arguments about what's the expected behavior when this
option as well as `-mavx512xxx` used together with `-mavx10.1-256`. We
decided to defer the support of `-mavx10.1` after we made consensus.
Or furthermore, we start from supporting AVX10.2 and not providing any
AVX10.1 options.

Reviewed By: RKSimon, skan

Differential Revision: https://reviews.llvm.org/D159250
2023-09-08 22:47:22 +08:00
Florian Hahn
3e2d564c3d
[VPlan] Use VPRecipeWithFlags for VPScalarIVStepsRecipe (NFC).
This directly models the flags as part of the recipe, which allows
dropping them using the VPlan infrastructure when required.

It also allows removing the full reference to InductionDescriptor and
limit it to only the opcode.
2023-09-08 15:46:12 +01:00
Jay Foad
bd6e77c667
[X86] Convert X86FixupBWInsts from LivePhysRegs to LiveRegUnits. NFCI. (#65592)
This gives a geomean 0.50% speed up according to
https://llvm-compile-time-tracker.com/
2023-09-08 15:44:03 +01:00
Timm Bäder
3276ac86aa [clang][Interp][NFC] Remove unused function prototype
This was causing warnings in MSVC.
2023-09-08 16:40:10 +02:00
Author: Eddie Phillips
9ce82a10a3 Wrong link target in the documentation #62990
In the LDDB documentation you have the following sentence:

"The --format (which you can shorten to -f) option accepts a format name."

The link points to the wrong place.

I pointed it to the table that precedes the Type summary section.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D151668
2023-09-08 15:38:28 +01:00
Kinuko Yasuda
8e1d2f2f12
[clang][dataflow] Don't crash when BlockToState is called from unreachable path (#65732)
When we call `getEnvironment`, `BlockToState[BlockId]` for the block can
return null even if CFCtx.isBlockReachable(B) returns true if it is
called from a particular block that is marked unreachable to the block.
2023-09-08 10:24:08 -04:00
Aaron Ballman
df455574cb Fix the Clang sphinx build
This addresses issues found by:
https://lab.llvm.org/buildbot/#/builders/92/builds/50402
2023-09-08 10:23:27 -04:00
David Spickett
f2b241474f [lldb][AArch64] Re-enable clone follow tests on AArch64 Linux
Fixes #49243

By unknown means, these have been fixed since the UNSUPPORTED
was added.
2023-09-08 14:10:08 +00:00
Dmitri Gribenko
5af556f6d8 [bazel] Add new TableGen output files for 46f3ade508 2023-09-08 16:01:28 +02:00
Dmitri Gribenko
a0022ccc72 Revert "[Bazel] Update "basic_attr_gen" (D141714, 46f3ade508)"
This reverts commit dbd548d062. The
correct target to update is ast_attr_gen.
2023-09-08 16:01:28 +02:00
Alexey Bataev
30edf1c449
[SLP]Do not early exit if the number of unique elements is non-power-of-2. (#65476)
We still can try to vectorize the bundle of the instructions, even if
the
repeated number of instruction is non-power-of-2. In this case need to
adjust the cost (calculate the cost only for unique scalar instructions)
and cost of the extracts. Also, when scheduling the bundle need to
schedule only unique scalars to avoid compiler crash because of the
multiple dependencies. Can be safely applied only if all scalars's users
are also vectorized and do not require memory accesses (this one is
a temporarily requirement, can be relaxed later).

---------

Co-authored-by: Alexey Bataev <a.bataev@outlook.com>
2023-09-08 10:00:46 -04:00
Zahira Ammarguellat
2c93e3c1c8 Take math-errno into account with '#pragma float_control(precise,on)' and
'attribute__((optnone)).

Differential Revision: https://reviews.llvm.org/D151834
2023-09-08 09:48:53 -04:00
Louis Dionne
77054f3946 [libc++abi][NFC] Run clang-format on a test that I am about to modify
https://reviews.llvm.org/D138460 touches that test a bunch, so we might
as well clang-format it first.
2023-09-08 09:47:49 -04:00
Saleem Abdulrasool
ecbd5230f7
Support: allow building with non-C/C++ language linkers (#65634) 2023-09-08 06:47:40 -07:00
Amara Emerson
730e8f659d [AArch64][GlobalISel] Fix global offset folding combine inserting MIs into wrong place.
Was causing use-before-def issues. Not sure how it remained undetected for so long.
2023-09-08 06:28:12 -07:00
Alexander Richardson
bf1bcb68fc [libc++] Use intptr_t instead of ptrdiff_t for messages_base::catalog
On GLibc, FreeBSD and macOS systems nl_catd is a pointer type, and
round-tripping this in a variable of ptrdiff_t is not portable.
In fact such a round-trip yields a non-dereferenceable pointer on
CHERI-enabled architectures such as Arm Morello. There pointers (and
therefore intptr_t) are twice the size of ptrdiff_t, which means casting
to ptrdiff_t strips the high (metadata) bits (as well as a hidden pointer
validity bit).

Since catalog is now guaranteed to be the same size or larger than nl_catd,
we can store all return values safely and the shifting workaround from
commit 0c68ed006d should not be needed
anymore (this is also not portable to CHERI systems on since shifting a
valid pointer right will create a massively out-of-bounds pointer that
may not be representable).

This can be fixed by using intptr_t which should be the same type as
ptrdiff_t on all currently supported architectures.

See also: https://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2028

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

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2023-09-08 09:15:57 -04:00
Jay Foad
dd5af895bb
[AMDGPU] Mark S_NOP as having side effects (#65745)
This prevents S_NOP from being rescheduled past other (side-effecting)
instructions, which is useful because it is generally used to introduce
a short delay or to avoid hazards. Currently this only affects MIR tests
because the compiler itself only inserts nops in PostRAHazardRecognizer
which runs after all scheduling.
2023-09-08 14:05:56 +01:00
David Spickett
e067b0e4a7 [lldb][AArch64] Re-enable TestShowLocationDwarf5
Fixes #43525

For unknown reasons, this has been fixed in the time
since the issue was raised.
2023-09-08 13:04:48 +00:00
Louis Dionne
7d7dcc1f25
[libc++][NFC] Remove dead code in <list> (#65651)
I came across this function (which is never used) while doing other
changes. It should be safe to remove since it's not used anywhere.
2023-09-08 08:52:02 -04:00
Daniel McIntosh
61cecf641f [libc++][NFC] tidy up strstreambuf::seekoff and strstreambuf::seekpos
Should be the same logic, but hopefully easier to read this way. Gets
rid of some superfluous state variables, and uses early returns.

Differential Revision: https://reviews.llvm.org/D112956
2023-09-08 08:50:20 -04:00
Louis Dionne
521c6117f6 [libc++][NFC] Run clang-format on strstream.cpp
I'm about to land https://reviews.llvm.org/D112956 which touches many
lines in that file anyway, so we might as well clang-format it first.
2023-09-08 08:50:19 -04:00
Guillaume Chatelet
74971db140
[libc] Add is_scalar (#65740)
Adds the is_scalar traits based on implementation in
https://en.cppreference.com/w/cpp/types/is_scalar
2023-09-08 12:45:17 +00:00
Tom Weaver
4871a9ca54 Revert "[jitlink/rtdydl][checker] Add TargetFlag dependent disassembler switching support"
This reverts commit 4b17c81d5a.

Caused buildbot failures:
https://lab.llvm.org/buildbot/#/builders/230/builds/18341
https://lab.llvm.org/buildbot/#/builders/109/builds/73169
https://lab.llvm.org/buildbot/#/builders/67/builds/12597
2023-09-08 13:41:11 +01:00
Markus Böck
feb7beaf70
[mlir][LLVM] Model side effects of volatile and atomic load-store (#65730)
According to the LLVM language reference, both volatile memory
operations and atomic operations (except unordered) do not simply read
memory but also perform write operations on arbitrary memory[0][1].

In the case of volatile memory operations, this is the case due to the
read possibly having target specific properties. A common real-world
situation where this happens is reading memory mapped registers on an
MCU for example. Atomic operations are more special. They form a kind of
memory barrier which from the perspective of the optimizer/lang-ref
makes writes from other threads visible in the current thread. Any kind
of synchronization can therefore conservatively be modeled as a
write-effect.

This PR therefore adjusts the side effects of `llvm.load` and
`llvm.store` to add unknown global read and write effects if they are
either atomic or volatile.

Regarding testing: I am not sure how to best test this change for
`llvm.store` and the "globalness" of the effect that isn't just a unit
test checking that the output matches exactly. For the time being, I
added a test making sure that `llvm.load` does not get DCEd in
aforementioned cases.

Related logic in LLVM proper:

3398744a61/llvm/lib/IR/Instruction.cpp (L638-L676)


3398744a61/llvm/include/llvm/IR/Instructions.h (L258-L262)

[0] https://llvm.org/docs/LangRef.html#volatile-memory-accesses
[1] https://llvm.org/docs/Atomics.html#monotonic
2023-09-08 13:50:49 +02:00
Phoebe Wang
da1eb886c4
[X86] Do not check alignment for VINSERTPS (#65721)
We don't have alignment constraint in AVX instructions.
2023-09-08 19:23:43 +08:00
Vinicius Couto Espindola
01192a09bb
[mlir][llvm] Add zeroinitializer constant (#65508)
This patch adds support for the zeroinitializer constant to LLVM
dialect. It's meant to simplify zero-initialization of aggregate types
in MLIR, although it can also be used with non-aggregate types.
2023-09-08 13:03:39 +02:00
Marius Brehler
3ac4ba37c0
[Github] Add mlir-emitc subscribers to watch the Cpp target (#65603) 2023-09-08 12:06:23 +02:00
Ramkumar Ramachandra
a06be8a2e4
SLP/RISCV: add negative test for lrint (#55208) (#65611)
The issue #55208 describes a current deficiency of the SLPVectorizer,
namely that it doesn't vectorize code written with lrint, while similar
code written with rint is vectorized. Add a test corresponding to this
issue for the RISC-V target.
2023-09-08 10:58:14 +01:00
David Spickett
f98ca79c7b [lldb][Docs] Update bug report and code review links
The issues link as it was was including PRs, so I've made that
issues only and only those in an open state.

Code review is now on Gtihub so same thing, PRs only, open state,
label lldb.
2023-09-08 09:56:42 +00:00
Christopher Di Bella
4a351ef70a
[cross-project-tests] remove final dexter.builder import (#65653) 2023-09-08 11:47:26 +02:00
Benjamin Maxwell
2a82dfd704 [mlir][VectorOps] Don't drop scalable dims when lowering transfer_reads/writes (in VectorToSCF)
This allows the lowering of > rank 1 transfer_reads/writes to equivalent
lower-rank ones when the trailing dimension is scalable. The resulting
ops still cannot be completely lowered as they depend on arrays of
scalable vectors being enabled, and a few related fixes (see D158517).

This patch also explicitly disables lowering transfer_reads/writes with
a leading scalable dimension, as more changes would be needed to handle
that correctly and it is unclear if it is required.

Examples of ops that can now be further lowered:

  %vec = vector.transfer_read %arg0[%c0, %c0], %cst, %mask
		 {in_bounds = [true, true]} : memref<3x?xf32>, vector<3x[4]xf32>

  vector.transfer_write %vec, %arg0[%c0, %c0], %mask
		 {in_bounds = [true, true]} : vector<3x[4]xf32>, memref<3x?xf32>

Reviewed By: c-rhodes, awarzynski, dcaballe

Differential Revision: https://reviews.llvm.org/D158753
2023-09-08 09:43:17 +00:00
Guillaume Chatelet
eebf8faf3e
[libc] Add is_member_pointer_v (#65631)
Implementation from
https://en.cppreference.com/w/cpp/types/is_member_pointer
2023-09-08 11:36:19 +02:00
Juan Manuel MARTINEZ CAAMAÑO
d60c47476d [Clang] Propagate target-features if compatible when using mlink-builtin-bitcode
Buitlins from AMD's device-libs are compiled without specifying a
target-cpu, which results in builtins without the target-features
attribute set.

Before this patch, when linking this builtins with -mlink-builtin-bitcode
the target-features were not propagated in the incoming builtins.

With this patch, the default target features are propagated
if they are compatible with the target-features in the incoming builtin.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D159206
2023-09-08 11:20:16 +02:00
David Spickett
3398744a61
[lldb][Docs] Additions to debuging LLDB page (#65635)
Adds the following:
* A note that you can use attaching to debug the right lldb-server
process, though there are drawbacks.
* A section on debugging the remote protocol.
* Reducing bugs, including reducing ptrace bugs to remove the need for
LLDB.

I've added a standlone ptrace program to the examples folder because:
* There's no better place to put it.
* Adding it to the page seems like wasting space, and would be harder to
update.
* I link to Eli Bendersky's classic blog on the subject, but we are
safer with our own example as well.
* Eli's example is for 32 bit Intel, AArch64 is more common these days.
* It's easier to show the software breakpoint steps in code than explain
it (though I still do that in the text).
* It was living on my laptop not helping anyone so I think it's good to
have it upstream for others, including future me.
2023-09-08 10:05:16 +01:00
Chuanqi Xu
96122b5b71 [C++20] [Modules] Introduce ForceCheckCXX20ModulesInputFiles options for
C++20 modules

Previously, we banned the check for input files from C++20 modules since
we thought the BMI from C++20 modules should be a standalone artifact.

However, during the recent experiment with clangd for modules, I find
it is necessary to tell whether or not a BMI is out-of-date by checking the
input files especially for language servers.

So this patch brings a header search option
ForceCheckCXX20ModulesInputFiles to allow the tools (concretly, clangd)
to check the input files from BMI.
2023-09-08 16:53:12 +08:00
jeanPerier
6ffea74f7c
[flang] Use BIND name, if any, when consolidating common blocks (#65613)
This patch changes how common blocks are aggregated and named in
lowering in order to:

* fix one obvious issue where BIND(C) and non BIND(C) with the same
Fortran name were "merged"

* go further and deal with a derivative where the BIND(C) C name matches
the assembly name of a Fortran common block. This is a bit unspecified
IMHO, but gfortran, ifort, and nvfortran "merge" the common block
without complaints as a linker would have done. This required getting
rid of all the common block mangling early in FIR (\_QC) instead of
leaving that to the phase that emits LLVM from FIR because BIND(C)
common blocks did not have mangled names. Care has to be taken to deal
with the underscoring option of flang-new.

See added flang/test/Lower/HLFIR/common-block-bindc-conflicts.f90 for an
illustration.
2023-09-08 10:43:55 +02:00
Qiu Chaofan
d4d0b5eaab Fix MIR failure after b922a362 2023-09-08 16:33:45 +08:00
Wang Pengcheng
2f780812ed
[TableGen] Add a field to filter out GenericTable entries (#65458)
A field `FilterClassField` is added to `GenericTable` class, which
is an optional bit field of `FilterClass`. If specified, only those
records with this field being true will have corresponding entries
in the table.
2023-09-08 16:27:11 +08:00
Wingrez
3639d81f7e
[ADT] Fix an empty BitVector call getData assert `idx < size()' failed (#65505)
Fixes #65500
2023-09-08 10:23:47 +02:00
Pavel Labath
d4c3c2872f [lldb] Fix Process::SyncIOHandler
D157648 broke the function because it put the blocking wait into a
critical section. This meant that, if m_iohandler_sync was not updated
before entering the function, no amount of waiting would help.

Fix that by restriciting the scope of the critical section to the
iohandler check.
2023-09-08 10:17:16 +02:00
David Spickett
b1f14d6473 Reland "[lldb] Add more ways to find split DWARF files"
This reverts commit dc3f758ddc.

Lit decided to show me the least interesting part of the
test output, but from what I gather on Mac OS the DWARF
stays in the object files (https://stackoverflow.com/a/12827463).

So either split DWARF options do nothing or they produce
files I don't know the name of that aren't .dwo, so I'm
skipping these tests on Darwin.
2023-09-08 08:15:08 +00:00
Owen
7ecbf6c306
[clang-format][NFC] Skip remaining tests of the same case upon failure (#65540)
A typical test case goes through the format, stability, ObjC, and messUp
tests. If any of theses tests fails, we should skip the remaining tests
for the same test case.
2023-09-08 01:06:54 -07:00