544328 Commits

Author SHA1 Message Date
Baranov Victor
b6b64f49c4
Format root clang-tidy config (NFC) (#147902)
Formatted config to column format, which is more readable.
Placed checks in alphabetical order.
2025-07-11 07:18:29 +03:00
Un1q32
f09e589ca6
properly align long double on i386 darwin (#148102)
Fixes https://github.com/llvm/llvm-project/issues/148034

e49fcfc7cdf82e41f15a857083c0fb275c1b6021 broke long double stack
alignment on i386 Darwin, this PR fixes the issue.
2025-07-11 12:17:43 +08:00
Trevor Gross
22d584e34e
[x86] Synchronize fp128 and i128 ABI tests (nfc) (#147923)
The ABI tests for fp128 covers a handful of things that the i128 test
currently does not, including targets other than x86-64 Linux and some
simpler argument cases. Update the i128 test to be consistent with
fp128. All existing test function patterns still exist, though they all
wind up renamed.

Additionally correct some `call` signatures in the fp128 test (not
relevant for output).
2025-07-11 12:10:48 +08:00
Valentin Clement (バレンタイン クレメン)
c919221bbe
[flang][cuda][NFC] Remove TODO implemented in semantic (#148058) 2025-07-10 20:52:55 -07:00
Chuanqi Xu
aa9902691d [NFC] [clangd] [Modules] Logging more if compilation failed
Coming from internal using experience.

The original log is just confusing... Users can't understand it unless
he reads the code.

This patch tries to make this more understandable.

Note that the mentioned module files in the logs might be removed
intentionally. We need another option to allow users to remain these
module files. Let's done this in another patch.
2025-07-11 11:18:21 +08:00
hev
34b55e1807
[LoongArch] Precommit tests for 128-to-256-bit vector insertion and 256-to-128-bit subvector extraction (NFC) (#146299) 2025-07-11 11:15:17 +08:00
Muhammad Bassiouni
c25a5e08ba
[libc][math] Refactor expf16 implementation to header-only in src/__support/math folder. (#147428)
Part of #147386

in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-10 22:21:48 -04:00
Rahman Lavaee
82acb599fc
[NFC] Split UniqueBBID definition to a separate file. (#148043) 2025-07-10 18:55:01 -07:00
Igor Kudrin
f0befb0dcd
[clang] Combine ConstRefUse with other warnings for uninitialized values (#147898)
This helps to avoid duplicating warnings in cases like:
```
> cat test.cpp
void bar(int);
void foo(const int &);
void test(bool a) {
  int v = v;
  if (a)
    bar(v);
  else
    foo(v);
}
> clang++.exe test.cpp -fsyntax-only -Wuninitialized
test.cpp:4:11: warning: variable 'v' is uninitialized when used within its own initialization [-Wuninitialized]
    4 |   int v = v;
      |       ~   ^
test.cpp:4:11: warning: variable 'v' is uninitialized when used within its own initialization [-Wuninitialized]
    4 |   int v = v;
      |       ~   ^
2 warnings generated.
```
2025-07-10 18:24:19 -07:00
Igor Kudrin
aa4c8564c5
[clang][NFC] Remove an unused parameter in CFGBlockValues::getValue() (#147897)
The second parameter is unused since 6080d32194.
2025-07-10 18:22:53 -07:00
Owen Pan
cb52efb893
[clang-format] Split line comments separated by backslashes (#147648)
Fixes #147341
2025-07-10 18:14:45 -07:00
Owen Pan
7704f817d0
[clang-format][NFC] Replace a function with StringRef::contains (#146245) 2025-07-10 18:07:17 -07:00
Oliver Hunt
34a1daae83
[Clang] Mark a concept as being invalid if the constraint is invalid (#147938)
Make sure to mark a concept decl as being invalid if the constraint is
invalid.


Fixes #138823
2025-07-10 17:33:03 -07:00
Changpeng Fang
eba5130544
AMDGPU: Add MC tests for s_barrier_signal and s_get_barrier_state for gfx1250, NFC (#148070) 2025-07-10 17:29:25 -07:00
Stanislav Mekhanoshin
1f990f0c2d
[AMDGPU] gfx1250 VOPD MC overflow tests. NFC. (#147826) 2025-07-10 17:25:53 -07:00
Ryotaro Kasuga
7d510b7f21
[DA] Set Distance to zero when Direction is EQ (#147966)
A Dependence object has two entries: Distance and Direction. The former
represents the distance of the dependence, while the latter
characterizes the distance by whether the value of it is positive,
negative, or zero (especially, zero is represented by EQ in DA). So it
is expected that the Distance equals zero iff the Direction is EQ.
However, this condition was not satisfied in some cases.
This patch adds a logic to set the Distance to zero if the Direction is
EQ. Although it is ideal that the Distance is updated to zero
simultaneously when the Direction is set to EQ, achieving it would
require changing the entire code in DA.
2025-07-11 09:22:24 +09:00
Ryotaro Kasuga
c0b82df5f3
[MachinePipeliner] Add validation for missed loop-carried memory deps (#145878)
This patch adds an additional validation step to ensure that the
generated schedule does not violate loop-carried memory dependencies.
Prior to this patch, incorrect schedules could be produced due to the
lack of checks for the following types of dependencies:

- load-to-store backward (from bottom to top within the BB) dependencies
- store-to-load dependencies
- store-to-store dependencies

One possible solution to this issue is to add these dependencies
directly to the dependency graph, although doing so may lead to
performance degradation. In addition, no known cases of incorrect code
generation caused by these missing dependencies have been observed in
practice. Given these factors, this patch introduces a post-scheduling
validation phase to check for such previously missed dependencies,
instead of adding them to the graph before searching for a schedule.
Since no actual problems have been identified so far, it is likely that
most generated schedules are already valid. Therefore, this additional
validation is not expected to cause performance degradation in practice.

Split off from #135148 .

The remaining tasks are as follows:

- Address other missing loop-carried dependencies (e.g., output
dependencies between physical registers, barrier instructions, and
instructions that may raise floating-point exceptions)
- Remove code that are currently retained to maintain the existing
behavior but probably unnecessary.
- Eliminate `SwingSchedulerDAG::isLoopCarriedDep` and use
`SwingSchedulerDDG` to traverse edges after dependency analysis part.
2025-07-11 09:20:43 +09:00
Thurston Dang
6fc3b40b2c
[msan] Model is_int_min_poison to avoid false negative in abs (#148069)
Note: since this patch reduces false negatives, buggy code that formerly
passed with MSan may start failing.

The current MSan handler for abs, like Hercules' in New York, ignores
is_int_min_poison. This patch fixes the issue by poisoning the shadow
corresponding to each int_min input value if is_int_min_poison.
2025-07-10 16:47:53 -07:00
Charitha Saumya
da608271ae
Revert "[MLIR][Conversion] Add convert-xevm-to-llvm pass." (#148081)
Reverts llvm/llvm-project#147375
2025-07-10 16:21:11 -07:00
Stanislav Mekhanoshin
eb97422e00
[AMDGPU] Disable DPP with v_mov_b64 on gfx1250 (#148054) 2025-07-10 16:20:13 -07:00
Andy Kaylor
b415db02e7
[CIR] Add handlers for 'using enum' and namespace alias (#148011)
These decl types don't require any code generation, though when debug
info is implemented, we will need to add handling for that. Until then,
we just need to have a handler so they don't generate an NYI error.
2025-07-10 16:16:37 -07:00
Andres-Salamanca
78e0c76789
[CIR][NFC] Add example for get_bitfield with volatile qualifier (#147828)
The example demonstrates how `get_bitfield` is emitted when accessing a
bitfield declared as `volatile`.
2025-07-10 18:05:58 -05:00
Sang Ik Lee
76eead1bd7
[MLIR][Conversion] Add convert-xevm-to-llvm pass. (#147375)
Although XeVM is an LLVM extension dialect,
SPIR-V backend relies on [function
calls](https://llvm.org/docs/SPIRVUsage.html#instructions-as-function-calls)
instead of defining LLVM intrinsics to represent SPIR-V instructions.
convert-xevm-to-llvm pass lowers xevm ops to function declarations and
calls using the above naming convention.
In the future, most part of the pass should be replaced with llvmBuilder
and handled as part of translation to LLVM instead.

---------
Co-authored-by: Artem Kroviakov <artem.kroviakov@intel.com>
2025-07-10 16:04:36 -07:00
Matt Arsenault
14b2d2cc3a
RuntimeLibcalls: Add entries for objc runtime calls (#147920)
Stop emitting these calls by name in PreISelIntrinsicLowering. This
is still kind of a hack. We should be going through the abstract
RTLIB:Libcall, and then checking if the call is really supported in
this module. Do this as a placeholder until RuntimeLibcalls is a
module analysis.
2025-07-11 07:45:12 +09:00
Jorge Gorbe Moya
545b075a87 [bazel] Add missing dep after 61004b7eb5bf63d813118753727e02be13d1e9e0 2025-07-10 15:32:54 -07:00
Jonas Devlieghere
f28a497a06
[lldb] Support specifying a language for breakpoint conditions (#147603)
LLDB breakpoint conditions take an expression that's evaluated using the
language of the code where the breakpoint is located. Users have asked
to have an option to tell it to evaluate the expression in a specific
language.

This is feature is especially helpful for Swift, for example for a
condition based on the value in memory at an offset from a register.
Such a condition is pretty difficult to write in Swift, but easy in C.

This PR adds a new argument (-Y) to specify the language of the
condition expression. We can't reuse the current -L option, since you
might want to break on only Swift symbols, but run a C expression there
as per the example above.

rdar://146119507
2025-07-10 15:24:27 -07:00
Razvan Lupusoru
4859b92b7f
[flang][acc] Update FIR ref, heap, and pointer to be MappableType (#147834)
The MappableType OpenACC type interface is a richer interface that
allows OpenACC dialect to be capable to better interact with a source
dialect, FIR in this case. fir.box and fir.class types already
implemented this interface. Now the same is being done with the other
FIR types that represent variables.

One additional notable change is that fir.array no longer implements
this interface. This is because MappableType is primarily intended for
variables - and FIR variables of this type have storage associated and
thus there's a pointer-like type (fir.ref/heap/pointer) that holds the
array type.

The end goal of promoting these FIR types to MappableType is that we
will soon implement ability to generate recipes outside of the frontend
via this interface.
2025-07-10 15:23:57 -07:00
LLVM GN Syncbot
78eb92b383 [gn build] Port 3076794e924f 2025-07-10 21:58:56 +00:00
Rahul Joshi
b6a4621f3b
[NFC][TableGen] Minor code cleanup in SearchableTableEmitter (#147856)
- Add braces around if/else bodies per LLVM coding standards.
- Use range for loops and structured bindings.
- use auto for variables initialized with `dyn_cast`.
- Refactor `compareBy` to also use early return in the comparison loop
by extracting the comparison into lambdas.
2025-07-10 14:52:00 -07:00
Utkarsh Saxena
3076794e92
[LifetimeSafety] Introduce intra-procedural analysis in Clang (#142313)
This patch introduces the initial implementation of the
intra-procedural, flow-sensitive lifetime analysis for Clang, as
proposed in the recent RFC:
https://discourse.llvm.org/t/rfc-intra-procedural-lifetime-analysis-in-clang/86291

The primary goal of this initial submission is to establish the core
dataflow framework and gather feedback on the overall design, fact
representation, and testing strategy. The focus is on the dataflow
mechanism itself rather than exhaustively covering all C++ AST edge
cases, which will be addressed in subsequent patches.

#### Key Components

* **Conceptual Model:** Introduces the fundamental concepts of `Loan`,
`Origin`, and `Path` to model memory borrows and the lifetime of
pointers.
* **Fact Generation:** A frontend pass traverses the Clang CFG to
generate a representation of lifetime-relevant events, such as pointer
assignments, taking an address, and variables going out of scope.
* **Testing:** `llvm-lit` tests validate the analysis by checking the
generated facts.


### Next Steps
*(Not covered in this PR but planned for subsequent patches)*

The following functionality is planned for the upcoming patches to build
upon this foundation and make the analysis usable in practice:

* **Dataflow Lattice:** A dataflow lattice used to map each pointer's
symbolic `Origin` to the set of `Loans` it may contain at any given
program point.
* **Fixed-Point Analysis:** A worklist-based, flow-sensitive analysis
that propagates the lattice state across the CFG to a fixed point.
* **Placeholder Loans:** Introduce placeholder loans to represent the
lifetimes of function parameters, forming the basis for analysis
involving function calls.
* **Annotation and Opaque Call Handling:** Use placeholder loans to
correctly model **function calls**, both by respecting
`[[clang::lifetimebound]]` annotations and by conservatively handling
opaque/un-annotated functions.
* **Error Reporting:** Implement the final analysis phase that consumes
the dataflow results to generate user-facing diagnostics. This will
likely require liveness analysis to identify live origins holding
expired loans.
* **Strict vs. Permissive Modes:** Add the logic to support both
high-confidence (permissive) and more comprehensive (strict) warning
levels.
* **Expanded C++ Coverage:** Broaden support for common patterns,
including the lifetimes of temporary objects and pointers within
aggregate types (structs/containers).
* Performance benchmarking
* Capping number of iterations or number of times a CFGBlock is
processed.

---------

Co-authored-by: Baranov Victor <bar.victor.2002@gmail.com>
2025-07-10 23:42:20 +02:00
Stanislav Mekhanoshin
7920dff394
[AMDGPU] VOPD/VOPD3 changes for gfx1250 (#147602) 2025-07-10 14:15:01 -07:00
Uzair Nawaz
88ba06d6fc
[libc] Addressed todo to make first_non_whitespace to return an idx instead of ptr (#148004)
Addressed todo to make first_non_whitespace to return an idx instead of
ptr
2025-07-10 13:55:14 -07:00
Teresa Johnson
838701a540
MemProf: Add minimum count threshold for inlining of promoted calls (#148001)
Allow users to set the minimum absolute count for inlining of indirect
calls promoted during cloning. This is primarily meant to enable
generation of synthetic vp metadata introduced in PR141164 when
profiling memprof-optimized binaries.
2025-07-10 13:48:16 -07:00
WhatAmISupposedToPutHere
74a6e5cf91
[LLD][MinGW] Support machine:arm64x when invoked in MinGW mode. (#145343)
Mingw mode already supports building machine:arm64ec arm64x binaries,
support machine:arm64x ones too.

Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
2025-07-10 23:47:37 +03:00
Sang Ik Lee
61004b7eb5
[MLIR][GPU] Add xevm-attach-target transform pass. (#147372)
Add xevm-attach-target transform pass and unit-tests.

Co-authored-by: by Sang Ik Lee sang.ik.lee@intel.com.
Co-authored-by: Artem Kroviakov artem.kroviakov@intel.com
2025-07-10 15:44:26 -05:00
Peter Collingbourne
0c0aa56cdc Revert "compiler-rt: Introduce runtime functions for emulated PAC."
As well as followup "builtins: Speculative MSVC fix."

This reverts commits 5b1db59fb87b4146f827d17396f54ef30ae0dc40 and
f1c4df5b7bb79efb3e9be7fa5f8176506499d0a6.

Needs fixes for failing tests which will take time to implement.
2025-07-10 13:16:36 -07:00
Andres-Salamanca
3d08a40959
[CIR] Upstream new SetBitfieldOp for handling C and C++ struct bitfields (#147609)
This PR upstreams the `set_bitfield` operation used to assign values to
bitfield members in C and C++ struct types.
Handling of AAPCS-specific volatile bitfield semantics will be addressed
in a future PR.
2025-07-10 15:16:29 -05:00
Rahul Joshi
d8a2141ff9
[NFC][LLVM][ADT] Simplify StringRef case insensitive compare (#147994)
Change `ascii_strncasecmp` to use a range for loop and use StringRef
parameters.
2025-07-10 13:08:19 -07:00
AZero13
0edc98cd6d
[ARM] Copy SMAX(lhs, 0) and SMIN(lhs, 0) patterns from AArch64 to ARM (#146565)
They work on ARM too.
2025-07-10 21:06:52 +01:00
David Green
0736f330b0
[DAG] Handle truncated splat in isBoolConstant (#145473)
This allows truncated splat / buildvector in isBoolConstant, to allow
certain not instructions to be recognized post-legalization, and allow
vselect to optimize.

An override for x86 avx512 predicated vectors is required to avoid an
infinite recursion from the code that detects zero vectors. From:
```
  // Check if the first operand is all zeros and Cond type is vXi1.
  // If this an avx512 target we can improve the use of zero masking by
  // swapping the operands and inverting the condition.
```
2025-07-10 20:59:34 +01:00
Alexey Bataev
dd60663b9b [SLP] Emit reduction instead of 2 extracts + scalar op, when vectorizing operands (#147583)
Added emission of the 2-element reduction instead of 2 extracts + scalar
op, when trying to vectorize operands of the instruction, if it is more
profitable.
2025-07-10 12:50:52 -07:00
Florian Hahn
c452de1715
Reapply "[VPlan] Allow derived IVs and scalar-steps in narrowing interleave."
This reverts commit f5ed863176dd286462cd5558723dfe445967fedf.

Recommit patch now that the crash exposed by the change has been fixed.
2025-07-10 20:48:19 +01:00
Florian Mayer
4b30bf0ee9
[NFC] [docs] point users towards clang remark flags (#147820) 2025-07-10 12:32:09 -07:00
Kazu Hirata
682d6c4942 [ADT] Fix a warning
This patch fixes:

  llvm/unittests/ADT/DenseMapTest.cpp:94:25: error: unused function
  'getTestValue' [-Werror,-Wunused-function]
2025-07-10 12:26:42 -07:00
Mikhail R. Gadelha
922fca5cc9 [RISCV][VLOPT] Pre-commit tests for adding more instruction to vlopt
Signed-off-by: Mikhail R. Gadelha <mikhail@igalia.com>
2025-07-10 16:20:37 -03:00
Jorge Gorbe Moya
00dd6660c2
Add back fallthrough annotations removed by 7f3afab (#148032)
The original commit removed them to avoid the dependency on llvm Support
because of LLVM_FALLTHROUGH, but this triggers `-Wimplicit-fallthrough`
warnings.

LLVM requires a C++17 compiler now, so we should be able to use the
standard [[fallthrough]] attribute.
2025-07-10 12:02:34 -07:00
Nikolas Klauser
03f6f48b73
[libc++] Move a few tests into more correct places (#147557) 2025-07-10 20:55:07 +02:00
Jessica Clarke
9320d1d484
[compiler-rt] Don't handle Linux-specific shmctl commands in sanitizer (#143116)
Despite being defined in the system headers, these commands are not in
fact part of the FreeBSD system call interface. They exist solely for
the Linuxulator, i.e. running Linux binaries on FreeBSD, and any attempt
to use them from a FreeBSD binary will return EINVAL. The fact we needed
to define _KERNEL (which, as the name implies, means we are compiling
the kernel) to even get the definition of shminfo should have been a
strong indicator that IPC_INFO at least was not a userspace interface.
2025-07-10 19:33:24 +01:00
Artem Chikin
a7091951f0
[APINotes] Add support for capturing all possible versioned APINotes without applying them
Swift-versioned API notes get applied at PCM constrution time relying on
'-fapinotes-swift-version=X' argument to pick the appropriate version.
This change adds a new APINotes application mode with
'-fswift-version-independent-apinotes' which causes *all* versioned API
notes to get recorded into the PCM wrapped in 'SwiftVersionedAttr'
instances. The expectation in this mode is that the Swift client will
perform the required transformations as per the API notes on the client
side, when loading the PCM, instead of them getting applied on the
producer side. This will allow the same PCM to be usable by Swift
clients building with different language versions.

In addition to versioned-wrapping the various existing API notes
annotations which are carried in declaration attributes, this change
adds a new attribute for two annotations which were previously applied
directly to the declaration at the PCM producer side: 1) Type and 2)
Nullability annotations with 'SwiftTypeAttr' and 'SwiftNullabilityAttr',
respectively. The logic to apply these two annotations to a declaration
is refactored into API.
2025-07-10 19:19:18 +01:00
Matheus Izvekov
8a7c973f64
[ci] premerge: upload artifacts even on failure (#147999)
This makes sure we upload the artifacts even if the previous step
failed.

This is helpful because we wish to upload crash reproducers, which the
scritps are already prepared to do.

Example:
https://github.com/llvm/llvm-project/actions/runs/16180778101/job/45676677544?pr=147835
2025-07-10 15:10:12 -03:00