[clang][Frontend] Table-drive compiler option dumping (#203161)
`Features.def` currently expands 228 feature formatting expressions and
49 extension formatting expressions in
`DumpCompilerOptionsAction::ExecuteAction`. This stores the names in
NUL-separated character blobs, evaluates the predicates into local
`bool` arrays, and formats both arrays with `writeCompilerOptionValues`.
In a Release arm64 build, standalone clang decreases by 49,256 bytes
unstripped and 49,520 bytes stripped, while the LLVM multicall binary
decreases by 49,264 bytes unstripped and 49,528 bytes stripped; linked
`__text` decreases by 52,696 bytes and linked fixups decrease by 7.
Work towards #202616
AI tool disclosure: Co-authored with OpenAI Codex.
[libsycl] Add tool dependencies in runtimes mode (#205384)
The libsycl runtime depends on multiple clang tools.
We should ensure that these tools are built.
---------
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova at intel.com>
Use existing encoding when writing to an existing file (#198873)
Clang lit test `Sema/warn-lifetime-safety-suggestions.cpp` is failing
because the encoding for the new contents of the source file don't match
the file tag on the file.
This change ensures the contents of a file are written in the same code
page as the existing file.
- The copyFileTagAttributes() function will change the auto conversion
to the code page of the file tag when writing a new version of a file.
- When writing to an existing file (eg. appending), use the file tag as
the code page for auto conversion. Don't assume 1047.
[VPlan] Introduce VPlan-based requiresScalarEpilogue helper. (NFC) (#207784)
Add requiresScalarEpilogue(Plan, VF) that directly checks if a scalar
epilogue is required for a VPlan. In that case, the middle block (i.e.
first predecessor of the scalar ph) unconditionally branches to the
scalar preheader.
For now added to LoopVectorizationPlanner, so we can assert that the
result of the VPlan check matches the legacy result, to catch any
potential divergences.
The helper should be moved to VPlan directly and the assertion dropped
when no divergences have been found for a while, to make it independent
of the cost mode.
PR: https://github.com/llvm/llvm-project/pull/207784
[NFC][clang][Serialization] Outline LangOptions mismatch diagnostics (#202843)
Outline language-option mismatch diagnostic construction into two
`noinline` helpers. Generated comparisons remain direct and ordered as
before, so successful imports add no indirect calls and the serialized
format is unchanged.
Linked `clang` and `clangd` shrink by 35,264 and 29,216 bytes
respectively; `ASTReader.cpp.o` shrinks by 62,712 bytes with 1,347 fewer
relocations, while linked fixups are unchanged.
PCH, PCM, and BMI outputs and mismatch diagnostics are byte-identical,
focused module/PCH tests pass, and batched PCH and module imports show
no significant performance change.
Work towards #202616
AI tool disclosure: Co-authored with OpenAI Codex.
devel/tvision: Update to 2026.05.12
ChangeLog:
- Update the borders of framed views upon insertion or removal
- Prevent out-of-bounds array access in TCommandSet
- Regenerate missing scan codes in win32-input-mode
- Fix write() usage in StderrRedirector
- Also restore terminal state on SIGBUS and SIGPIPE
MFH: 2026Q2
(cherry picked from commit dc1d38427b6b1c8b52f84328eceac9e8776a5401)
[libcxx][NFC] Move guards outside namespace (#208089)
Libc++ has a warning that triggers on empty namespaces. When
_LIBCPP_BUILDING_LIBRARY is not defined, the __locale namespace was
empty. This PR moves the #ifdef to surround the namespace and fix the
warning.
devel/tvision: Update to 2026.05.12
ChangeLog:
- Update the borders of framed views upon insertion or removal
- Prevent out-of-bounds array access in TCommandSet
- Regenerate missing scan codes in win32-input-mode
- Fix write() usage in StderrRedirector
- Also restore terminal state on SIGBUS and SIGPIPE
MFH: 2026Q2
[flang-rt] Fix -Wunused-template in time intrinsics and test helpers (NFC) (#207979)
`time-intrinsic.cpp` implements the timing intrinsics as SFINAE overload
sets (preferred/fallback per platform), so on any given platform some
overloads are intentionally never instantiated and trip
-Wunused-template. Mark all variants [[maybe_unused]].
`StoreElement` and `MakeArray` in `unittests/Runtime/tools.h` are static
function templates in a header, so any test TU that includes it without
using all of them trips the warning.
Part of #202945
Don't remove other elements in a RB_FOREACH_SAFE walk since that is not safe.
repo_move_valid() walks the tree with RB_FOREACH_SAFE() but it also calls
RB_REMOVE() via filepath_put() on an other element in a case where a
conflict is resolved. This results in a use-after-free if that element is
the next one in the tree (nfp). Instead of removing the present
conflicting node (ofp), replace the contents of it, free fp and swap fp
with ofp.
With and OK tb@
[RISCV] Report "unexpected extra operand" for surplus operands in AsmParser (#207142)
This improves upon the shared near-miss reporting infrastructure added
in #205721 by handling a case that was deferred during that PR's review.
Assisted-by: claude-opus
[AMDGPU] Gate fold_pow(x, ±0.5)->sqrt/rsqrt on nsz+ninf fast-math flags (#205592)
AMDGPULibCalls::fold_pow rewrote pow(x, 0.5)->sqrt(x) and pow(x,
-0.5)->rsqrt(x) unconditionally, firing before the
isUnsafeFiniteOnlyMath guard. This is incorrect for two IEEE corner
cases:
pow(-Inf, 0.5) == +Inf but sqrt(-Inf) == NaN
pow(-0.0, 0.5) == +0.0 but sqrt(-0.0) == -0.0
Guard the fold on hasNoSignedZeros() && (IsPowr || hasNoInfs()), where
IsPowr is true for powr/powr_fast. The OpenCL spec requires x >= 0 for
powr, so -Inf is undefined behaviour and the ninf check can be skipped;
-0.0 is a valid input for powr since -0.0 >= 0 by IEEE comparison, so
nsz is still required for all variants. afn alone is not sufficient
since it only permits approximate results and says nothing about the
treatment of infinities or signed zeros.
Update the four autogenerated test files to reflect the new semantics:
[4 lines not shown]
[AMDGPU] Guard block-count upgrade against volatile/atomic grid-size … (#208068)
…loads
AMDGPULowerKernelAttributes upgrades the pre-COV5 pattern
udiv(grid_size_x, group_size_x)
to a direct load of hidden_block_count_x from the implicit args. The
m_Load() pattern matcher does not check whether the matched load is
volatile or atomic, so a volatile or atomic grid_size load would have
been silently deleted and replaced -- dropping its observable side
effects in violation of the LangRef.
Fix: after the pattern match succeeds, cast the matched value to
LoadInst and bail out if !isSimple() (i.e., volatile or atomic).
Add a test case num_blocks_x_volatile_grid_size in
implicit-arg-block-count.ll to verify the volatile load and udiv are
preserved unchanged.