[FileCheck] Avoid matching IR keywords in source filenames (#213809)
Anchor checks for declare, define, and comdat to the start of lines or another fixture so
paths in module headers cannot satisfy or invalidate them.
Tested with make check.
Assisted by AI.
[SPIRV] Split wide shader PHIs before applying explicit supported types (#213806)
fixes #213802
Apply the maximum-vector-size rule before the explicit PHI legality
rules for type. This way if we see a size 16 vector we split it
beforehand.
In more precise words this preserves existing legality rules while
ensuring shader PHIs wider than four lanes are split first.
Assisted by Copilot (GPT 5.6 Sol)
[X86] LowerPARITY - use countMaxActiveBits to determine if representable as uint8_t. NFC. (#214056)
Much cleaner than using the MaskedValueIsZero check.
Fix i64 -> xor(i32,i32) parity stage comment as well.
[X86] Handle multi-use setcc in commuteSelect (#213645)
When a setcc condition is shared between multiple vselects,
commuteSelect previously bailed out due to the m_OneUse constraint.
Extend it to check all users of the setcc and, if they all benefit from
commuting, invert the condition once with ReplaceAllUsesOfValueWith and
swap all vselect operands.
This fixes a write-mask fusion regression where masked min/max
reductions produced unfused vminps + vmovaps {%k} instead of a single
write-masked vminps {%k}.
[NFC][Clang][Docs] Fix minor typos in Constant Interpreter doc. (#211608)
First: Typo is obvious.
Second: In the example, the a.y field is missing and field a.b.y is
required.
[Support][Driver][LLDB] Guard WIN32_LEAN_AND_MEAN definitions with #ifndef (#213045)
Several Windows headers/TUs unconditionally `#define
WIN32_LEAN_AND_MEAN`. When a build predefines the macro on the compiler
command line (e.g. a toolchain that passes -DWIN32_LEAN_AND_MEAN, which
clang treats as `#define WIN32_LEAN_AND_MEAN 1`), the differing token
lists trigger -Wmacro-redefined, which becomes a hard error under
-Werror.
Guard the definitions with #ifndef, matching the adjacent NOMINMAX
handling and the existing pattern in
llvm/lib/Support/rpmalloc/rpmalloc.c. The macro is only a presence flag,
so keeping an externally-provided definition is correct.
Sites guarded:
llvm/include/llvm/Support/Windows/WindowsSupport.h
llvm/lib/WindowsDriver/MSVCPaths.cpp
clang/lib/Driver/ToolChains/MSVC.cpp
lldb/include/lldb/Host/windows/windows.h
[13 lines not shown]
Did the following:
- Updated intrinsic.md document
- Simplified the code per recommendations
- Fixed constant folding to be context aware and only report errors
in constant expressions. Otherwise they are left for runtime.
- Corrected namelist declaration error.
- Corrected enumeration type attributes.
- Added/modified test cases are appropriate.
[lldb] Disable TestProcessSaveCoreMinidumpSizeMismatch on Windows hosts (#214044)
The buildbot
[lldb-remote-linux-win](https://lab.llvm.org/buildbot/#/builders/197) is
red after #212861. #212861 cannot be reverted automatically now because of
#212641. So disable TestProcessSaveCoreMinidumpSizeMismatch on Windows
hosts to make the buildbot green again.
[NFC][AMDGPU] Fix exit code mismatch with EXPENSIVE_CHECK in schedule… (#214027)
…-amdgpu-tracker-physreg-crash.ll
Observed in
https://ci.swift.org/job/llvm.org/job/clang-stage1-RA-expensive/job/main/1155
with LLVM_ENABLE_EXPENSIVE_CHECKS enabled,
`CodeGen/AMDGPU/schedule-amdgpu-tracker-physreg-crash.ll` fails due to
MachineVerifier running, causing an exit 1.
Modified to always run the `-verify-machineinstrs`.
rdar://184010766
[DWP] Eagerly clear buffers after writing (#213345)
Lowers peak memory usage on a llvm-dwp invocation from 12.37GB ->
11.19GB.
This actually now beats out GNU dwp (11.35GB) at least when the output
file is in tmpfs.
[flang][OpenMP] Diagnose failed construct decomposition instead of falling through (#214012)
`buildConstructQueue` asserts that decomposition produced output:
```cpp
ConstructDecomposition decompose(modOp, semaCtx, eval, compound, clauses);
assert(!decompose.output.empty() && "Construct decomposition failed");
```
Release builds have no check, so the empty queue falls through to the
loop below and out to the
caller. That is undefined behaviour, and it is reachable — semantics
does not catch every
directive/clause combination that cannot be decomposed. The result is an
intermittent segfault
rather than a diagnostic.
#211430 is one way in: `allocate` is an OpenMP 5.0 clause, but most
directives declare it in
[45 lines not shown]
[SystemZ][z/OS] Add guard for SI_USER (#213101)
SI_USER is not defined on z/OS and is causing the following build
failure. `error: use of undeclared identifier 'SI_USER'`
This patch adds a guard to check whether SI_USER is defined
before using it.
[TableGen][AsmMatcher] Resolve RegClassByHwMode kinds for all operands
validateOperandClass() only remapped a RegClassByHwMode operand kind
when the actual parsed operand was a register. When the operand was
something else entirely (e.g. a bare immediate where a register was
expected), this fell through to the generic "Kind <= MCK_LAST_REGISTER"
diagnostic check, so we end up with a generic Match_InvalidOperand.
No test changes here, but this is needed to avoid diagnostic regressions
with the RVY load/store support (PR #177073).
Pull Request: https://github.com/llvm/llvm-project/pull/213479
[TableGen] Generate `getRegClassFromMatchKind()` for AsmMatchers
This helper can be useful in validateTargetOperandClass to get the
MCRegisterClass for the MCK_* enum.
Migrate the RVY logic to use this new generated function. Checking all
register classes instead of just the RVY ones will marginally slow down
validateTargetOperandClass, but since this is already a slow path it
should not matter.
If multiple RegisterOperands share a ParserMatchClass but map to different
RegisterClasses, omit them from the generated getRegClassFromMatchKind
mapping function. I originally tried to emit an error here, but it turns
out there are many targets that rely on sharing the ParserMatchClass with
different (but similar) RegisterClasses so ignoring them is safer.
Reviewed By: lenary
Pull Request: https://github.com/llvm/llvm-project/pull/200453
[SystemZ][z/OS] use LLVM_THREAD_LOCAL instead of thread_local (#214039)
This patch is to fix the following error on z/OS
```
llvm/include/llvm/Support/PerThreadBumpPtrAllocator.h:75:12: error: thread-local storage is not supported for the current target
75 | static thread_local std::vector<AllocatorTy *> Cache;
| ^
```
[AMDGPU][GISel] Add RegBankLegalize rules for amdgcn_tanh
Enable the existing gfx1250 and gfx13 GlobalISel coverage now that tanh operands are assigned to VGPRs.
Co-authored-by: Cursor <cursoragent at cursor.com>
[AMDGPU][GlobalISel] Legalize BF16 fneg and fabs
Restore the BF16 semantic types omitted by the extended LLT migration and preserve packed vector legalization.
Co-authored-by: Cursor <cursoragent at cursor.com>