[SmallVector] Out-of-line the trivially-copyable push_back grow path (#206213)
In the approximately trivially-copyable specialization, push_back's grow
path does not early return. Both Clang and GCC likely keep `this` and
`Elt` live across the out-of-line `grow_pod` call, saving and restoring
them in the prologue/epilogue. Shrink wrapping can't sink it (the saved
values are used in the store block the fast path also reaches).
Move the grow-and-store into a noinline `growAndPushBack` helper and
tail call it. The fast path needs no callee-saved registers.
`push_back(int)` drops from 14 to 7 instructions on x86-64.
```
// void vec_pb_int(llvm::SmallVectorImpl<int>&v, int x){ v.push_back(x); }
mov eax, dword ptr [rdi + 8]
cmp eax, dword ptr [rdi + 12]
jae _ZN4llvm23SmallVectorTemplateBaseIiLb1EE15growAndPushBackEi # TAILCALL
mov rcx, qword ptr [rdi]
[12 lines not shown]
[BOLT] Work around BSD sed's lack of in-place editing support (#206183)
BSD sed does not implement `-i` the same way as GNU sed. Use a
copy-and-replace approach instead of in-place editing to ensure
compatibility.
[gn] use `sources` instead of `inputs` for libc++ header copy action (#206263)
`sources` and `inputs` have the same semantics for GN action targets,
but the sync script can only handle `sources`.
Follow-up to cd98648925531663.
[libc++][NFC] Mark random_device::__padding_ as [[maybe_unused]] (#206248)
Instead of pushing and popping warnings we can just mark the offending
member as `[[maybe_unused]]`, improving compile times a bit and
simplifying the code.
Pull up following revision(s) (requested by riastradh in ticket #1280):
sys/dev/pci/virtio.c: revision 1.85
virtio(4): Add missing BUS_DMASYNC_PREREAD operations.
And one missing BUS_DMASYNC_POSTREAD operation.
With this change, loads from vq->vq_used->flags (which occur
immediately after a transfer is submitted to test whether we need to
kick the host device) is separated by a PREREAD/POSTREAD cycle from
loads from vq->vq_used->idx (which occur when we think a transfer may
have completed, e.g. upon receiving an interrupt, to test whether it
has, in fact, completed).
Additionally, with this change, consecutive loads from
*vq->vq_avail_event are separated by a PREREAD/POSTREAD cycle.
Should fix virtio(4) issues on m68k and other related architectures
like mips and armv<7:
PR kern/60144: virtio(4) cache coherence issue
[152 lines not shown]
ctld: Normalize physical port names
Don't require ioctl port names to be fully expanded as this
contradicts the syntax documented in the ctl.conf(5). However, don't
require users to exactly guess when pp or vp can be omitted. Instead,
normalize all physical port names by parsing any port name with a pp
or vp value and reformatting them to a standardized format. This
format is also used when generating names for kernel-enumerated ports.
Reported by: Seth Hoffert <seth.hoffert at gmail.com>
Fixes: caef3c50ac06 ("ctld: Refactor ioctl port handling")
Sponsored by: Chelsio Communications
Pull up following revision(s) (requested by riastradh in ticket #332):
sys/dev/pci/virtio.c: revision 1.85
virtio(4): Add missing BUS_DMASYNC_PREREAD operations.
And one missing BUS_DMASYNC_POSTREAD operation.
With this change, loads from vq->vq_used->flags (which occur
immediately after a transfer is submitted to test whether we need to
kick the host device) is separated by a PREREAD/POSTREAD cycle from
loads from vq->vq_used->idx (which occur when we think a transfer may
have completed, e.g. upon receiving an interrupt, to test whether it
has, in fact, completed).
Additionally, with this change, consecutive loads from
*vq->vq_avail_event are separated by a PREREAD/POSTREAD cycle.
Should fix virtio(4) issues on m68k and other related architectures
like mips and armv<7:
PR kern/60144: virtio(4) cache coherence issue
[152 lines not shown]
Pull up following revision(s) (requested by riastradh in ticket #1279):
sys/dev/pci/virtio_pci.c: revision 1.56
virtio(4): Allow virtio 0.9 BAR0 type to be memory rather than I/O.
This matches virtio>=1.0, and can't break working `hardware': any
existing virtio devices that worked must have reported I/O-type BAR0,
so they will continue to work; this will only enable previously
unusable virtio devices, reporting memory-type BAR0, to work.
Patch from Petri Koistinen.
PR kern/60247: virtio(4): legacy attach fails when BAR0 is MMIO
Pull up following revision(s) (requested by riastradh in ticket #331):
sys/dev/pci/virtio_pci.c: revision 1.56
virtio(4): Allow virtio 0.9 BAR0 type to be memory rather than I/O.
This matches virtio>=1.0, and can't break working `hardware': any
existing virtio devices that worked must have reported I/O-type BAR0,
so they will continue to work; this will only enable previously
unusable virtio devices, reporting memory-type BAR0, to work.
Patch from Petri Koistinen.
PR kern/60247: virtio(4): legacy attach fails when BAR0 is MMIO
[AggressiveInstCombine] Factor out the beginning of foldSelectSplitCTTZ/CTLZ into common entry point. NFC (#206220)
Both start by matching a select and a eq/ne compare with 0.
Assisted-by: claude
Pull up following revision(s) (requested by riastradh in ticket #1277):
tests/net/if_wg/t_misc.sh: revision 1.17
tests/net/if_wg/t_misc.sh: revision 1.18
sys/net/if_wg.c: revision 1.136
tests/net/if_wg/t_basic.sh: revision 1.7
sys/net/if_wg.c: revision 1.137
tests/net/if_wg/t_basic.sh: revision 1.8
sys/net/if_wg.c: revision 1.138
tests/net/if_wg/t_basic.sh: revision 1.9
tests/net/if_wg/common.sh: revision 1.2
wg(4): Add test case for bad peer public keys.
wg(4) should not crash on an assertion if they are used -- it should
just gracefully accept them, with degraded security, since a peer
that maliciously provides an invalid public key is no worse than a
peer that voluntarily exposes all its plaintext anyway.
PR kern/60106: wg(4) should properly handle invalid or insecure
[45 lines not shown]
Pull up following revision(s) (requested by riastradh in ticket #329):
tests/net/if_wg/t_misc.sh: revision 1.17
tests/net/if_wg/t_misc.sh: revision 1.18
sys/net/if_wg.c: revision 1.136
tests/net/if_wg/t_basic.sh: revision 1.7
sys/net/if_wg.c: revision 1.137
tests/net/if_wg/t_basic.sh: revision 1.8
sys/net/if_wg.c: revision 1.138
tests/net/if_wg/t_basic.sh: revision 1.9
tests/net/if_wg/common.sh: revision 1.2
wg(4): Add test case for bad peer public keys.
wg(4) should not crash on an assertion if they are used -- it should
just gracefully accept them, with degraded security, since a peer
that maliciously provides an invalid public key is no worse than a
peer that voluntarily exposes all its plaintext anyway.
PR kern/60106: wg(4) should properly handle invalid or insecure
[45 lines not shown]