10051 Commits

Author SHA1 Message Date
Jim Lin
dfbb9a0e30
[RISCV] Implement intrinsics for XAndesVDot (#141441)
This patch implements clang intrinsic support for XAndesVDot.

The document for the intrinsics can be found at:

https://github.com/andestech/andes-vector-intrinsic-doc/blob/ast-v5_4_0-release-v5/auto-generated/andes-v5/intrinsic_funcs.adoc#andes-vector-dot-product-extensionxandesvdot
and with policy variants
https://github.com/andestech/andes-vector-intrinsic-doc/blob/ast-v5_4_0-release-v5/auto-generated/andes-v5/policy_funcs/intrinsic_funcs.adoc#andes-vector-dot-product-extensionxandesvdot

Co-authored-by: Tony Chuan-Yue Yuan <yuan593@andestech.com>
2025-05-31 14:12:01 +08:00
Weining Lu
fbbae9ea2b [LoongArch] Only report the first range error if there is actually more than one for __builtin_loongarch_cacop_[wd]
Other builtins do the same. Align with them.
2025-05-30 10:29:00 +08:00
Qinkun Bao
f9073e7e62
[UBSan] Move type:*=sanitize handling. (#142006)
As discussed in https://github.com/llvm/llvm-project/issues/139128, this
PR moves =sanitize handling from `ASTContext::isTypeIgnoredBySanitizer`
to `NoSanitizeList::containsType`.

Before this PR: "=sanitize" has priority regardless of the order
After this PR: If multiple entries match the source, than the latest
entry takes the precedence.
2025-05-29 19:38:33 -04:00
Paul Kirth
d93788fcbf
Revert "[Clang][LoongArch] Support target attribute for function" (#141998)
Reverts llvm/llvm-project#140700

This breaks bots both in buildbot and downstream CI: 
- https://lab.llvm.org/buildbot/#/builders/11/builds/16173
- https://lab.llvm.org/buildbot/#/builders/202/builds/1531
-
https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-host-linux-x64/b8713537585914796017/overview
2025-05-29 11:26:44 -07:00
Ami-zhang
b359422eeb
[Clang][LoongArch] Support target attribute for function (#140700)
This adds support under LoongArch for the target("..") attributes.

The supported formats are:
- "arch=<arch>" strings, that specify the architecture features for a
function as per the -march=arch option.
- "tune=<cpu>" strings, that specify the tune-cpu cpu for a function as
per -mtune.
- "<feature>", "no-<feature>" enabled/disables the specific feature.
2025-05-29 19:54:48 +08:00
Thurston Dang
9553514e4a
[NFCI][ubsan] Precommit tests for -fsanitize-annotate-debug-info (#141814)
These tests will track progress on extending
https://github.com/llvm/llvm-project/pull/139809 from CFI to more UBSan
checks.
2025-05-28 14:12:39 -07:00
Qinkun Bao
45b874bc57
[UBSan] Support src:*=sanitize for multiple ignorelists. (#141640)
See: https://github.com/llvm/llvm-project/issues/139128 and
https://github.com/llvm/llvm-project/pull/140529 for the background.

The introduction of these new tests (ubsan-src-ignorelist-category.test)
`-fsanitize-ignorelist=%t/src.ignorelist
-fsanitize-ignorelist=%t/src.ignorelist.contradict9` in this PR will not
lead to failures in the previous implementation (without this PR). This
is because the existing logic distinguishes between Sections in
different ignorelists, even if their names are identical. The order of
these Sections is preserved using a `vector`.
2025-05-28 11:12:53 -04:00
Qinkun Bao
4f1291e484
[UBSan] Implement src:*=sanitize for UBSan (#140529)
Background: https://github.com/llvm/llvm-project/issues/139128

It is a draft implementation for "src:*=sanitize". It should be applied
to all sanitizers.

Any srcs assigned to the sanitize category will have their sanitizer
instrumentation remained ignored by "src:". For example,

```
src:*
src:*/test1.cc=sanitize
```

`test1.cc` will still have the UBSan instrumented.

Conflicting entries are resolved by the latest entry, which takes
precedence.

```
src:*
src:*/mylib/*=sanitize
src:*/mylib/test.cc
```
`test.cc` does not have the UBSan check (In this case,
`src:*/mylib/test.cc` overrides `src:*/mylib/*=sanitize` for `test.cc`).

```
src:*
src:*/mylib/test.cc
src:*/mylib/*=sanitize
```

`test1.cc` has the UBSan instrumented (In this case,
`src:*/mylib/*=sanitize` overrides `src:*/mylib/test.cc`).

Documents update will be in a new PR.
2025-05-27 19:19:25 -07:00
Harald van Dijk
86d1d4eacb
[RISC-V] Allow intrinsics to be used with any pointer type. (#139634)
RISC-V does not use address spaces and leaves them available for user
code to make use of. Intrinsics, however, required pointer types to use
the default address space, complicating handling during lowering to
handle non-default address spaces. When the intrinsics are overloaded,
this is handled without extra effort.

This commit does not yet update Clang builtin functions to also permit
pointers to non-default address spaces.
2025-05-23 09:40:27 +01:00
hev
689342de25
[Clang][LoongArch] Add inline asm support for the q constraint (#141037)
This patch adds support for the `q` constraint:
a general-purpose register except for $r0 and $r1 (for the csrxchg
instruction)

Link: https://gcc.gnu.org/pipermail/gcc-patches/2025-May/684339.html
2025-05-23 11:14:41 +08:00
Alex MacLean
3a84a4e55d
Reland "[NVPTX] Unify and extend barrier{.cta} intrinsic support" (#141143)
Note: This relands #140615 adding a ".count" suffix to the non-".all"
variants.

Our current intrinsic support for barrier intrinsics is confusing and
incomplete, with multiple intrinsics mapping to the same instruction and
intrinsic names not clearly conveying intrinsic semantics. Further, we
lack support for some variants. This change unifies the IR
representation to a single consistently named set of intrinsics.

- llvm.nvvm.barrier.cta.sync.aligned.all(i32)
- llvm.nvvm.barrier.cta.sync.aligned.count(i32, i32)
- llvm.nvvm.barrier.cta.arrive.aligned.count(i32, i32)
- llvm.nvvm.barrier.cta.sync.all(i32)
- llvm.nvvm.barrier.cta.sync.count(i32, i32)
- llvm.nvvm.barrier.cta.arrive.count(i32, i32)

The following Auto-Upgrade rules are used to maintain compatibility with
IR using the legacy intrinsics:

* llvm.nvvm.barrier0 --> llvm.nvvm.barrier.cta.sync.aligned.all(0)
* llvm.nvvm.barrier.n --> llvm.nvvm.barrier.cta.sync.aligned.all(x)
* llvm.nvvm.bar.sync --> llvm.nvvm.barrier.cta.sync.aligned.all(x)
* llvm.nvvm.barrier --> llvm.nvvm.barrier.cta.sync.aligned.count(x, y)
* llvm.nvvm.barrier.sync --> llvm.nvvm.barrier.cta.sync.all(x)
* llvm.nvvm.barrier.sync.cnt --> llvm.nvvm.barrier.cta.sync.count(x, y)
2025-05-22 19:38:10 -07:00
Alex Maclean
e72d8b2553 Revert "[NVPTX] Unify and extend barrier{.cta} intrinsic support (#140615)"
This reverts commit 735209c0688b10a66c24750422b35d8c2ad01bb5.
2025-05-22 17:28:43 +00:00
Mohammad Bashir
bcdce987c0
Fix regression tests with bad FileCheck checks (#140373)
Fixes https://github.com/llvm/llvm-project/issues/140149
2025-05-22 07:59:57 +03:00
Alex MacLean
735209c068
[NVPTX] Unify and extend barrier{.cta} intrinsic support (#140615)
Our current intrinsic support for barrier intrinsics is confusing and
incomplete, with multiple intrinsics mapping to the same instruction and
intrinsic names not clearly conveying intrinsic semantics. Further, we
lack support for some variants. This change unifies the IR
representation to a single consistently named set of intrinsics.

- llvm.nvvm.barrier.cta.sync.aligned.all(i32)
- llvm.nvvm.barrier.cta.sync.aligned(i32, i32)
- llvm.nvvm.barrier.cta.arrive.aligned(i32, i32)
- llvm.nvvm.barrier.cta.sync.all(i32)
- llvm.nvvm.barrier.cta.sync(i32, i32)
- llvm.nvvm.barrier.cta.arrive(i32, i32)

The following Auto-Upgrade rules are used to maintain compatibility with
IR using the legacy intrinsics:

* llvm.nvvm.barrier0 --> llvm.nvvm.barrier.cta.sync.aligned.all(0)
* llvm.nvvm.barrier.n --> llvm.nvvm.barrier.cta.sync.aligned.all(x)
* llvm.nvvm.bar.sync --> llvm.nvvm.barrier.cta.sync.aligned.all(x)
* llvm.nvvm.barrier --> llvm.nvvm.barrier.cta.sync.aligned(x, y)
* llvm.nvvm.barrier.sync --> llvm.nvvm.barrier.cta.sync.all(x)
* llvm.nvvm.barrier.sync.cnt --> llvm.nvvm.barrier.cta.sync(x, y)
2025-05-21 08:14:15 -07:00
Vitaly Buka
bdc1296de4
[NFC] Ubsan a few corner cases for =sanitize (#140855) 2025-05-21 06:42:25 -04:00
Jim Lin
d561d595c4
[RISCV] Implement intrinsics for XAndesVPackFPH (#140007)
This patch implements clang intrinsic support for XAndesVPackFPH.

The document for the intrinsics can be found at:

https://github.com/andestech/andes-vector-intrinsic-doc/blob/ast-v5_4_0-release-v5/auto-generated/andes-v5/intrinsic_funcs.adoc#andes-vector-packed-fp16-extensionxandesvpackfph
and with policy variants

https://github.com/andestech/andes-vector-intrinsic-doc/blob/ast-v5_4_0-release-v5/auto-generated/andes-v5/policy_funcs/intrinsic_funcs.adoc#andes-vector-packed-fp16-extensionxandesvpackfph

Co-authored-by: Tony Chuan-Yue Yuan <yuan593@andestech.com>
2025-05-20 13:16:51 +08:00
Alexander Richardson
07e2ba445d
[AMDGPU] Set AS8 address width to 48 bits
Of the 128-bits of buffer descriptor only 48 bits are address bits, so
following the discussion on https://discourse.llvm.org/t/clarifiying-the-semantics-of-ptrtoint/83987/54,
the logic conclusion is to set the index width to 48 bits instead of
the current value of 128.

Most of the test changes are mechanical datalayout updates, but there
is one actual change: the ptrmask test now uses .i48 instead of .i128
and I had to update SelectionDAGBuilder to correctly extend the mask.

Reviewed By: krzysz00

Pull Request: https://github.com/llvm/llvm-project/pull/139419
2025-05-19 17:26:05 -07:00
Vitaly Buka
5db4aeae3c [NFC] Extend ubsan-src-ignorelist-category.test
For #140529.
2025-05-19 15:45:43 -07:00
Vitaly Buka
b93bc773f8 [NFC] Extend ubsan-src-ignorelist-category.test
For #140529.
2025-05-19 15:42:59 -07:00
Qinkun Bao
91a45a33fc
[NFC] Pre-commit UBSAN src:*=sanitize test (#140602)
For https://github.com/llvm/llvm-project/pull/140529
2025-05-19 15:22:13 -07:00
choikwa
77de8a0c0a
[AMDGPU][clang] provide device implementation for __builtin_logb and … (#129347)
…__builtin_scalbn

Clang generates library calls for __builtin_* functions which can be a
problem for GPUs that cannot handle them. This patch generates call to
device implementation for __builtin_logb and ldexp intrinsic for
__builtin_scalbn.
2025-05-19 14:11:31 -04:00
Thurston Dang
b24c33a9d7
[cfi] Enable -fsanitize-annotate-debug-info functionality for CFI checks (#139809)
This connects the -fsanitize-annotate-debug-info plumbing (https://github.com/llvm/llvm-project/pull/138577) to CFI check codegen, using SanitizerAnnotateDebugInfo() (https://github.com/llvm/llvm-project/pull/139965) and SanitizerInfoFromCFIKind (https://github.com/llvm/llvm-project/pull/140117).

Note: SanitizerAnnotateDebugInfo() is updated to a public function because it is needed in ItaniumCXXABI.

Updates the tests from https://github.com/llvm/llvm-project/pull/139149.
2025-05-19 09:39:26 -07:00
Matthew Devereau
22576e2cce
[Clang][AArch64] Add pessimistic vscale_range for sve/sme (#137624)
The "target-features" function attribute is not currently considered
when adding vscale_range to a function. When +sve/+sme are pushed onto
functions with "#pragma attribute push(+sve/+sme)", the function
potentially misses out on optimizations that rely on vscale_range being
present.
2025-05-16 09:39:07 +01:00
Kiva
af083d09bd
[RISCV] Add zihintpause LLVM/Clang intrinsic (#139519)
This PR adds the missing intrinsic `__builtin_riscv_pause` for the
zihintpause extension.

Spec:
https://five-embeddev.com/riscv-user-isa-manual/Priv-v1.12/zihintpause.html
Fixes #129961
2025-05-16 14:20:53 +08:00
Lukacma
6fc0312919
[Clang][AArch64] Add fp8 variants for untyped NEON intrinsics (#128019)
This patch adds fp8 variants to existing intrinsics, whose operation
doesn't depend on arguments being a specific type.

It also changes mfloat8 type representation in memory from `i8` to
`<1xi8>`
2025-05-15 14:01:41 +01:00
David Green
f8f11c541d [AArch64] Add a test case for the coerced arguments. NFC 2025-05-15 11:51:58 +01:00
Jessica Clarke
864f0ff4ef
[clang][IR] Overload @llvm.thread.pointer to support non-AS0 targets (#132489)
Thread-local globals live, by default, in the default globals address
space, which may not be 0, so we need to overload @llvm.thread.pointer
to support other address spaces, and use the default globals address
space in Clang.
2025-05-14 21:51:56 +01:00
Tomohiro Kashiwada
76d866f793
[Cygwin] Global symbols should be external by default (#139797)
Behaves as same as both of Clang and GCC targetting MinGW. Required for
compatibility for Cygwin-GCC.

Divided from https://github.com/llvm/llvm-project/pull/138773
2025-05-14 22:21:09 +03:00
Craig Topper
bf0655f208
[RISCV] Improve casting between i1 scalable vectors and i8 fixed vectors for -mrvv-vector-bits (#139190)
For i1 vectors, we used an i8 fixed vector as the storage type.

If the known minimum number of elements of the scalable vector type is
less than 8, we were doing the cast through memory. This used a load or
store from a fixed vector alloca. If  is less than 8, DataLayout
indicates that the load/store reads/writes vscale bytes even if vscale
is known and vscale*X is less than or equal to 8. This means the load or
store is outside the bounds of the fixed size alloca as far as
DataLayout is concerned leading to undefined behavior.

This patch avoids this by widening the i1 scalable vector type with zero
elements until it is divisible by 8. This allows it be bitcasted to/from
an i8 scalable vector. We then insert or extract the i8 fixed vector
into this type.

Hopefully this enables #130973 to be accepted.
2025-05-14 10:27:00 -07:00
Srinivasa Ravi
155e188d94
[NVPTX] Add intrinsics and clang builtins for conversions of f4x2 type (#139244)
This change adds intrinsics and clang builtins for the cvt instruction
variants of type (FP4) `.e2m1x2`. introduced in PTX 8.6 for `sm_100a`,
`sm_101a`, and `sm_120a`.

Tests are added in `NVPTX/convert-sm100a.ll` and
`clang/test/CodeGen/builtins-nvptx.c` and verified through ptxas 12.8.0.

PTX Spec Reference:
https://docs.nvidia.com/cuda/parallel-thread-execution/#data-movement-and-conversion-instructions-cvt
2025-05-14 14:39:59 +05:30
Hood Chatham
e29b70ee11
[WebAssembly][Clang] Add __builtin_wasm_ref_is_null_extern (#139580)
I also fixed __builtin_wasm_ref_null_extern() to generate a diagnostic
when it gets an argument. It seems like `SemaRef.checkArgCount()` has a
bug that makes it unable to check for 0 args.
2025-05-13 21:36:51 -07:00
Bill Wendling
9ae3bce175
[Clang][counted_by] Add support for 'counted_by' on struct pointers (#137250)
The 'counted_by' attribute is now available for pointers in structs.
It generates code for sanity checks as well as
__builtin_dynamic_object_size()
calculations. For example:

  struct annotated_ptr {
    int count;
    char *buf __attribute__((counted_by(count)));
  };

If the pointer's type is 'void *', use the 'sized_by' attribute, which
works similarly to 'counted_by', but can handle the 'void' base type:

  struct annotated_ptr {
    int count;
    void *buf __attribute__((sized_by(count)));
  };

If the 'count' field member occurs after the pointer, use the
'-fexperimental-late-parse-attributes' flag during compilation.

Note that 'counted_by' cannot be applied to a pointer to an incomplete
type, because the size isn't known.

  struct foo;
  struct annotated_ptr {
    int count;
    struct foo *buf __attribute__((counted_by(count))); /* invalid */
  };

Signed-off-by: Bill Wendling <morbo@google.com>
2025-05-13 16:01:36 -07:00
ykhatav
3cf280c16a
Emit nested unused enum types with -fno-eliminate-unused-debug-types (#137818)
Unused types are retained in the debug info when
-fno-eliminate-unused-debug-types is specified.
However, unused nested enums were not being emitted even with this
option.
This patch fixes the missing emission of unused nested enums with
-fno-eliminate-unused-debug-types
2025-05-13 11:29:53 -04:00
Thurston Dang
40767e9575
[cfi][NFCI] Pre-commit -fsanitize-annotate-debug-info tests for CFI (#139149)
These tests will show progress as the -fsanitize-annotate-debug-info
plumbing (https://github.com/llvm/llvm-project/pull/138577) gets
connected to CFI check codegen.
2025-05-12 11:02:01 -07:00
Ricardo Jesus
af03d6b518
[AArch64][SVE] Refactor getPTrue to return splat(1) when pattern=all. (#139236)
Similarly to #135016, refactor getPTrue to return splat (1) for
all-active patterns. The main motivation for this is to improve
code gen for fixed-length vector loads/stores that are converted to SVE
masked memory ops when the vectors are wider than Neon. Emitting the
mask as a splat helps DAGCombiner simplify all-active masked
loads/stores into unmaked ones, for which it already has suitable
combines and ISel has suitable patterns.
2025-05-12 10:35:30 +01:00
Daniel Paoliello
97a58b04c6
[aarch64][x86][win] Add compiler support for MSVC's /funcoverride flag (Windows kernel loader replaceable functions) (#125320)
Adds support for MSVC's undocumented `/funcoverride` flag, which marks
functions as being replaceable by the Windows kernel loader. This is
used to allow functions to be upgraded depending on the capabilities of
the current processor (e.g., the kernel can be built with the naive
implementation of a function, but that function can be replaced at boot
with one that uses SIMD instructions if the processor supports them).

For each marked function we need to generate:
* An undefined symbol named `<name>_$fo$`.
* A defined symbol `<name>_$fo_default$` that points to the `.data`
section (anywhere in the data section, it is assumed to be zero sized).
* An `/ALTERNATENAME` linker directive that points from `<name>_$fo$` to
`<name>_$fo_default$`.

This is used by the MSVC linker to generate the appropriate metadata in
the Dynamic Value Relocation Table.

Marked function must never be inlined (otherwise those inline sites
can't be replaced).

Note that I've chosen to implement this in AsmPrinter as there was no
way to create a `GlobalVariable` for `<name>_$fo$` that would result in
a symbol being emitted (as nothing consumes it and it has no
initializer). I tried to have `llvm.used` and `llvm.compiler.used` point
to it, but this didn't help.

Within LLVM I referred to this feature as "loader replaceable" as
"function override" already has a different meaning to C++ developers...

I also took the opportunity to extract the feature symbol generation
code used by both AArch64 and X86 into a common function in AsmPrinter.
2025-05-09 14:56:38 -07:00
Oliver Hunt
65a6cbde5b
[clang] Add support for __ptrauth being applied to integer types (#137580)
Allows the __ptrauth qualifier to be applied to pointer sized integer types,
updates Sema to ensure trivially copyable, etc correctly handle address
discriminated integers, and updates codegen to perform authentication
around arithmetic on the types.
2025-05-09 13:12:09 -07:00
Daniel Paoliello
72c3ed6745
[win][x64] Unwind v2 3/n: Add support for emitting unwind v2 information (equivalent to MSVC /d2epilogunwind) (#129142)
Adds support for emitting Windows x64 Unwind V2 information, includes
support `/d2epilogunwind` in clang-cl.

Unwind v2 adds information about the epilogs in functions such that the
unwinder can unwind even in the middle of an epilog, without having to
disassembly the function to see what has or has not been cleaned up.

Unwind v2 requires that all epilogs are in "canonical" form:
* If there was a stack allocation (fixed or dynamic) in the prolog, then
the first instruction in the epilog must be a stack deallocation.
* Next, for each `PUSH` in the prolog there must be a corresponding
`POP` instruction in exact reverse order.
* Finally, the epilog must end with the terminator.

This change adds a pass to validate epilogs in modules that have Unwind
v2 enabled and, if they pass, emits new pseudo instructions to MC that
1) note that the function is using unwind v2 and 2) mark the start of
the epilog (this is either the first `POP` if there is one, otherwise
the terminator instruction). If a function does not meet these
requirements, it is downgraded to Unwind v1 (i.e., these new pseudo
instructions are not emitted).

Note that the unwind v2 table only marks the size of the epilog in the
"header" unwind code, but it's possible for epilogs to use different
terminator instructions thus they are not all the same size. As a work
around for this, MC will assume that all terminator instructions are
1-byte long - this still works correctly with the Windows unwinder as it
is only using the size to do a range check to see if a thread is in an
epilog or not, and since the instruction pointer will never be in the
middle of an instruction and the terminator is always at the end of an
epilog the range check will function correctly. This does mean, however,
that the "at end" optimization (where an epilog unwind code can be
elided if the last epilog is at the end of the function) can only be
used if the terminator is 1-byte long.

One other complication with the implementation is that the unwind table
for a function is emitted during streaming, however we can't calculate
the distance between an epilog and the end of the function at that time
as layout hasn't been completed yet (thus some instructions may be
relaxed). To work around this, epilog unwind codes are emitted via a
fixup. This also means that we can't pre-emptively downgrade a function
to Unwind v1 if one of these offsets is too large, so instead we raise
an error (but I've passed through the location information, so the user
will know which of their functions is problematic).
2025-05-09 10:42:10 -07:00
Yingwei Zheng
61a8da9367
[Clang][CodeGen] Add workaround for old glibc __PTR_ALIGN macro (#137851)
This patch adds a workaround for the old glibc `__PTR_ALIGN` macro:
```
((sizeof(long int) < sizeof(void *) ? (base) : (char *)0) +
   (((pointer) - (sizeof(long int) < sizeof(void *) ? (base) : (char *)0) +
     (align_mask)) &
    ~(align_mask)));
```
Closes https://github.com/llvm/llvm-project/issues/137833.
2025-05-09 19:23:48 +08:00
Yingwei Zheng
d2b012e391
[Clang][CodeGen] Enable pointer overflow check for GCC workaround (#137849)
Do not suppress the pointer overflow check for the `(i8*) nullptr + N`
idiom.

Related issue: https://github.com/llvm/llvm-project/issues/137833
2025-05-09 14:53:00 +08:00
Lei Wang
b836f96b8f
[Coverage] Support -fprofile-list for cold function coverage (#136333)
Add a new instrumentation section type `[sample-coldcov]` to
support`-fprofile-list` for sample pgo based cold function coverage.
Note that the current cold function coverage is based on sampling PGO
pipeline, which is incompatible with the existing [llvm] option(see
[PGOOptions](https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/Support/PGOOptions.h#L27-L43)),
so we can't reuse the IR-PGO(-fprofile-instrument=llvm) flag.
2025-05-08 10:51:38 -07:00
Kirill Radkin
b3ef15aa00
[RISCV] Fix generation of DWARF info for vector segmented types (#137941)
In DWARF info RISC-V Vector types are presented as DW_TAG_array_type
with tags DW_AT_type (what elements does this array consist of) and
DW_TAG_subrange_type. DW_TAG_subrange_type have DW_AT_upper_bound tag
which contain upper bound value for this array.

For now, it's generate same DWARF info about length of segmented types
and their corresponding non-tuple types.

For example, vint32m4x2_t and vint32m4_t have DW_TAG_array_type with
same DW_AT_type and DW_TAG_subrange_type, it means that this types have
same length, which is not correct
(vint32m4x2_t length is twice as big as vint32m4_t)
2025-05-08 18:29:27 +08:00
Prabhu Rajasekaran
20d6375796
[clang] Handle CC attrs for UEFI (#138935)
UEFI's default ABI is MS ABI. Handle the calling convention attributes
accordingly.
2025-05-07 21:42:01 -07:00
Thurston Dang
6a28d8c24a
[sanitizer] Add plumbing for -fsanitize-annotate-debug-info and partly replace '-mllvm -array-bounds-pseudofn' (#138577)
@fmayer introduced '-mllvm -array-bounds-pseudofn'
(https://github.com/llvm/llvm-project/pull/128977/) to make it easier to
see why crashes occurred, and to estimate with a profiler the cycles
spent on these array-bounds checks. This functionality could be usefully
generalized to other checks in future work.

This patch adds the plumbing for -fsanitize-annotate-debug-info, and
connects it to the existing array-bounds-pseudo-fn functionality i.e.,
-fsanitize-annotate-debug-info=array-bounds can be used as a replacement
for '-mllvm -array-bounds-pseudofn', though we do not yet delete the
latter.

Note: we replaced '-mllvm -array-bounds-pseudofn' in
clang/test/CodeGen/bounds-checking-debuginfo.c, because adding test
cases would modify the line numbers in the test assertions, and
therefore obscure that the test output is the same between '-mllvm
-array-bounds-pseudofn' and -fsanitize-annotate-debug-info=array-bounds.
2025-05-07 15:57:01 -07:00
Jim Lin
658cac84a1
[RISCV] Rename XCValu intrinsic name *_slet(u) to *_sle(u)) (#138498)
The instruction name and intrinsic name have been renamed to sle(u). The
`t` was removed. Please refer to
https://github.com/openhwgroup/core-v-sw/blob/master/specifications/corev-builtin-spec.md.
2025-05-06 09:57:07 +08:00
Lukacma
e4d9be3d12
[Clang][AArch64] make bitperm intrinsics available in streaming mode (#129700)
Based on recent changes in armv9.6 BitPerm instructions and thus
intrinsics are available in streaming mode when
[FEAT_SSVE_BitPerm](https://developer.arm.com/documentation/109697/2024_12/Feature-descriptions/The-Armv9-6-architecture-extension?lang=en#md463-the-armv96-architecture-extension__feat_FEAT_SSVE_BitPerm)
is available. This patch reflects this change and is based on [ACLE
proposal](https://github.com/ARM-software/acle/pull/385).
2025-05-02 11:52:09 +01:00
Douglas
efd46bc1ef
[sanitizer] Allow use-after-scope front-end argument to take effect with -fsanitize=kernel-address (#137015)
Allow `-f[no]-sanitize-address-use-after-scope` to take effect under
kernel-address sanitizer (`-fsanitize=kernel-address`). `use-after-scope` is
now enabled by default under kernel-address sanitizer.

Previously, users may have enabled `use-after-scope` checks for kernel-address
sanitizer via `-mllvm -asan-use-after-scope=true`. While this may have worked
for optimization levels > O0, the required lifetime intrinsics to allow for
`use-after-scope` detection were not emitted under O0. This commit ensures
the required lifetime intrinsics are emitted under O0 with kernel-address
sanitizer.
2025-04-28 11:54:43 -07:00
jyli0116
064f9d03f2
[AArch64] Add FEAT_FPAC to supported CPUs (#137330)
Added FEAT_FPAC onto supported AArch64 CPUs which don't have it under
the processor description.
2025-04-28 14:49:06 +01:00
Phoebe Wang
a87d8e9442
[X86][AVX512FP16] Decouple AVX512VL and AVX512DQ from AVX512FP16 (#137450)
Fixes: #136209
2025-04-27 14:01:37 +08:00
Nick Sarnie
b60ee39978
Revert "[clang][ARM][AArch64] Define intrinsics guarded by __has_builtin on all platforms" (#137374)
This reverts commit
de0153da32.

It breaks MSVC.

---------

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
2025-04-25 20:18:17 +00:00