558919 Commits

Author SHA1 Message Date
Baranov Victor
ad9eb0d016
Add default empty header filter regex to root .clang-tidy (#167386)
After https://github.com/llvm/llvm-project/pull/164165, we emit warnings
from non-system headers by default.
This change only preserves functionality of `clang-tidy` as it was
before the change.
2025-11-11 01:36:25 +03:00
Susan Tan (ス-ザン タン)
bf3b704c60
[flang][NFC] Characterize allocation based on MemAlloc effect instead of pattern matching (#166806)
Flang alias analysis used to find allocation site by pattern matching
allocation ops in mainly FIR dialect. This MR extends the
characterization to instead characterize based on whether the result of
an op has MemAlloc effect.
2025-11-10 17:33:43 -05:00
AZero13
7b12a08f5e
[AArch64] Allow peephole to optimize AND + signed compare with 0 (#153608)
This should be the peephole's job. Because and sets V flag to 0, this is
why signed comparisons with 0 are okay to replace with tst. Note this is
only for AArch64, because ANDS on ARM leaves the V flag the same.

Fixes: https://github.com/llvm/llvm-project/issues/154387
2025-11-10 22:32:31 +00:00
Zhen Wang
d5125b3089
[flang][CUDA] Unify element size computation in CUF helpers (#167398)
Refactor computeWidth from CUFOpConversion into a shared helper function
computeElementByteSize in CUFCommon.
2025-11-10 14:28:32 -08:00
Rahman Lavaee
95db31e7f6
Treat specifying a function in the bbsection profile without any directive as noop. (#167359) 2025-11-10 14:19:12 -08:00
Florian Hahn
8b1cc2d5f5 [VPlan] Update canNarrowLoad to check WidenMember0's op first (NFCI).
This hardens the code to check based on WideMember0's operands. This
ensures each call will go through the same check. Should be NFC
currently but needed when generalizing in follow-up patches.
2025-11-10 22:18:34 +00:00
Christopher Ferris
046ae85536
[scudo] Small cleanup of memory tagging code. (#166860)
Make the systemSupportsMemoryTagging() function return even on system
that don't support memory tagging. This avoids the need to always check
if memory tagging is supported before calling th function.

Make systemSupportsMemoryTagging() cache the getauxval return value
instead of calling the function every time.

Updated the code that calls systemSupportsMemoryTagging().
2025-11-10 14:17:23 -08:00
Vitaly Buka
a1934ee500
[NFC][SpecialCaseList] Replace callback with return value (#165943)
This commit introduces `SpecialCaseList::Match`, a small struct to hold
the matched rule and its line number. This simplifies the `match`
methods by allowing them to return a single value instead of using a
callback.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-10 22:04:01 +00:00
Florian Hahn
0767c64043 [VPlan] Use getDefiningRecipe instead of directly accessing Def. (NFC)
Use getDefiningRecipe to future-proof the code. Split off from
https://github.com/llvm/llvm-project/pull/156262 as suggested.
2025-11-10 21:55:19 +00:00
Matt Arsenault
8c86bc89c1
AMDGPU/GlobalISel: Fix AGPR regbank check for mfma_scale (#167393)
Fixes regressions with #159493 after 476a6ea9575
2025-11-10 21:54:35 +00:00
Jackson Stogel
4b9d7e167b
Reapply "[libc] Return errno from OFD failure paths in fcntl." (#166658) (#166846)
The previous implementation in #166252 (rolled back in #166658) caused
buildbot failures due to a bug in an added test. The modified
`UseAfterClose` did not pass a `struct flock` value to `fcntl`:


2d51705941/libc/test/src/fcntl/fcntl_test.cpp (L175)

Which ASAN caught and errored in the `fcntl` implementation when the
unspecified argument was accessed:


c12cb2892c/libc/src/__support/OSUtil/linux/fcntl.cpp (L59)
2025-11-10 13:39:34 -08:00
jofrn
fb2fa21bd6
[AMDGPU] Remove calling conv check on entry function (#162080)
It is undefined behavior to call a function with a mismatched calling
convention. Rather than crash on this behavior, it should compile.

This LLVM defect was identified via the AMD Fuzzing project.
2025-11-10 16:27:55 -05:00
Adrian Prantl
20e1a12480 [LLDB] Fix (more) darwin shell tests under ASAN 2025-11-10 13:25:44 -08:00
Kevin Sala Penades
540250ca7a
[OpenMP][Clang] Add codegen support for dyn_groupprivate clause (#152830)
This adds the codegen support for the dyn_groupprivate clause.
2025-11-10 13:11:03 -08:00
Amr Hesham
b4a61517a6
[CIR][NFC] Re-land: Add test for Complex imag literal GNU extension (#167383)
Re-land: Add test for Complex imag literal GNU extension after updating
the name
2025-11-10 22:04:49 +01:00
Vitaly Buka
a37c4e0fad
[NFC][SpecialCaseList] Hide Section internals in private section (#167276)
Preparing to moving most of implementation out of the header file.

* https://github.com/llvm/llvm-project/pull/167280

---------

Co-authored-by: Naveen Seth Hanig <naveen.hanig@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-10 21:03:20 +00:00
Jordan Rupprecht
17e26411f8
[bazel][clang] Port #167374: split clang options/driver (#167387) 2025-11-10 20:56:59 +00:00
Fateme Hosseini
826cadd562
[Hexagon] Clean-up Instrprof test (#166990) 2025-11-10 12:55:07 -08:00
Brox Chen
067f1556d0
[AMDGPU] remove clamp and omod for trans bf16 insts (#165819)
trans bf16 insts do not support clamp and omod
2025-11-10 15:50:51 -05:00
Matt Arsenault
2aa629da6a
AArch64: Enable terminal rule (#165959) 2025-11-10 12:49:21 -08:00
Matt Arsenault
f8e9723d17
ARM: Enable terminal rule (#165958) 2025-11-10 12:49:01 -08:00
Adrian Prantl
2fc2e1f951 [LLDB] Fix darwin shell tests under ASAN 2025-11-10 12:34:13 -08:00
Matt Arsenault
793ab6a80d
X86: Enable terminal rule (#165957) 2025-11-10 12:34:00 -08:00
Justin Bogner
4ae7348513
[DirectX] Teach DXILResourceAccess about cbuffers (#164554)
This isn't reachable today but will come into play once we reorder
passes for #147352 and #147351.

Note that the `CBufferRowIntrin` helper struct is copied from the
`DXILCBufferAccess` pass, but it will be removed from there when we
simplify that pass in #147351
2025-11-10 12:32:43 -08:00
Naveen Seth Hanig
f63d33da0a
Reland "[clang] Refactor option-related code from clangDriver into new clangOptions library" (#167374)
This relands #167348.

The original PR was reverted due to a reported build failure, which was
later diagnosed as a local issue in the developer’s checkout or build
state. See discussion here:
https://github.com/llvm/llvm-project/pull/163659#discussion_r2511546964

No additional changes have been made in this reland.
2025-11-10 21:24:39 +01:00
Matt Arsenault
f2f04c363c
RuntimeLibcalls: Add call entries for sincos sleef and armpl libcalls (#166983)
These are the tested set of libcalls used for codegen of llvm.sincos
and are needed to get the legalization to follow standard procedure.
2025-11-10 12:00:02 -08:00
Aiden Grossman
eae817d26a
Reapply "[CI] Make premerge_advisor_explain write comments" (#167198)
This reverts commit c0e4bced616cffe01dd6816638355ae14ced528a.

This was causing issues on older python versions. They are fixed in the
reland and have been tested as working.
2025-11-10 11:57:35 -08:00
Pranav Kant
2f54efd1bf
[MachineOutliner] Don't outline ADRP pair to avoid incorrect ICF (#160232)
On AArch64, ADRP and its user instructions (LDR, ADD, etc.), that are
referencing a GOT symbol, when separated into different functions by
machine outliner exposes a correctness issue in the linker ICF. In such
cases, user instructions can end up pointing to a folded section (with
its canonical folded symbol), while ADRP instruction point to a GOT
entry corresponding to the original symbol. This leads to loading from
incorrect memory address after ICF. #129122 explains how this can happen
in detail.

This addresses #131660 which should fix two things:
1. Hide the correctness issue described above in the LLVM linker.
2. Allows optimizations that could relax GOT addressing to PC-relative
addressing.
2025-11-10 11:54:16 -08:00
Amr Hesham
70a6475fdd
Revert "[CIR][NFC] Add test for Complex imag with GUN extension" (#167373)
Revert "[CIR][NFC] Add test for Complex imag with GUN extension" to fix
the name

This reverts commit 9f0c4498aa60c82574618ca70f47fd9754454e64.
2025-11-10 19:49:02 +00:00
Jasmine Tang
5c4083ef1c
[WebAssembly] Enable musttail only when tail-call is enabled (#163618)
Fixes https://github.com/llvm/llvm-project/issues/163256
2025-11-10 19:38:25 +00:00
Paul Kirth
0364bafdad
[clang] Fix possible nullptr deref in BuildCXXNestedNameSpecifier (#166995)
There is a possible nullptr deref in BuildCXXNestedNameSpecifier when
calling ExtendNestedNameSpecifier or using isa<>. This initially showed
up as a crash in clangd, that didn't manifest in when compiling w/
clang. The reduced test case added in this patch, however does expose
the issue in clang. Testing locally shows that both this test case and
the original clangd issue are fixed by checking the validity of the
pointer before trying to dispatch. Since all code paths require the
pointer to be valid (usually by virtue of a dyn_cast or isa<> check),
there should be no functional difference.

Fixes #166843
2025-11-10 11:28:25 -08:00
Vitaly Buka
efc83cc4a0
[NFC][SpecialCaseList] Precommit Version 4 tests (#167282)
At the moment the behavior is no different from
Version 3.
2025-11-10 19:27:57 +00:00
Krzysztof Parzyszek
89577e910e
[flang][OpenMP] Detect complex part designators in atomic variables (#166612)
Complex part designators do not have their own symbols. A symbol
obtained for the expression `x%re` will be the symbol for `x`, and in
this case x is allowed to be allocatable.

Fixes https://github.com/llvm/llvm-project/issues/166278.
2025-11-10 13:22:19 -06:00
Matt Arsenault
821d2825a4
RuntimeLibcalls: Remove incorrect sincospi from most targets (#166982)
sincospi/sincospif/sincospil does not appear to exist on common
targets. Darwin targets have __sincospi and __sincospif, so define
and use those implementations. I have no idea what version added
those calls, so I'm just guessing it's the same conditions as
__sincos_stret.

Most of this patch is working to preserve codegen when a vector
library is explicitly enabled. This only covers sleef and armpl,
as those are the only cases tested.

The multiple result libcalls have an aberrant process where the
legalizer looks for the scalar type's libcall in RuntimeLibcalls,
and then cross references TargetLibraryInfo to find a matching
vector call. This was unworkable in the sincospi case, since the
common case is there is no scalar call available. To preserve
codegen if the call is available, first try to match a libcall
with the vector type before falling back on the old scalar search.

Eventually all of this logic should be contained in RuntimeLibcalls,
without the link to TargetLibraryInfo. In principle we should perform
the same legalization logic as for an ordinary operation, trying
to find a matching subvector type with a libcall.
2025-11-10 11:05:08 -08:00
Nikolas Klauser
46a8ddbd14
[libc++abi][NFC] Remove some cruft from <__cxxabi_config.h> (#164578)
In `<__cxxabi_config.h>` there were a few things still around which
aren't ever actually used. This removes some of that cruft.
2025-11-10 20:04:26 +01:00
Nikolas Klauser
0d97f43974
[libc++] Inline vector::__append into resize (#162086)
These functions are only used in a single place, so there is not much
reason to keep them around.
2025-11-10 20:02:54 +01:00
agozillon
08222caf28
[Flang][OpenMP] Move char box bounds generation for Maps to DirectiveCommons.h (#165918)
Currently we generate these bounds in the MapInfoFinalization.cpp pass
as it seems there's a missing case for character strings/arrays (length
parameter) in the DirectiveCommons bounds generation functionality
OpenMP uses for it's map operations.

This PR tries to add this case to the DirectiveCommons function and
remove the need for the bounds generation in the MapInfoFinalization
pass, so that we are generating the bounds in the same place most other
bounds are generated.
2025-11-10 19:57:53 +01:00
Matt Arsenault
b7423af8da
RuntimeLibcalls: Add entries for vector sincospi functions (#166981)
Add libcall entries for sleef and armpl sincospi implementations.
This is the start of adding the vector library functions; eventually
they should all be tracked here.

I'm starting with this case because this is a prerequisite to fix
reporting sincospi calls which do not exist on any common targets
without
regressing vector codegen when these libraries are available.
2025-11-10 10:56:33 -08:00
Simon Pilgrim
e9d3340b57
[X86] _mm_addsub_pd is not valid for constexpr (#167363)
Typo in #156822

Part of #166814
2025-11-10 18:56:13 +00:00
Andy Kaylor
b639b6a1c5
[CIR] Re-land: Recognize constant aggregate initialization of auto vars (#167033)
This adds code that was previously missing from emitAutoVarAlloca to
identify when an aggregate auto var is being emitted with a constant
initializer, and the associated code that is called from emitAutoVarInit
to store the constant. This allows significantly more efficient
initialization.

This was previously committed in
https://github.com/llvm/llvm-project/pull/166850 but that change
contained an unintended modification to an unrelated test.
2025-11-10 10:51:21 -08:00
LLVM GN Syncbot
5eb712608b [gn build] Port d2521f14a73d 2025-11-10 18:31:14 +00:00
LLVM GN Syncbot
f7c61b68f8 [gn build] Port caed0893465a 2025-11-10 18:31:13 +00:00
LLVM GN Syncbot
de147e51f9 [gn build] Port 315d705b7608 2025-11-10 18:31:12 +00:00
LLVM GN Syncbot
824df4686c [gn build] Port 2345b7d98f75 2025-11-10 18:31:11 +00:00
zhijian lin
ccedf259fc
[PowerPC] convert memmove to milicode call .___memmove64[PR] in 64-bit mode (#167334)
conversion of bl memmove call to milicode bl .___memmove64[PR] in
64--bit mode is broken , the patch fix the problem.
 
in the llvm/include/llvm/IR/RuntimeLibcalls.td, we do not need to define
the

 `def ___memmove64 : RuntimeLibcallImpl<MEMCPY>` in PPC64AIXCallList 
` def ___memmove32 : RuntimeLibcallImpl<MEMCPY>` in PPC32AIXCallList
 
 since there is function 
 
```
   /// Return a function impl compatible with RTLIB::MEMCPY, or
  /// RTLIB::Unsupported if fully unsupported.
  RTLIB::LibcallImpl getMemcpyImpl() const {
    RTLIB::LibcallImpl Memcpy = getLibcallImpl(RTLIB::MEMCPY);
    if (Memcpy == RTLIB::Unsupported) {
      // Fallback to memmove if memcpy isn't available.
      return getLibcallImpl(RTLIB::MEMMOVE);
    }

    return Memcpy;
  }
```
2025-11-10 10:30:40 -08:00
Helena Kotas
6d1831361f
[HLSL] Add internal linkage attribute to resources (#166844)
HLSL resources should not be externally visible from the module. We made sure of this by marking them `static` as soon as they were declared. However, this prevents us fixing issue #166458 because there is no way to know if a resource has been explicitly marked `static` by the user, and can therefore be assigned to.

This change moves from making all resources `static` to adding Clang internal linkage attribute to all non-static resource declarations as a global scope.

No explicit test added this change. There is a number of existing HLSL codegen tests that already verify that the resource globals are emitted as `internal global`.
2025-11-10 10:25:59 -08:00
Matt Arsenault
5aec174894 AMDGPU: Update test after e95f6fa12
Test newer than last presubmit check
2025-11-10 10:23:54 -08:00
Jordan Rupprecht
ca175843e7
[bazel] Port #166980: TLI/VectorLibrary refactor (#167354) 2025-11-10 18:11:33 +00:00
Louis Dionne
d2521f14a7
[libc++] Split macros related to hardening into their own header (#167069)
Hardening macros are easy to extract into their own header, and doing so
decreases the complexity of the main __config file.
2025-11-10 12:57:41 -05:00
Louis Dionne
911d1c2a24
[libc++][NFC] Remove unused imports from generate_feature_test_macro_components.py (#159591) 2025-11-10 12:56:43 -05:00