516869 Commits

Author SHA1 Message Date
Vlad Serebrennikov
e6917e9554
[clang][NFC] Add test for CWG1898 "Use of “equivalent” in overload resolution" (#113439)
[CWG1898](https://cplusplus.github.io/CWG/issues/1898.html) Use of
“equivalent” in overload resolution
====================

[P1787R6](https://wg21.link/p1787r6):
> CWG1898 is resolved by explicitly using the defined term
parameter-type-list.

Except that now it's called non-object-parameter-type-list, which is
defined in [dcl.fct] [p8](https://eel.is/c++draft/dcl.fct#8) and
[p4](https://eel.is/c++draft/dcl.fct#8).

As for the wording, the first sentence
[\_N4140\_.[over.dcl]/1](https://timsong-cpp.github.io/cppwp/n4140/over.dcl#1)
where the word "equivalent" was used:
> Two function declarations of the same name refer to the same function
if they are in the same scope and have equivalent parameter declarations
([over.load]).

was replaced with what is now known as "corresponding overloads",
defined in
[[basic.scope.scope]/4](https://eel.is/c++draft/basic.scope#scope-4).
The definition is present in P1787R6, but it's hard to reference,
because the "corresponding overloads" term was coined later.
2024-10-25 21:15:21 +04:00
Simon Pilgrim
f24c1dd08e Fix MSVC "signed/unsigned mismatch" warning. NFC. 2024-10-25 18:11:28 +01:00
Abhina Sree
9d88543301
[AIX] Use internal lit shell for TableGen instead of a global setting (#113627)
This is to address the latest lit regressions
https://lab.llvm.org/buildbot/#/builders/64/builds/1285 caused by using
the internal lit shell. This change will limit using the internal lit
shell to TableGen on AIX so we do not hit these regressions.
2024-10-25 13:06:02 -04:00
Alexander Richardson
305a1ceae3
[DataLayout] Refactor storage of non-integral address spaces
Instead of storing this as a separate array of non-integral pointers,
add it to the PointerSpec class instead. This will allow for future
simplifications such as splitting the non-integral property into
multiple distinct ones: relocatable (i.e. non-stable representation) and
non-integral representation (i.e. pointers with metadata).

Reviewed By: arsenm

Pull Request: https://github.com/llvm/llvm-project/pull/105734
2024-10-25 10:02:40 -07:00
LLVM GN Syncbot
9ea6fcd02b [gn build] Port 1f2b7ae6d789 2024-10-25 16:47:08 +00:00
Florian Mayer
2ec5c69b68
Revert "[Sanitizers] Intercept timer_create" (#113710)
Reverts llvm/llvm-project#112285
2024-10-25 09:42:01 -07:00
Jonathan Thackray
4161ca2092 [NFC][AArch64][LLVM] Update ReleaseNotes.md with Armv9.6-A (2024) arch extensions 2024-10-25 17:38:00 +01:00
Momchil Velikov
ba81e1949a
[AArch64] Add assembly/disassembly for BFMOP4{A,S} (widening) instructions (#113203)
The new instructions are described in
https://developer.arm.com/documentation/ddi0602/2024-09/SME-Instructions
2024-10-25 17:32:25 +01:00
Louis Dionne
1f2b7ae6d7
[libc++] Refactor locale_guard (#113694)
Rename __libcpp_locale_guard to just __locale_guard, since there's no
reason for it to have __libcpp_ in its name -- it's just an internal
utility.

Also, define __locale_guard unconditionally of
_LIBCPP_LOCALE__L_EXTENSIONS, since that header is only used on Windows
(where it has a custom definition) or from bsd_locale_fallbacks.h, which
is only included when the L extensions are not provided.
2024-10-25 12:28:55 -04:00
Ryosuke Niwa
5c20891b2b
[WebKit Checkers] Allow a guardian CheckedPtr/CheckedRef (#110222)
This PR makes WebKit checkers allow a guardian variable which is
CheckedPtr or CheckedRef as in addition to RefPtr or Ref.
2024-10-25 08:52:56 -07:00
David Spickett
81e536ec87 [clang][test] Fix typo in arm-mfp8.cpp
New test added by https://github.com/llvm/llvm-project/pull/97277.
2024-10-25 15:43:47 +00:00
Jonas Paulsson
aba39c3974
[System] Precommit of test for #112491 (#113704) 2024-10-25 17:40:00 +02:00
Kai Nacke
e47bf3d08d
[JIT] Fix crash in unit tests
The unit tests `ReOptimizeLayerTest.BasicReOptimization` and `JITLinkRedirectionManagerTest.BasicRedirectionOperation` are failing for me with the error:

```
Program aborted due to an unhandled Error:
Error value was Success. (Note: Success values must still be checked prior to being destroyed).
```

The error is raised when a value is assigned to `Err`, due to the the missing `ErrorAsOutParameter`.

The fix is to move the error handling out of the constructor.
2024-10-25 11:11:03 -04:00
Thomas Preud'homme
bbc0e631d2
[MLIR] Remove unneeded LLVMDialect.h include in ControlFlowToSCF.cpp (#113560)
This fixes the following failure when doing a clean build (in particular
no .ninja* lying around) of lib/libMLIRControlFlowToSCF.a only:
```
In file included from llvm/include/llvm/IR/Module.h:22,
                 from mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h:37,
                 from mlir/lib/Conversion/ControlFlowToSCF/ControlFlowToSCF.cpp:19
llvm/include/llvm/IR/Attributes.h:90:14: fatal error: llvm/IR/Attributes.inc: No such file or directory
```
2024-10-25 15:41:39 +01:00
Alex Bradbury
cbdfb18794
[RISCV] Add Supm extension to RVA23 profiles (#113619)
This is mandatory for both RVA23U64 and RVA23S64 in the ratified version
of the specification

<https://github.com/riscv/riscv-profiles/blob/main/src/rva23-profile.adoc>.
2024-10-25 15:39:07 +01:00
Andrea Faulds
9f6c632ecd
[mlir][mlir-spirv-cpu-runner] Move MLIR pass pipeline to mlir-opt (#113594)
Adds a new mlir-opt test-only pass, -test-spirv-cpu-runner-pipeline,
which runs the set of MLIR passes needed for the mlir-spirv-cpu-runner,
and removes them from the runner. The tests are changed to invoke
mlir-opt with this flag before running the runner. The eventual goal is
to move all host/device code generation steps out of the runner, like
with some of the other runners.

Recommit of 17e9752267ed9c81c8da87f3a6d0e01f130b0d04. It was reverted
due to a build failure, but the build failure had in fact already been
fixed in e7302319b52e3d231216d54d10622b0698928a96.
2024-10-25 07:21:59 -07:00
David Green
577c7dd7cc [AArch64] Add a phase-ordering test for vectorizing predicated selects. NFC 2024-10-25 15:20:24 +01:00
Louis Dionne
800a47d6cd [libc++][NFC] Fix include guards inside locale_base_api 2024-10-25 10:17:59 -04:00
Anatoly Trosinenko
21ecd4a9df
[AArch64][PAC] Factor out the emission of pointer check sequence (NFC) (#110702)
When pointer is authenticated or resigned, it may be required to
explicitly check the authenticated value to prevent introducing signing
or authentication oracles. While the check sequence is expensive in
general, a more efficient sequence can be emitted under specific
assumptions.

This commit factors out the emission of the code sequence to check the
authenticated pointer value in preparation for adding other variants
of checking code, as it is currently done when emitting tail calls.
2024-10-25 17:03:15 +03:00
Boaz Brickner
9043bdbce4
[clang] Output an error when [[lifetimebound]] attribute is applied on a function parameter while the function returns void (#113460)
Fixes: https://github.com/llvm/llvm-project/issues/107556
2024-10-25 15:31:57 +02:00
Caroline Concatto
b3703fa504 [AArch64]Update test aarch64-debug-types.c
This patch fix the failing tests by adding
REQUIRES: aarch64-registered-target

This tests was failing in non aarch64 cpu.
The test was introduced by:
 [CLANG][AArch64] Add the  modal 8 bit floating-point scalar type (#97277)
2024-10-25 13:30:16 +00:00
LLVM GN Syncbot
a3dd6000a7 [gn build] Port c4248fa3edd3 2024-10-25 13:20:15 +00:00
LLVM GN Syncbot
83e7e6a0ff [gn build] Port 2e43a304f10f 2024-10-25 13:20:14 +00:00
Nico Weber
4a6b56960f [gn] try to port b1be21394e9c even more
Bots are now failing check-hwasan with

    llvm-lit: .../llvm/utils/lit/lit/llvm/subst.py:133: fatal: Did not find
        hwasan_symbolize in .../out/gn/stage2_unix/bin

This time it's the right fix for sure!
2024-10-25 09:19:21 -04:00
Nico Weber
a69d2a18d2 [gn] try to port b1be21394e9c more
Bots are currently failing check-hwasan with

    llvm-lit: .../llvm/utils/lit/lit/llvm/subst.py:133: fatal: Did not find
        hwasan_symbolize in /.../out/gn/lib/clang/20/lib/linux

Maybe this fixes that.

See also llvm/utils/gn/secondary/compiler-rt/lib/hwasan/scripts/BUILD.gn.
2024-10-25 09:05:29 -04:00
CarolineConcatto
49940514e2
[CLANG][AArch64] Add the modal 8 bit floating-point scalar type (#97277)
ARM ACLE PR#323[1] adds new modal types for 8-bit floating point
intrinsic.

From the PR#323:
```
ACLE defines the `__mfp8` type, which can be used for the E5M2 and E4M3
8-bit floating-point formats. It is a storage and interchange only type
with no arithmetic operations other than intrinsic calls.
````

The type should be an opaque type and its format in undefined in Clang.
Only defined in the backend by a status/format register, for AArch64 the
FPMR.

This patch is an attempt to the add the mfloat8_t scalar type. It has a
parser and codegen for the new scalar type.

The patch it is lowering to and 8bit unsigned as it has no format. But
maybe we should add another opaque type.

[1]  https://github.com/ARM-software/acle/pull/323
2024-10-25 13:59:46 +01:00
Benjamin Kramer
32baf29173 Make NoopLattice.h self-contained 2024-10-25 14:48:38 +02:00
Benjamin Kramer
6854ad90e3 [bazel][lldb] "Fix" the build after b852fb1ec5fa15f0b913cc4988cbd09239b19904
b852fb1ec5fa15f0b913cc4988cbd09239b19904 split out ValueObject, but it's
still all a big pile of dependency spaghetti so just build it with Core.
2024-10-25 14:23:56 +02:00
Benjamin Maxwell
43dda4bbeb
[clang][doc] Add release note for changes to -fveclib={ArmPL,SLEEF} (#113673)
Changed in #112580.
2024-10-25 13:08:39 +01:00
Ivan Kosarev
183ddefff6
[MC][ELF] Have an assert catching creating group sections without signatures. (#113553) 2024-10-25 13:06:32 +01:00
SpencerAbson
403e4a2074
[AArch64] Add assembly/disassembly for SVE zeroing int-float conversions (#113605)
This patch adds assembly/disassembly for the following predicated SVE2.2
instructions

    - SCVTF (zeroing)
    - UCVTF (zeroing)
    - FCVTZS (zeroing)
    - FCVTZU (zeroing)
    - FLOGB (zeroing)
- In accordance with:
https://developer.arm.com/documentation/ddi0602/latest/
2024-10-25 13:03:07 +01:00
Jay Foad
90cdc03e7f
[IR] Fix undiagnosed cases of structs containing scalable vectors (#113455)
Type::isScalableTy and StructType::containsScalableVectorType failed to
detect some cases of structs containing scalable vectors because
containsScalableVectorType did not call back into isScalableTy to check
the element types. Fix this, which requires sharing the same Visited set
in both functions. Also change the external API so that callers are
never required to pass in a Visited set, and normalize the naming to
isScalableTy.
2024-10-25 12:56:10 +01:00
Alex Bradbury
2c0b34852a
[RISCV] Mark pointer masking extensions as non-experimental (#113618)
These extensions were ratified very recently.

<https://lf-riscv.atlassian.net/wiki/spaces/HOME/pages/16154732/Ratified+Extensions>

I've ensured we have definitions for all extensions in the document
<https://drive.google.com/file/d/159QffOTbi3EEbdkKndYRZ2c46D25ZLmO/view?usp=drive_link>.
There are no additional CSRs.
2024-10-25 12:24:50 +01:00
Michael Buch
2d26ef09fc
[lldb-dap][test] Set disableASLR to False for tests (#113593)
When running in constrained environments like docker, disabling ASLR
might fail with errors like:
```
AssertionError: False is not true : launch failed (Cannot launch
'/__w/.../lldb-dap/stackTrace/subtleFrames/TestDAP_subtleFrames.test_subtleFrames/a.out':
personality set failed: Operation not permitted)
```
E.g., https://github.com/llvm/llvm-project/pull/110303

Hence we already run `settings set target.disable-aslr false` as part of
the init-commands for the non-DAP tests (see
https://github.com/llvm/llvm-project/pull/88312 and
https://discourse.llvm.org/t/running-lldb-in-a-container/76801).

But we never adjusted it for the DAP tests. As a result we get
conflicting test logs like:
```
 {
    "arguments": {
      "commandEscapePrefix": null,
      "disableASLR": true,
     ....
      "initCommands": [
        ...
        "settings set target.disable-aslr false",
```

Disabling ASLR by default in tests isn't useulf (it's only really a
debugging aid for users). So this patch sets `disableASLR=False` by
default.
2024-10-25 12:06:57 +01:00
Phoebe Wang
c2d2b3b808
[test] Avoid writing to a potentially write-protected dir (#113674) 2024-10-25 18:43:40 +08:00
Abid Qadeer
85af1926f7
[flang][debug] Support mlir::NoneType. (#113550) 2024-10-25 11:43:25 +01:00
Sergio Afonso
d87964de78
[OpenMP][OMPIRBuilder] Error propagation across callbacks (#112533)
This patch implements an approach to communicate errors between the
OMPIRBuilder and its users. It introduces `llvm::Error` and
`llvm::Expected` objects to replace the values returned by callbacks
passed to `OMPIRBuilder` codegen functions. These functions then check
the result for errors when callbacks are called and forward them back to
the caller, which has the flexibility to recover, exit cleanly or dump a
stack trace.

This prevents a failed callback to leave the IR in an invalid state and
still continue the codegen process, triggering unrelated assertions or
segmentation faults. In the case of MLIR to LLVM IR translation of the
'omp' dialect, this change results in the compiler emitting errors and
exiting early instead of triggering a crash for not-yet-implemented
errors. The behavior in Clang and openmp-opt stays unchanged, since
callbacks will continue always returning 'success'.
2024-10-25 11:30:16 +01:00
T-Gruber
86d65ae794
[analyzer] Improve FieldRegion descriptive name (#112313)
The current implementation of MemRegion::getDescriptiveName fails for
FieldRegions whose SuperRegion is an ElementRegion. As outlined below:
```Cpp
struct val_struct { int val; };
extern struct val_struct val_struct_array[3];

void func(){
  // FieldRegion with ElementRegion as SuperRegion.
  val_struct_array[0].val;
}
```

For this special case, the expression cannot be pretty printed and must
therefore be obtained separately.
2024-10-25 11:59:16 +02:00
Jacek Caban
6bb6922de9
[LLD][COFF] Allow overriding EC alias symbols with alternate names (#113456) 2024-10-25 11:53:47 +02:00
Sayan Saha
b91ce7bc0e
[Tosa] : Fix integer overflow for computing intmax+1 in tosa.cast to linalg. (#112455)
This PR fixes an issue related to integer overflow when computing
`(intmax+1)` for `i64` during `tosa-to-linalg` pass for `tosa.cast`.

Found this issue while debugging a numerical mismatch for `deeplabv3`
model from `torchvision` represented in `tosa` dialect using the
`TorchToTosa` pipeline in `torch-mlir` repository. `torch.aten.to.dtype`
is converted to `tosa.cast` that casts `f32` to `i64` type. Technically
by the specification, `tosa.cast` doesn't handle casting `f32` to `i64`.
So it's possible to add a verifier to error out for such tosa ops
instead of producing incorrect code. However, I chose to fix the
overflow issue to still be able to represent the `deeplabv3` model with
`tosa` ops in the above-mentioned pipeline. Open to suggestions if
adding the verifier is more appropriate instead.
2024-10-25 10:51:09 +01:00
Nikolas Klauser
2e43a304f1
[libc++] Granularize <vector> (#99705)
|                    | old time | new time |
| ------------------ | -------- | -------- |
| functional - c++23 | 416ms    | 225ms    |
| random - c++23     | 513ms    | 392ms    |
| vector - c++17     | 206ms    | 100ms    |
2024-10-25 11:28:46 +02:00
Jonathan Thackray
8be860ddc4
[AArch64] Add support for Armv9.6-A FEAT_PoPS architecture extension (#113496)
Add support for the following Armv9.6-A architecture extensions:
  * FEAT_PoPS      - Point of Physical Storage

as documented here:

https://developer.arm.com/documentation/109697/2024_09/Feature-descriptions/The-Armv9-6-architecture-extension

Co-authored-by: Alfie Richards <alfie.richards@arm.com>
2024-10-25 09:51:47 +01:00
Oliver Stannard
376d7b27fa [ARM] Optimise byval arguments in tail-calls
We don't need to copy byval arguments to tail calls via a temporary, if
we can prove that we are not copying from the outgoing argument area.
This patch does this when the source if the argument is one of:
* Memory in the local stack frame, which can't be used for tail-call
  arguments.
* A global variable.

We can also avoid doing the copy completely if the source and
destination are the same memory location, which is the case when the
caller and callee have the same signature, and pass some arguments
through unmodified.
2024-10-25 09:34:09 +01:00
Oliver Stannard
914a3990d1 [ARM] Avoid clobbering byval arguments when passing to tail-calls
When passing byval arguments to tail-calls, we need to store them into
the stack memory in which this the caller received it's arguments. If
any of the outgoing arguments are forwarded from incoming byval
arguments, then the source of the copy is from the same stack memory.
This can result in the copy corrupting a value which is still to be
read.

The fix is to first make a copy of the outgoing byval arguments in local
stack space, and then copy them to their final location. This fixes the
correctness issue, but results in extra copying, which could be
optimised.
2024-10-25 09:34:09 +01:00
Kiran
a96c14eeb8 [Clang] Always forward sret parameters to musttail calls
If a call using the musttail attribute returns it's value through an
sret argument pointer, we must forward an incoming sret pointer to it,
instead of creating a new alloca. This is always possible because the
musttail attribute requires the caller and callee to have the same
argument and return types.
2024-10-25 09:34:08 +01:00
Oliver Stannard
78ec2e2ed5 [ARM] Allow tail calls with byval args
Byval arguments which are passed partially in registers get stored into
the local stack frame, but it is valid to tail-call them because the
part which gets spilled is always re-loaded into registers before doing
the tail-call, so it's OK for the spill area to be deallocated.
2024-10-25 09:34:08 +01:00
Oliver Stannard
82e6472197 [ARM] Allow functions with sret returns to be tail-called
It is valid to tail-call a function which returns through an sret
argument, as long as we have an incoming sret pointer to pass on.
2024-10-25 09:34:08 +01:00
Oliver Stannard
c1eb790cd2 [ARM] Tail-calls do not require caller and callee arguments to match
The ARM backend was checking that the outgoing values for a tail-call
matched the incoming argument values of the caller. This isn't
necessary, because the caller can change the values in both registers
and the stack before doing the tail-call. The actual limitation is that
the callee can't need more stack space for it's arguments than the
caller does.

This is needed for code using the musttail attribute, as well as
enabling tail calls as an optimisation in more cases.
2024-10-25 09:34:08 +01:00
Oliver Stannard
246baeb5fe [ARM] Add debug trace for tail-call optimisation
There are lots of reasons a call might not be eligible for tail-call
optimisation, this adds debug trace to help understand the compiler's
decisions here.
2024-10-25 09:34:08 +01:00
Oliver Stannard
8e289e4fa6 [ARM] Fix comment typo 2024-10-25 09:34:07 +01:00