549622 Commits

Author SHA1 Message Date
Michael Buch
8fa55a023b
[clang][DebugInfo][test] Move debug-info tests from CodeGenObjC to DebugInfo directory (#154781)
This patch works towards consolidating all Clang debug-info into the
`clang/test/DebugInfo` directory
(https://discourse.llvm.org/t/clang-test-location-of-clang-debug-info-tests/87958).

Here we move only the `clang/test/CodeGenObjC` tests.

The list of files i came up with is:
1. searched for anything with `*debug-info*` in the filename
2. searched for occurrences of `debug-info-kind` in the tests
2025-08-21 22:09:34 +01:00
Dan Liew
09612007f1
[NFC][Diagnostics] Reformat DiagnosticIDs.h and AllDiagnostics.h (#154628)
When trying to add a new diagnostic category (e.g. #154618) I discovered
`clang-format` really wanted to reformat these files.

My initial attempt was just to suppress the reformatting with `//
clang-format (on|off)` directives but reviewers preferred just
reformatting the files so these two files have been completely
reformatted.

`clang-format` has been disabled for the enum that declares the
`DIAG_START_*` constants because its much less readable after
formatting.
2025-08-21 14:06:49 -07:00
Florian Hahn
300d2c6d20
[VPlan] Move SCEV expansion to VPlan transform. (NFCI).
Move the logic to expand SCEVs directly to a late VPlan transform that
expands SCEVs in the entry block. This turns VPExpandSCEVRecipe into an
abstract recipe without execute, which clarifies how the recipe is
handled, i.e. it is not executed like regular recipes.

It also helps to simplify construction, as now scalar evolution isn't
required to be passed to the recipe.
2025-08-21 22:03:26 +01:00
ykhatav
38f0b9e6d9
Fix scope of typedefs present inside a template class (#146729)
When a typedef is declared within a templated class, clang incorrectly
assigns the typedef to the compilation unit (CU) scope rather than the
intended scope of the templated class. This issue arises because, during
the creation of the typedef, the context lookup in the RegionMap fails
to locate the templated class, despite its prior creation.
The problem stems from the way the context is stored in the RegionMap.
When handling templated types, the current implementation stores the
class specialization rather than the templated declaration itself. This
leads to a mismatch when attempting to retrieve the context for the
typedef.
To address this issue, the solution involves modifying the
CreatedLimitedType() function. Specifically, when a struct or class is a
templated type, we should store the actual templated declaration in the
RegionMap instead of the class specialization. This ensures that
subsequent lookups for context, such as those needed for typedef
declarations, correctly identify the templated class scope.
Fixes https://github.com/llvm/llvm-project/issues/91451
2025-08-21 16:58:25 -04:00
Alex MacLean
9b24ccca73
[NVPTX] Allow more argument integer types, such as i256 and i96 (#154824)
The refactoring of ComputePTXValueVTs in #154476 caused the complier to
no longer crash when lowering i256 and i96. This has caused a few tests
to unexpectedly pass.

Update these tests and tweak how we emit parameter declarations to
correctly lower these types.
2025-08-21 13:54:38 -07:00
Dave Lee
933d8723b0
[llvm][utils] Improve the StringRef summary formatter (#151594)
Improve the `StringRef` summary formatter in the following ways:
* inherit adherence to the `target.max-string-summary-length` setting
* support non-printable bytes (such as null bytes, and any other binary data)

With the previous implementation, some non-printable bytes would raise a
Python exception.
2025-08-21 13:42:49 -07:00
Dave Lee
545cda649e
[lldb] Add flag to "settings show" to include default values (#153233)
Adds a `--defaults`/`-d` flag to `settings show`. This mode will _optionally_ show a
setting's default value. In other words, this does not always print a default value for
every setting.

A default value is not shown when the current value _is_ the default.

Note: some setting types do not print empty or invalid values. For these setting types,
if the default value is empty or invalid, the same elision logic is applied to printing
the default value.
2025-08-21 13:41:38 -07:00
Florian Hahn
ba5d487ac4
[LV] Add test with interleave groups separated by offset.
Adds extra test coverage for
https://github.com/llvm/llvm-project/pull/91196.
2025-08-21 21:40:47 +01:00
Alex MacLean
4a9d2187ee
[SeparateConstOffsetFromGEP] propagate const offset through GEP chains (#143470)
When separating the constant offset from a GEP, if the pointer operand
is a constant ptradd (likely generated when we performed this transform
on that GEP), we accumulate the offset into the current offset. This
ensures that when there is a chain of GEPs the constant offset reaches
the final memory instruction where it can likely be folded into the
addressing.
2025-08-21 13:37:24 -07:00
Scott Linder
76b8e19203
[LangRef] Rework DIExpression docs (#153072)
Factor out most of the DIExpression docs from LangRef.rst into
SourceLevelDebugging.rst

What remains in LangRef is just enough context to make sense of how
DIExpression-as-metadata fits into the IR, including some examples of
the DIExpression syntax.

The rest now lives in the SourceLevelDebugging document, which gives
more context to make sense of DIExpression-as-semantic-entity.

Use sections to clearly separate DWARF opcodes from LLVM internal-only
opcodes, where before the distinction was only explicit in the source
code.

Also make some other changes like fixing typos, using :ref: rather than
unchecked links, and rewording DW_OP_LLVM_entry_value.
2025-08-21 16:32:53 -04:00
Dave Lee
a447fc63f9
[lldb] Improve error message in ResolveSDKPathFromDebugInfo (NFC) (#154607)
While debugging, I saw a log line of:

> Failed to resolve SDK path: Error while searching for SDK (XcodeSDK ''): Unrecognized SDK type:

Looking into how this might happen, it seems `ResolveSDKPathFromDebugInfo` appears to
(implicitly) assume there's at least one compile unit. This change adds a precondition
to return a meaningful error when there are no compile units.

Original: https://github.com/llvm/llvm-project/pull/146062
2025-08-21 13:23:38 -07:00
James Newling
a64e6f4928
[MLIR][Vector] Test to accompany bug fix (#154434)
Bug introduced in 
https://github.com/llvm/llvm-project/pull/93664

The bug was fixed in
https://github.com/llvm/llvm-project/pull/152957

But there was no test. This PR adds a test that hits the assertion
failure if the fix is reverted (if I change dyn_cast to cast).
2025-08-21 13:00:41 -07:00
Ramkumar Ramachandra
de7bac6426
[VPlan/PatternMatch] Strip outdated hdr comment (NFC) (#154794) 2025-08-21 20:43:03 +01:00
Carlos Galvez
344793e513
[clang-tidy][doc] Improve option docs for readability-identifier-naming (#154806)
Currently it's hard to find the "general" options, since they are listed
in the middle of the "specific" options. Split them into two categories
so they are easier to find.

This can help in adding a potential new general option in a follow-up
patch.

Co-authored-by: Carlos Gálvez <carlos.galvez@zenseact.com>
2025-08-21 21:41:24 +02:00
Peter Collingbourne
b3baa4d063 gn build: Port 4c9b7ff04cb4 2025-08-21 12:15:37 -07:00
Peter Collingbourne
779bb04a9a [gn build] Port fea7e6934a25 2025-08-21 12:15:37 -07:00
Peter Collingbourne
9b5282723b [gn build] Port eb764040bccc 2025-08-21 12:15:37 -07:00
Peter Collingbourne
4e7779c099 [gn build] Port deab049b5cc8 2025-08-21 12:15:36 -07:00
Peter Collingbourne
8d69c83808 [gn build] Port 8b64cd8be29d 2025-08-21 12:15:36 -07:00
Peter Collingbourne
7d1f15c985 [gn build] Port 87a1d42bed3d 2025-08-21 12:15:36 -07:00
Peter Collingbourne
f66d7b50ff [gn build] Port 15babbaf5d40 2025-08-21 12:15:36 -07:00
Shubham Sandeep Rastogi
0f33b90b61 Revert "[lldb-dap] Re-land refactor of DebugCommunication. (#147787)"
This reverts commit 13eca5248c7bf625af9c7af898d48e8c0a441496.

This change broke greendragon lldb test:

lldb-api.tools/lldb-dap/moduleSymbols.TestDAP_moduleSymbols.py
2025-08-21 12:12:46 -07:00
Craig Topper
424521f599
[RISCV] Correct the OperandType for simm8_unsigned and simm10_unsigned. (#154667) 2025-08-21 12:01:07 -07:00
William Huynh
1b9e9e29e2
[libc] Add boot code for AArch64 (#154789)
This is required in hermetic testing downstream. It is not complete, and
will not work on hardware, however it runs on QEMU, and can report a
pass/fail on our tests.
2025-08-21 18:47:34 +00:00
Tom Honermann
c80b7822e3
[NFC][SYCL] Test use of sycl_kernel_entry_point with null declarations and statements. (#154583)
The `sycl_kernel_entry_point` attribute only appertains to functions.
This change adds missing tests to validate that an appropriate
diagnostic is issued for likely unintentional application of the
attribute to a null declaration or a null statement; perhaps due to an
unintended semicolon.
2025-08-21 14:47:07 -04:00
Thurston Dang
de64f85f5d
[hwasan] Port "[Asan] Skip pre-split coroutine and noop coroutine frame (#99415)" (#154803)
Originally suggested by rnk@

(this is the simplified function-level skip version, to unblock builds
ASAP)
2025-08-21 11:20:35 -07:00
Sebastian Pop
e42ef8083c
[delinearize] use update_analyze_test_checks.py in delinearization testcases (#153831)
In this patch:
1. Adapt the output of printDelinearization() to match what the script
   expects to see, "Printing analysis 'Delinearization' for function".
2. Register the "Delinearization" pass in the update script.
3. Automatically remove the existing CHECK statements.
4. Update the tests with a run of:
```
$ ~/llvm-project/llvm/utils/update_analyze_test_checks.py
        --opt=~/llvm-project/build/bin/opt
        ~/llvm-project/llvm/test/Analysis/Delinearization/*.ll
```
5. Drop llvm/test/Analysis/Delinearization/undef.ll because the test
   does not pass the github-actions "undef deprecator."
6. Only run delinearization pretty-print pass on the most internal loop.
7. Only run delinearization pretty-print pass on load and store
   instructions.
2025-08-21 13:02:56 -05:00
Timm Baeder
8b091961b1
[clang][bytecode] Implement Pointer::getType() for function pointers (#154788)
Fixes #152920
2025-08-21 20:01:22 +02:00
Florian Hahn
e41aaf5a64
[VPlan] Use VPIRMetadata for VPInterleaveRecipe. (#153084)
Use VPIRMetadata for VPInterleaveRecipe to preserve noalias metadata
added by versioning.

This still uses InterleaveGroup's logic to preserve existing metadata
from IR. This can be migrated separately.

Fixes https://github.com/llvm/llvm-project/issues/153006.

PR: https://github.com/llvm/llvm-project/pull/153084
2025-08-21 18:58:10 +01:00
Florian Hahn
21cca5ea9d
[VPlan] Rely on VPlan opts to simplify multiply by 1 (NFCI). 2025-08-21 18:43:47 +01:00
David Green
11994e8da7
[AArch64][GlobalISel] Mark G_BR as always legal. NFC (#153545)
As far as I understand this will not affect anything, just lower the
exposure to the legacy legalizer rules.
2025-08-21 18:42:44 +01:00
Craig Topper
c91f7dc7cd
[TableGen] Remove dummy UINT64_C(0) from end of InstBits table. NFC (#154778)
I suspect this originally existed to avoid a trailing comma from the
previous entry. C++ allows trailing commas in arrays so this isn't
necessary.
2025-08-21 10:42:37 -07:00
David Green
1a09581aa1
[AArch64][GlobalISel] Be more precise in RegBankSelect for s/uitofp (#154489)
We can generate fpr->fpr instructions for G_SITOFP and G_UITOFP. It was
previously marking the instructions as FPR but then generating GPR
instructions and introducing a copy.
2025-08-21 17:41:01 +00:00
Finn Plummer
87a1d42bed
[DirectX] Add support for remove-section of DXContainer for llvm-objcopy (#153246)
This pr implements the `remove-section` option for a `DXContainer`
object in `llvm-objcopy`.

It implements a base `removeParts` to the minimal `object`
representation of a `DXContainerObject`.

This is the second step to implement
https://github.com/llvm/llvm-project/issues/150275 as a compiler actions
that invokes llvm-objcopy for functionality.
2025-08-21 10:30:54 -07:00
Alex MacLean
a9de1ab44d
[NVPTX] Disable v2f32 registers when no operations supported, or via cl::opt (#154476)
The addition of v2f32 as a legal type, supported by the B64 register
class, has caused performance regressions, broken inline assembly, and
resulted in a couple (now fixed) mis-compilations. In order to mitigate
these issues, only mark this as a legal type when there exist operations
that support it, since for targets where this is not the case it serves
no purpose. To enable further debugging, add an option to disable v2f32.

In order to allow for a target-dependent set of legal types,
ComputePTXValueVTs has been fully re-written to take advantage of
TargetLowering call-lowering APIs.
2025-08-21 10:30:36 -07:00
Aiden Grossman
0319a7970d
[CI] Disable PIE on Linux Premerge Builds (#154584)
We do not gain any additional security from having PIE on the test
binaries, and this does have an impact on test times. It is about 10%
from my measurements. Not as much as previous reports
(https://reviews.llvm.org/D140880), but still significant. This is a
similar gain to finish enabling the lit internal shell, which will take
significantly more effort. I also do not think this is a meaningful
enough difference from the "default" configuration to keep it the
default, especially given the option is mostly set by distros.
2025-08-21 10:21:02 -07:00
John Harrison
13eca5248c
[lldb-dap] Re-land refactor of DebugCommunication. (#147787)
Originally commited in 362b9d78b4ee9107da2b5e90b3764b0f0fa610fe and then
reverted in cb63b75e32a415c9bfc298ed7fdcd67e8d9de54c.

This re-lands a subset of the changes to
dap_server.py/DebugCommunication and addresses the python3.10
compatibility issue.

This includes less type annotations since those were the reason for the
failures on that specific version of python.

I've done additional testing on python3.8, python3.10 and python3.13 to
further validate these changes.
2025-08-21 10:20:01 -07:00
Anchu Rajendran S
bce9b6d177
[Flang][Flang-Driver]Fix to add atomic control options in non-fc1 mode (#154638) 2025-08-21 10:15:33 -07:00
Andy Kaylor
c5466c64d4
[CIR] Add CIR vtable attribute (#154415)
This adds the #cir.vtable attribute definition and verification.
Generation of the vtable will be implemented in a later change.
2025-08-21 09:52:14 -07:00
7mile
761125f267
[CIR][Dialect] Add SourceLangAttr (#152511)
This patch upstreams `SourceLangAttr` and its CodeGen logic in the CGM,
which encodes the source language in CIR.
2025-08-21 09:51:37 -07:00
Shafik Yaghmour
436f391d1d
[Clang][Codegen][NFC] Apply rule of three to some classes (#154671)
Static analysis flagged these classes as having implemented the
destructor but not applying rule of three. This could lead to accidental
misuse and so it makes sense to apply it.
2025-08-21 09:36:25 -07:00
Florian Hahn
b5fc4fd009
[LAA] Add test requiring runtime checks with -max-dependences flag.
Adds extra test coverage for
https://github.com/llvm/llvm-project/pull/91196.
2025-08-21 17:31:53 +01:00
Jordan Rupprecht
9576a100ae
[bazel] Port #152474: RemarkEngine (#154792) 2025-08-21 16:29:50 +00:00
Leandro Lacerda
eed5f06ae8
[Offload][Conformance] Add randomized tests for single-precision bivariate math functions (#154663)
This patch adds a new set of randomized conformance tests for
single-precision bivariate math functions.

The functions included in this set were selected based on the following
criteria:
- An implementation exists in `libc/src/math/generic` (i.e., it is not
just a wrapper around a compiler built-in).
- The corresponding LLVM CPU libm implementation is correctly rounded.
- The function is listed in Table 65 of the OpenCL C Specification
v3.0.19.
2025-08-21 11:27:25 -05:00
Tim Gymnich
e20fa4f412
[mlir][AMDGPU] Add PermlaneSwapOp (#154345)
- Add PermlaneSwapOp that lowers to `rocdl.permlane16.swap` and
`rocdl.permlane32.swap`

---------

Co-authored-by: Jakub Kuderski <kubakuderski@gmail.com>
2025-08-21 18:21:43 +02:00
Andres-Salamanca
fc62990657
[CIR] Upstream GotoSolver pass (#154596)
This PR upstreams the GotoSolver pass.  
It works by walking the function and matching each label to a goto. If a
label is not matched to a goto, it is removed and not lowered.
2025-08-21 11:02:29 -05:00
Timm Baeder
3923adfa3f
[clang][bytecode] Guard strcmp against differing element types (#154777)
This can happen when casts are involved.

Fixes #154006
2025-08-21 18:02:08 +02:00
Dave Lee
dacabc1fee
[lldb] Tweak check for CommandLineTools in ParseXcodeSDK (#154574)
Follow up to https://github.com/llvm/llvm-project/pull/128712
2025-08-21 08:56:17 -07:00
Dave Lee
86c9a7b0c1
[lldb] Remove unused XcodeSDK::SupportsSwift (NFC) (#154572) 2025-08-21 08:55:50 -07:00
Kazu Hirata
035dd1d854 [ADT] Fix a warning
This patch fixes:

  third-party/unittest/googletest/include/gtest/gtest.h:1379:11:
  error: comparison of integers of different signs: 'const unsigned
  long' and 'const int' [-Werror,-Wsign-compare]
2025-08-21 08:49:56 -07:00