565310 Commits

Author SHA1 Message Date
Paschalis Mpeis
f51fdff835
[BOLT] Add Arm's large-bolt-tests in docker-tests (#174961)
docker-tests now runs out-of-tree tests from:
- https://github.com/arm/large-bolt-tests
2026-01-14 09:32:21 +00:00
Ebuka Ezike
75c597aa50
[llvm][Support] Remove unnecessary allocations when creating StringEr… (#175863)
…rors

The String Error class has three constructors .
StringError::StringError(const Twine &S, std::error_code EC)
StringError::StringError(std::error_code EC, const Twine &S) 
StringError::StringError(std::string &&S, std::error_code EC, bool
PrintMsgOnly)

When we use the `createStringError(std::error_code, char const *, ... )`
it ends up using twine variant and ends up creating a new string twice
2026-01-14 09:25:28 +00:00
Muhammad Omair Javaid
f4e74b6e4e Revert "[flang][OpenMP] Fix LINEAR clause validation and test expectations (#175707)"
This reverts commit 6e62d40b7c65a67ac0e5c6e0f462ce2663db98b9.

The change causes test failures clause-validity01.f90 on multiple
builders (links below):

https://lab.llvm.org/buildbot/#/builders/207/builds/12198
https://lab.llvm.org/buildbot/#/builders/140/builds/36994
https://lab.llvm.org/buildbot/#/builders/50/builds/19637
https://lab.llvm.org/buildbot/#/builders/172/builds/18946
https://lab.llvm.org/buildbot/#/builders/29/builds/20278
https://lab.llvm.org/buildbot/#/builders/80/builds/19622
2026-01-14 14:20:34 +05:00
Yao Hwang
a24784ce11
[ADT][NFC] Expose fltSemantics struct (#175676)
This patch moves the `fltSemantics` struct definition (along with
`fltNonfiniteBehavior`
and `fltNanEncoding` enums) from APFloat.cpp to APFloat.h, making them
part of the
public API.

Currently, downstream projects cannot define custom floating-point
semantics because
`fltSemantics` is an opaque forward declaration in the header. This
forces projects
with specialized float formats to either patch LLVM locally or request
new formats be added upstream for each variant. By exposing the struct,
downstream users can define their own semantics.
2026-01-14 10:17:35 +01:00
Hans Wennborg
a70f534abc Revert "[LifetimeSafety] Merge lifetimebound attribute on implicit 'this' across method redeclarations (#172146)"
This caused assertion failures, see comment on the PR:

  clang/lib/Sema/TypeLocBuilder.cpp:89:
  TypeLoc clang::TypeLocBuilder::pushImpl(QualType, size_t, unsigned int):
  Assertion `TLast == LastTy && "mismatch between last type and new type's inner type"' failed.

> Followup on https://github.com/llvm/llvm-project/pull/107627
> Fixes https://github.com/llvm/llvm-project/issues/62072
> Fixes https://github.com/llvm/llvm-project/issues/172013
> Fixes https://github.com/llvm/llvm-project/issues/175391
>
> This PR adds support for merging the `lifetimebound` attribute on the implicit `this` parameter when merging method declarations. Previously, if a method was declared with `lifetimebound` on its function type (which represents the implicit `this` parameter), this attribute would not be propagated to the method definition, causing lifetime safety warnings to be missed.
>
> The implementation adds helper functions to extract the `lifetimebound` attribute from a function type and to merge this attribute from an old method declaration to a new one when appropriate.

This reverts commit ef90ba684d012790c86ac1b5e7c6b325abe78803.
2026-01-14 10:09:03 +01:00
Nikita Popov
7db584562d [IR] Add some missing LLVM_ABI
To fix the ids errors from #175875.
2026-01-14 10:01:46 +01:00
Sjoerd Meijer
1e96ee67a1
[Delinearization] Precommit global decl test. NFC. (#175173)
This precommits a test that should demonstrate that Delinearization can
succeed when we analyse the size of the global variable definition.
2026-01-14 08:39:17 +00:00
Subash B
075e4672a6
[SPIRV] Added Support for the SPV_ALTERA_arbitrary_precision_floating_point Extension (#160054)
Added support for the SPV_ALTERA_arbitrary_precision_floating_point
extension, enabling all the arbitrary precision floating-point
operations with instruction definitions and test files.
2026-01-14 00:37:22 -08:00
Victor Chernyakin
aaa99a3e9a
[clang-tidy] Fix false negatives around static data members in readability-redundant-typename (#175477)
Fixes #175475.
2026-01-14 00:28:47 -08:00
Subash B
17aa32c243
[SPIRV] Added support for the constrained arithmetic(Fmuladd) intrinsic (#170270)
Added SPIR-V support for constrained arithmetic intrinsic fmuladd,
lowered as a sequence of OpFMul and OpFAdd with roundingmode, consistent
with the SPIR-V translator.
2026-01-14 00:20:40 -08:00
willmafh
c705003e8c
[NFC] Exactly one kind typo fixes, change defintions to definitions. (#174333) 2026-01-14 08:12:26 +00:00
hev
c9cc782e0b
[llvm][LoongArch] Add PC-relative address materialization using pcadd instructions (#175358)
This patch adds support for PC-relative address materialization using
pcadd-class relocations, covering the HI20/LO12 pair and their GOT and
TLS variants (IE, LD, GD, and DESC).

Link:
https://gcc.gnu.org/pipermail/gcc-patches/2025-December/703312.html
2026-01-14 16:12:18 +08:00
Robert Imschweiler
71cc38736c
[InferAddressSpaces] Handle unconverted ptrmask (#140802)
In case a ptrmask cannot be converted to the new address space due to an
unknown mask value, this needs to be detcted and an addrspacecast is
needed to not hinder a future use of the unconverted return value of
ptrmask. Otherwise, users of this value will become invalid by receiving
a nullptr as an operand.

This LLVM defect was identified via the AMD Fuzzing project.

(See https://reviews.llvm.org/D80129 for an explanation of why some
ptrmasks are impossible to convert to other addrspaces.)
2026-01-14 09:10:05 +01:00
Timm Baeder
ef44d25971
[clang][ExprConst] Diagnose out-of-lifetime access consistently (#175562)
Previously, we had two very similar diagnostics, "read of object outside
its lifetime" and "read of variable whose lifetime has ended".
The difference, as far as I can tell, is that the latter was used when
the variable was created in a function frame that has since vanished,
i.e. in this case:
```c++
constexpr const int& return_local() { return 5; }
static_assert(return_local() == 5);
```
so the output used to be:
```console
array.cpp:602:15: error: static assertion expression is not an integral constant expression
  602 | static_assert(return_local() == 5);
      |               ^~~~~~~~~~~~~~~~~~~
array.cpp:602:15: note: read of temporary whose lifetime has ended
array.cpp:601:46: note: temporary created here
  601 | constexpr const int& return_local() { return 5; }
      |                                              ^
```

But then this scenario gets the other diagnostic:
```c++
constexpr int b = b;
```
```console
array.cpp:603:15: error: constexpr variable 'b' must be initialized by a constant expression
  603 | constexpr int b = b;
      |               ^   ~
array.cpp:603:19: note: read of object outside its lifetime is not allowed in a constant expression
  603 | constexpr int b = b;
      |                   ^
```

With this patch, we diagnose both cases similarly:
```c++
constexpr const int& return_local() { return 5; }
static_assert(return_local() == 5);
constexpr int b = b;
```
```console
array.cpp:602:15: error: static assertion expression is not an integral constant expression
  602 | static_assert(return_local() == 5);
      |               ^~~~~~~~~~~~~~~~~~~
array.cpp:602:15: note: read of object outside its lifetime is not allowed in a constant expression
  602 | static_assert(return_local() == 5);
      |               ^~~~~~~~~~~~~~
array.cpp:601:46: note: temporary created here
  601 | constexpr const int& return_local() { return 5; }
      |                                              ^
array.cpp:603:15: error: constexpr variable 'b' must be initialized by a constant expression
  603 | constexpr int b = b;
      |               ^   ~
array.cpp:603:19: note: read of object outside its lifetime is not allowed in a constant expression
  603 | constexpr int b = b;
      |                   ^
```

We do lose the "object" vs. "temporary" distinction in the note and only
mention it in the "created here" note. That can be added back if it's
important enough. I wasn't sure.
2026-01-14 08:59:28 +01:00
Florian Hahn
d5c11b9a24
[VPlan] Replace PhiR operand of ComputeRdxResult with VPIRFlags. (#174026)
Remove the artificial PhiR operand of ComputeReductionResult, which was
only used to look up recurrence kind, in-loop and ordered properties.

Instead, encode them as VPIRFlags as suggested by @ayalz in
https://github.com/llvm/llvm-project/pull/170223.

This addresses a TODO to make codegen for ComputeReductionResult
independent of looking up information from other recipes.

This is NFC w.r.t. codegen, the printing has been improved to include
the reduction type, and whether it is in-loop/ordered.

PR: https://github.com/llvm/llvm-project/pull/174026
2026-01-14 07:45:44 +00:00
David Sherwood
48ce7bb038
[LV] Fix bug in setVectorizedCallDecision (#175742)
There is a bug in this logic:

```
   InstructionCost Cost = ScalarCost;
   InstWidening Decision = CM_Scalarize;

   if (VectorCost <= Cost) {
     Cost = VectorCost;
     Decision = CM_VectorCall;
   }

   if (IntrinsicCost <= Cost) {
     Cost = IntrinsicCost;
     Decision = CM_IntrinsicCall;
   }
```

because it assumes that the comparisons behave sensibly in the face of
invalid costs. Unfortunately, PR #174835 exposes an issue when
attempting to vectorise the new test
uadd_with_overflow_i32 for AArch64 targets. Specifically, there are
situations where all costs are invalid (e.g. VF=vscale x 1), but some
costs are more invalid than others. For example, when querying the
intrinsic cost via the TTI hook we get an invalid cost with a non-zero
value, whereas the vector cost is invalid with a zero value. That leads
to us erroneously choosing CM_VectorCall as the call widening decision,
despite the lack of a vector math variant. Inevitably this causes
crashes because we create a VPCallWidenRecipe without a variant
function.

Fix this by only performing comparisons if the costs are valid. It now
leads to us choosing CM_Scalarize more often, but it's a toin coss
anyway between CM_Scalarize and CM_IntrinsicCall when both strategies
are invalid. Potentially we could also create a new strategy called
CM_Invalid, and avoid the creation of VPlans entirely.
2026-01-14 07:28:38 +00:00
Wei Wang
f51eca20cf
[IndirectCallPromotion] Proper canonicalize coroutine function (#175606)
Fix an issue where coroutine function and its await suspend wrappers are
all canonicalized to the same name. This creates duplicate entries in
`MD5FuncMap` (a sorted vector) and may return an incorrect GUID that
mismatches the one from prof metadata and miss ICP. For example, coro
function `foo` and its wrappers `foo.__await_suspend_wrapper__init`,
`foo.__await_suspend_wrapper__final` are all canonicalized to `foo`.
During GUID lookup, any of them can be returned due to unstable sort.
This is more of the reliability issue (the indeterminism) than a
performance issue because hot indirect calls should've been promoted in
sample loader pass.

This also fixes the same naming issue in `CGProfile` where symtab is
created. By the time the pass is run, wrapper functions should already
be inlined but naming collision can happen to the coro function and its
post-split clones (`foo.resume`, `foo.cleanup`).

This change
* Unifies `InstrProfSymtab::getCanonicalName` with
`FunctionSamples::getCanonicalFnName` by providing a customized list of
suffixes to remove instead of removing everything after the first dot
(.) except ".__uniq.". This also addresses the "FIXME" comment.
* Uses stable sort when storing `MD5FuncMap` which avoids indeterminism
during GUID lookup. `MD5FuncMap` can still contain duplicate entries
even with this change, because no check is done before insertion. Making
entries unique needs some additional work.
* Checks for same PGO names before calling the second `addFuncWithName`,
which does nothing in case of name match.
2026-01-13 23:18:45 -08:00
Victor Chernyakin
6ddab42952
[clang-tidy] Fix false positive from readability-redundant-typename on partially specialized variables (#175473)
Fixes #174827.
2026-01-13 23:09:22 -08:00
Luke Lau
0ae23ca9e6
[VPlan] Split out optimizeEVLMasks. NFC (#174925)
Addresses part of #153144 and splits off part of #166164

There are two parts to the EVL transform:

1) Convert the loop so the number of elements processed each iteration
is EVL, not VF. The IV and header mask are replaced with EVL-based
variants.
2) Optimize users of the EVL based header mask to VP intrinsic based
recipes.

(1) changes the semantics of the vector loop region, whereas (2) needs
to preserve them. This splits (2) out so we don't mix the two up, and
allows us to move (1) earlier in the pipeline in a future PR.
2026-01-14 07:01:14 +00:00
Abhishek Varma
fc81a66513
[NFC][Linalg] Add matchConvolutionOpOfType API and make isaConvolutionOpOfType API a wrapper (#174722)
-- This commit involves the following updates pertaining to
`isaConvolutionOpOfType` API :-
1. We don't want dilations/strides of convolution op to be returned as
pointer arguments to the API function - to tackle this we create a new
API `matchConvolutionOpOfType` which would return an optional struct of
dilations/stride.
2. To not break the original API's use case as a simple querying
functionality with true/false return - we keep `isaConvolutionOpOfType`
as a wrapper API which will invoke `matchConvolutionOpOfType` API and
return true/false depending on whether `matchConvolutionOpOfType` API
returned any value or not.
3. Dilations/strides of named convolution op are also populated now (it
was missed in the previous PRs while creating `isaConvolutionOpOfType`).
4. [Max/Min]UnsignedPool ops' body matcher now only matches unsigned int
ops (refer: https://github.com/llvm/llvm-project/pull/166070)

-- No tests are being added as all the above are NFC changes around the
API which already is being tested via Specialize.cpp.

Signed-off-by: Abhishek Varma <abhvarma@amd.com>
2026-01-14 06:20:33 +00:00
Batzorig Zorigoo
d186277e6b
[MLIR][Bufferization] Fold LoadOp only when the buffer is read only (#172595)
When we `memref.load` from a buffer, it folded to `tensor.extract` even
when the buffer was writable, causing unexpected results. For example:

```mlir
func.func @load_after_write_from_buffer_cast(%arg0: index, %arg1: index,
                            %arg2: tensor<?x?xf32>) -> f32 {
  %0 = bufferization.to_buffer %arg2 : tensor<?x?xf32> to memref<?x?xf32>
  linalg.ceil ins(%0 : memref<?x?xf32>) outs(%0 : memref<?x?xf32>)
  %1 = memref.load %0[%arg0, %arg1] : memref<?x?xf32>
  return %1 : f32
}
```
would fold into
```mlir
module {
  func.func @load_after_write_from_buffer_cast(%arg0: index, %arg1: index, %arg2: tensor<?x?xf32>) -> f32 {
    %0 = bufferization.to_buffer %arg2 : tensor<?x?xf32> to memref<?x?xf32>
    linalg.ceil ins(%0 : memref<?x?xf32>) outs(%0 : memref<?x?xf32>)
    %extracted = tensor.extract %arg2[%arg0, %arg1] : tensor<?x?xf32>
    return %extracted : f32
  }
}
```
2026-01-14 07:13:31 +01:00
Vassil Vassilev
84c19e7cf3
[clang-repl] Use more precise search to find the orc runtime. (#175805)
The new mechanism relies on the path in the toolchain which should be
the autoritative answer. This patch tweaks the discovery of the orc
runtime from unittests where the resource directory is hard to deduce.

Should address the issue raised in #175435 and #175322
2026-01-14 08:06:03 +02:00
Brandon Wu
c7e4350cdc
[RISCV][llvm] Support select codegen for P extension (#175741)
This is scalar condition with fixed vector true/false value, we can just
handle it same as scalars.
2026-01-14 14:05:45 +08:00
Brandon Wu
2f2ec93a83
[RISCV][llvm] Support vselect codegen for P extension (#175744)
The only difference between vselect vs. select is condition value(a.k.a.
mask), we can select by using bitwise operation:
vselect(mask, true, false) = (mask & true) | (~mask & false)
2026-01-14 14:02:55 +08:00
Brandon Wu
0e6ef95f5e
[RISCV][llvm] Support IS_FPCLASS codegen for zvfbfa (#175758) 2026-01-14 14:02:17 +08:00
Teja Alaghari
7cc013af9c
[CodeGen][NPM] Add support for -print-regusage in New Pass Manager (#169761)
Support `-print-regusage` flag in NPM for printing register usage information
2026-01-14 11:00:02 +05:30
Krish Gupta
6e62d40b7c
[flang][OpenMP] Fix LINEAR clause validation and test expectations (#175707)
Fixes #175688

After #175383 was merged, the test
`Semantics/OpenMP/linear-clause01.f90` was failing because it had an
early return that prevented multiple errors from being reported.

This PR fixes two issues:

1. **Removes the early return** after detecting a modifier error on
DO/SIMD directives. Previously, when a modifier error was found, the
function would return immediately without checking other restrictions
like the scalar requirement. Now all applicable errors are reported.

2. **Updates test expectations** to expect both the modifier error AND
the scalar error for Case 1, where `arg(:)` is an array used with `uval`
modifier on a DO directive.

Thanks to @NimishMishra for catching this during review - arrays should
always be rejected in LINEAR clauses (except for `declare simd` with
`ref` modifier), regardless of whether there are other errors.
2026-01-13 20:17:00 -08:00
Hristo Hristov
f7b943e4ed
[libc++][ranges][NFC] Merge join_with_views [[nodiscard]] tests (#175734)
This just merges all tests in a single `nodiscard.verify.cpp` as is the
common practice.
2026-01-14 06:05:22 +02:00
Victor Mustya
309ca6dd47
[Clang][OpenCL] Add cl_intel_split_work_group_barrier extension (#175878)
The extension adds support for split work group barriers in OpenCL C.
The spec is available at:

https://registry.khronos.org/OpenCL/extensions/intel/cl_intel_split_work_group_barrier.html
2026-01-14 11:21:28 +08:00
Chuanqi Xu
c560f1cf03
[Serialization] Stop demote var definition as declaration (#172430)
Close https://github.com/llvm/llvm-project/issues/172241
Close https://github.com/llvm/llvm-project/issues/64034
Close https://github.com/llvm/llvm-project/issues/149404
Close https://github.com/llvm/llvm-project/issues/174858

After this patch, we (the clang dev) no longer assumes there are at
most one definition in a redeclaration chain.

See

https://discourse.llvm.org/t/rfc-clang-not-assuming-there-is-at-most-one-definition-in-a-redeclaration-chain/89360
for details.
2026-01-14 02:54:03 +00:00
Liu Ke
be89247403
[DebugInfo] Set the DI flag for the simplified name of a template function/type (2/3). (#175708)
Set the `NameIsSimplified` flag for a template function/type that is
treated as having simplified names. Previous patch: #175130 .
Based on:
[RFC](https://discourse.llvm.org/t/rfc-debuginfo-selectively-generate-template-parameters-in-the-skeleton-cu/89395).
2026-01-14 10:53:19 +08:00
Aiden Grossman
c0edf7894e
[Github] Bump clang-format version to 21.1.8 for formatting job (#175850)
In line with the current de-facto support policy of bumping to the
first/last versions of a release.
2026-01-13 18:50:45 -08:00
Joseph Huber
95da1354d0 Revert "[libc] Support %lc in printf (#169983)"
This reverts commit 1327c50ef199b481f5326cf6ca3710fc111b70b1.

The printf headers are intended to be header-only, this introduces
external symbol dependencies.
2026-01-13 20:01:29 -06:00
YongKang Zhu
b1e4f26928
[BOLT][AArch64] Fix epilogue-determination test (#175668)
Define jump table for each function, for conformance and better clarity.
2026-01-13 17:59:30 -08:00
NAKAMURA Takumi
0b783f5a76
[MC/DC] Refactor MCDCCoverageBuilder. NFC. (#125409)
- Get rid of the old `DecisionStack` and dissolve it into push/pop
`CurCondIDs` in `VisitBin`, since `VisitBin` is recursive.

- Introduce the new `DecisionStack` with `DecisionState` to handle the
current `Decision` in nested `Decision`s.
  - The stack has the sentinel that has `DecisionExpr = nullptr`.
- Split out `checkDecisionRootOrPush` from `pushAndAssignIDs` for
non-BinOp. It assigns `CondID` to `E` (instead of assignment LHS in
`pushAndAssignIDs`).
  - The stack is manupilated at the top Decision operator in `VisitBin`.
- The stack grows at the entrance of the Decision with the initial
state.
- In the same level in `VisitBin`, the stack is popped and the
`Decision` record is emitted.
- Introduce `DecisionEndToSince` to sweep `MCDCBranch`es partially in
`cancelDecision`.
2026-01-14 10:19:39 +09:00
Andy Kaylor
7584c28063
[CIR] Upstream CIR method attribute handling (#174640)
This adds code for generating cir.method attributes and lowering them to
LLVM IR to implement support the C++ method pointer variables.
2026-01-13 16:35:04 -08:00
Wenju He
386d939973
[OpenCL] Set KHR extensions minimum version to OpenCL 1.0 (#175120)
Motivation is similar to 25cfdaa4e9dc. Their spec don't specify a
required OpenCL version. Targets may expose them before OpenCL 1.2.
Set KHR extensions (depth images, mipmaps, subgroups, kernel clock, dot
product, ext_float_atomics, extended_bit_ops, cles_khr_int64) to
availability 1.0.
Changes to opencl-c.h:
* Relax header and test guards to allow extension macros whenever any
OpenCL C version is defined.
* Relax cl_khr_depth_images guard to allow cl_khr_depth_images, OpenCL
C++, or OpenCL C 2.0+, since image2d_depth_t and image2d_array_depth_t
types require that coverage.
* Guard image1d_t, image1d_array_t and image2d_array_t types with OpenCL
C++ or OpenCL C 1.2+ to match with OpenCL C spec.

Relates to https://github.com/KhronosGroup/OpenCL-CTS/pull/2376.
2026-01-14 08:29:52 +08:00
Dave Lee
fb0653c36b
[lldb] Change po fallback messaging (#175847)
When an object description expression fails, instead of emitting an error, mark it as a
warning instead. Additionally, send the more low level details of the failure to the
`expr` log, and show a more user friendly message:

> `po` was unsuccessful, running `p` instead

rdar://165190497
2026-01-13 16:19:54 -08:00
hev
9f7af28972
[llvm][LoongArch] Add call and tail macro instruction support (#175357)
Link:
https://sourceware.org/pipermail/binutils/2025-December/146091.html
2026-01-14 07:49:16 +08:00
GeorgeHuyubo
0f24d0fb6c
[lldb] Fix null pointer crash in LibStdcppTupleSyntheticFrontEnd::Update (#175700)
When displaying a backtrace with std::tuple function arguments,
GetChildAtIndex() can return a null ValueObjectSP. The code was
dereferencing this pointer without checking for null, causing a SIGSEGV
crash when LLDB tried to pretty-print function arguments containing
tuples.


This PR fix the crash and add unit test which would crash before this PR
and only pass after this PR.

---------

Co-authored-by: George Hu <georgehuyubo@gmail.com>
Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com>
2026-01-13 15:35:27 -08:00
Daniel Paoliello
8fa680b9d9
[win][aarch64] Called globals must match for instructions to be considered identical (#175798)
When trying to enable AArch64 Import Call Optimization for Windows, we
noticed an issue where a call to an incorrect function was happening
after the loader replaced a branch instruction. The root cause of this
was that LLVM had decided to fold two branch instructions into one as
they were both branches to the same register, however the value of the
register would be different in either path as they were branches for
different imported functions.

This change updates `MachineInstr::isIdenticalTo` to also consider any
"called global" that is attached to the instruction, and will consider
two instructions as "not the same" if the globals differ.

Also fixed a possible source of non-determinism: switched from using a
`DenseMap` to using a `vector` for mapping sections to lists of called
globals (we don't expect many sections, so no need to use a map) and
sort the map by section name before emitting.
2026-01-13 15:34:10 -08:00
Andy Kaylor
02984cf61b
[CIR] Attempt to fold casts and unary ops during codegen (#175675)
This change introduces basic folding of casts and unary ops as they are
created this is needed in order to allow later codegen pieces, such as
builtin handlers, to more easily identify and examine constant operands.
For example, many X86 builtin functions use a default mask operand of
-1, which was previously generated as a constant 1 and a unary minus.

In some cases, the folding process leaves behind unused constant
operations, so I am also added a simple change to the canonicalize pass
to remove unused constants. We had other places where unused constants
were being generated already, and this change cleans those up too.
2026-01-13 15:31:30 -08:00
Nishant Patel
4a8ecccd70
[MLIR][XeGPU] Pass inst_data for blocking create/constant Mask and Step op (#175456) 2026-01-13 15:21:39 -08:00
Bruno De Fraine
64430b4f09
[clang][CodeGenCXX] Fix pragma unroll test patterns (NFC) (#175860)
These tests were not testing the loop metadata that they suggest to be
testing. They would define FileCheck variables such as `UNROLL_8` for
metadata nodes and then later redefine instead of use them (redefinition
always succeeds and thus checks nothing). The error was likely
introduced because the earlier loop metadata nodes, which must define
the variables at the first occurrence, were copy-pasted for later loop
metadata nodes, without realizing that the variable definitions in the
FileCheck pattern must be changed to uses to match later occurrences of
the same metadata node. By matching the metadata section with a block of
DAG patterns, we can define variables such as `UNROLL_8` with a pattern
that matches at the metadata node definition, even if it occurs later,
and the loop metadata nodes can be matched with uniform patterns. This
system is also used in the `pragma-loop.cpp` test.
2026-01-13 23:09:10 +00:00
Paul Kirth
feeb934a3c
[clang-tools-extra] Update Maintainers for Clang-Doc (#175822)
Currently, Erick Velez has been doing the bulk of clang-doc development.
We're also moving one of the old maintainers that hasn't participated in
almost a year to inactive.
2026-01-13 22:45:21 +00:00
Jakub Kuderski
b2c7e734cb
[ADT] Hide no_unique_address behind a macro (#175841)
This attribute was introduced in C++20 and not available across all compilers.
2026-01-13 22:43:02 +00:00
Sander de Smalen
9fc7c42975
[AArch64] Let LoadStoreOptimizer handle renamable implicit-defs. (#174186)
The LoadStoreOptimizer is very conservative with handling instructions
that have implicit-def operands and only support them for 2
instructions. However, they can be considered when a MachineOperand is
marked explicitly as 'renamable'.
2026-01-13 22:13:31 +00:00
Sander de Smalen
0133247567
[AArch64] Enable subreg liveness tracking for streaming functions. (#174189)
Most use of subreg liveness tracking will be for streaming SME2
functions where it can use the strided- and contiguous form of the
multi-vector LD1, see #123081 for details.

Any regressions come from disabling coalescing of SUBREG_TO_REG when
sub-reg liveness tracking is enabled, which may introduce some scalar
`mov`s and may limit some peephole optimizations from the load-store
optimizer, but the impact of disabling coalescing seems limited in
practice (empirically from trying this on workloads) and we think the
regressions are offset by improvements to the handling of multi-vector
instructions (tuple registers) in SME2.

PR #174188 addresses these issues in a separate PR.
2026-01-13 22:12:56 +00:00
Shubh Pachchigar
1327c50ef1
[libc] Support %lc in printf (#169983)
Add support for %lc in printf by calling internal wcrtomb function and
relevant end-to-end sprintf test. Additionally, modified printf parser
for recognizing length modifier and added two internal error codes. Also
added a flag to disable wchar support on windows platform. Resolves
#166598

Co-authored-by: shubh@DOE <shubhp@mbm3a24.local>
2026-01-13 14:05:48 -08:00
keinflue
ac15ac90e3
[clang] Restore diagnostic for certain jumps into VLA(ish) scopes. (#175833)
Commit 543f112e148a enabled diagnostics for C++ compatibility for jumps
over initialization of variables. However, inadvertently this may cause
a prior diagnostic for jumps into scopes of variables with variably
modified types to be replaced with the less severe C++ compatibility
warning, resulting in impossible codegen.

This skips the check for the C++ compatibility warning if there is
already another diagnostic planned for the scope.

Fixes #175540
2026-01-13 17:05:13 -05:00