[TableGen] Use llvm_unreachable in switch guard for all except gcc 8-
Follow-up to https://github.com/llvm/llvm-project/pull/194728.
For gccs older than v9 use abort. That seems to make everybody happy.
[LifetimeSafety] Fix liveness propagation for all origin flows (#205323)
Previously, the `transfer` function for `OriginFlowFact` only handled
killing the destination origin. It did not propagate liveness backwards
from destination to source, meaning that if an origin flowed into
another, the source was not marked live even when the destination was.
The `transfer` function now propagates liveness from destination to
source: if the destination origin is live, the source origin is also
marked live with the same `LivenessInfo`, before optionally killing the
destination.
Additionally, `handleMovedArgsInCall` now skips rvalue reference
parameters annotated with `[[clang::lifetimebound]]`, since such
parameters should not be treated as moved-from.
This introduces some false positives for invalidations as container
modifications are not considered self-invalidating. The updated test
expectations reflect this, along with `FIXME` comments explaining that
[2 lines not shown]
[docs] Enforce unambiguous toctree in llvm/docs
It seems like using a non-`hidden` `toctree` for page navigation is a
bit of a trap, in that every doc must have a single unique path through
the global toctree to the root doc, and it is very easy to end up with
multiple.
This patch tries to address the warnings (actually infos, hence why it
does not fail the build) in llvm/docs/, namely:
$ sphinx-build -b html -jauto llvm/docs/ /tmp/sphinx-out
checking consistency...
llvm/docs/AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack/AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack.md: document is referenced in multiple toctrees: ['UserGuides', 'AMDGPUUsage'], selecting: UserGuides <- AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack/AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack
llvm/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.rst: document is referenced in multiple toctrees: ['UserGuides', 'AMDGPUUsage'], selecting: UserGuides <- AMDGPUDwarfExtensionsForHeterogeneousDebugging
llvm/docs/CommandGuide/llvm-reduce.rst: document is referenced in multiple toctrees: ['CommandGuide/index', 'CommandGuide/index', 'Reference'], selecting: Reference <- CommandGuide/llvm-reduce
llvm/docs/GitHub.rst: document is referenced in multiple toctrees: ['GettingInvolved', 'UserGuides'], selecting: UserGuides <- GitHub
llvm/docs/GlobalISel/IRTranslator.rst: document is referenced in multiple toctrees: ['GlobalISel/index', 'GlobalISel/Pipeline'], selecting: GlobalISel/index <- GlobalISel/IRTranslator
llvm/docs/GlobalISel/InstructionSelect.rst: document is referenced in multiple toctrees: ['GlobalISel/index', 'GlobalISel/Pipeline'], selecting: GlobalISel/index <- GlobalISel/InstructionSelect
llvm/docs/GlobalISel/Legalizer.rst: document is referenced in multiple toctrees: ['GlobalISel/index', 'GlobalISel/Pipeline'], selecting: GlobalISel/index <- GlobalISel/Legalizer
[35 lines not shown]
[docs] Create utils/docs
llvm-project is home to many sphinx documentation sites, each with
configuration quirks and bespoke extensions.
The sphinx config model makes sharing code somewhat difficult. There
are options like sphinx-multiproject, but some of our docs builds are
out of the source tree while some are done out of the binary tree, so
the multiproject configuration itself would need to be generated. It
also would impose more uniformity around extensions than required.
This change instead creates a python package at utils/docs/llvm_sphinx
and makes it available to all sphinx-build processes via PYTHONPATH.
Each conf.py does not modify its own sys.path because not all builds are
out of the source tree, so there isn't a stable relative path to use to
refer to the utils/docs/ directory.
Type checking via pyright in new package is pinned to being python 3.8
compatible.
[29 lines not shown]
bnxt: Report actual link speed, rather than hard-coded 100Gbs
We need to report the actual link speed, rather than a hard-coded
100Gbs for a variety of reasons, but most importantly, as reporting
100Gbs on a 10g link breaks lacp when this NIC is in an LACP bundle
with other vendors' NICs after e98ed8d99fd4 (lacp:
Simplify lacp_compose_key()), as the fake 100g puts this nic
into a different aggregation group.
Sponsored by: Netflix
Reviewed by: glebius
Tested by: glebius
iflib: handle transient errors from isc_txd_encap()
Until we introduced support for nic ktls offload, all error returns
from isc_txd_encap() indicated a permanent failure. Iflib remapped all
those failures to ENOMEM, which was treated by the tcp stack as a
permanent error and passed back to the caller. This was done to avoid
creating "infinite loops" where a packet couldn't be mapped for
transmit, and kept being sent over and over.
Now that we have support for nic ktls offload, some ktls offload
drivers may return ENOBUFS from their encap function to indicate that,
for example, the ktls context may not yet be fully initialized. This
needs to be treated as a transient error so that the TCP stack may
re-try at a later time. To achieve this, pass the raw error back to
the caller when the encap routine returns an error aside from EFBIG.
Note that I audited all in-tree iflib drivers. Only ice and ixl ran
return anything other than 0 from their encap, which is EFBIG. both of
which are still treated as they were before.
[8 lines not shown]
[CIR] Atomic load and store via library call (#202671)
This patch adds support for atomic load/store operations that go through
calls to the `__atomic_load` and `__atomic_store` library functions.
This could happen when the size of the atomic type is too large or is
not a power of 2.
Assisted-by: Codex / gpt-5.5 xhigh
[libc] Add loff_t type (#204641)
Added loff_t type definition. This is a Linux extension required for
large file offsets.
* llvm-libc-types/loff_t.h: Include linux/loff_t.h on Linux.
* llvm-libc-types/linux/loff_t.h: Added Linux definition using
__kernel_loff_t.
* llvm-libc-types/CMakeLists.txt: Include linux subdirectory and add
dependency for loff_t.
* llvm-libc-types/linux/CMakeLists.txt: Registered loff_t.
* sys/types.yaml: Added loff_t to sys/types.
* libc/include/CMakeLists.txt: Added dependency to sys_types target.
Assisted-by: Automated tooling, human reviewed.
[LifetimeSafety] Model pointer-to-data-member access in the fact generator (#204612)
VisitBinaryOperator had no case for `obj.*pm` (BO_PtrMemD) /
`objptr->*pm` (BO_PtrMemI), so a borrow of the accessed member
(`&(obj.*pm)`) dropped the object's loan to an empty origin and a
use-after-scope was missed. Flow the object operand's origin into the
result, mirroring a member access: for `.*` the object is the LHS, for
`->*` it is the LHS pointer's pointee.
Assisted-by: Claude Opus 4.8
Co-authored-by: Gabor Horvath <gaborh at apple.com>
NAS-141449 / 27.0.0-BETA.1 / Convert SSH plugin to typesafe pattern (#19163)
## Context
Migrates the `ssh` plugin from the legacy dict-based
`SystemServiceService` to the typesafe pattern, matching the `ups`/`ftp`
shape.
## Solution
Split the single `ssh.py` into a package: a lean `SSHService` (`generic
= True`) in `__init__.py` delegating to `SSHServicePart` in `config.py`,
with the host-key helpers moved to plain functions in `keys.py`.
`config`/`update` now return the `SSHEntry` Pydantic model in-process,
so every internal consumer was updated: the `sshd_config` mako and the
SSH `config.py` renderer `.model_dump()` the model at the top, and the
in-process callers (`keychain`, `failover` nftables, the `service_`
start/reload hooks, and the plugin's own `setup()`) were switched from
string `middleware.call('ssh.…')` to typed `call2`/`call_sync2`. The
only remaining string call is `etc.py`'s dynamic `CtxMethod` dispatch,
which has no static method handle. Registered the service in `main.py`
and added the package to the mypy workflow.
hwpmc_ibs: Add more IBS register definitions
Small change to add additional IBS register definitions for the new pmc
tools. Most of the definitions are for Zen 4 and above where we get
detailed information regarding the source of a completed memory
operation.
Reviewed by: mhorne
Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/2292
hwpmc_amd: Avoid using PMCs if in use by firmware
Some firmwares use the PMCs to monitor OS performance. We can't be
certain that the BIOS would detect any change to the counters if we
reprogram them. In cases where the firmware is using the PMCs to
control power management this could have dangerous side effects or
unexpected performance effects.
During initialization, detect if any of the counters are enabled and
fail if so.
Reported by: Sandipan Das
Reviewed by: mhorne
MFC after: 1 week
Sponsored by: Netflix
Pull Request: https://github.com/freebsd/freebsd-src/pull/2277
Recommit "[libc] Introduce the ioctl syscall wrapper and port all callers (#204640)" (#205317)
This patch reapplies #204640 (reverted in #205277), due to (-Werror)
build failure with gcc. Gcc warned about passing an uninitialized
structure through a `const void *` argument. This isn't a problem
because the ioctls in question write to that argument. The
fix/workaround is to provide a `void *` overload.
The original commit message was:
This patch adds an ioctl syscall wrapper in linux_syscalls namespace and
migrates all direct SYS_ioctl calls to use it.
To handle the polymorphic nature of ioctl arguments (where some commands
expect pointers, some expect scalar integers like queue_selector, and
some expect no argument at all), I use a helper struct IoctlArg with
implicit constructors. This avoids template bloat and overload
ambiguities (particularly around literal 0) while keeping call sites
clean.
Assisted by Gemini.
[SLP]Fix dominance crash for scheduled copyable PHI-operand bundles
Extend the copyable/non-copyable PHI conflict bail-out in
tryScheduleBundle to the scheduled path, not just the non-schedulable
one.
Fixes #205327
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/205372
[CIR] Add cir.builtin_int_cast operation to replace uses of builtin.unrealized_conversion_cast (#201592)
This patch adds a new operation builtin_int_cast to handle casting
between CIR integer types and builtin integer types. This will replace
the current use of the builtin.unrealized_conversion_cast since this
operation is only intended to be used temporarily when doing
transformations.
Assisted-by: Cursor/Claude Opus 4.8 High
ctl: Use CAM_PRIORITY_NORMAL for queued CCBs
Previously this was using CAM_PRIORITY_NONE which tripped over the
assertion added in b4b166b8c46b8.
PR: 293076
Reported by: Ken J. Thomson <thomsonk at yandex.com>
Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D56995
(cherry picked from commit 887841731be60a958e471b9fd79261169b67b7ad)