[LiveDebugVariables] Repair stale SlotIndexes
The analysis keeps its indexes from before the first register allocator
until DBG_VALUEs are emitted, by which point passes in between have
erased some of the instructions they point at. Resolve them at the
start of each allocator run and before emitting.
SlotIndexes can then reclaim the entries of erased instructions without
sparing the ones held here, which would have made generated code depend
on -g. Emitted locations are unchanged, except that intervals resolving
to one position now emit a single DBG_VALUE rather than identical
consecutive ones.
[clang] Add a one-entry cache to DiagStateMap::getFile() (#228956)
Once a TU has seen a `#pragma clang diagnostic` (libc++ has them in most
headers), every DiagnosticsEngine::isIgnored() / getDiagnosticSeverity()
call with a location looks up the location's FileID in a
std::map<FileID, File>. The map has an entry for every FileID a state
was ever looked up for, including macro expansions, so it gets large.
For blink's logical_box_fragment.cc, it has 60755 entries, and 92.4% of
the 3.28M lookups are for the same FileID as the previous lookup.
std::map has stable addresses, so remember the result of the last
lookup.
For 60 random Chromium TUs (linux x64, -O2) picked with probability
proportional to their compile time, sum over all TUs:
CPU time: 192.6 s => 191.4 s, -0.65%
instructions: 1903.0e9 => 1888.3e9, -0.77%
[3 lines not shown]
[SelectionDAG] Handle constants in SimplifyMultipleUseDemandedBits
Replace a non-zero constant with zero when none of its set bits are
demanded.
This allows users of `SimplifyMultipleUseDemandedBits` to eliminate
irrelevant constant bits while preserving the convention that a null
SDValue indicates no simplification.
[AMDGPU] Fold mul24 with an operand whose low 24 bits are zero (#224537)
mul24 only reads the low 24 bits of each operand. Try
`SimplifyDemandedBits`
before `SimplifyMultipleUseDemandedBits` so that a single use operand
such as
`(x & 0xff000000)` is simplified to zero, then fold the multiply to zero
when
either operand is a zero constant.
This folds cases such as:
```
mul24(x & 0xff000000, y) -> 0
mul24(x, 0) -> 0
```
[lldb][test] Correct register validity check in TestProcessSaveCoreMinidump.py (#229059)
This API will never return None, instead it will be an invalid SBValue.
I noticed this because I'm checking what can be run on an AArch64 host,
and this part of the test passed due to this mistake.
[lldb][NativePDB] Route expression function calls through FunctionCallLabel (#227021)
`NativePDB` creates function and method decls without an asm label or
with the public symbol name as the label. The expression evaluator then
has to find the callee by the name Clang mangles for the decl, which
fails whenever that name is not in the symbol table:
- Methods of class template specializations: the record is a plain
`CXXRecordDecl` named `"A<int>"`, so Clang mangles `?foo at A<int>@@...`
instead of `?foo@?$A at H@@...`.
- Functions with internal linkage, which have no `S_PUB32`.
- Functions renamed with `__asm__`.
All of the above fail with:
```
error: Couldn't look up symbols:
int A<int>::foo(void)
```
[26 lines not shown]
[flang] Build 128-bit MIN/MAX identity constants from APInt (#228513)
The MIN/MAX reduction identities were computed with
`APInt::getSigned{Min,Max}Value(bits).getSExtValue()`
and passed to `createIntegerConstant(int64_t)`. For INTEGER(16) that
value does not fit in `int64_t`.
An assertions build aborts at `-O1` on any
`MINVAL`/`MAXVAL`/`MINLOC`/`MAXLOC` of an INTEGER(16)
array, and on OpenMP `reduction(min:)`/`reduction(max:)` of INTEGER(16)
at any `-O`. A release
build zero-extends the low 64 bits instead. The identity becomes
`2**64-1` or `0`, so empty and
fully masked reductions return the wrong value.
This adds an `APInt` overload of `FirOpBuilder::createIntegerConstant`
and uses it at the four
affected sites: `SimplifyHLFIRIntrinsics`, the MAXVAL and MINLOC/MAXLOC
`init` lambdas in
`SimplifyIntrinsics`, and `ReductionProcessor::getReductionInitValue`.
[3 lines not shown]
[SystemZ][z/OS] Add the missing libm entry points to the libcall table (#228587)
The z/OS runtime libcall table maps most math libcalls to the IEEE entry
points of the C runtime (e.g. `cos` -> `@@FCOS at B`, `pow` -> `@@WPOW at B`),
but `tan`, `asin`, `acos`, `atan`, `atan2`, `sinh`, `cosh` and `tanh`
had no entries. Calls generated for the corresponding intrinsics then
used the plain names (`atan2f` etc.), which bind to entry points that
cannot be used in IEEE mode: a program fails at run time with `CEE3728S
The use of a function, which is not supported by this release of
Language Environment was detected.` Reproducer and details are in
#228584.
This adds the F32/F64/F128 entry points for these eight functions, with
the names the z/OS C headers map them to in IEEE mode, and three more
cases to `zos-intrinsics.ll`.
Tests: the same change on a branch based on 85ac560262, with SystemZ as
the only target: `llvm-lit test/CodeGen/SystemZ` passes (1282 tests),
and five programs of the NIST FORTRAN 77 test suite that failed with
[9 lines not shown]
secure: Rearrange Makefile SRCS to match upstream Makefile.in
SRCS entries are kept in the same order and with the same line breaks as
upstream, to make comparison easier.
No functional change intended.
Reviewed by: emaste
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D49793
(cherry picked from commit 9440aad19dca73fdd224b128ac2dc2e78191ff15)
arm64/gicv5: Use ArmMpidr to find the correct CPU
The GICv5 ACPI code uses CpuInterfaceNumber to as the CPU ID. This a
GICv5 CPU ID and may not be the same as the appropriate FreeBSD value.
It is also possible the target CPU is disabled, e.g. when the hw.ncpu
tunable is uses to limit CPUs. If this is the case we don't want to
enable the CPU in the cpu set as it is offline so cannot handle
interrupts.
Switch to use ArmMpidr to find which pcpu to use when finding which
CPUs the IRS is attached to.
Fixes: 9556306213e1 ("arm64: Add ACPI support to GICv5 driver")
Differential Revision: https://reviews.freebsd.org/D59993
Sponsored by: Arm Ltd
[libsycl] Take MDataCollectionMutex in getDeviceKernelInfo() (#228099)
getDeviceKernelInfo() searched MDeviceKernelInfoMap without holding
MDataCollectionMutex, so a kernel launch could race with the
registerFatBin() or unregisterFatBin(). Fixing it by addition of lock.
Report an unknown kernel name with sycl::errc::runtime instead of
asserting. Unlike registration, which runs from a module's static
initialization where nothing can catch, this runs from a user kernel
submission, so the exception reaches the user's handler.
Assited-by: Claude Code.
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova at intel.com>
nuageinit: Allow the userdata script to run before firstboot* rc services
Allowing nuageinit user scripts to run before these makes it possible to
customize official BASIC-CI and BASIC-CLOUDINIT FreeBSD images.
This was requested by KDE for their CI.
Approved by: cperciva
Pull-Request: https://ron-dev.freebsd.org/FreeBSD/src/pulls/60
(cherry picked from commit 16e47f317c4ce2be5fed530bf8a9af9f9bf55364)
[libclc][test] Fix a regression in libclc/test/work-item/get_group_id.cl (#228621)
Add a missing noundef in libclc/test/work-item/get_group_id.cl from a
recent commit.
Fixes: 552ea17e0a93 ([ValueTracking] Handle zext/sext in
computeConstantRange (#227726), 2026-09-30)
[libsycl] Fix and test sycl::item conversion (#227692)
Assisted-by: Claude Code.
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova at intel.com>
bsd.lib.mk: only ctfmerge if objfiles have a CTF section
PR: 299013
Reported by: Trond.Endrestol at ximalas.info
Reviewed by: emaste
Fixes: 222210c6a822 ("libgcc_s: add libgcc_s_asneeded.so wrapper for gcc 16")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D60252