[libc] Add struct sockaddr_storage (on linux) (#192978)
This deceptively simple patch has one catch. The POSIX standard states:
"""
When a pointer to a sockaddr_storage structure is converted to a pointer
to a sockaddr structure, or vice versa, the ss_family member of the
sockaddr_storage structure shall map onto the sa_family member of the
sockaddr structure. When a pointer to a sockaddr_storage structure is
converted to a pointer to a protocol-specific address structure, or vice
versa, the ss_family member shall map onto a member of that structure
that is of type sa_family_t that identifies the protocol's address
family. When a pointer to a sockaddr structure is converted to a pointer
to a protocol-specific address structure, or vice versa, the sa_family
member shall map onto a member of that structure that is of type
sa_family_t that identifies the protocol's address family. Additionally,
the structures shall be defined in such a way that the compiler treats
an access to the stored value of the sa_family_t member of any of these
structures, via an lvalue expression whose type involves any other one
[20 lines not shown]
NAS-140717 / 26.0.0-BETA.2 / Move VM NVRAM and TPM atomically with VM rename (by Qubad786) (#18775)
## Problem
Two bugs in the VM lifecycle leave on-disk state out of sync with the VM
record:
1. **Rename loses TPM state and can desync the DB.** `do_update` only
renamed the NVRAM file; the TPM state directory
(`/var/db/system/vm/tpm/{id}_{name}_tpm_state/`) was never touched.
After rename, pylibvirt generates XML pointing libvirt/swtpm at the new
name, the old-named TPM dir is orphaned, and swtpm silently initialises
fresh empty state — Windows 11's TPM appears reset, BitLocker keys and
measured-boot state are lost. On top of that, the DB update ran *before*
the filesystem rename, so any I/O failure left the DB at the new name
while the files stayed at the old one. The `CallError` raised on a
missing NVRAM was also misleading — libvirt recreates NVRAM from its
`template=` attribute on first start.
[43 lines not shown]
[flang][OpenMP] Remove unused member, NFC
After e8e8b6a3d8616b5d6572f9e16442cc97ef3867bd, the member
`privateDataSharingAttributeObjects_` of OmpAttrVisitor is no longer
used. Remove it and the associated accessor functions.
[RISCV] Functional llvm.vector.reduce.mul on scalable types (#193094)
RVV does not have an instruction for performing a horizontal multiply
reduction (either integer or floating point). However, a user of clang
can explicitly write at least the integer form via the
__builtin_reduce_mul construct, and currently we just crash when
compiling this.
This change converts the crash into functionally correct scalar loop to
process each element one by one at runtime. This will be slow, but at
least correct.
Note that to my knowledge we can't generate the floating point one
directly from C, but I decided to handle both for completeness while I
was here.
Written by Claude Code with guidance and review by me.
[lldb] Remove trailing newlines from AppendErrorWithFormat calls (part 2) (#193168)
Follow up to #192965.
This call adds a newline if there isn't one. Changing these will
eventually let us always add a newline, which is in line with
the other methods on CommandReturnObject.
This is a small part of calls found with:
* VSCode search for
`(\.AppendErrorWithFormat\(([\s\r\n]+)?"(?:(?:\\.|[^"\\])*))\\n"` and
replace with `$1"`.
* Asserting that the last character of the format string is not a
newline.
* Manual inspection.
arm: fix float to integer conversion with `+mve` (#193319)
Fix an instruction selection failure when using the `+mve` (and an implied `-mve.fp`)
target feature. From what I understand, e.g. based on
https://reviews.llvm.org/D60694, this combination of target features
enables float registers and loads/moves, but no real FP operations.
Hence
https://godbolt.org/z/xeTcbqMqx
```llvm
define i32 @foo(float %x) {
%i = call i32 @llvm.fptosi.sat.i32.f32(float %x)
ret i32 %i
}
```
compiled with `llc -mtriple=thumbv8m.main-none-eabi
-mattr=+v8.1m.main,-mve.fp,+mve -O2` hit
[8 lines not shown]
[LoopInterchange] Fix out-of-bounds accesses in tests (NFC) (#193272)
These tests trigger out-of-bounds accesses. Fix them by decreasing the
backedge-taken counts of the loops, and add pseudo code.
[DAG] visitFREEZE - revisit frozen node after merging with unfrozen uses (#188206)
After merging other uses of a N to all use FREEZE(N), make sure we
revisit FREEZE(N) to attempt to push the FREEZE through the (now
hasOneUse()) operand.
The only remaining annoyance I can find is the freeze nodes interfering
with amdgpu scalar/vector instructions - mainly because we end up with
more freeze(vectorload) patterns and extract_vector_elt nodes can't peek
through anymore - this is an ongoing general problem that nobody has
found a good answer to yet.
[MachineCopyPropagation][NFC] Refactor EliminateSpillageCopies (#192609)
This patch builds on the original implementation to address areas that
may impact compile time regression if enabled. The aim of the patch is
to streamline and improve the implementation for better compile time
impact. A summary of the changes is as follows:
- Cost modelling that does an initial scan of the block, any blocks with
less than 6 copies are immediately skipped.
- RegMask scan in `findLastSeenDefInCopy` removed. This now only checks
the recorded copies to ensure that RegMasks are clobbered when they are
seen if they clobber a Reg
- Streamlining of `IsSpillReloadPair` and `IsChainedCopy` to reduce the
need for a second call to isCopyInstr to get the DestSourcePair, these
are now returned from the lamdba function
- Use of TRI API to get the CommonRegClass
Assisted-by: Claude Sonnet 4.6 (Co-Pilot)
[lldb] Override UpdateBreakpointSites in ProcessGDBRemote to use MultiBreakpoint
This concludes the implementation of MultiBreakpoint by actually using
the new packet to batch breakpoint requests.
https://github.com/llvm/llvm-project/pull/192910
[lldb] Implement delayed breakpoints
This patch changes the Process class so that it delays *physically*
enabling/disabling breakpoints until the process is about to
resume/detach/be destroyed, potentially reducing the packets transmitted
by batching all breakpoints together.
Most classes only need to know whether a breakpoint is "logically"
enabled, as opposed to "physically" enabled (i.e. the remote server has
actually enabled the breakpoint). However, lower level classes like
derived Process classes, or StopInfo may actually need to know whether
the breakpoint was physically enabled. As such, this commit also adds a
"IsPhysicallyEnabled" API.
https://github.com/llvm/llvm-project/pull/192910
INIT_ALL: Fix typo in option description
From GitHub pull request #2035; the change needs to be applied to the
source file for the option description, not the generated src.conf.5.
(cherry picked from commit c9f3de0ba95b8da31d35fa92e0a54cf6f3d3f1dd)
[lldb][NFC] Move BreakpointSite::IsEnabled/SetEnabled into Process
The Process class is the one responsible for managing the state of a
BreakpointSite inside the process. As such, it should be the one
answering questions about the state of the site.
https://github.com/llvm/llvm-project/pull/192910
ctladm tests: Only use allowed chars in IQN
_ isn't part of the allowed IQN format, but - is.
None functional change.
Reviewed by: asomers, ngie
Approved by: asomers (mentor)
MFC after: 1 week
Sponsored by: ConnectWise
Differential Revision: https://reviews.freebsd.org/D56557
ctl: require ctladm in addition to sg_opcodes
Each test case in opcodes.sh uses ctladm to create and remove the LUN it
exercises, but only sg_opcodes was listed in require.progs.
On systems where ctladm is not builded the tests would fail at setup instead of
being skipped cleanly.
Approved by: asomers
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D56568
[lldb-server] Implement support for MultiBreakpoint packet
This is fairly straightforward, thanks to the helper functions created
in the previous commit.
https://github.com/llvm/llvm-project/pull/192910
[lldb-server][NFC] Factor out code handling breakpoint packets
This commit extracts the code handling breakpoint packets into a helper
function that can be used by a future implementation of the
MultiBreakpointPacket.
It is meant to be purely NFC.
There are two functions handling breakpoint packets (`handle_Z`
and `handle_z`) with a lot of repeated code. This commit did not attempt
to merge the two, as that would make the diff much larger due to subtle
differences in the error message produced by the two. The only
deduplication done is in the code processing a GDBStoppointType, where a
helper struct (`BreakpointKind`) and function (`std::optional<BreakpointKind> getBreakpointKind(GDBStoppointType stoppoint_type)`) was created.
https://github.com/llvm/llvm-project/pull/192910
[SPIRV] Fix legalization of zero-sized intrinsic globals (#192730)
Some LLVM global intrinsics like `llvm.global_ctors` may become
zero-sized arrays if all constructors are inlined/optimized out.
These variables use appending linkage, which is only valid on arrays,
however as we are lowing to a pointer, this causes invalid IR if we
maintain the same linkage.
Use `ExternalWeak` linkage, the only other mergable linking type allowed
for intrinsic global variables with definitions. We also need to not
specify an initializer to not produce an invalid module.
As these variables do not represent user visible code, and all entries
were optimized out anyway, the new linkage should be fine.
---------
Signed-off-by: Nick Sarnie <nick.sarnie at intel.com>
[lldbremote][NFC] Factor out code handling breakpoint packets
This commit extracts the code handling breakpoint packets into a helper
function that can be used by a future implementation of the
MultiBreakpointPacket.
It is meant to be purely NFC.
There are two functions handling breakpoint packets (`handle_Z`
and `handle_z`) with a lot of repeated code. This commit did not attempt
to merge the two, as that would make the diff much larger due to subtle
differences in the error message produced by the two. The only
deduplication done is in the code processing a GDBStoppointType, where a
helper struct (`BreakpointKind`) and function (`std::optional<BreakpointKind> getBreakpointKind(GDBStoppointType stoppoint_type)`) was created.
https://github.com/llvm/llvm-project/pull/192910
[bolt] AArch64: Fix TLSDESC to LE relaxation by mold (#190370)
mold linker creates relaxation stub from TLSDESC to LE, (lld makes it
IE) using sequence as NOP+NOP+MOVZ+MOVK. This in itself is not an issue,
when --emit-relocs is added the relocs R_AARCH64_TLSDESC_ADD_LO12 and
R_AARCH64_TLSDESC_CALL are associated with useful MOVW instructions.
However bolt does not check for R_AARCH64_TLSDESC_ADD_LO12 in
adjustRelocation() when disassembling the file. This later triggers a
bug when reloc is patched as movk is patched with S_LO12 fixup kind
which is invalid.
Refer to bug: https://github.com/llvm/llvm-project/issues/190366 for
details.
[offload] Get kernel argument sizes from Level Zero (#192487)
Retrieve kernel argument sizes directly from Level Zero API as a
temporary workaround. This approach assumes no padding or alignment
between arguments. This enables immediate functionality while a more
permanent solution requiring offload API changes is being discussed.