551262 Commits

Author SHA1 Message Date
Louis Dionne
8d5b81ae9b
[libc++] Make it possible to mark a gen-test as UNSUPPORTED (#156737)
Previously, only the tests that are generated by the gen-test could be
marked as UNSUPPORTED. After this patch, the gen-test itself can be
marked as UNSUPPORTED, which makes it possible to add RUN lines that
would be an error when unsupported to the gen-test itself.
2025-09-04 11:26:00 -04:00
Lei Huang
7bd958f62e
[PowerPC][NFC] Update TableGen range punctuator with '...' (#156893)
The '-' punctuator was deprecated via:
196e6f9f18
2025-09-04 11:25:14 -04:00
Philip Reames
e90ab31024 [RISCV] Add coverage for select between simm12 constant and zero [nfc]
The zicond codegen for this involves an extra register for basically
no purpose; to be addressed in an upcoming change.
2025-09-04 08:14:07 -07:00
Florian Hahn
ec581e460a
[LV] Don't run instcombine for interleaved-accesses test.
Drop instcombine from the run-line to make test independent and make it
easier to follow the generated code for SCEV predicate checks.
2025-09-04 16:08:52 +01:00
Chaitanya Koparkar
79ea319231
[Clang] Enable constexpr handling for builtin elementwise fshl/fshr (#153572)
Fixes #153151.
2025-09-04 16:00:06 +01:00
Ramkumar Ramachandra
c24e9e3d8f
[HashRecognize] Strip ValueEvolution (#148620)
The ValueEvolution logic is deeply flawed, and checking that zero-bits
are shifted can be exploited for miscompiles. In an effort to redo
HashRecognize with a pattern-matching based approach, extract and fix
the core logic of ValueEvolution, and strip it completely, showing that
none of the tests rely on the KnownBits computation of ValueEvolution.

Co-authored-by: Piotr Fusik <p.fusik@samsung.com>
2025-09-04 15:52:33 +01:00
Sergei Barannikov
ed3597e2f7
[TableGen][Decoder] Decode operands with zero width or all bits known (#156358)
There are two classes of operands that DecoderEmitter cannot currently
handle:
1. Operands that do not participate in instruction encoding.
2. Operands whose encoding contains only 1s and 0s.

Because of this, targets developed various workarounds. Some targets
insert missing operands after an instruction has been (incompletely)
decoded, other take into account the missing operands when printing the
instruction. Some targets do neither of that and fail to correctly
disassemble some instructions.

This patch makes it possible to decode both classes of operands and
allows to remove existing workarounds.

For the case of operand with no contribution to instruction encoding,
one should now add `bits<0> OpName` field to instruction encoding
record. This will make DecoderEmitter generate a call to the decoder
function specified by the operand's DecoderMethod. The function has a
signature different from the usual one and looks like this:

```
static DecodeStatus DecodeImm42Operand(MCInst &Inst, const MCDisassembler *Decoder) {
  Inst.addOperand(MCOperand::createImm(42));
  return DecodeStatus::Success;
}
```

Notably, encoding bits are not passed to it (since there are none).

There is nothing special about the second case, the operand bits are
passed as usual. The difference is that before this change, the function
was not called if all the bits of the operand were known (no '?' in the
operand encoding).

There are two options controlling the behavior. Passing an option
enables the old behavior. They exist to allow smooth transition to the
new behavior. They are temporary (yeah, I know) and will be removed once
all targets migrate, possibly giving some more time to downstream
targets.

Subsequent patches in the stack enable the new behavior on some in-tree
targets.
2025-09-04 14:48:36 +00:00
Kazu Hirata
238c2a925b
[llvm] Proofread CodeGenerator.rst (#156814) 2025-09-04 07:46:28 -07:00
Kazu Hirata
3e28d3c30e
[Utils] Remove an unnecessary cast (NFC) (#156813)
getZExtValue() already return uint64_t.
2025-09-04 07:46:19 -07:00
Kazu Hirata
2157055ea7
[ADT] Simplify EnumeratedArray::operator[] (NFC) (#156811)
This patch simplifies EnumeratedArray::operator[] with the
injected-class-name.
2025-09-04 07:46:11 -07:00
Kazu Hirata
ec061cd6ba
[ADT] Simplify DenseMapInfo<std::tuple<...>> with constexpr if (NFC) (#156810)
This patch consolidates two implementations of getHashValueImpl into
one with "constexpr if", which should be more readable than the
SFINAE-based approach.

The same applies to isEqualImpl.
2025-09-04 07:46:03 -07:00
Florian Hahn
a614807130
[LV] Add more tests for interleave groups requiring predicates.
Adds tests for https://github.com/llvm/llvm-project/issues/156849.

Also tidies up the existing related test a bit.
2025-09-04 15:45:15 +01:00
Jannick Kremer
9a6c0ea161
[libclang/python] Add type annotations for code completion classes (#140539)
This fully annotates the code completion classes (CompletionChunk,
CompletionString, CodeCompletionResult, CodeCompletionResults and
CCRStructure) resolving 59 strict typing errors as the next step towards
#76664
2025-09-04 16:44:25 +02:00
Congcong Cai
a3186bed6a
[clang][initlist] handle incomplete array type in Constant Expr Calculation (#155080)
fix: #151716

In #65918, support of incomplete array type is added in
TryReferenceListInitialization. It causes the crash in Constant Expr
Calculation since it only considers the case where it is
ConstantArrayType.

This patch wants to add support for incomplete array type also.
2025-09-04 14:28:42 +00:00
LU-JOHN
3e10bdd18e
[NFC][AMDGPU] Pre-commit test for setcc removal by using add/sub carryout (#155118)
Pre-commit test for setcc removal by using add/sub carryout.

---------

Signed-off-by: John Lu <John.Lu@amd.com>
2025-09-04 09:27:11 -05:00
Sergei Barannikov
9bb860eca5
[PowerPC] Remove non-existent operand of CP_COPY instruction (#153867)
The operand is not encoded, decoded, or printed and would break MCInst
verification if we had one.
Extracted from #156358, where the extra operand causes DecoderEmitter
to emit an error about an operand with a missing encoding.
2025-09-04 17:12:54 +03:00
Aiden Grossman
cc220b1d55 [lldb] Mark UnsupportedLanguage.test Unsupported on Windows
This is to fix buildbot fallout post #156729 without needing to revert the
original patch.
2025-09-04 13:53:37 +00:00
Bhasawut Singhaphan
5d13f2864d
[Headers][X86] Allow AVX2/AVX512 integer min/max intrinsics to be used in constexpr (#156833)
Update the AVX2/AVX512 min/max integer intrinsics to be constexpr
compatible.

This PR is a follow-up to #156678. The AVX512 mask/maskz variants will
be addressed in the next follow-up.

Part of #153153.
2025-09-04 13:52:26 +00:00
Donát Nagy
36fb493b8f
[analyzer] Clean up bug types in CallAndMessageChecker (#156073)
In CallAndMessageChecker the initialization of bug types was highly
obfuscated (even compared to other `mutable std::unique_ptr` hacks).
This commit cleans up this situation and removes a totally superfluous
hidded 'modeling' sub-checker that did not have any role apart from
obstructing the normal initialization of bug types.

(Note that if we need to reintroduce CallAndMessageModeling in the
future, we can do it cleanly within the CheckerFamily framework, so we
wouldn't need to re-obfuscate the bug type initialization.)

This change is mostly non-functional, the only visible change is the
removal of the hidden modeling checker.
2025-09-04 15:50:20 +02:00
Timm Baeder
9e755445f1
[clang][bytecode] Create implicit variables for wider base types (#156658)
If we create an implicit local variable for a derived-to-base cast, we
still should allocate enough space for the entire derived type.

Fixes #156219
2025-09-04 15:38:14 +02:00
Aleksandar Spasojevic
1b47135c9d
[AMDGPU] Ensure positive InstOffset for buffer operations (#145504)
GFX12+ buffer ops require positive InstOffset per AMD hardware spec.
Modified assembler/disassembler to reject negative buffer offsets.
2025-09-04 15:37:46 +02:00
Sadiinso
c6b6d859cf
[X86] make the set/r/4 intrinsics macros into functions (#156819)
Change the definitions of `_mm_setr_ph`, `_mm256_setr_ph` and `_mm512_setr_ph` to be functions instead of macros.

Resolves #156709
2025-09-04 13:37:35 +00:00
Krzysztof Parzyszek
5520e16d2a
[flang][OpenMP] Parse ORDERED as standalone when DEPEND/DOACROSS is p… (#156693)
…resent

The OpenMP spec 4.5-5.1 defines ORDERED as standalone when a DEPEND
clause is present (with either SOURCE or SINK as argument). The OpenMP
spec 5.2+ defines ORDERED as standalone when a DOACROSS clause is
present.
2025-09-04 08:30:23 -05:00
Timm Baeder
4931c3afc3
[clang][bytecode] Reject null pointers in CheckStore() (#156645)
In the attached test case, the global variable later only points to
gargbage, because the MaterializeTemporaryExpr used to initialize it is
a local variable, which is gone by the time we try to evaluate the
store.

Fixes #156223
2025-09-04 15:19:26 +02:00
Chaitanya Koparkar
faca9ddce6
[Headers][X86] Group related AVX512VL FMA intrinsics together (NFC) (#156794)
Follow-up of #156385.
2025-09-04 14:17:05 +01:00
Rahul Joshi
21532f0084
[NFC][MC][DecoderEmitter] Refactor code related to EncodingField (#156759) 2025-09-04 05:59:38 -07:00
Rahul Joshi
c8e760e03b
[LLVM][MC][DecoderEmitter] Fail fatally if Insn and decoder table bitwidths mismatch (#156734) 2025-09-04 05:59:13 -07:00
Rahul Joshi
08fd349adf
[NFC][MC][ARM] Reorder decoder functions 4/N (#156690) 2025-09-04 05:58:04 -07:00
Rahul Joshi
bcb1a896d8
[NFC][IntrinsicEmitter] Include source location with enum definition (#156800) 2025-09-04 05:57:37 -07:00
Krzysztof Parzyszek
13f97f013a
[flang][OpenMP] Simplify LooselyStructuredBlockParser, NFC (#156701)
Part of the logic in this parser was dealing with a list of executable
constructs that begins with BLOCK. Since after 6b92a3bc21cdc we're doing
it via a lookahead, this handling can be simplified.
2025-09-04 07:55:56 -05:00
Krzysztof Parzyszek
f8f96a4d4e
[flang][OpenMP] Rename variable block to body, NFC (#156702)
`block` is a global variable that represents the Block parser, so avoid
using local variables with the same name.
2025-09-04 07:55:23 -05:00
moorabbit
8bdd9090d0
[Headers][X86] Add constexpr support for some AVX[512] intrinsics. (#156567)
The following AVX[512] intrinsics are now constexpr:
- `_mm_mask_cvtepi32_pd`
- `_mm_maskz_cvtepi32_pd`
- `_mm_mask_cvtepi32_ps`
- `_mm_maskz_cvtepi32_ps`
- `_mm_cvtepu32_pd`
- `_mm_mask_cvtepu32_pd`
- `_mm_maskz_cvtepu32_pd`
- `_mm_cvtepu32_ps`
- `_mm_mask_cvtepu32_ps`
- `_mm_maskz_cvtepu32_ps`
- `_mm256_mask_cvtepi32_pd`
- `_mm256_maskz_cvtepi32_pd`
- `_mm256_mask_cvtepi32_ps`
- `_mm256_maskz_cvtepi32_ps`
- `_mm256_cvtepu32_pd`
- `_mm256_mask_cvtepu32_pd`
- `_mm256_maskz_cvtepu32_pd`
- `_mm256_cvtepu32_ps`
- `_mm256_mask_cvtepu32_ps`
- `_mm256_maskz_cvtepu32_ps`
- `_mm512_cvtepi64_pd`
- `_mm512_mask_cvtepi64_pd`
- `_mm512_maskz_cvtepi64_pd`
- `_mm512_cvtepu64_pd`
- `_mm512_mask_cvtepu64_pd`
- `_mm512_maskz_cvtepu64_pd`

This PR is part 2 [[part
1](https://github.com/llvm/llvm-project/pull/156187)] of a series of PRs
fixing #155798
2025-09-04 12:50:06 +00:00
Jan Patrick Lehr
209d91d9e4
[Offload] Fix CHECK string in llvm-omp-device-info test (#156872) 2025-09-04 14:30:37 +02:00
Muhammad Omair Javaid
c0f84d31ed [lldb] Add issue no to xfail decorators in TestGetBaseName (#155939)
TestGetBaseName.py is currently marked as an expected failure on Windows
because SBFunction::GetBaseName() and SBSymbol::GetBaseName() don’t yet
handle MSVC-style mangling.

This patch updates the @expectedFailureAll decorator to include a
reference to https://github.com/llvm/llvm-project/issues/156861
2025-09-04 17:23:18 +05:00
Hongyu Chen
379e121122
[X86] Compute the known bits for VPMADD52L/VPMADD52H in SimplifyDemandedBitsForTargetNode (#156847)
Address TODO and compute the known bits with the intermediate result.
2025-09-04 20:21:50 +08:00
Timm Baeder
8f376689ec
[clang][bytecode] Print 8 bit integers as 32 bit in Function::dump() (#156858)
Otherwise we get the char representation in our disassembly output,
which we don't want.
2025-09-04 14:15:05 +02:00
Lang Hames
f84d23183a
[orc-rt] Fix typo in include guard comment. NFC. (#156869) 2025-09-04 22:14:35 +10:00
Timm Baeder
83ca877159
[clang][bytecode] Reject final ltor casts on string literals (#156669)
Similar to what the current interpreter does.
2025-09-04 14:08:04 +02:00
Lang Hames
5eb0ec4c1c
[orc-rt] Fix header list in CMakeLists.txt after 6af1247ecb9. (#156867)
6af1247ecb9 renamed both C and C++ WrapperFunctionResult.h headers to
WrapperFunction.h. This commit updates CMakeLists.txt to reflect that
change.
2025-09-04 22:04:17 +10:00
Walter Lee
f1c9950cc8
[clang-tidy] Fix file extension inconsistency (#156528)
This fixes an issue with #150791. In CheckRunner, we treat files with
unrecognized extensions as ".cpp", by forcefully assigning `extension =
".cpp"` if it's not already one of `".c", ".hpp", ".m", or ".mm"`. Make
the new code which chooses the default `-std` argument be consistent
with that, so that using other file extensions doesn't trigger an error
message like `error: invalid argument '-std=c99' not allowed with 'C++'`
2025-09-04 08:00:42 -04:00
Benjamin Maxwell
5899bca6ba
[AArch64][SME] Resume streaming-mode on entry to exception handlers (#156638)
This patch adds a new `TargetLowering` hook `lowerEHPadEntry()` that is
called at the start of lowering EH pads in SelectionDAG. This allows the
insertion of target-specific actions on entry to exception handlers.

This is used on AArch64 to insert SME streaming-mode switches at landing
pads. This is needed as exception handlers are always entered with
PSTATE.SM off, and the function needs to resume the streaming mode of
the function body.
2025-09-04 12:55:12 +01:00
Paul Walker
73c5bc5cfd
[SVE ACLE] Remove explicit sve2 requirement from crypto and b16b16 builtins. (#156456)
The instructions have no direct dependency on SVE2, nor does the code
generator require it.
2025-09-04 12:46:56 +01:00
Andrew Savonichev
371d1a8e3e
[lldb] Use weak pointers instead of shared pointers in DynamicLoader (#156446)
DynamicLoaderWindowsDYLD uses pointers to Modules to maintain a map
from modules to their addresses, but it does not need to keep "strong"
references to them. Weak pointers should be enough, and would allow
modules to be released elsewhere.

Other DynamicLoader classes do not use shared pointers as well. For
example, DynamicLoaderPOSIXDYLD has a similar map with weak pointers.

Actually testing for modules being completely released can be tricky.
The test here is just to illustrate the case where shared pointers kept
modules in DynamicLoaderWindowsDYLD and prevented them from being
released. The test executes the following sequence:

  1. Create a target, load an executable and run it.

2. Remove one module from the target. The target should be the last
actual use of the module, but we have another reference to it in the
shared module cache.

3. Call MemoryPressureDetected to remove this last reference from the
cache.

  4. Replace the corresponding DLL file.

LLDB memory maps DLLs, and this makes files read-only on Windows. Unless
the modules are completely released (and therefore unmapped), (4) is
going to fail with "access denied".

However, the test does not trigger the bug completely - it passes with
and without the change.
2025-09-04 20:36:14 +09:00
Ross Brunton
4e8b4d6190
[Offload] Port llvm-offload-device-info to new offload API (#155626)
This is a tool similar to urinfo that simply prints properties of all
devices. The old openMP version has been ported to liboffload.
2025-09-04 12:23:30 +01:00
Björn Pettersson
465f793735
[SeparateConstOffsetFromGEP] Highlight that trunc is handled. NFC (#154563)
Update code comments and variable/function names to make it more clear
that we handle trunc instructions (and not only sext/zext) when
extracting constant offsets from a GEP index expressions.

This for example renames the vector ExtInsts to CastInsts.
2025-09-04 13:17:54 +02:00
Donát Nagy
faa7a87c86
[NFC][TableGen][analyzer] Fix some obsolete comments (#156677)
ClangSACheckersEmitter.cpp had some comments that described the
structure of its output, which would have been helpful, but became out
of sync with the code. This commit updates them to ensure they are
consistent with `CheckerRegistry.cpp`.
2025-09-04 13:15:38 +02:00
Matthew Devereau
f831463704
[MemoryLocation] Size Scalable Masked MemOps (#154785)
Scalable masked loads and stores with a get active lane mask whose size
is less than or equal to the scalable minimum number of elements can be
be proven to have a fixed size. Adding this infomation allows scalable
masked loads and stores to benefit from alias analysis optimizations.
2025-09-04 12:02:40 +01:00
Simon Pilgrim
05da1603e7
[X86] Add assembly comment for VMOVSH instructions (#156848)
Matches existing MOVSD/S implementations
2025-09-04 11:02:05 +00:00
Florian Hahn
b400fd1151
[LAA] Support assumptions with non-constant deref sizes. (#156758)
Update evaluatePtrAddrecAtMaxBTCWillNotWrap to support non-constant
sizes in dereferenceable assumptions.

Apply loop-guards in a few places needed to reason about expressions
involving trip counts of the from (BTC - 1).

PR: https://github.com/llvm/llvm-project/pull/156758
2025-09-04 11:32:33 +01:00
Ramkumar Ramachandra
c14052e20b
[VPlan] Let Not preserve uniformity in isSingleScalar (#156676)
LogicalAnd and WidePtrAdd should also preserve uniformity, but we don't
have test coverage to enable adding them.
2025-09-04 11:27:14 +01:00